:root {
  --bg: #05030f;
  --panel: rgba(11, 6, 24, 0.78);
  --line: #3b2a6b;
  --text: #e2e8f0;
  --muted: #a78bfa;
  --signal: #22d3ee;
  --high: #f472b6;
  --medium: #fb923c;
  --low: #fde047;
  --bad: #f472b6;
  --font: var(--font-vt323);
  --pixel: var(--font-press-start);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 22px/1.25 var(--font);
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* The stage: the scene fills it, behind everything; the sky on top, the ground (the panels)
   below. The planet's ground surface sits at the top of #app (scene anchor). i-000009. */
.stage { position: relative; min-height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.top {
  position: relative; z-index: 30; display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
}
.top-tag { margin: 0; font: 12px var(--pixel); color: #fff; }
.top-tag #top-day { color: var(--signal); }
.signal { color: var(--muted); }
.top-right { display: flex; gap: 14px; align-items: center; margin-left: auto; }
.mute { font-size: 20px; cursor: pointer; padding: 4px; background: none; border: none; opacity: 0.7; }
.mute:hover { opacity: 1; }
/* fullscreen (b-000018): pixel corners, out when windowed, in when fullscreen */
.fs-btn svg { display: block; fill: #e9d5ff; }
.fs-btn .fs-out, .fs-btn[aria-pressed="true"] .fs-in { display: none; }
.fs-btn[aria-pressed="true"] .fs-out { display: inline; }
.account-btn {
  font: 10px var(--pixel); cursor: pointer; padding: 6px 8px;
  background: rgba(11, 6, 24, 0.6); color: var(--signal); border: 2px solid var(--signal);
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* the same height in both modes, so the title screen's buttons don't jump; low enough that
   the notices under them fit on a laptop screen without scrolling */
.sky { position: relative; z-index: 20; flex: 1; min-height: max(360px, 47vh); }
.playing .sky { min-height: max(320px, 45vh); }
.title { position: absolute; inset-inline: 0; top: max(110px, 24%); padding: 0 16px; text-align: center; }
.title .logo { margin: 0; font: 48px var(--pixel); color: #fff; }
.title .letter { display: inline-block; }
.kicker { margin: 20px 0 0; font: 12px var(--pixel); letter-spacing: 0.4em; color: #67e8f9; }
.pitch { margin: 18px auto 0; max-width: 28rem; font-size: 28px; line-height: 1.1; color: #fff; }
.rules { margin: 10px 0 0; font-size: 22px; color: #c4b5fd; }
.rules .win { color: #fde047; }
@media (min-width: 640px) { .title .logo { font-size: 72px; } .kicker { font-size: 20px; } .pitch { font-size: 32px; } }
.playing .title { pointer-events: none; }

.dialog {
  background: var(--panel); color: var(--text); border: 2px solid var(--line);
  padding: 24px; width: min(420px, calc(100vw - 32px)); position: relative;
}
.dialog::backdrop { background: rgba(5, 6, 15, 0.8); }
.dialog h2 { margin-top: 0; color: var(--signal); font-size: 18px; letter-spacing: 2px; }
.dialog p { color: var(--muted); font-size: 20px; }
.dialog form { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.dialog input {
  font: inherit; padding: 10px; background: var(--bg); color: var(--text); border: 2px solid var(--line);
}
.dialog label { font-size: 19px; color: var(--muted); }
.dialog-close {
  position: absolute; top: 8px; right: 10px; font: inherit; font-size: 20px; line-height: 1;
  background: none; border: none; color: var(--muted); cursor: pointer;
}
.dialog-error { color: var(--bad) !important; min-height: 18px; }
.signin-google { min-height: 44px; margin: 12px 0; }
.menu-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.menu-delete { color: var(--bad); font-size: 19px; margin-top: 8px; }

.signal strong { color: var(--signal); }

.ground { position: relative; z-index: 10; width: 100%; max-width: 640px; margin: 0 auto; padding: 12px 12px 24px; }

/* the title screen: one centered column over the ground, like the source's */
.view { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0; text-align: center; }
.view p { margin: 0; }
/* one size whatever the label says (START TRANSMISSION, CONTINUE, VIEW RESULTS) */
.view #start { width: min(100%, 420px); font: 18px var(--pixel); padding: 24px 0; cursor: pointer; }

.ai-note, .consent { max-width: 34em; padding: 6px 10px; color: #c4b5fd; font-size: 18px; background: #05030fcc; }
.consent a { color: #c4b5fd; }
.ai-note { margin-top: 4px !important; }
.consent a, .legal a { color: var(--muted); }

.legal { padding: 16px 0 0; color: var(--muted); font-size: 16px; text-align: center; }

.btn {
  font: inherit; cursor: pointer; padding: 10px 18px;
  border: 2px solid var(--signal); background: transparent; color: var(--signal);
}
.btn-primary { background: var(--signal); color: var(--bg); font-weight: bold; }
.btn:disabled { opacity: .5; cursor: wait; }
.btn:focus-visible, input:focus-visible { outline: 2px dashed var(--text); outline-offset: 2px; }

.daily, .countdown { color: #a78bfa; font: 10px var(--pixel); letter-spacing: 0.2em; line-height: 1.8; }

/* ---------- the game (i-000010): the collaborator's radio, gauge, popups and TV; the
   source's Tailwind classes as plain rules ---------- */
.pixel { font-family: var(--pixel); }
.tiny { font-size: 9px; letter-spacing: 0.3em; }
.huge { font-size: 26px; margin: 10px 0 0; }
.big { font-size: 24px; margin: 8px 0 0; }
.yellow { color: #fde047; } .pink { color: #f472b6; } .white { color: #fff; } .violet { color: #c4b5fd; }
.cyan { color: #67e8f9; } .dim-yellow { color: #fde047b3; } .ok { color: #86efac; } .bad { color: #f472b6; }
/* The error and the names line share one reserved line under the meter (i-000017): one
   showing up while typing must not grow the bottom-anchored radio and make it jump. */
.status-line { display: grid; min-height: calc(22px * 1.3); font-size: 22px; line-height: 1.3; }
.status-line > p { grid-area: 1 / 1; }
.message { margin: 0; padding: 0 4px; color: #f472b6; font-size: 22px; }
@media (min-width: 640px) { .huge { font-size: 40px; } .big { font-size: 30px; } }

.radio { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; margin-top: 30px; }
.radio-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 4px; }
.radio-head .label { font-size: 8px; color: #ddd6feaa; }
.leds { display: flex; gap: 6px; }
.radio-body { display: flex; gap: 12px; }
.grille.side { width: 56px; flex-shrink: 0; }
.radio-mid { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.knobs { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 48px; flex-shrink: 0; padding-top: 4px; }
.knobs .label { margin-bottom: 8px; }
@media (max-width: 639px) { .grille.side, .knobs { display: none; } }
.lcd { padding: 8px 12px; }
.lcd .row, .label.row { display: flex; justify-content: space-between; gap: 8px; margin: 0; }
.target { margin: 4px 0 0; font: 20px var(--pixel); color: #f9a8d4; overflow-wrap: anywhere; }
.jammed { margin: 6px 0 0; font-size: 20px; line-height: 1; }
.jammed .label { margin-right: 8px; }
.jam { display: inline-block; margin-right: 10px; color: #fca5a5e6; text-decoration: line-through 2px; }
/* unlocked (b-000024): the alien said it, so it may be used now */
.jam.free { color: #86efac; text-decoration: none; animation: unlock 0.25s steps(2) 3; }
@keyframes unlock { 50% { opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) { .jam.free { animation: none; } }
.convo { font-size: 22px; line-height: 1.3; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; font-size: 18px; line-height: 1; }
.chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 2px solid; border-radius: 4px; padding: 2px 6px; color: #a5f3fccc; }
.said-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; }
.said { color: #a5f3fc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alien { flex-shrink: 0; }
.send-row { display: flex; align-items: center; gap: 12px; }
.input-box { display: flex; flex: 1; min-width: 0; align-items: center; gap: 8px; }
.input-box .prompt { font-size: 26px; color: #67e8f9; }
.input-box input {
  flex: 1; min-width: 0; padding: 6px 0; font: 26px var(--font); color: #cffafe;
  background: transparent; border: 0; outline: none; caret-color: #f472b6;
}
.input-box input::placeholder { color: #a5f3fc4d; }
.ptt { width: 64px; height: 64px; flex-shrink: 0; font: 9px var(--pixel); cursor: pointer; }
.over-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; }
.over-row p { margin: 0; color: #ede9fe; }
.over-row .ptt { font-size: 8px; }
.meter-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 4px; }
.char-meter { display: flex; flex: 1; gap: 2px; min-width: 0; }
.char-meter span { height: 12px; max-width: 6px; flex: 1; background: #ffffff1a; }
.char-meter span.on { background: #67e8f9; }
.char-meter span.hot { background: #f472b6; }

/* the rank gauge, left of the sky */
.gauge {
  position: absolute; left: 8px; top: 144px; z-index: 10; margin: 0; padding: 6px 8px; list-style: none;
  border: 2px solid #4c1d95cc; background: #0b0618b3; color: #ddd6fe;
  font: 7px/13px var(--pixel);
}
.gauge li { display: flex; align-items: center; gap: 4px; }
.gauge li.off { opacity: 0.4; }
.gauge li.head { justify-content: space-between; gap: 12px; margin-bottom: 4px; font-size: 7px; }
.gauge .arrow { width: 8px; }
.gauge .dots { flex: 1; min-width: 8px; align-self: flex-end; border-bottom: 2px dotted currentColor; opacity: 0.4; }
@media (min-width: 640px) { .gauge { left: 12px; top: 44px; font-size: 8px; line-height: 15px; } }

/* the rank popup and the new-word banner, across the sky */
.rank-pop, .word-banner { position: absolute; inset-inline: 0; z-index: 20; text-align: center; margin: 0; }
.rank-pop { top: 26%; padding: 12px 8px; background: #0b061899; }
.rank-pop p, .word-banner p { margin: 0; }
.rank-pop .tiny { color: #ffffffcc; }
.rank-pop .psy-name { text-shadow: -3px 0 #f472b6, 3px 0 #22d3ee; }
.psy-letter { display: inline-block; }
.pop-line { margin-top: 8px !important; font-size: 26px; color: #fff; }
.word-banner { top: 42%; animation: banner 1.8s steps(12) both; }
.word-banner .tiny { margin-top: 12px; }
.psy-wash { position: fixed; }

/* the result TV over the game */
/* A column that scrolls when the TV doesn't fit; margin: auto centers it otherwise without
   pushing its top above the scroll start (grid centering did, i-000019). */
.tv-wrap { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; overflow-y: auto; padding: 80px 16px 16px; }
.tv-col { margin: auto 0; display: flex; flex-direction: column; align-items: center; }
.tv { position: relative; width: min(92vw, 440px); padding: 12px 12px 16px; }
.tv-screen { position: relative; padding: 16px; }
.tv-screen > .label.row { font-size: 7px; color: #67e8f9cc; }
.tv-body { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.tv-alien { display: flex; align-items: center; gap: 12px; }
.alien-face { width: 70px; height: 64px; flex-shrink: 0; }
.tv-alien .bubble { flex: 1; position: relative; padding: 8px 12px; font-size: 24px; line-height: 1; }
.tv-center { text-align: center; }
.tv-center p, .tv-center h2 { margin: 0; }
.quote { margin-top: 4px !important; font-size: 22px; color: #ddd6fe; }
.tv-words { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tv-words li { display: flex; align-items: center; gap: 8px; font-size: 22px; }
.tv-words .n { width: 20px; color: #a78bfa; }
.tv-words .w { width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.tv-words .w.lost { color: #f472b6; text-decoration: line-through; }
.tv-words .bars { display: flex; flex: 1; gap: 4px; }
.tv-words .s { width: 36px; text-align: right; }
.tv-score { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 2px dashed #67e8f933; }
.tv-score p { margin: 0; }
.tv-score .right { text-align: right; }
.tv-score .score { font-size: 36px; color: #fde047; text-shadow: 0 0 14px #fde04788; }
.tv-score .pct { margin-top: 4px; font-size: 24px; color: #a5f3fc; }
.tv-score .sub { font-size: 18px; color: #c4b5fd; }
.spread { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.spread li { display: flex; align-items: center; gap: 8px; font: 7px var(--pixel); }
.spread .name { width: 92px; flex-shrink: 0; }
.spread .track { flex: 1; height: 10px; }
.spread .bar-grow { display: block; height: 100%; }
.spread .p { width: 28px; text-align: right; }
.spread .you { width: 32px; }
.zap { align-self: flex-start; font: 9px var(--pixel); color: #67e8f9; background: none; border: 0; cursor: pointer; padding: 4px 0; }
.zap.right { align-self: flex-end; }
.zap:hover { color: #fff; }
.tv-board { list-style: none; margin: 0; padding: 0; }
.tv-board li { display: flex; align-items: center; gap: 8px; padding: 0 4px; font-size: 22px; color: #cffafe; }
.tv-board li.mine { background: #f472b626; color: #f9a8d4; }
.tv-board li.gap { justify-content: center; color: #a78bfa; line-height: 1; }
.tv-board .pos { width: 48px; color: #a78bfa; }
.tv-board .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-board .rk { width: 92px; overflow: hidden; white-space: nowrap; font: 7px var(--pixel); }
.tv-board .sc { width: 36px; text-align: right; color: #fde047; }
.note { text-align: center; color: #f9a8d499; line-height: 1.6; }
.tv-panel { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 0 4px; }
.tv-panel .grille { width: 56px; height: 36px; flex-shrink: 0; }
.tv-panel .label { flex: 1; font-size: 8px; color: #ddd6feb3; }
.knob.small { transform: scale(0.75); }
.share-row { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.share-row > .arcade { padding: 16px 0; font: 10px var(--pixel); cursor: pointer; }
.share-row > #end-signin, .share-row > #share[hidden] + #tv-free { grid-column: span 2; }
.view #free { margin-top: -4px; padding: 12px 20px; font: 10px var(--pixel); cursor: pointer; }
.share-menu {
  position: absolute; inset-inline: 0; bottom: 100%; z-index: 10; margin-bottom: 8px;
  display: flex; flex-direction: column; gap: 8px; padding: 8px; border: 2px solid #67e8f9; background: #05030ff2;
}
.share-menu .arcade { padding: 12px 0; font: 10px var(--pixel); cursor: pointer; }
.end-ranks { margin: 8px 0 0; text-align: center; color: #86efac; }
.end-ranks:empty { display: none; }
/* its own row under the TV, clear of its 26 px legs: no longer sticky over SHARE and
   FREE PLAY (b-000021) */
.back-btn {
  margin-top: 44px; padding: 8px 16px; cursor: pointer;
  font: 10px var(--pixel); color: #c4b5fd; background: #05030fe6; border: 2px solid #a78bfa99;
}
.back-btn:hover { color: #fff; }

/* countries mode (i-000011): the mode tabs, the names line, the names popup */
.tabs { display: flex; gap: 8px; }
.tabs .tab { font: 10px var(--pixel); cursor: pointer; }
.names-line { margin: 0; padding: 0 4px; color: #fde047; font-size: 22px; }
.atlas-new { margin-top: 6px !important; letter-spacing: 0.25em; }
.names-dialog { text-align: center; }

/* abort a run (t-000004): a quiet button in the meter row, a confirm dialog */
.abort-btn {
  flex-shrink: 0; padding: 1px 6px; cursor: pointer; font: 8px/8px var(--pixel); letter-spacing: 0.1em; /* 12 px: the meter row's own height */
  color: #f9a8d4b3; background: none; border: 1px solid #f472b666;
}
.abort-btn:not(:disabled):hover, .abort-btn:focus-visible { color: #fff; border-color: #f472b6; }
.abort-btn:disabled { opacity: 0.4; cursor: default; }
.abort-dialog { text-align: center; }
.abort-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.abort-actions .arcade { padding: 12px 16px; font: 10px var(--pixel); cursor: pointer; }
.names-dialog h2 { font: 14px var(--pixel); color: #fde047; }
.names-examples { list-style: none; margin: 12px 0; padding: 8px 12px; text-align: left; font-size: 22px; }
.names-examples li { display: flex; justify-content: space-between; gap: 12px; color: #a5f3fc; }
.names-dialog .arcade { padding: 12px 24px; font: 12px var(--pixel); cursor: pointer; }
/* countries mode: the title sits higher, the Earth turns below it (the source's) */
.title { transition: top 0.7s; }
.geo .title { top: max(48px, 5%); }
/* the sky is as low as in words mode (the buttons stay put): the pitch makes room for the
   Earth; the rules line under it still says what to do */
.geo:not(.playing) .pitch { display: none; }
