* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; background: #0c0a14; overflow: hidden; font-family: "Segoe UI", system-ui, sans-serif; }
#wrap { position: relative; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, #1a1526 0%, #0c0a14 100%); }
#game { max-width: 100vw; max-height: 100vh; width: auto; height: auto; aspect-ratio: 16 / 9; width: min(100vw, calc(100vh * 16 / 9)); image-rendering: auto; box-shadow: 0 0 60px rgba(0,0,0,.8); border-radius: 8px; }
.hidden { display: none !important; }

/* HUD */
#hud { position: absolute; top: 14px; left: 20px; right: 20px; display: flex; justify-content: space-between; z-index: 5; pointer-events: none; color: #f5efe2; }
.hud-left, .hud-right { display: flex; gap: 14px; align-items: flex-start; }
.hud-item { background: rgba(10, 8, 20, .62); border: 1px solid rgba(245, 239, 226, .18); border-radius: 10px; padding: 6px 12px; text-align: center; min-width: 84px; backdrop-filter: blur(4px); }
.hud-item.best { border-color: rgba(255, 210, 110, .45); }
.hud-label { display: block; font-size: 10px; letter-spacing: .18em; opacity: .75; text-transform: uppercase; }
.hud-item span:last-child { font-size: 22px; font-weight: 800; color: #ffe9a8; font-variant-numeric: tabular-nums; }
.meter-wrap { background: rgba(10, 8, 20, .62); border: 1px solid rgba(245,239,226,.18); border-radius: 10px; padding: 6px 12px; backdrop-filter: blur(4px); min-width: 150px; }
.meter { height: 10px; background: #241f33; border-radius: 6px; overflow: hidden; margin-top: 4px; }
.meter-fill { height: 100%; width: 100%; transition: width .18s ease-out; }
.meter-fill.fuel { background: linear-gradient(90deg, #2f9e44, #ffd43b); }
.meter-fill.damage { background: linear-gradient(90deg, #e8590c, #e03131); width: 0%; }

/* Flash */
#flash { position: absolute; top: 18%; left: 50%; transform: translateX(-50%); z-index: 6; font-size: 42px; font-weight: 900; color: #ffd43b; text-shadow: 0 3px 0 rgba(0,0,0,.55), 0 0 28px rgba(255, 180, 40, .45); letter-spacing: .04em; pointer-events: none; text-align: center; }

/* Overlays */
.overlay { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; background: rgba(6, 5, 12, .72); backdrop-filter: blur(3px); border-radius: 8px; }
.panel { background: linear-gradient(165deg, #1d1830 0%, #100d1c 100%); border: 1px solid rgba(255, 210, 110, .28); border-radius: 18px; padding: 34px 44px; text-align: center; color: #f5efe2; box-shadow: 0 24px 80px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.06); max-width: 640px; animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.menu-panel h1 { font-size: 64px; letter-spacing: .14em; color: #ffd43b; text-shadow: 0 0 30px rgba(255, 180, 40, .35), 0 4px 0 rgba(0,0,0,.5); }
.tagline { margin-top: 6px; color: #cfc6e6; font-size: 17px; letter-spacing: .05em; }
.menu-best { margin: 18px 0 6px; color: #ffe9a8; font-size: 18px; }
.controls-grid { display: flex; flex-direction: column; gap: 6px; margin: 14px auto 20px; text-align: left; font-size: 13px; color: #b6acd0; }
.controls-grid b { color: #ffe9a8; background: rgba(255, 210, 110, .12); border: 1px solid rgba(255,210,110,.3); border-radius: 5px; padding: 1px 7px; margin-right: 6px; }
.big-btn { cursor: pointer; font: inherit; font-weight: 800; font-size: 20px; letter-spacing: .08em; color: #1d1405; background: linear-gradient(180deg, #ffe14d, #f0a81e); border: none; border-radius: 12px; padding: 15px 40px; box-shadow: 0 6px 0 #9c6007, 0 12px 26px rgba(0,0,0,.45); transition: transform .08s, box-shadow .08s; }
.big-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #9c6007, 0 16px 30px rgba(0,0,0,.5); }
.big-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 #9c6007; }
.big-btn.small { font-size: 15px; padding: 12px 26px; margin-top: 14px; }
.footnote { margin-top: 16px; font-size: 11px; letter-spacing: .16em; color: #7e74a0; text-transform: uppercase; }

/* Shop */
.shop-panel { max-width: 560px; }
.shop-panel h2 { letter-spacing: .18em; color: #ffe9a8; font-size: 30px; }
.shop-timer { display: inline-block; margin: 8px 0 4px; font-size: 54px; font-weight: 900; color: #ffd43b; font-variant-numeric: tabular-nums; text-shadow: 0 0 22px rgba(255,180,40,.4); }
.shop-sub { color: #b6acd0; font-size: 13px; margin-bottom: 10px; }
.shop-babies { font-size: 13px; color: #8fe3a8; margin: 8px 0 2px; min-height: 20px; letter-spacing: .04em; }
.shop-credits { font-size: 18px; color: #ffe9a8; margin: 6px 0 14px; font-weight: 700; }
.shop-grid { display: flex; gap: 12px; justify-content: center; }
.shop-btn { cursor: pointer; font: inherit; flex: 1; background: rgba(255, 210, 110, .07); border: 1px solid rgba(255,210,110,.3); border-radius: 12px; padding: 14px 10px; color: #f5efe2; display: flex; flex-direction: column; gap: 5px; transition: transform .1s, background .1s; }
.shop-btn:hover:not(:disabled) { transform: translateY(-2px); background: rgba(255, 210, 110, .16); }
.shop-btn:disabled { opacity: .38; cursor: not-allowed; }
.shop-btn-title { font-weight: 800; font-size: 15px; letter-spacing: .04em; color: #ffe9a8; }
.shop-btn-desc { font-size: 11px; color: #b6acd0; }
.shop-msg { min-height: 20px; margin-top: 10px; font-size: 13px; font-weight: 700; color: #ffb4a2; }

/* Game over */
#gameover .panel { min-width: 440px; }
#goTitle { letter-spacing: .12em; font-size: 30px; color: #ff8f8f; }
#goTitle.rescued { color: #9be8ff; }
.go-sub { margin: 10px 0 4px; color: #b6acd0; font-size: 15px; min-height: 22px; }
.rescue-anim { font-size: 56px; letter-spacing: 6px; margin: 10px 0 4px; animation: floaty 2.4s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.go-stats { display: flex; flex-direction: column; gap: 7px; margin: 18px 0 22px; font-size: 16px; color: #cfc6e6; }
.go-stats b { color: #ffe9a8; margin-left: 8px; }

/* Touch */
#touchUI { position: absolute; bottom: 18px; left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 22px; z-index: 8; pointer-events: none; }
.t-side { display: flex; gap: 14px; align-items: flex-end; }
.t-btn { pointer-events: auto; font: inherit; font-weight: 800; letter-spacing: .08em; color: #f5efe2; background: rgba(20, 16, 32, .65); border: 2px solid rgba(255, 210, 110, .5); border-radius: 50%; width: 92px; height: 92px; font-size: 14px; backdrop-filter: blur(4px); touch-action: none; user-select: none; -webkit-user-select: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.t-btn small { font-size: 9px; font-weight: 600; letter-spacing: .04em; opacity: .7; }
.t-btn.jump { width: 128px; height: 128px; }
.t-btn.jump { background: rgba(240, 168, 30, .35); border-color: #ffd43b; }
.t-btn:active { transform: scale(.93); }
@media (pointer: fine) { #touchUI { display: none; } }
@media (max-width: 760px) { .hud-left, .hud-right { gap: 6px; } .hud-item { min-width: 60px; padding: 4px 8px; } .hud-item span:last-child { font-size: 16px; } .meter-wrap { min-width: 90px; } #flash { font-size: 26px; } .menu-panel h1 { font-size: 40px; } }
