/* =========================================================
   PONG-O-VISION · retro television ping-pong
   ========================================================= */

:root {
  --ink: #080b08;
  --screen: #06120b;
  --phosphor: #9dffad;
  --phosphor-bright: #ddffe3;
  --phosphor-dim: #66b877;
  --cream: #efe2c1;
  --cream-dim: #b4a88c;
  --amber: #f4ad58;
  --orange: #d76430;
  --red: #ff6b4f;
  --wood-1: #2a1309;
  --wood-2: #6e371a;
  --wood-3: #4a2411;
  --wood-edge: #1a0c06;
  --pixel: "Press Start 2P", "Courier New", monospace;
  --display: "VT323", "Courier New", monospace;
  --body: "Courier New", ui-monospace, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  min-height: 100%;
  background: #090c09;
  scrollbar-color: #4c432e #0b0f0b;
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--cream);
  font-family: var(--body);
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 58% 48% at 43% 38%, rgba(126, 142, 91, .18), transparent 72%),
    radial-gradient(ellipse 28% 60% at 92% 50%, rgba(212, 102, 48, .055), transparent 70%),
    repeating-linear-gradient(90deg, rgba(231, 217, 179, .023) 0 1px, transparent 1px 92px),
    repeating-linear-gradient(0deg, rgba(231, 217, 179, .012) 0 1px, transparent 1px 92px),
    linear-gradient(180deg, #111712 0%, #0c110d 48%, #151009 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .28;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, .055) 0 1px, transparent 1.3px),
    radial-gradient(circle at 70% 65%, rgba(255, 255, 255, .035) 0 1px, transparent 1.2px);
  background-size: 37px 41px, 53px 47px;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, .42) 100%);
}

::selection { color: #061009; background: var(--phosphor); }

button, input { font: inherit; }
button { color: inherit; }

.page {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1450px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 38px);
  display: flex;
  flex-direction: column;
}

/* ---------------- masthead ---------------- */

.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(16px, 2.4vh, 28px) 4px clamp(8px, 1.4vh, 14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 17px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  flex: none;
  width: 52px;
  height: 41px;
  border: 2px solid #756b55;
  border-radius: 6px;
  background: linear-gradient(145deg, #30352b, #11150f 72%);
  box-shadow:
    0 4px 0 #080a07,
    inset 0 1px 0 rgba(255, 255, 255, .16),
    0 0 20px rgba(157, 255, 173, .08);
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 8px 8px 9px;
  border-radius: 3px;
  background:
    linear-gradient(90deg, transparent 47%, rgba(157, 255, 173, .25) 48% 52%, transparent 53%),
    #07120a;
  box-shadow: inset 0 0 12px #000;
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 15px;
  bottom: 13px;
  width: 13px;
  height: 4px;
  background: var(--phosphor);
  box-shadow: 0 0 9px rgba(157, 255, 173, .85);
}

.brand-mark .mark-antenna {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 1px);
  width: 1px;
  height: 15px;
  background: #8f8a78;
  transform-origin: bottom;
  transform: rotate(-26deg);
}
.brand-mark .mark-antenna + .mark-antenna { transform: rotate(26deg); }

.eyebrow {
  margin: 0;
  font-family: var(--pixel);
  font-size: clamp(6px, .55vw, 8px);
  line-height: 1.8;
  letter-spacing: .16em;
  color: var(--amber);
  text-transform: uppercase;
}

h1 {
  margin: 5px 0 0;
  font-family: var(--pixel);
  font-size: clamp(18px, 2.05vw, 29px);
  line-height: 1.28;
  letter-spacing: -.035em;
  color: var(--cream);
  text-shadow: 0 2px 0 #3c2b17, 0 0 30px rgba(239, 226, 193, .12);
}

h1 .dot { color: var(--orange); }

.top-meta {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.on-air {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(239, 226, 193, .22);
  background: rgba(0, 0, 0, .2);
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: .12em;
  color: var(--cream);
  box-shadow: inset 0 0 14px rgba(255, 255, 255, .02);
}

.on-air i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 9px rgba(255, 107, 79, .9);
  animation: onAir 1.8s ease-in-out infinite;
}

.top-meta p {
  margin: 0;
  padding-right: 2px;
  font-family: var(--pixel);
  font-size: 6px;
  letter-spacing: .11em;
  color: #847b65;
}
.top-meta p span { color: var(--orange); margin: 0 4px; }

/* ---------------- main layout ---------------- */

.stage {
  flex: 1;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 364px);
  align-items: center;
  gap: clamp(26px, 4vw, 64px);
  padding: 10px 2px 28px;
}

.tv-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------------- television cabinet ---------------- */

.tv-unit {
  position: relative;
  width: min(100%, 885px);
  padding-top: 74px;
  animation: setDown .9s cubic-bezier(.2, .8, .2, 1) both;
}

.antenna {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 69px);
  width: 1px;
  height: 78px;
  z-index: 0;
  pointer-events: none;
}

.rod {
  position: absolute;
  left: -2px;
  bottom: 0;
  width: 4px;
  height: 74px;
  border-radius: 3px;
  background: linear-gradient(90deg, #4f524a, #c8cbbb 44%, #74776c 72%, #2f312d);
  transform-origin: 50% 100%;
  box-shadow: 0 0 5px rgba(0, 0, 0, .45);
}
.rod.left { transform: rotate(-27deg); }
.rod.right { transform: rotate(27deg); }
.rod::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle at 35% 30%, #e4e5d9, #8b8d80 55%, #363832);
}

.antenna-base {
  position: absolute;
  left: -25px;
  bottom: -6px;
  width: 50px;
  height: 16px;
  border-radius: 50% 50% 5px 5px;
  background: linear-gradient(180deg, #55584e, #1b1d18);
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, .12), 0 4px 10px rgba(0, 0, 0, .55);
}

.tv-body {
  position: relative;
  z-index: 2;
  padding: 10px 14px 14px;
  border: 1px solid rgba(255, 214, 167, .15);
  border-radius: 27px 27px 16px 16px;
  background:
    repeating-linear-gradient(93deg, rgba(255, 255, 255, .027) 0 2px, transparent 2px 8px, rgba(0, 0, 0, .09) 8px 9px, transparent 9px 15px),
    radial-gradient(ellipse at 24% 20%, rgba(195, 113, 56, .38), transparent 46%),
    linear-gradient(102deg, var(--wood-1) 0%, var(--wood-2) 31%, #562a14 53%, var(--wood-3) 74%, #261007 100%);
  box-shadow:
    0 3px 0 #1a0b05,
    0 22px 34px rgba(0, 0, 0, .48),
    0 44px 80px rgba(0, 0, 0, .32),
    inset 0 2px 0 rgba(255, 229, 187, .18),
    inset 0 -3px 0 rgba(0, 0, 0, .45);
}

.tv-body::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 220, 180, .08);
  border-radius: 22px 22px 12px 12px;
  pointer-events: none;
}

.tv-topline {
  height: 24px;
  padding: 0 7px 0 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(236, 215, 178, .56);
  font-family: var(--pixel);
  font-size: 5px;
  letter-spacing: .15em;
}

.tv-topline .vents {
  flex: 1;
  height: 7px;
  max-width: 160px;
  opacity: .55;
  background: repeating-linear-gradient(90deg, #190d07 0 2px, transparent 2px 6px);
  border-radius: 1px;
}
.tv-topline .model { margin-left: auto; }
.tv-topline .channel {
  padding: 3px 5px;
  color: #dfd1ad;
  border: 1px solid rgba(235, 222, 187, .2);
  border-radius: 2px;
}

.screen-bezel {
  position: relative;
  padding: clamp(13px, 1.45vw, 18px) clamp(13px, 1.45vw, 18px) clamp(16px, 1.8vw, 21px);
  border-radius: 23px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .07), transparent 18%),
    linear-gradient(160deg, #21231d, #080a07 47%, #161813 100%);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, .13),
    inset 0 -4px 9px #000,
    0 0 0 1px #050604,
    0 7px 14px rgba(0, 0, 0, .6);
}

.screen-bezel::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(229, 224, 195, .09);
  border-radius: 18px;
  pointer-events: none;
}

.screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 14px;
  background: #041009;
  isolation: isolate;
  box-shadow:
    0 0 0 2px #020403,
    0 0 0 3px rgba(157, 255, 173, .05),
    inset 0 0 48px rgba(0, 0, 0, .95),
    0 0 30px rgba(92, 212, 114, .07);
  animation: screenOn .9s .18s cubic-bezier(.22, .8, .2, 1) both;
}

.screen.is-playing { cursor: none; touch-action: none; }

.screen canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.scanlines,
.screen-vignette,
.glass-glare,
.screen-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scanlines {
  z-index: 10;
  opacity: .52;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, .26) 2px,
    rgba(0, 0, 0, .26) 3px
  );
  mix-blend-mode: multiply;
}

.screen-vignette {
  z-index: 9;
  background:
    radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, .64) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, .3), transparent 8% 92%, rgba(0, 0, 0, .3));
  box-shadow: inset 0 0 38px rgba(0, 0, 0, .75);
}

.glass-glare {
  z-index: 11;
  opacity: .48;
  background:
    linear-gradient(124deg, rgba(255, 255, 255, .085) 0%, rgba(255, 255, 255, .018) 24%, transparent 42%),
    radial-gradient(ellipse 52% 25% at 32% 2%, rgba(255, 255, 255, .1), transparent 72%);
}

.screen-flash {
  z-index: 8;
  opacity: 0;
}
.screen-flash.hit { background: rgba(157, 255, 173, .15); animation: flash .18s ease-out; }
.screen-flash.point { background: rgba(255, 195, 102, .2); animation: flash .3s ease-out; }
.screen-flash.miss { background: rgba(255, 80, 55, .3); animation: flash .38s ease-out; }

.screen.glitching { animation: glitch .46s steps(1) both; }

.tv-controls {
  height: 62px;
  margin-top: 12px;
  padding: 0 18px;
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto auto;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  border: 1px solid #33382e;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), transparent 38%),
    linear-gradient(180deg, #1b1e18, #0d100c);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .09),
    inset 0 -8px 14px rgba(0, 0, 0, .38),
    0 3px 0 #130a05;
}

.control-brand {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.control-brand strong {
  font-family: var(--pixel);
  font-size: clamp(6px, .7vw, 9px);
  letter-spacing: .06em;
  color: #dbc9a3;
  text-shadow: 0 1px 0 #000;
  white-space: nowrap;
}
.control-brand small {
  font-family: var(--pixel);
  font-size: 5px;
  letter-spacing: .14em;
  color: #6f7564;
}

.speaker {
  width: 90px;
  height: 34px;
  border: 1px solid #090b08;
  border-radius: 4px;
  background:
    radial-gradient(circle, #050705 1.5px, transparent 1.8px) 0 0 / 7px 7px,
    linear-gradient(180deg, #161913, #0b0d0a);
  box-shadow: inset 0 2px 7px #000, 0 1px 0 rgba(255, 255, 255, .06);
}

.knob-cluster {
  display: flex;
  align-items: center;
  gap: 13px;
}

.knob-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--pixel);
  font-size: 4px;
  letter-spacing: .08em;
  color: #777d6c;
}

.knob {
  position: relative;
  width: 29px;
  height: 29px;
  border: 2px solid #090a08;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 30%, #c9c8b9, #7a7c70 30%, #2a2c26 69%, #11130f 100%);
  box-shadow: 0 2px 4px #000, inset 0 1px 2px rgba(255, 255, 255, .3);
}
.knob::after {
  content: "";
  position: absolute;
  top: 3px;
  left: calc(50% - 1px);
  width: 2px;
  height: 9px;
  border-radius: 1px;
  background: #171912;
}
.knob.knob-2 { transform: rotate(63deg); }

.audio-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #373b31;
  border-radius: 4px;
  padding: 7px 8px;
  background: linear-gradient(#1c2019, #0b0d0a);
  color: #9a9e8c;
  font-family: var(--pixel);
  font-size: 5px;
  letter-spacing: .07em;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .2s, color .2s, background .2s;
}
.audio-btn:hover, .audio-btn:focus-visible { border-color: #68705b; color: var(--cream); outline: none; }
.audio-btn .audio-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--phosphor);
  box-shadow: 0 0 7px rgba(157, 255, 173, .8);
}
.audio-btn.is-off .audio-dot { background: #4d5047; box-shadow: none; }
.audio-btn.is-off { color: #5e6457; }

.tv-feet {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  padding: 0 78px;
  margin-top: -2px;
}
.tv-feet span {
  width: 78px;
  height: 17px;
  border-radius: 0 0 7px 7px;
  background: linear-gradient(180deg, #1a0f09, #080504);
  box-shadow: 0 8px 12px rgba(0, 0, 0, .48);
}

.below-tv {
  width: 100%;
  margin-top: 18px;
  padding: 0 clamp(6px, 2vw, 24px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  color: #90866e;
  font-family: var(--pixel);
  font-size: clamp(5px, .53vw, 7px);
  line-height: 1.9;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.below-tv p { margin: 0; }
.below-tv .player-status { display: flex; align-items: center; gap: 8px; color: var(--cream-dim); white-space: nowrap; }
.below-tv .player-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 7px rgba(244, 173, 88, .65);
}
.below-tv .controls-hint { text-align: right; }
.below-tv kbd {
  display: inline-block;
  min-width: 18px;
  padding: 2px 4px;
  margin: 0 2px;
  border: 1px solid rgba(239, 226, 193, .2);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: rgba(0, 0, 0, .18);
  color: #cfc2a5;
  font-family: var(--pixel);
  font-size: .9em;
  text-align: center;
}
.below-tv .divider { color: #4f5548; margin: 0 4px; }

/* ---------------- game HUD + overlays ---------------- */

.game-hud {
  position: absolute;
  z-index: 4;
  inset: 16px 22px auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
  font-family: var(--display);
  color: var(--phosphor);
  text-shadow: 0 0 10px rgba(157, 255, 173, .55);
}
.hud-block { display: flex; flex-direction: column; gap: 2px; min-width: 62px; }
.hud-block.center { align-items: center; }
.hud-block.right { align-items: flex-end; }
.hud-label {
  font-family: var(--pixel);
  font-size: clamp(5px, .52vw, 7px);
  letter-spacing: .12em;
  color: rgba(157, 255, 173, .6);
  text-shadow: none;
}
.hud-value {
  font-size: clamp(21px, 2.2vw, 30px);
  line-height: .92;
  letter-spacing: .035em;
  font-variant-numeric: tabular-nums;
}
.hud-value small { font-size: .6em; color: rgba(157, 255, 173, .55); }

.screen-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 4.2%, 38px);
  text-align: center;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(1, 8, 4, .48), rgba(1, 7, 3, .82)),
    radial-gradient(ellipse at center, rgba(8, 32, 15, .16), rgba(0, 0, 0, .5));
  animation: overlayIn .35s ease-out both;
}
.screen-overlay[hidden] { display: none; }

.start-overlay {
  background:
    linear-gradient(180deg, rgba(1, 8, 4, .28), rgba(1, 7, 3, .76)),
    radial-gradient(ellipse at 50% 54%, rgba(23, 68, 33, .18), transparent 64%);
}

.start-content {
  width: min(100%, 590px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.screen-kicker {
  margin: 0 0 clamp(8px, 1.5vh, 14px);
  font-family: var(--pixel);
  font-size: clamp(5px, .64vw, 8px);
  letter-spacing: .19em;
  color: rgba(157, 255, 173, .65);
}
.screen-kicker::before,
.screen-kicker::after { content: " · "; color: rgba(157, 255, 173, .32); }

.game-logo {
  margin: 0;
  font-family: var(--pixel);
  font-size: clamp(24px, 3.65vw, 43px);
  line-height: 1.12;
  letter-spacing: -.055em;
  color: var(--phosphor-bright);
  text-shadow:
    0 0 8px rgba(157, 255, 173, .7),
    0 0 30px rgba(112, 255, 142, .32),
    3px 0 0 rgba(255, 94, 57, .17),
    -3px 0 0 rgba(76, 143, 255, .16);
  animation: logoGlow 4.5s ease-in-out infinite;
}
.game-logo .logo-o {
  color: rgba(4, 16, 9, .2);
  -webkit-text-stroke: 2px var(--phosphor-bright);
  filter: drop-shadow(0 0 9px rgba(157, 255, 173, .62));
}
.game-logo .logo-sep {
  display: inline-block;
  width: .17em;
  height: .17em;
  margin: 0 .16em;
  border-radius: 50%;
  background: var(--amber);
  vertical-align: .33em;
  box-shadow: 0 0 8px rgba(244, 173, 88, .55);
}

.game-tagline {
  margin: clamp(7px, 1.2vh, 11px) 0 0;
  font-family: var(--pixel);
  font-size: clamp(5px, .62vw, 8px);
  letter-spacing: .22em;
  color: var(--amber);
  text-transform: uppercase;
}

.rule-line {
  margin: clamp(13px, 2.4vh, 23px) 0 clamp(12px, 2.2vh, 20px);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(157, 255, 173, .12);
  border-bottom: 1px solid rgba(157, 255, 173, .12);
  color: rgba(157, 255, 173, .58);
  font-family: var(--pixel);
  font-size: clamp(5px, .57vw, 7px);
  letter-spacing: .1em;
}
.rule-line b { color: var(--red); font-weight: 400; }
.rule-line .rule-ball {
  width: 6px;
  height: 6px;
  background: var(--phosphor);
  box-shadow: 0 0 8px rgba(157, 255, 173, .8);
}

.start-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--phosphor);
  padding: clamp(11px, 1.7vh, 15px) clamp(18px, 2.6vw, 29px);
  background: rgba(157, 255, 173, .04);
  color: var(--phosphor-bright);
  font-family: var(--pixel);
  font-size: clamp(7px, .78vw, 10px);
  letter-spacing: .08em;
  cursor: pointer;
  box-shadow:
    0 0 0 3px rgba(4, 16, 9, .9),
    0 0 0 4px rgba(157, 255, 173, .28),
    0 0 25px rgba(157, 255, 173, .12),
    inset 0 0 18px rgba(157, 255, 173, .04);
  transition: background .18s, color .18s, box-shadow .18s, transform .18s;
  text-transform: uppercase;
}
.start-button:hover, .start-button:focus-visible {
  background: var(--phosphor);
  color: #041009;
  box-shadow: 0 0 0 3px rgba(4, 16, 9, .9), 0 0 0 4px var(--phosphor), 0 0 32px rgba(157, 255, 173, .28);
  outline: none;
  transform: translateY(-1px);
}
.start-button .play-triangle { font-size: .85em; animation: blink 1.3s steps(1) infinite; }
.start-button:hover .play-triangle { animation: none; }

.start-hint {
  margin: clamp(11px, 1.9vh, 18px) 0 0;
  font-family: var(--pixel);
  font-size: clamp(4px, .5vw, 6px);
  letter-spacing: .1em;
  color: rgba(157, 255, 173, .42);
  text-transform: uppercase;
}
.start-hint kbd {
  border: 1px solid rgba(157, 255, 173, .2);
  border-radius: 2px;
  padding: 1px 3px;
  color: rgba(157, 255, 173, .65);
}

.center-readout {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  pointer-events: none;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(3, 14, 7, .65), transparent 45%);
}
.center-readout[hidden] { display: none; }
.center-readout strong {
  padding: 12px 21px;
  border: 1px solid rgba(157, 255, 173, .35);
  background: rgba(3, 13, 6, .86);
  color: var(--phosphor-bright);
  font-family: var(--pixel);
  font-size: clamp(13px, 1.65vw, 20px);
  font-weight: 400;
  letter-spacing: .04em;
  text-shadow: 0 0 13px rgba(157, 255, 173, .65);
  box-shadow: 0 0 26px rgba(157, 255, 173, .08);
}
.center-readout small {
  font-family: var(--pixel);
  font-size: clamp(5px, .55vw, 7px);
  letter-spacing: .12em;
  color: var(--amber);
}

.over-overlay {
  background:
    linear-gradient(180deg, rgba(9, 3, 2, .56), rgba(3, 7, 3, .88)),
    radial-gradient(ellipse at center, rgba(92, 23, 10, .18), rgba(0, 0, 0, .56));
}

.over-panel {
  width: min(100%, 510px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.signal-lost {
  margin: 0 0 clamp(6px, 1vh, 9px);
  font-family: var(--pixel);
  font-size: clamp(5px, .64vw, 8px);
  letter-spacing: .2em;
  color: var(--red);
  text-shadow: 0 0 12px rgba(255, 107, 79, .4);
}
.over-panel h2 {
  margin: 0;
  color: #ffe8dd;
  font-family: var(--pixel);
  font-size: clamp(18px, 2.6vw, 31px);
  font-weight: 400;
  letter-spacing: -.045em;
  text-shadow: 0 0 12px rgba(255, 120, 86, .35), 3px 1px 0 rgba(160, 44, 24, .38);
}

.final-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: clamp(7px, 1.4vh, 12px) 0 2px;
}
.final-score span {
  font-family: var(--pixel);
  font-size: clamp(4px, .5vw, 6px);
  letter-spacing: .16em;
  color: rgba(255, 232, 221, .5);
}
.final-score strong {
  color: var(--phosphor-bright);
  font-family: var(--display);
  font-size: clamp(43px, 5vw, 66px);
  line-height: .88;
  font-weight: 400;
  letter-spacing: .03em;
  text-shadow: 0 0 16px rgba(157, 255, 173, .6), 3px 0 0 rgba(255, 107, 79, .2);
}

.rank-preview {
  min-height: 1.6em;
  margin: 5px 0 clamp(8px, 1.3vh, 13px);
  font-family: var(--pixel);
  font-size: clamp(5px, .54vw, 7px);
  line-height: 1.8;
  letter-spacing: .08em;
  color: var(--amber);
  text-transform: uppercase;
}
.rank-preview.dim { color: #887e6b; }

.score-form { width: min(100%, 360px); }
.score-form[hidden] { display: none; }
.score-form label {
  display: block;
  margin-bottom: 7px;
  font-family: var(--pixel);
  font-size: clamp(4px, .5vw, 6px);
  letter-spacing: .12em;
  color: rgba(221, 255, 227, .52);
  text-transform: uppercase;
}
.entry-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.entry-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(157, 255, 173, .3);
  border-radius: 0;
  padding: 8px 10px;
  background: rgba(2, 10, 5, .72);
  color: var(--phosphor-bright);
  font-family: var(--display);
  font-size: clamp(19px, 1.9vw, 25px);
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  outline: none;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, .5);
}
.entry-row input:focus {
  border-color: var(--phosphor);
  box-shadow: 0 0 0 2px rgba(157, 255, 173, .12), inset 0 0 16px rgba(157, 255, 173, .04);
}
.entry-row input::placeholder { color: rgba(157, 255, 173, .22); }
.entry-row input.shake { animation: inputShake .3s ease; border-color: var(--red); }
.entry-row button {
  border: 1px solid var(--amber);
  border-radius: 0;
  padding: 0 13px;
  background: rgba(244, 173, 88, .08);
  color: var(--amber);
  font-family: var(--pixel);
  font-size: clamp(6px, .61vw, 8px);
  cursor: pointer;
  transition: color .18s, background .18s;
}
.entry-row button:hover, .entry-row button:focus-visible {
  background: var(--amber);
  color: #1b1005;
  outline: none;
}
.form-error {
  min-height: 1.5em;
  margin: 5px 0 0;
  font-family: var(--pixel);
  font-size: 5px;
  line-height: 1.5;
  letter-spacing: .04em;
  color: var(--red);
  text-transform: uppercase;
}

.post-save { width: 100%; display: flex; flex-direction: column; align-items: center; }
.post-save[hidden] { display: none; }
.save-result {
  margin: 0 0 clamp(9px, 1.5vh, 14px);
  color: var(--phosphor);
  font-family: var(--pixel);
  font-size: clamp(5px, .56vw, 7px);
  line-height: 1.8;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.post-save .start-button { font-size: clamp(6px, .68vw, 9px); padding: 10px 18px; }
.text-button {
  margin-top: clamp(8px, 1.4vh, 13px);
  border: 0;
  border-bottom: 1px solid rgba(239, 226, 193, .2);
  padding: 2px 0;
  background: transparent;
  color: rgba(239, 226, 193, .46);
  font-family: var(--pixel);
  font-size: clamp(4px, .47vw, 6px);
  letter-spacing: .08em;
  cursor: pointer;
  text-transform: uppercase;
}
.text-button:hover, .text-button:focus-visible { color: var(--cream); border-color: var(--cream-dim); outline: none; }

/* ---------------- high score cabinet ---------------- */

.board-card {
  width: 100%;
  max-width: 364px;
  justify-self: end;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.scoreboard {
  position: relative;
  padding: 9px;
  border: 1px solid #4e452e;
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .04), transparent 22%),
    linear-gradient(150deg, #24271c, #0c100c 60%, #17140d);
  box-shadow:
    0 28px 50px rgba(0, 0, 0, .48),
    inset 0 0 0 1px rgba(255, 255, 255, .04),
    inset 0 0 24px rgba(0, 0, 0, .7);
}
.scoreboard::before,
.scoreboard::after {
  content: "";
  position: absolute;
  top: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #685e45;
  box-shadow: inset 0 0 2px #0b0c09;
}
.scoreboard::before { left: 4px; }
.scoreboard::after { right: 4px; }

.board-head {
  position: relative;
  overflow: hidden;
  padding: clamp(12px, 1.6vh, 17px) 11px clamp(10px, 1.4vh, 14px);
  border: 1px solid #654726;
  border-radius: 4px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(244, 173, 88, .16), transparent 64%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #2c1b0c, #190d05);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, .75), 0 1px 0 rgba(255, 230, 184, .07);
}
.board-head::before,
.board-head::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 9px rgba(244, 173, 88, .8);
  animation: bulb 2.2s ease-in-out infinite;
}
.board-head::before { left: 14px; }
.board-head::after { right: 14px; animation-delay: -1.1s; }

.board-head .eyebrow {
  color: rgba(244, 173, 88, .48);
  font-size: 5px;
  letter-spacing: .16em;
}
.board-head h2 {
  margin: 7px 0 3px;
  color: #ffd58a;
  font-family: var(--pixel);
  font-size: clamp(15px, 1.35vw, 20px);
  font-weight: 400;
  letter-spacing: -.04em;
  text-shadow: 0 0 15px rgba(244, 173, 88, .35), 0 2px 0 #000;
}
.board-sub {
  margin: 0;
  color: #9f855a;
  font-family: var(--pixel);
  font-size: 5px;
  letter-spacing: .12em;
}
.board-sub span { color: #715b3c; }

.board-columns {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) 63px;
  gap: 8px;
  padding: 8px 12px 4px;
  color: #69755f;
  font-family: var(--pixel);
  font-size: 5px;
  letter-spacing: .13em;
}
.board-columns span:last-child { text-align: right; }

.leaderboard {
  margin: 0;
  padding: 0 12px;
  list-style: none;
  counter-reset: rank;
}

.score-row {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) 63px;
  align-items: center;
  gap: 8px;
  height: clamp(18px, 2.22vh, 23px);
  border-bottom: 1px solid rgba(157, 255, 173, .085);
  color: #a7dbae;
  font-family: var(--display);
  font-size: clamp(16px, 1.9vh, 21px);
  line-height: 1;
  letter-spacing: .025em;
}

.score-row .rank { color: #5f7a60; font-size: .86em; letter-spacing: .04em; }
.score-row .name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  letter-spacing: .07em;
}
.score-row .pts {
  text-align: right;
  color: #d9f6dc;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}
.score-row.top-1 .rank,
.score-row.top-1 .pts { color: #ffd58a; }
.score-row.top-2 .rank,
.score-row.top-2 .pts { color: #d6d6c6; }
.score-row.top-3 .rank,
.score-row.top-3 .pts { color: #d89761; }
.score-row.top-1 .name { color: #fff1c8; text-shadow: 0 0 8px rgba(244, 173, 88, .2); }
.score-row.empty { color: #33483a; }
.score-row.empty .name { color: #304035; letter-spacing: .19em; }
.score-row.is-new {
  background: linear-gradient(90deg, rgba(244, 173, 88, .15), transparent 78%);
  animation: newEntry 1.1s ease-out 3;
}
.score-row.is-new .rank,
.score-row.is-new .name,
.score-row.is-new .pts { color: var(--amber); }

.board-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
  padding: 7px 11px 0;
  border-top: 1px solid rgba(239, 226, 193, .1);
  color: #5f6b5b;
  font-family: var(--pixel);
  font-size: 5px;
  letter-spacing: .1em;
}
.board-foot .memory { display: flex; align-items: center; gap: 6px; }
.board-foot i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--phosphor);
  box-shadow: 0 0 6px rgba(157, 255, 173, .65);
}
.board-foot button {
  border: 0;
  border-bottom: 1px solid rgba(239, 226, 193, .16);
  padding: 1px 0;
  background: none;
  color: #69634f;
  font-family: var(--pixel);
  font-size: 5px;
  letter-spacing: .08em;
  cursor: pointer;
}
.board-foot button:hover, .board-foot button:focus-visible { color: var(--amber); border-color: var(--amber); outline: none; }
.board-foot button.is-confirming { color: var(--red); border-color: var(--red); }

.board-note {
  margin: 0 4px;
  padding-left: 11px;
  border-left: 2px solid rgba(215, 100, 48, .7);
  color: #817963;
  font-family: var(--pixel);
  font-size: clamp(5px, .5vw, 7px);
  line-height: 1.8;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.board-note strong { color: #b7a581; font-weight: 400; }

/* ---------------- footer ---------------- */

.footer {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 6px 16px;
  color: #515c4c;
  font-family: var(--pixel);
  font-size: 5px;
  line-height: 1.7;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.footer .footer-center { color: #635f4d; }
.footer .footer-center span { color: var(--orange); }

/* ---------------- motion ---------------- */

@keyframes onAir {
  0%, 100% { opacity: 1; }
  48% { opacity: .32; }
}
@keyframes blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: .18; }
}
@keyframes bulb {
  0%, 100% { opacity: .92; box-shadow: 0 0 9px rgba(244, 173, 88, .8); }
  50% { opacity: .4; box-shadow: 0 0 3px rgba(244, 173, 88, .3); }
}
@keyframes logoGlow {
  0%, 100% { filter: brightness(1); }
  48% { filter: brightness(1.09); }
  50% { filter: brightness(.92); }
  52% { filter: brightness(1.05); }
}
@keyframes screenOn {
  0% { opacity: 0; transform: scaleY(.02); filter: brightness(5); }
  40% { opacity: 1; transform: scaleY(1); filter: brightness(2.2); }
  58% { opacity: .7; filter: brightness(.6); }
  70% { opacity: 1; filter: brightness(1.35); }
  100% { opacity: 1; transform: scaleY(1); filter: brightness(1); }
}
@keyframes setDown {
  0% { opacity: 0; transform: translateY(15px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes overlayIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes flash {
  0% { opacity: 0; }
  22% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes newEntry {
  0%, 100% { background-color: rgba(244, 173, 88, 0); }
  45% { background-color: rgba(244, 173, 88, .13); }
}
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}
@keyframes glitch {
  0% { transform: translate(0); filter: none; }
  11% { transform: translate(-5px, 1px); filter: hue-rotate(25deg) saturate(1.7); }
  22% { transform: translate(4px, -2px); filter: brightness(1.25); }
  33% { transform: translate(-3px, 0); filter: none; }
  46% { transform: translate(5px, 2px); filter: brightness(.7); }
  60% { transform: translate(-2px, -1px); filter: none; }
  72% { transform: translate(2px, 0); }
  100% { transform: translate(0); }
}

/* ---------------- responsive ---------------- */

@media (min-width: 1081px) {
  .tv-unit { width: min(100%, 885px, calc((100dvh - 205px) / .89)); }
}

@media (min-width: 821px) and (max-width: 1080px) {
  .stage {
    grid-template-columns: minmax(0, 1fr) minmax(285px, 310px);
    align-items: center;
    gap: clamp(20px, 3vw, 34px);
    padding-top: 10px;
    padding-bottom: 20px;
  }
  .tv-unit { max-width: 650px; }
  .below-tv { max-width: 650px; gap: 10px; font-size: 5px; }
  .board-card { max-width: 310px; }
  .board-head { padding: 12px 10px 10px; }
  .board-head .eyebrow { font-size: 4px; }
  .board-head h2 { font-size: 18px; }
  .board-sub { font-size: 4px; }
  .board-columns {
    grid-template-columns: 28px minmax(0, 1fr) 58px;
    padding: 8px 10px 4px;
    font-size: 4px;
  }
  .leaderboard { padding: 0 10px; }
  .score-row {
    height: 20px;
    grid-template-columns: 28px minmax(0, 1fr) 58px;
    font-size: 17px;
  }
  .board-foot { font-size: 4px; }
  .board-foot button { font-size: 4px; }
  .board-note { font-size: 5px; }
  .game-hud { inset: 12px 16px auto; }
  .hud-label { font-size: 4px; }
  .hud-value { font-size: 22px; }
  .screen-overlay { padding: 12px; }
  .screen-kicker { font-size: 5px; margin-bottom: 9px; }
  .game-logo { font-size: clamp(22px, 3.1vw, 32px); }
  .game-tagline { font-size: 6px; }
  .rule-line { margin: 13px 0 11px; padding: 6px 9px; gap: 8px; font-size: 5px; }
  .start-button { padding: 10px 17px; font-size: 7px; }
  .start-hint { margin-top: 11px; font-size: 5px; }
  .over-panel h2 { font-size: clamp(16px, 2.2vw, 26px); }
  .signal-lost { font-size: 4px; margin-bottom: 5px; }
  .final-score { margin-top: 6px; }
  .final-score span { font-size: 4px; }
  .final-score strong { font-size: clamp(34px, 4.5vw, 50px); }
  .rank-preview { margin: 3px 0 7px; font-size: 4px; }
  .score-form label { font-size: 4px; margin-bottom: 4px; }
  .entry-row input { padding: 6px 8px; font-size: 18px; }
  .entry-row button { padding: 0 8px; font-size: 5px; }
  .form-error { font-size: 4px; }
  .post-save .start-button { padding: 7px 10px; font-size: 5px; }
  .text-button { margin-top: 6px; font-size: 4px; }
  .center-readout strong { padding: 8px 12px; font-size: 12px; }
  .center-readout small { font-size: 4px; }
  .footer { padding-top: 8px; }
}

@media (max-width: 820px) {
  .stage {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 38px;
    padding-top: 18px;
  }
  .tv-unit { max-width: 790px; }
  .below-tv { max-width: 790px; }
  .board-card { max-width: 650px; justify-self: center; }
  .scoreboard { padding: 10px; }
  .score-row { height: 25px; font-size: 21px; }
  .leaderboard { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
  .leaderboard .score-row:nth-child(10) { border-bottom: 1px solid rgba(157, 255, 173, .085); }
  .board-columns { display: none; }
  .board-head h2 { font-size: 22px; }
  .board-note { text-align: center; border: 0; padding: 0; }
  .footer { padding-top: 12px; }
}

@media (max-width: 700px) {
  .topbar { padding-top: 17px; padding-bottom: 10px; }
  .brand { gap: 11px; }
  .brand-mark { width: 39px; height: 32px; }
  .brand-mark::before { inset: 6px; }
  .brand-mark::after { left: 11px; bottom: 10px; width: 10px; height: 3px; }
  .brand-mark .mark-antenna { height: 11px; }
  .eyebrow { font-size: 5px; letter-spacing: .12em; }
  h1 { font-size: clamp(15px, 4.7vw, 21px); margin-top: 4px; }
  .top-meta { display: none; }
  .stage { gap: 30px; padding-top: 9px; }
  .tv-unit { padding-top: 54px; }
  .antenna { height: 58px; bottom: calc(100% - 51px); }
  .rod { height: 55px; }
  .antenna-base { left: -18px; width: 36px; height: 12px; }
  .tv-body { padding: 7px 8px 9px; border-radius: 18px 18px 11px 11px; }
  .tv-topline { height: 18px; padding-left: 6px; font-size: 4px; }
  .tv-topline .vents { max-width: 55px; }
  .screen-bezel { padding: 8px 8px 10px; border-radius: 14px; }
  .screen-bezel::before { inset: 4px; border-radius: 10px; }
  .screen { border-radius: 9px; }
  .tv-controls {
    height: 44px;
    margin-top: 8px;
    padding: 0 10px;
    grid-template-columns: 1fr auto;
    gap: 10px;
  }
  .control-brand { gap: 3px; }
  .control-brand strong { font-size: 5px; }
  .control-brand small { font-size: 4px; }
  .speaker { display: none; }
  .knob-cluster { gap: 9px; }
  .knob-wrap { display: none; }
  .knob { width: 23px; height: 23px; }
  .audio-btn { padding: 5px 6px; font-size: 4px; gap: 5px; }
  .tv-feet { padding: 0 46px; }
  .tv-feet span { width: 52px; height: 12px; }
  .below-tv { flex-direction: column; align-items: flex-start; gap: 7px; margin-top: 14px; font-size: 5px; }
  .below-tv .controls-hint { text-align: left; }
  .screen-overlay { padding: 12px; }
  .screen-kicker { display: none; }
  .game-logo { font-size: clamp(17px, 5.5vw, 26px); }
  .game-tagline { margin-top: 6px; font-size: 5px; letter-spacing: .15em; }
  .rule-line { margin: 10px 0; padding: 5px 8px; gap: 7px; font-size: 4px; }
  .start-button { padding: 9px 14px; font-size: 6px; }
  .start-hint { display: none; }
  .game-hud { inset: 9px 12px auto; }
  .hud-label { font-size: 4px; }
  .hud-value { font-size: 20px; }
  .center-readout strong { font-size: 12px; padding: 9px 12px; }
  .center-readout small { font-size: 4px; }
  .over-panel h2 { font-size: 18px; }
  .signal-lost { font-size: 4px; }
  .final-score { margin-top: 5px; }
  .final-score strong { font-size: 38px; }
  .final-score span { font-size: 4px; }
  .rank-preview { margin: 3px 0 7px; font-size: 4px; }
  .score-form label { font-size: 4px; margin-bottom: 4px; }
  .entry-row input { font-size: 19px; padding: 6px 8px; }
  .entry-row button { font-size: 5px; padding: 0 9px; }
  .form-error { font-size: 4px; }
  .post-save .start-button { padding: 7px 11px; font-size: 5px; }
  .text-button { margin-top: 6px; font-size: 4px; }
  .board-card { gap: 11px; }
  .scoreboard { padding: 8px; }
  .board-head { padding: 12px 10px 10px; }
  .board-head .eyebrow { font-size: 4px; }
  .board-head h2 { font-size: 18px; }
  .board-sub { font-size: 4px; }
  .leaderboard { display: block; padding: 0 10px; }
  .score-row { height: 23px; font-size: 19px; grid-template-columns: 28px minmax(0, 1fr) 56px; }
  .score-row:nth-child(10) { border-bottom: 1px solid rgba(157, 255, 173, .085); }
  .board-foot { font-size: 4px; }
  .board-foot button { font-size: 4px; }
  .board-note { font-size: 5px; }
  .footer { flex-direction: column; align-items: flex-start; gap: 4px; padding-bottom: 14px; font-size: 4px; }
  .footer .footer-center { display: none; }
}

@media (max-width: 400px) {
  .game-logo { font-size: 16px; }
  .screen-kicker { display: none; }
  .over-panel h2 { font-size: 16px; }
  .final-score strong { font-size: 33px; }
  .rule-line b { display: none; }
}

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