:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #02070e;
  color: #e7f6ff;
}

* { box-sizing: border-box; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
body { margin: 0; background: radial-gradient(circle at top, #102a46 0, #02070e 48rem); min-height: 100vh; }
button, select, input { font: inherit; }
button, select { color: #e7f6ff; background: #102942; border: 1px solid #2e698f; border-radius: 8px; }
button { padding: .55rem .85rem; cursor: pointer; font-weight: 700; }
button:hover:not(:disabled), button:focus-visible, select:focus-visible { border-color: #49ddff; outline: 2px solid rgba(73, 221, 255, .35); outline-offset: 2px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.shell { width: min(1120px, calc(100% - 24px)); margin: 0 auto; padding: 12px 0 22px; }
.game-header { display: flex; justify-content: space-between; gap: 1rem; align-items: end; padding: .2rem .2rem .6rem; }
.eyebrow { margin: 0 0 .16rem; color: #67dff8; font-size: .72rem; font-weight: 800; letter-spacing: .14em; }
h1 { margin: 0; font-size: clamp(1.75rem, 4vw, 2.55rem); line-height: .98; }
.tagline { margin: .36rem 0 0; color: #a7c6d8; }
.header-actions { display: flex; gap: .5rem; }
.hud { display: grid; grid-template-columns: 1.22fr .52fr .64fr .58fr .62fr .86fr 1.55fr; gap: 1px; background: #214562; border: 1px solid #214562; border-radius: 10px 10px 0 0; overflow: hidden; }
.hud > div { background: #07182a; padding: .48rem .6rem; min-width: 0; }
.hud-label { display: block; font-size: .64rem; color: #6fa7c7; text-transform: uppercase; font-weight: 800; letter-spacing: .08em; }
.hud strong { display: block; margin-top: .08rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.objective strong { color: #9dffd8; }
#shieldLabel { color: #a9c6ff; }
#utilityLabel { color: #ffe27f; }
.play-frame { position: relative; background: #02070e; border-inline: 1px solid #214562; }
canvas { display: block; width: 100%; height: auto; max-height: min(64vh, 640px); aspect-ratio: 16 / 9; background: #02070e; outline: none; }
canvas:focus-visible { box-shadow: inset 0 0 0 3px #45ecff; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(2, 7, 14, .62); backdrop-filter: blur(3px); }
.overlay.hidden { display: none; }
.overlay-card { max-width: 560px; margin: 1rem; padding: 1.2rem 1.4rem; border: 1px solid #48c6e8; border-radius: 12px; background: rgba(5, 22, 38, .97); box-shadow: 0 16px 50px rgba(0,0,0,.45); text-align: center; }
.overlay-card h2 { margin: 0 0 .45rem; color: #7eeaff; }
.overlay-card p { margin: 0; color: #c6dfea; line-height: 1.45; }
.control-strip { display: flex; flex-wrap: wrap; gap: .45rem 1rem; padding: .52rem .7rem; background: #081a2b; border: 1px solid #214562; border-radius: 0 0 10px 10px; color: #a9cadc; font-size: .82rem; }
kbd { display: inline-block; min-width: 1.7em; padding: .08rem .35rem; border: 1px solid #37688a; border-bottom-width: 2px; border-radius: 4px; background: #102942; color: #e9f9ff; font-size: .76rem; text-align: center; }
details { margin-top: .65rem; border: 1px solid #1e4763; border-radius: 10px; background: rgba(5, 19, 33, .88); }
summary { padding: .7rem .85rem; cursor: pointer; font-weight: 800; color: #bdeeff; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; padding: 0 .85rem .85rem; }
.guide-grid > div { padding: .7rem; border-radius: 8px; background: #0a2237; }
.guide h2 { margin: 0 0 .3rem; font-size: .94rem; color: #78e9ff; }
.guide p { margin: 0; color: #b7ceda; line-height: 1.45; font-size: .88rem; }
footer { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem .2rem 0; color: #6287a0; font-size: .75rem; }
@media (max-width: 860px) {
  .game-header { align-items: start; flex-direction: column; }
  .hud { grid-template-columns: repeat(3, 1fr); }
  .hud .objective { grid-column: 1 / -1; }
  canvas { max-height: none; }
}
@media (max-width: 620px) {
  .hud { grid-template-columns: repeat(2, 1fr); }
  .guide-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
