:root { color-scheme: dark; font-family: Inter, ui-rounded, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif; background: #080c10; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #080c10; overscroll-behavior: none; }
body { position: fixed; inset: 0; touch-action: none; -webkit-user-select: none; user-select: none; }
button { appearance: none; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; background: rgba(10,15,20,.82); color: #f3f6f8; font: 700 12px/1 -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: .01em; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
button:active { transform: scale(.96); background: rgba(39,52,63,.94); }
#game, #gameCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#gameCanvas { display: block; touch-action: none; }
.hud { position: absolute; z-index: 5; left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right)); display: flex; align-items: center; pointer-events: none; }
.hud button { min-width: 66px; height: 38px; padding: 0 15px; pointer-events: auto; }
.top-hud { top: max(9px, env(safe-area-inset-top)); display: grid; grid-template-columns: 70px minmax(0,1fr) 70px; gap: 8px; }
.top-hud button { min-width: 0; padding: 0 8px; }
.top-hud .title { min-width: 0; flex: 1; padding: 7px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: rgba(7,11,15,.76); text-align: center; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.title strong, .title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title strong { color: #f7f9fa; font-size: 12px; }
.title span { margin-top: 3px; color: #aab7c2; font: 600 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.bottom-hud { bottom: max(8px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 66px minmax(0,1fr) 84px; gap: 8px; }
.bottom-hud button { min-width: 0; padding: 0 8px; }
.bottom-hud span { min-width: 0; color: rgba(235,242,246,.7); font-size: 9px; line-height: 1.25; text-align: center; text-shadow: 0 1px 4px #000; }
.bottom-hud button[aria-pressed="true"] { border-color: #c8f45b; color: #d9ff7f; background: rgba(53,72,24,.9); }
.blocking-card { position: absolute; z-index: 20; left: 50%; top: 50%; width: min(310px, calc(100% - 40px)); padding: 24px; transform: translate(-50%,-50%); border: 1px solid rgba(255,255,255,.14); border-radius: 22px; background: rgba(9,14,19,.94); box-shadow: 0 28px 80px rgba(0,0,0,.52); text-align: center; }
.blocking-card strong, .blocking-card span { display: block; }
.blocking-card strong { margin: 12px 0 6px; font-size: 17px; }
.blocking-card span { color: #8d9cab; font-size: 12px; line-height: 1.5; }
.blocking-card button { height: 42px; margin-top: 18px; padding: 0 22px; }
.spinner { width: 30px; height: 30px; margin: auto; border: 3px solid rgba(255,255,255,.12); border-top-color: #c8f45b; border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.panel { position: absolute; z-index: 15; inset: 0; padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); background: rgba(2,5,8,.72); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.panel-card { height: 100%; overflow: auto; padding: 20px; border: 1px solid rgba(255,255,255,.13); border-radius: 26px; background: #0d141b; box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.panel-card header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-card small, .win-card small { color: #c8f45b; font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; }
.panel-card h1 { margin: 5px 0 0; font-size: 24px; }
.panel-card header button { height: 38px; padding: 0 15px; }
#levelList { display: grid; gap: 10px; margin-top: 20px; }
.level-choice { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; width: 100%; padding: 15px; border-radius: 16px; text-align: left; }
.level-choice strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.level-choice span { grid-column: 1; color: #8795a2; font: 10px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace; }
.level-choice time { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: #c8f45b; font-size: 10px; }
.win-panel { display: grid; place-items: center; }
.win-card { width: min(340px, 100%); padding: 30px 24px 24px; border: 1px solid rgba(200,244,91,.35); border-radius: 30px; background: linear-gradient(155deg,#17211d,#0b1117 70%); box-shadow: 0 30px 100px rgba(0,0,0,.72); text-align: center; }
.win-mark { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; background: #c8f45b; color: #182007; font-size: 36px; box-shadow: 0 0 40px rgba(200,244,91,.28); }
.win-card h1 { margin: 8px 0 8px; font-size: 28px; }
.win-card p { margin: 0 0 22px; color: #9aabb8; font-size: 13px; line-height: 1.5; }
.win-card button { width: 100%; height: 48px; margin-top: 8px; background: #c8f45b; color: #182007; }
.win-card button.quiet { background: rgba(255,255,255,.06); color: #c4ced6; }
#rotateNotice { display: none; position: absolute; z-index: 50; inset: 0; place-items: center; align-content: center; gap: 8px; padding: 30px; background: #080c10; text-align: center; }
#rotateNotice strong { font-size: 22px; }
#rotateNotice span { color: #8d9aa5; font-size: 13px; }
[hidden] { display: none !important; }
@media (orientation: landscape) and (max-height: 600px) { #rotateNotice { display: grid; } }
@media (display-mode: standalone) { .top-hud { top: max(6px, env(safe-area-inset-top)); } }
