:root {
  --ink: #081017;
  --panel: #0d1821;
  --paper: #e8eadf;
  --acid: #d9ff43;
  --aqua: #4de8d0;
  --orange: #ff7043;
  --muted: #8fa0a5;
  --line: rgba(232, 234, 223, 0.16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--paper);
  background: var(--ink);
  font-family: "DM Mono", monospace;
  overflow-x: hidden;
}

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

button { font: inherit; }

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 5%, rgba(77, 232, 208, .08), transparent 30%),
    radial-gradient(circle at 85% 30%, rgba(217, 255, 67, .055), transparent 24%),
    linear-gradient(90deg, transparent 49.9%, rgba(255,255,255,.018) 50%, transparent 50.1%);
  background-size: auto, auto, 64px 64px;
}

.shell { width: min(1520px, 100%); margin: 0 auto; padding: 0 28px; }

.masthead {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 49px; height: 49px;
  color: var(--ink); background: var(--acid); border-radius: 50%;
  font: 800 23px/1 "Barlow Condensed", sans-serif; letter-spacing: -1px;
  transform: rotate(-7deg);
}
.brand > span:last-child { display: grid; }
.eyebrow, .kicker { color: var(--aqua); font-size: 10px; letter-spacing: .2em; font-weight: 500; }
.brand-name { font: 700 23px/1 "Barlow Condensed", sans-serif; letter-spacing: .06em; }

.status-line {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: 10px; letter-spacing: .14em;
}
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 12px var(--acid); animation: pulse 1.7s infinite; }
.status-slash { color: rgba(232,234,223,.28); }

.game-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  margin-top: 34px;
  overflow: hidden;
  background: #111d26;
  border: 1px solid rgba(232,234,223,.23);
  box-shadow: 0 40px 100px rgba(0,0,0,.45);
  isolation: isolate;
}

canvas { display: block; width: 100%; height: 100%; outline: none; }
.scanlines {
  position: absolute; inset: 0; pointer-events: none; z-index: 4; opacity: .18;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(8,16,23,.26) 4px);
  mix-blend-mode: multiply;
}
.corner { position: absolute; width: 23px; height: 23px; border-color: var(--acid); z-index: 15; pointer-events: none; }
.corner-tl { top: 9px; left: 9px; border-left: 2px solid; border-top: 2px solid; }
.corner-tr { top: 9px; right: 9px; border-right: 2px solid; border-top: 2px solid; }
.corner-bl { bottom: 9px; left: 9px; border-left: 2px solid; border-bottom: 2px solid; }
.corner-br { bottom: 9px; right: 9px; border-right: 2px solid; border-bottom: 2px solid; }

.hud {
  position: absolute; z-index: 5; left: 28px; right: 28px; top: 24px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start;
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(0,0,0,.65);
}
.hud-cluster { display: flex; gap: 23px; }
.hud-right { justify-content: flex-end; align-items: start; pointer-events: auto; }
.readout { display: grid; gap: 2px; }
.readout-label { font-size: 8px; letter-spacing: .17em; color: rgba(232,234,223,.65); }
.readout strong { font: 600 19px/1 "DM Mono", monospace; color: white; }
.hud-dim { font-size: 10px; color: rgba(255,255,255,.45); }
.hud-center { min-width: 238px; text-align: center; display: grid; gap: 2px; }
.hud-center > span { color: var(--aqua); font-size: 8px; letter-spacing: .21em; }
.hud-center > strong { font: 600 13px/1.2 "Barlow Condensed", sans-serif; letter-spacing: .12em; }
.progress-rail { position: relative; width: 100%; height: 2px; margin-top: 8px; background: rgba(255,255,255,.2); }
.progress-rail i { position: absolute; inset: 0 auto 0 0; width: 0%; background: var(--acid); }
.progress-rail b { position: absolute; left: 0%; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: var(--acid); transform: translate(-50%,-50%); box-shadow: 0 0 8px var(--acid); }
.icon-button {
  height: 28px; padding: 0 9px; color: rgba(255,255,255,.7); background: rgba(8,16,23,.42);
  border: 1px solid rgba(255,255,255,.17); font-size: 8px; letter-spacing: .12em; cursor: pointer;
}
.icon-button:hover { color: var(--acid); border-color: var(--acid); }

.start-screen, .message-screen {
  position: absolute; z-index: 10; inset: 0; display: grid; align-items: center;
  background:
    linear-gradient(90deg, rgba(7,14,19,.97) 0%, rgba(7,14,19,.92) 43%, rgba(7,14,19,.25) 75%, rgba(7,14,19,.4) 100%),
    repeating-linear-gradient(115deg, transparent 0 70px, rgba(255,255,255,.02) 71px 72px);
  transition: opacity .45s, visibility .45s;
}
.start-screen::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(circle at 76% 52%, rgba(77,232,208,.19), transparent 28%);
}
.start-screen.off { opacity: 0; visibility: hidden; }
.start-copy { width: 55%; padding-left: clamp(42px, 7vw, 104px); position: relative; z-index: 2; }
.start-copy h1 {
  margin: 12px 0 16px; font: 800 clamp(56px, 7vw, 110px)/.74 "Barlow Condensed", sans-serif;
  letter-spacing: -.045em; color: var(--acid); transform: skewY(-2deg);
}
.start-copy h1 span { display: block; color: var(--paper); font-size: .43em; letter-spacing: .04em; margin: 0 0 11px 3px; }
.lede { max-width: 520px; margin: 24px 0 28px; color: #bac5c5; font-size: 12px; line-height: 1.75; }
.primary-button {
  display: inline-flex; align-items: stretch; padding: 0; border: 0; cursor: pointer;
  background: var(--acid); color: var(--ink); font: 700 14px "Barlow Condensed", sans-serif; letter-spacing: .1em;
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 0 100%);
}
.primary-button span { padding: 15px 22px; }
.primary-button b { display: grid; place-items: center; padding: 0 15px; border-left: 1px solid rgba(8,16,23,.25); font-size: 9px; }
.primary-button:hover { background: white; transform: translateY(-2px); }
.mini-controls { display: flex; flex-wrap: wrap; gap: 19px; margin-top: 23px; color: #8ca0a3; font-size: 8px; letter-spacing: .08em; }
kbd {
  min-width: 25px; display: inline-grid; place-items: center; padding: 5px 7px; margin-right: 3px;
  color: var(--paper); background: rgba(232,234,223,.08); border: 1px solid rgba(232,234,223,.24);
  border-bottom-width: 3px; border-radius: 3px; font: 500 9px "DM Mono", monospace;
}
.cross-portrait { position: absolute; inset: 0 0 0 50%; overflow: hidden; }
.portrait-badge {
  position: absolute; left: 48%; top: 49%; translate: -50% -50%;
  width: clamp(180px, 19vw, 300px); height: clamp(180px, 19vw, 300px); border-radius: 50%;
  display: grid; place-items: center; color: var(--acid); border: 2px solid rgba(217,255,67,.7);
  background: radial-gradient(circle at 55% 35%, #273d45, #0a151b 65%);
  box-shadow: 0 0 0 18px rgba(217,255,67,.035), inset 0 0 70px rgba(77,232,208,.18);
  font: 800 clamp(52px, 7vw, 100px)/.68 "Barlow Condensed", sans-serif; text-align: center; transform: rotate(5deg);
}
.portrait-badge::before, .portrait-badge::after { content: ""; position: absolute; background: var(--aqua); }
.portrait-badge::before { width: 68%; height: 11%; border-radius: 50%; transform: rotate(-22deg); opacity: .75; }
.portrait-badge::after { width: 12%; height: 64%; border-radius: 50%; transform: rotate(-22deg); opacity: .45; }
.orbit { position: absolute; left: 48%; top: 49%; border: 1px solid rgba(77,232,208,.3); border-radius: 50%; transform: translate(-50%,-50%) rotate(-16deg); }
.orbit::after { content: ""; position: absolute; left: 9%; top: 24%; width: 8px; height: 8px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 14px var(--acid); }
.orbit-one { width: 65%; height: 38%; animation: orbit 9s linear infinite; }
.orbit-two { width: 48%; height: 72%; animation: orbit 13s linear reverse infinite; }
.specimen-card {
  position: absolute; left: 12%; right: 11%; bottom: 10%; padding: 13px 16px;
  display: grid; gap: 3px; border-left: 2px solid var(--acid); background: rgba(7,14,19,.76); backdrop-filter: blur(8px);
  font-style: normal;
}
.specimen-card span { color: var(--aqua); font-size: 8px; letter-spacing: .18em; }
.specimen-card b { font: 700 18px "Barlow Condensed", sans-serif; letter-spacing: .08em; }
.specimen-card i { color: #87989b; font-size: 8px; font-style: normal; }

.message-screen { justify-items: center; align-content: center; text-align: center; background: rgba(7,14,19,.88); backdrop-filter: blur(7px); }
.message-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.message-screen h2 { margin: 8px 0 6px; font: 800 clamp(45px,6vw,82px)/.9 "Barlow Condensed", sans-serif; color: var(--acid); }
.message-screen p:not(.kicker) { margin: 6px 0 24px; color: #aebcbd; font-size: 12px; }
.toast {
  position: absolute; z-index: 8; left: 50%; top: 19%; translate: -50% 0; padding: 9px 16px;
  color: var(--ink); background: var(--paper); font: 700 11px "Barlow Condensed", sans-serif; letter-spacing: .13em;
  opacity: 0; transform: translateY(10px); transition: .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

.briefing { display: grid; grid-template-columns: .85fr 1.75fr; gap: 7vw; padding: 100px 2vw 82px; }
.briefing-intro h2 { margin: 12px 0 20px; font: 700 clamp(40px,4vw,62px)/.9 "Barlow Condensed", sans-serif; letter-spacing: -.02em; }
.briefing-intro > p:last-child { color: var(--muted); font-size: 11px; line-height: 1.8; max-width: 440px; }
.control-grid { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--line); }
.control-grid article { position: relative; min-height: 260px; padding: 34px 23px 20px 0; border-bottom: 1px solid var(--line); }
.control-grid article + article { padding-left: 23px; border-left: 1px solid var(--line); }
.control-number { position: absolute; right: 15px; top: 13px; color: rgba(232,234,223,.19); font: 700 30px "Barlow Condensed", sans-serif; }
.key-row { min-height: 47px; display: flex; align-items: center; }
.key-row span { padding: 0 8px; color: #667579; font-size: 8px; }
.control-grid h3 { margin: 20px 0 9px; color: var(--acid); font: 700 17px "Barlow Condensed", sans-serif; letter-spacing: .08em; }
.control-grid p { color: var(--muted); font-size: 9px; line-height: 1.75; }
.field-note { grid-column: 2; display: flex; gap: 18px; align-items: baseline; padding: 17px 20px; background: rgba(77,232,208,.07); border-left: 2px solid var(--aqua); }
.field-note span { flex: 0 0 auto; color: var(--aqua); font: 600 10px "Barlow Condensed", sans-serif; letter-spacing: .15em; }
.field-note p { margin: 0; color: #9caeaf; font-size: 9px; line-height: 1.6; }
footer { height: 78px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: #526267; font-size: 8px; letter-spacing: .14em; }

@keyframes pulse { 50% { opacity: .35; box-shadow: 0 0 2px var(--acid); } }
@keyframes orbit { to { transform: translate(-50%,-50%) rotate(344deg); } }

@media (max-width: 900px) {
  .shell { padding: 0 12px; }
  .masthead { height: 82px; }
  .status-line { display: none; }
  .game-frame { margin-top: 18px; }
  .hud { left: 17px; right: 17px; top: 15px; }
  .hud-center { display: none; }
  .hud { grid-template-columns: 1fr 1fr; }
  .hud-cluster { gap: 13px; }
  .hud-right { grid-column: 2; }
  .icon-button { display: none; }
  .start-copy { width: 72%; padding-left: 7vw; }
  .start-copy h1 { font-size: 9vw; }
  .lede { font-size: 9px; margin: 15px 0 17px; }
  .mini-controls { margin-top: 12px; }
  .cross-portrait { left: 60%; opacity: .5; }
  .briefing { grid-template-columns: 1fr; padding-top: 70px; }
  .field-note { grid-column: 1; }
}

@media (max-width: 620px) {
  .start-copy { width: 92%; padding: 25px; }
  .start-copy h1 { font-size: 14vw; }
  .cross-portrait { opacity: .18; inset: 0; }
  .mini-controls span:nth-child(3) { display: none; }
  .hud-left .readout:nth-child(3), .hud-time { display: none; }
  .control-grid { grid-template-columns: 1fr; }
  .control-grid article + article { border-left: 0; padding-left: 0; }
  .control-grid article { min-height: 210px; }
  .briefing { padding: 60px 3vw; }
}

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