:root {
  color-scheme: dark;
  --ink: #080b12;
  --paper: #edf2eb;
  --acid: #c7ff42;
  --cyan: #5ceeff;
  --red: #ff4b50;
  --line: rgba(237, 242, 235, 0.18);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--ink); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 75% 15%, rgba(92, 238, 255, 0.1), transparent 32rem),
    radial-gradient(circle at 8% 80%, rgba(199, 255, 66, 0.07), transparent 28rem),
    var(--ink);
  color: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, a { -webkit-tap-highlight-color: transparent; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

.site-header, footer {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.18em;
}

.site-header { height: 82px; border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; color: var(--ink); background: var(--acid); font-size: 16px; letter-spacing: 0; }
.status { color: rgba(237,242,235,.58); }
.status span { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 14px var(--acid); }

main { width: min(1440px, calc(100% - 48px)); margin: 0 auto; }
.game-shell { display: grid; grid-template-columns: minmax(190px, .75fr) minmax(360px, 1.6fr) minmax(190px, .75fr); gap: 36px; align-items: center; min-height: calc(100vh - 152px); padding: 40px 0; }
.eyebrow, .kicker { margin: 0 0 15px; color: var(--acid); font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .25em; }
h1 { margin: 0; font-size: clamp(52px, 7vw, 112px); font-weight: 900; line-height: .78; letter-spacing: -.075em; }
h1 em { color: transparent; font-style: normal; -webkit-text-stroke: 1px var(--paper); }
.lede { max-width: 220px; margin: 28px 0 0; color: rgba(237,242,235,.55); font-size: 13px; line-height: 1.65; }

.cabinet { padding: 8px; border: 1px solid rgba(237,242,235,.28); background: rgba(255,255,255,.025); box-shadow: 0 35px 100px rgba(0,0,0,.55), inset 0 0 0 1px rgba(0,0,0,.7); }
.screen-wrap { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #04070c; border: 1px solid rgba(92,238,255,.2); }
#game { display: block; width: 100%; height: 100%; touch-action: none; }

.hud { position: absolute; inset: 20px 18px auto; display: grid; grid-template-columns: 1fr 1fr 1fr; pointer-events: none; }
.hud > div { display: flex; flex-direction: column; }
.hud > div:last-child { text-align: right; }
.hud-center { align-items: center; }
.hud span { color: rgba(237,242,235,.45); font: 700 8px/1 ui-monospace, monospace; letter-spacing: .22em; }
.hud strong { margin-top: 6px; font: 700 15px/1 ui-monospace, monospace; letter-spacing: .08em; }

.overlay { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 52px; text-align: center; background: radial-gradient(circle, rgba(8,11,18,.68), rgba(4,7,12,.94) 70%); transition: opacity .25s ease, visibility .25s ease; }
.overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.overlay h2 { margin: 0 0 12px; font-size: clamp(28px, 4vw, 54px); line-height: 1; letter-spacing: -.045em; }
.overlay > p:not(.kicker):not(.key-hint) { max-width: 340px; margin: 0; color: rgba(237,242,235,.58); font-size: 13px; line-height: 1.6; }
.pulse-logo { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 28px; color: var(--ink); background: var(--acid); font-size: 32px; font-weight: 900; box-shadow: 0 0 0 0 rgba(199,255,66,.4); animation: pulse 2s infinite; }
.kicker.danger { color: var(--red); }
.primary { min-width: 190px; margin-top: 28px; padding: 16px 18px; border: 0; color: var(--ink); background: var(--acid); font: 900 11px/1 ui-sans-serif, system-ui; letter-spacing: .13em; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.primary span { margin-left: 15px; }
.primary:hover { transform: translateY(-2px); box-shadow: 0 10px 35px rgba(199,255,66,.2); }
.key-hint { margin: 20px 0 0; color: rgba(237,242,235,.32); font: 700 8px/1 ui-monospace, monospace; letter-spacing: .18em; }

.icon-button { position: absolute; right: 14px; bottom: 14px; z-index: 3; padding: 8px; border: 0; color: rgba(237,242,235,.5); background: transparent; font: 700 8px/1 ui-monospace, monospace; letter-spacing: .12em; cursor: pointer; }
.pause { right: auto; left: 14px; display: none; }
.pause.visible { display: block; }
.cabinet-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 7px 5px; color: rgba(237,242,235,.32); font: 700 7px/1 ui-monospace, monospace; letter-spacing: .18em; }
.lights { display: flex; gap: 5px; }
.lights i { width: 4px; height: 4px; border-radius: 50%; background: rgba(237,242,235,.2); }
.lights i:first-child { background: var(--acid); box-shadow: 0 0 6px var(--acid); }

.instructions { display: grid; gap: 14px; }
.stat-card { padding: 20px; border: 1px solid var(--line); background: rgba(255,255,255,.018); }
.stat-card span { color: var(--cyan); font: 700 8px/1 ui-monospace, monospace; letter-spacing: .18em; }
.stat-card strong { display: block; margin-top: 9px; font-size: 12px; letter-spacing: .05em; }
.stat-card p { margin: 12px 0 0; color: rgba(237,242,235,.42); font-size: 11px; line-height: 1.55; }
.stat-card.warning span { color: var(--red); }
.tip { margin: 7px 0 0; color: rgba(237,242,235,.35); font: 9px/1.6 ui-monospace, monospace; }
.tip b { color: var(--acid); }

footer { height: 70px; border-top: 1px solid var(--line); color: rgba(237,242,235,.28); font-size: 8px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(199,255,66,0); } }

@media (max-width: 900px) {
  .game-shell { grid-template-columns: 1fr minmax(340px, 1.6fr); }
  .instructions { display: none; }
}

@media (max-width: 650px) {
  .site-header, main, footer { width: calc(100% - 24px); }
  .site-header { height: 58px; }
  .game-shell { display: flex; flex-direction: column; min-height: auto; gap: 24px; padding: 24px 0 36px; }
  .title-block { width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: end; }
  .title-block .eyebrow { grid-column: 1 / -1; }
  h1 { font-size: 51px; }
  .lede { margin: 0 0 2px; max-width: 142px; font-size: 10px; }
  .cabinet { width: 100%; }
  .screen-wrap { max-height: calc(100svh - 235px); min-height: 455px; }
  .overlay { padding: 30px; }
  .status { font-size: 8px; }
  footer { height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

