:root { color-scheme: dark; font-family: system-ui, -apple-system, sans-serif; background: #10172d; color: #fff; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
button { font: inherit; cursor: pointer; touch-action: manipulation; }
#game { position: relative; width: 100%; height: 100%; height: 100dvh; overflow: hidden; background: #fff; }
.hud { position: absolute; z-index: 10; top: 0; left: 0; right: 0; min-height: 58px; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: center; gap: clamp(12px, 4vw, 36px); background: #10172de8; font-size: clamp(.78rem, 3.3vw, 1rem); white-space: nowrap; }
.hud strong { font-variant-numeric: tabular-nums; }
#field { position: absolute; inset: 58px 0 0; overflow: hidden; touch-action: none; }
.tile { position: absolute; left: 0; top: 0; border: 0; border-radius: 0; box-shadow: none; touch-action: none; will-change: transform; }
.tile.dissolving { pointer-events: none; animation: dissolve 360ms ease-out forwards; }
@keyframes dissolve {
  0% { opacity: 1; filter: blur(0) brightness(1); }
  25% { opacity: .9; filter: blur(0) brightness(1.8); }
  100% { opacity: 0; filter: blur(12px) brightness(1.4); }
}
.burst { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 2; }
.burst-ring { position: absolute; width: 35px; height: 35px; margin: -17.5px; border: 5px solid currentColor; border-radius: 50%; box-shadow: 0 0 22px currentColor; animation: burst-ring 650ms ease-out forwards; }
.burst-piece { position: absolute; width: 12px; height: 12px; margin: -6px; background: currentColor; box-shadow: 0 0 12px currentColor; animation: burst-piece 650ms cubic-bezier(.15,.65,.25,1) forwards; }
@keyframes burst-ring { from { opacity: 1; transform: scale(.3); } to { opacity: 0; transform: scale(4); } }
@keyframes burst-piece { from { opacity: 1; transform: translate(0, 0) rotate(0) scale(1.2); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--turn)) scale(.25); } }
.tile:focus-visible { outline: 4px solid white; outline-offset: 2px; }
.panel { position: absolute; z-index: 20; top: 50%; left: 50%; width: min(90%, 420px); transform: translate(-50%, -50%); padding: 28px; text-align: center; background: #172554f2; border: 1px solid #ffffff30; border-radius: 22px; box-shadow: 0 20px 60px #0008; }
.panel .update-status { min-height: 1.3em; margin: 12px 0 0; font-size: .82rem; }
.action:disabled { opacity: .6; cursor: wait; }
.panel h1 { margin: 0 0 8px; font-size: clamp(2rem, 9vw, 3rem); }
.panel p { line-height: 1.5; color: #dbeafe; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.action, .small { border: 0; border-radius: 10px; padding: 12px 18px; background: #2780e3; color: white; font-weight: 750; }
.action.secondary, .small { background: #ffffff22; color: white; border: 1px solid #ffffff55; }
.small { padding: 7px 9px; font-size: .8rem; }
.demo-status { position: absolute; z-index: 11; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); padding: 7px 12px; border-radius: 8px; background: #10172de8; white-space: nowrap; font-size: .8rem; pointer-events: none; }
[hidden] { display: none !important; }
@media (max-width: 360px) { .hud { gap: 9px; } .hud span { font-size: .72rem; } }
@media (prefers-reduced-motion: reduce) { .tile.dissolving { animation-duration: 1ms; } }
