:root { color-scheme: dark; font-family: system-ui, sans-serif; color: #fff1d2; background: #102438; }
* { box-sizing: border-box; }
body { margin: 0; overflow: hidden; }
[hidden] { display: none !important; }
#game { position: relative; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; isolation: isolate; background: #102438 url('art/winter_background.svg') center / cover no-repeat; }
#game.market { background-image: url('art/market_background.svg'); }
#scene, #effects, #popups { position: absolute; inset: 0; width: 100%; height: 100%; }
#scene { touch-action: none; }
#effects, #popups { pointer-events: none; }
.hud { position: absolute; z-index: 1; inset: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) auto max(12px, env(safe-area-inset-left)); display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.card { display: grid; grid-template-columns: minmax(50px, 1fr) auto; align-items: center; gap: 4px 14px; min-width: min(250px, 55vw); padding: 8px 13px; background: #142f30ed; border: 1px solid #d5ab61; border-radius: 14px; }
.score-label, #combo { font-weight: 750; color: #ffd483; font-size: clamp(11px, 2.8vw, 14px); }
#score { grid-row: 2; font-size: clamp(24px, 5vw, 38px); line-height: 1; }
#hearts { color: #ff8293; font-size: clamp(17px, 4vw, 26px); }
#combo { grid-row: 2; grid-column: 2; }
nav { display: flex; align-items: flex-start; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
button { pointer-events: auto; cursor: pointer; border: 1px solid #cba563; border-radius: 10px; padding: 7px 10px; background: #233d3d; color: inherit; font: 650 clamp(11px, 2.7vw, 15px)/1.2 system-ui, sans-serif; }
button:hover, button:focus-visible { background: #365954; outline: 2px solid #ffe3a7; }
.center { position: absolute; z-index: 2; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(91%, 850px); max-height: 92dvh; display: grid; grid-template-columns: minmax(0, 1.24fr) minmax(0, 1fr); align-items: center; overflow: auto; text-align: center; border: 2px solid #cba563; border-radius: 18px; background: #102833fa; box-shadow: 0 18px 70px #080f17a8; }
.welcome-art { display: block; width: 100%; height: auto; max-height: 72dvh; object-fit: contain; background: #f0eeea; }
.welcome-copy { padding: clamp(16px, 4vw, 42px); }
h1 { margin: 0; font-size: clamp(32px, 6vw, 57px); line-height: 1.02; color: #ffe2a0; }
#start { font-size: 19px; }
@media (max-width: 600px) and (orientation: portrait) {
  .center { grid-template-columns: minmax(0, 1fr); width: min(90%, 420px); }
  .welcome-art { max-height: 48dvh; }
}
#status { pointer-events: none; position: absolute; margin: 0; inset: auto 16px max(16px, env(safe-area-inset-bottom)) 16px; text-align: center; text-shadow: 0 2px 6px black; }
#restart { position: absolute; z-index: 1; bottom: max(50px, calc(env(safe-area-inset-bottom) + 32px)); left: 14px; }
.star-hint { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font-size: clamp(13px, 3vw, 21px); font-weight: 850; text-shadow: 0 2px 6px black; }
.splash { position: absolute; width: clamp(110px, 17vw, 166px); aspect-ratio: 256 / 104; display: grid; place-items: center; background: url('art/combo_splash.svg') center / contain no-repeat; color: #fff2ca; font-weight: 850; font-size: clamp(13px, 2vw, 19px); text-shadow: 0 1px 2px #1a2e14; animation: float 660ms both; }
@keyframes float { 0% { transform: translate(-50%, -45%) scale(.68); } 25% { transform: translate(-50%, -65%) scale(1.08); } 72% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -115%); } }
