:root {
  --night: #04030e;
  --karaoke-green: #a6ff5e;
  --riso-pink: #f27aa4;
  --hot-pink: #ff4f9a;
  --ice: #9fe8ff;
  --phosphor: #b9ffc9;
  --karaoke: "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro", "Arial Rounded MT Bold", "Varela Round", system-ui, sans-serif;
  --mincho: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
/* Layout rules like display: grid must never override the hidden attribute. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--night);
  color: #fff;
  font: 16px/1.35 var(--karaoke);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Atmosphere ---------- */

.cosmos { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.floor {
  position: fixed;
  left: -50%; right: -50%; bottom: -6vh;
  height: 46vh;
  transform: perspective(42vh) rotateX(62deg);
  transform-origin: 50% 100%;
  background:
    repeating-linear-gradient(90deg, rgba(120, 220, 255, .55) 0 1.5px, transparent 1.5px 9vh),
    repeating-linear-gradient(0deg, rgba(255, 110, 170, .55) 0 1.5px, transparent 1.5px 9vh);
  filter: drop-shadow(0 0 6px rgba(140, 200, 255, .7));
  mask-image: linear-gradient(to top, #000 10%, transparent 92%);
  animation: floor 2.4s linear infinite;
  opacity: .5;
}
@keyframes floor { to { background-position: 0 0, 0 9vh; } }
body[data-state="spinning"] .floor { animation-duration: .45s; opacity: .8; }

.leak {
  position: fixed; inset: -10%;
  pointer-events: none;
  background:
    radial-gradient(42% 30% at 0% 8%, rgba(255, 70, 20, .38), transparent 70%),
    radial-gradient(30% 45% at 100% 22%, rgba(255, 60, 130, .22), transparent 70%),
    radial-gradient(40% 26% at 92% 100%, rgba(80, 200, 255, .16), transparent 70%);
  mix-blend-mode: screen;
  animation: leak 14s ease-in-out infinite alternate;
}
@keyframes leak { to { transform: translate3d(2%, -2%, 0) scale(1.05); opacity: .75; } }

.grain {
  position: fixed; inset: -50%;
  pointer-events: none;
  opacity: .16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .9s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-4%, 3%); } 40% { transform: translate(3%, -5%); }
  60% { transform: translate(-6%, -2%); } 80% { transform: translate(5%, 4%); } 100% { transform: translate(0, 0); }
}

.spine {
  position: fixed; top: 8vh; margin: 0;
  writing-mode: vertical-rl;
  font: 600 15px/1.9 var(--mincho);
  letter-spacing: .18em;
  color: var(--riso-pink);
  text-shadow: 0 0 12px rgba(242, 122, 164, .45);
  display: flex; gap: 2.4em;
}
.spine-left { left: clamp(16px, 4vw, 56px); }
.spine-right { right: clamp(16px, 4vw, 56px); color: #f4e9d8; font-size: 13px; align-items: center; }
.spine-right i { display: block; width: 1px; height: 64px; margin: 10px 0; background: currentColor; }

/* ---------- Stage ---------- */

.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: clamp(18px, 3.2vh, 32px);
  padding: 16px;
}

.tv {
  position: relative;
  width: min(820px, 100%, 108vh);
  padding: 3.2% 3.6% 0;
  border-radius: 34px 34px 26px 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 18%),
    linear-gradient(180deg, #c9c9cd 0%, #9d9ea4 46%, #7d7e85 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .8),
    inset 0 -8px 18px rgba(0, 0, 0, .35),
    0 0 0 1px rgba(0, 0, 0, .5),
    0 40px 80px -20px rgba(0, 0, 0, .9),
    0 0 120px -10px rgba(120, 110, 255, .35);
}

.screen {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 7% / 9%;
  overflow: hidden;
  background: #020208;
  box-shadow:
    0 0 0 3px #2c2c33,
    0 0 0 6px #5c5d63,
    inset 0 0 60px rgba(0, 0, 0, .9);
}

/* Stand-in for karaoke background footage: slow drifting blue flame. */
.screen-video {
  position: absolute; inset: -20%;
  background:
    radial-gradient(30% 40% at 48% 60%, rgba(90, 80, 255, .55), transparent 70%),
    radial-gradient(22% 30% at 58% 48%, rgba(170, 120, 255, .45), transparent 70%),
    radial-gradient(40% 30% at 40% 80%, rgba(30, 110, 255, .35), transparent 70%),
    radial-gradient(60% 60% at 50% 50%, #0b0b2c, #020208 80%);
  filter: blur(18px) saturate(1.3);
  animation: flame 7s ease-in-out infinite alternate;
}
@keyframes flame {
  0% { transform: translate(0, 2%) scale(1) rotate(0deg); }
  50% { transform: translate(-3%, -2%) scale(1.12) rotate(4deg); }
  100% { transform: translate(3%, 1%) scale(1.04) rotate(-3deg); }
}
body[data-state="spinning"] .screen-video { animation-duration: 1.2s; }

.screen-content {
  position: absolute; inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 4.2% 5.5%;
  text-shadow: -1px 0 rgba(255, 40, 110, .55), 1px 0 rgba(60, 200, 255, .55);
}

.glass {
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, .14) 0%, rgba(255, 255, 255, 0) 32%),
    radial-gradient(120% 100% at 50% 50%, transparent 58%, rgba(0, 0, 0, .65) 100%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .28) 0 1px, transparent 1px 3px);
  animation: flicker 5s steps(1) infinite;
}
@keyframes flicker { 0%, 100% { opacity: 1; } 47% { opacity: .9; } 48% { opacity: 1; } 83% { opacity: .94; } }

/* ---------- Bezel controls ---------- */

.tv-chin {
  position: relative;
  height: clamp(48px, 8.6vw, 70px);
  display: flex; align-items: center; gap: clamp(10px, 2.2vw, 24px);
  padding: 0 3.6%;
  /* The seam where the screen surround meets the chin. */
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, .22), inset 0 2px 0 rgba(255, 255, 255, .45);
}

/* Engraved badge. */
.brand {
  display: grid; gap: 3px;
  font: 800 clamp(8px, 1.3vw, 11px)/1 var(--mono);
  letter-spacing: .34em;
  color: #5a5b61;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .75), 0 -1px 0 rgba(0, 0, 0, .28);
}
.brand small { font: 600 clamp(5px, .75vw, 7px)/1 var(--mono); letter-spacing: .26em; text-transform: uppercase; color: #6c6d73; }

/* Speaker slots cut into the plastic. */
.grille {
  flex: 1;
  height: clamp(14px, 2.4vw, 22px);
  background: repeating-linear-gradient(90deg, #3d3e43 0 2px, transparent 2px 6px);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .45);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  opacity: .7;
}

/* The recessed well the buttons sit in. */
.panel {
  display: flex; align-items: flex-start; gap: clamp(6px, 1.2vw, 12px);
  padding: clamp(5px, .8vw, 7px) clamp(7px, 1.2vw, 11px) clamp(3px, .5vw, 5px);
  border-radius: 7px;
  background: linear-gradient(#66676d, #85868c);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, .6),
    inset 0 -1px 0 rgba(255, 255, 255, .22),
    0 1px 0 rgba(255, 255, 255, .7),
    0 -1px 0 rgba(0, 0, 0, .18);
}

.key {
  position: relative;
  display: grid; justify-items: center; gap: clamp(3px, .5vw, 5px);
  padding: 0; border: 0; background: none;
  color: #1f2025; text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* A bigger invisible hit area than the little cap itself. */
.key::before { content: ""; position: absolute; inset: -10px -5px; }
.key b {
  font: 800 clamp(5.5px, .8vw, 7.5px)/1 var(--mono);
  letter-spacing: .2em; text-transform: uppercase;
  color: #e9e9ec;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, .55);
  opacity: .85;
}

/* The cap: a slab of pale plastic with a visible edge, raised above the well. */
.cap {
  display: block;
  width: clamp(24px, 4.2vw, 40px);
  height: clamp(9px, 1.5vw, 13px);
  border-radius: 3px 3px 4px 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .9) 0, rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, #ececef 0%, #cdced3 60%, #b5b6bc 100%);
  box-shadow:
    0 0 0 1px rgba(20, 20, 24, .7),
    inset 0 1px 0 #fff,
    inset 0 -1px 0 rgba(0, 0, 0, .18),
    0 2px 0 #4f5056,
    0 3px 0 rgba(20, 20, 24, .5),
    0 4px 4px rgba(0, 0, 0, .45);
  transform: translateY(-2px);
  transition: transform .06s ease-out, box-shadow .06s ease-out, background .06s;
}
.key:hover .cap { background: linear-gradient(180deg, rgba(255, 255, 255, .95) 0, rgba(255, 255, 255, 0) 38%), linear-gradient(180deg, #f6f6f8 0%, #d8d9dd 60%, #bfc0c6 100%); }
/* Pressed: the cap sinks into the well and loses its edge and shadow. */
.key:active .cap, .key[aria-pressed="true"] .cap, .key[aria-current="page"] .cap {
  transform: translateY(1px);
  background: linear-gradient(180deg, #c9cacf 0%, #b9bac0 100%);
  box-shadow:
    0 0 0 1px rgba(20, 20, 24, .75),
    inset 0 1px 2px rgba(0, 0, 0, .3),
    0 0 0 #4f5056,
    0 1px 1px rgba(0, 0, 0, .3);
}
.key:focus-visible { outline: none; }
.key:focus-visible .cap { outline: 2px solid var(--ice); outline-offset: 3px; }

/* The outlink: a pink cap with the arrow printed on it, so it reads as leaving the set. */
.key-out .cap {
  display: grid; place-items: center;
  font: 800 clamp(8px, 1.2vw, 10px)/1 var(--mono); font-style: normal;
  color: #7a1238;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .85) 0, rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, #ffd3e4 0%, #f59cbf 60%, #e2789f 100%);
}
.key-out:hover .cap { background: linear-gradient(180deg, rgba(255, 255, 255, .9) 0, rgba(255, 255, 255, 0) 38%), linear-gradient(180deg, #ffe0ec 0%, #f8acc9 60%, #e886aa 100%); }
.key-out b { color: #ffd0e2; }

/* Power light behind a little lens, with its label printed below. */
.power { display: grid; justify-items: center; gap: clamp(3px, .5vw, 5px); margin-left: auto; }
.power b { font: 800 clamp(5.5px, .8vw, 7.5px)/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: #55565c; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }

.osd-mute {
  position: absolute; left: 5.5%; bottom: 13%;
  margin: 0;
  font-size: clamp(11px, 1.8vw, 16px);
  letter-spacing: .2em; text-transform: uppercase;
}
.osd-mute span { font-family: var(--karaoke); margin-right: .3em; letter-spacing: .05em; }

.led {
  display: block; width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd1dc 0 18%, #ff3b6b 45%, #9c1236 100%);
  box-shadow: 0 0 0 1.5px #55565c, 0 0 0 2.5px rgba(255, 255, 255, .55), 0 0 10px 2px rgba(255, 59, 107, .75);
}
body[data-state="spinning"] .led { animation: blink .18s steps(1) infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- On-screen display ---------- */

.osd {
  font: 500 clamp(9px, 1.45vw, 13px)/1.3 var(--mono);
  color: var(--phosphor);
  text-shadow: 0 0 6px rgba(185, 255, 201, .65);
  letter-spacing: .04em;
}
.osd-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.osd-track { opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.osd-credits { margin: 0; display: grid; gap: 2px; text-align: right; opacity: 0; transition: opacity .6s; }
.osd-credits div { display: flex; gap: 8px; justify-content: flex-end; }
.osd-credits dt { font-family: var(--karaoke); opacity: .75; }
.osd-credits .short { display: none; }
.osd-credits dd { margin: 0; font-variant-numeric: tabular-nums; }
body[data-state="landed"] .osd-credits, body[data-state="chorus"] .osd-credits, body[data-state="scored"] .osd-credits { opacity: 1; }

.osd-bottom { display: flex; align-items: center; gap: 12px; }

/* Play / pause / replay, drawn like the rest of the on-screen display. */
.osd-play {
  position: relative;
  display: grid; place-items: center;
  width: clamp(22px, 3vw, 28px); height: clamp(22px, 3vw, 28px);
  flex: none;
  padding: 0;
  border: 1.5px solid var(--hot-pink); border-radius: 50%;
  background: rgba(255, 79, 154, .12);
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 79, 154, .55), inset 0 0 8px rgba(255, 79, 154, .35);
  cursor: pointer;
}
.osd-play::before { content: ""; position: absolute; inset: -8px; }
.osd-play i { display: block; width: 38%; height: 38%; background: currentColor; filter: drop-shadow(0 0 3px rgba(255, 255, 255, .7)); }
.osd-play[data-icon="play"] i { clip-path: polygon(15% 0, 100% 50%, 15% 100%); transform: translateX(8%); }
.osd-play[data-icon="pause"] i { clip-path: polygon(0 0, 34% 0, 34% 100%, 0 100%, 0 0, 66% 0, 100% 0, 100% 100%, 66% 100%, 66% 0); }
.osd-play[data-icon="replay"] i { width: 44%; height: 44%; border-radius: 50%; background: none; border: 2px solid currentColor; border-top-color: transparent; transform: rotate(45deg); }
.osd-play:hover:not(:disabled) { background: rgba(255, 79, 154, .28); }
.osd-play:disabled { opacity: .3; cursor: default; box-shadow: none; }
.osd-play:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }
/* Mute lives on the screen beside play, like a set-top OSD. */
.osd-sound svg { width: 58%; height: 58%; filter: drop-shadow(0 0 3px rgba(255, 255, 255, .6)); }
.osd-sound .cross { display: none; }
.osd-sound[aria-pressed="true"] .waves { display: none; }
.osd-sound[aria-pressed="true"] .cross { display: inline; }
.osd-sound[aria-pressed="true"] { border-color: var(--phosphor); background: rgba(185, 255, 201, .12); box-shadow: 0 0 10px rgba(185, 255, 201, .45); }
/* While paused the screen says so, the way a VCR would. */
body[data-paused] .osd-time::before { content: "❚❚ PAUSE  "; color: var(--hot-pink); animation: blink 1s steps(1) infinite; }
body[data-paused] .screen-video { animation-play-state: paused; }
.progress { position: relative; flex: 1; height: 3px; border-radius: 3px; background: rgba(185, 255, 201, .2); }
.progress i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--hot-pink); box-shadow: 0 0 10px var(--hot-pink); }
.progress i::after { content: ""; position: absolute; right: -5px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--hot-pink); box-shadow: 0 0 10px var(--hot-pink); }
.osd-time { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Karaoke type ---------- */

.lyric {
  position: relative;
  display: inline-block;
  font-family: var(--karaoke);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
  white-space: nowrap;
  color: #fff;
  -webkit-text-stroke: .09em #0b0820;
  paint-order: stroke fill;
}
.lyric .word { position: relative; display: inline-block; }
.lyric .word + .word { margin-left: .3em; }
.lyric .fill {
  position: absolute; inset: 0;
  color: var(--karaoke-green);
  clip-path: inset(0 100% 0 0);
  text-shadow: none;
}
/* No glow on the fill: iOS Safari paints a text-shadow under a clip-path as a solid block. */
body[data-jackpot] .lyric .fill { color: #ff8fc4; }

.reels {
  align-self: center;
  display: grid;
  justify-items: center;
  gap: .32em;
  width: 100%;
  font-size: clamp(22px, 5.4vw, 54px);
  transition: opacity .45s, transform .45s;
}
/* Each reel clips its own words, so a spinning word never runs into the next reel.
   No window or glass: just the words rolling, softened at the top and bottom edges.
   The fade masks the small fixed window, never the tall strip inside it. */
.reel {
  position: relative;
  height: 1.3em; width: 92%;
  overflow: hidden;
  text-align: center;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
}
body[data-state="idle"] .reel, body[data-state="landed"] .reel { -webkit-mask-image: none; mask-image: none; }
.strip { display: flex; flex-direction: column; align-items: center; will-change: transform; }
.strip .lyric { height: 1.3em; line-height: 1.3em; }
body[data-state="chorus"] .reels, body[data-state="scored"] .reels { opacity: 0; transform: translateY(-6%) scale(.96); }
body[data-state="idle"] .reels { animation: attract 2.6s ease-in-out infinite; }
@keyframes attract { 50% { opacity: .72; } }

/* Reels, chorus and score swap places in the same row. */
.reels, .chorus, .score { grid-row: 2; grid-column: 1; align-self: center; }
.osd-bottom { grid-row: 3; }
.chorus [data-chorus] { display: grid; justify-items: center; gap: .25em; font-size: clamp(11px, 2.4vw, 24px); }
/* Upcoming lines wait dimmed, like a karaoke screen showing what's next. */
.chorus [data-chorus] .lyric { opacity: .32; transform: scale(.94); transition: opacity .3s, transform .3s; }
.chorus [data-chorus] .lyric.is-on { opacity: 1; transform: none; }
.chorus { transition: opacity .4s; }
body[data-state="scored"] .chorus { opacity: 0; }

.score { display: grid; justify-items: center; gap: .5em; text-align: center; }
.score p { margin: 0; }
.clause {
  max-width: 34em;
  min-height: 4.5em;
  font: 500 clamp(8px, 1.25vw, 12px)/1.5 var(--mono);
  color: var(--phosphor);
  letter-spacing: .14em;
  text-transform: uppercase;
  text-shadow: 0 0 6px rgba(185, 255, 201, .65);
}
.clause::after { content: "▍"; animation: blink .8s steps(1) infinite; }
.score.is-landed .clause::after { content: none; }
.score-value, .score-owner, .score-note, .score-final, .jackpot { visibility: hidden; }
.score.is-landed .score-value { visibility: visible; animation: score-in .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.score.is-landed .score-owner, .score.is-landed .score-note, .score.is-landed .score-final { visibility: visible; animation: fade-up .5s ease-out both; }
.score.is-landed .score-owner { animation-delay: .35s; }
.score.is-landed .score-note { animation-delay: .9s; }
.score.is-landed .score-final { animation-delay: 1.5s; }
.score-owner { margin-top: -.2em !important; font: 800 clamp(11px, 1.9vw, 17px)/1 var(--karaoke); letter-spacing: .22em; text-transform: uppercase; color: var(--riso-pink); text-shadow: 0 0 10px rgba(242, 122, 164, .6); }
.score.is-landed .jackpot { visibility: visible; animation: blink .4s steps(1) 6; }
.score-note { font: 700 clamp(12px, 2vw, 18px)/1.2 var(--karaoke); color: #fff; letter-spacing: .04em; }
.score-final { font: 500 clamp(8px, 1.25vw, 12px)/1.3 var(--mono); color: var(--riso-pink); letter-spacing: .12em; text-transform: uppercase; text-shadow: 0 0 6px rgba(242, 122, 164, .6); }
.up { color: var(--karaoke-green); }
@keyframes fade-up { from { opacity: 0; transform: translateY(.4em); } }
.score-value {
  font: 800 clamp(52px, 12vw, 132px)/.95 var(--karaoke);
  color: #fff;
  -webkit-text-stroke: .05em #0b0820;
  paint-order: stroke fill;
  text-shadow: -3px 0 rgba(255, 40, 110, .7), 3px 0 rgba(60, 200, 255, .7), 0 0 40px rgba(255, 79, 154, .6);
}
.score-value small { font-size: .42em; margin-left: .06em; color: var(--riso-pink); -webkit-text-stroke: 0; }
.jackpot { font: 800 clamp(14px, 2.6vw, 26px)/1.2 var(--karaoke); color: #ff8fc4; letter-spacing: .08em; text-transform: uppercase; }
.jackpot span { font-family: var(--mincho); margin-right: .4em; }
@keyframes score-in { from { opacity: 0; transform: scale(.7); } }
body[data-state="chorus"] .score, body[data-state="chorus"] .score * { animation: none; }

/* ---------- Glints ---------- */

.glints { position: absolute; inset: 0; pointer-events: none; }
.glint {
  position: absolute;
  width: var(--size, 34px); height: var(--size, 34px);
  margin: calc(var(--size, 34px) / -2) 0 0 calc(var(--size, 34px) / -2);
  background:
    radial-gradient(circle, #fff 0 6%, rgba(255, 255, 255, .5) 12%, transparent 34%),
    linear-gradient(90deg, transparent 0, rgba(255, 255, 255, .9) 50%, transparent 100%) center / 100% 2px no-repeat,
    linear-gradient(0deg, transparent 0, rgba(255, 255, 255, .9) 50%, transparent 100%) center / 2px 100% no-repeat;
  filter: drop-shadow(-1px 0 rgba(255, 60, 130, .8)) drop-shadow(1px 0 rgba(80, 200, 255, .8));
  mix-blend-mode: screen;
  animation: twinkle var(--duration, 3.2s) ease-in-out var(--delay, 0s) infinite;
  opacity: 0;
}
.glint.is-burst { animation: burst .9s ease-out var(--delay, 0s) forwards; }
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(.2) rotate(0deg); }
  12% { opacity: 1; transform: scale(1) rotate(12deg); }
  24% { opacity: 0; transform: scale(.4) rotate(24deg); }
}
@keyframes burst {
  0% { opacity: 0; transform: scale(.1) rotate(-20deg); }
  25% { opacity: 1; transform: scale(1.25) rotate(0deg); }
  100% { opacity: 0; transform: scale(.3) rotate(30deg); }
}

/* ---------- Lever ---------- */

.lever {
  position: relative;
  display: inline-flex; align-items: center; gap: .7em;
  padding: .85em 2.2em .85em 1.6em;
  border: 0; border-radius: 999px;
  font: 800 clamp(15px, 2.2vw, 19px)/1 var(--karaoke);
  letter-spacing: .14em; text-transform: uppercase;
  color: #1a1424;
  cursor: pointer;
  background: linear-gradient(180deg, #ffffff 0%, #d9d9de 38%, #9fa0a8 52%, #e9e9ee 100%);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -3px 6px rgba(0, 0, 0, .25),
    0 0 0 1px rgba(0, 0, 0, .6),
    0 10px 24px -8px rgba(0, 0, 0, .9),
    0 0 34px rgba(255, 79, 154, .55);
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.lever-jp {
  display: grid; place-items: center;
  width: 2em; height: 2em; border-radius: 50%;
  font: 700 .8em/1 var(--mincho); letter-spacing: 0;
  color: #fff; background: var(--hot-pink);
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .3), 0 0 14px rgba(255, 79, 154, .9);
}
.lever:hover { filter: brightness(1.06); box-shadow: inset 0 1px 0 #fff, inset 0 -3px 6px rgba(0, 0, 0, .25), 0 0 0 1px rgba(0, 0, 0, .6), 0 10px 24px -8px rgba(0, 0, 0, .9), 0 0 54px rgba(255, 79, 154, .85); }
.lever:active { transform: translateY(2px) scale(.98); }
.lever:focus-visible { outline: 2px solid var(--ice); outline-offset: 4px; }
.lever:disabled { cursor: wait; filter: saturate(.4) brightness(.8); }

.controls { display: flex; align-items: center; gap: 18px; margin-top: -8px; }
.sound {
  display: inline-flex; align-items: center; gap: .6em;
  padding: .45em .9em .45em .45em;
  border: 1px solid rgba(185, 255, 201, .35); border-radius: 999px;
  background: rgba(4, 3, 14, .55);
  font: 500 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase;
  color: var(--phosphor);
  text-shadow: 0 0 6px rgba(185, 255, 201, .6);
  cursor: pointer;
}
.sound-jp { display: grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 50%; font: 700 12px/1 var(--mincho); letter-spacing: 0; background: rgba(185, 255, 201, .16); }
.sound[aria-pressed="false"] { color: rgba(255, 255, 255, .45); border-color: rgba(255, 255, 255, .2); text-shadow: none; }
.sound:focus-visible, .about-link:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }
.about-link {
  display: inline-flex; align-items: center; gap: .6em;
  padding: .45em .9em .45em .45em;
  border: 1px solid rgba(242, 122, 164, .45); border-radius: 999px;
  background: rgba(4, 3, 14, .55);
  font: 500 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase;
  color: var(--riso-pink); text-decoration: none;
  text-shadow: 0 0 6px rgba(242, 122, 164, .6);
}
.about-link:hover { background: rgba(242, 122, 164, .12); }
.about-jp { display: grid; place-items: center; height: 1.9em; padding: 0 .55em; border-radius: 999px; font: 700 11px/1 var(--mincho); letter-spacing: .05em; background: rgba(242, 122, 164, .16); }
.hint { margin: 0; font: 500 11px/1 var(--mono); letter-spacing: .28em; text-transform: uppercase; color: rgba(255, 255, 255, .45); }

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

@media (max-width: 760px) {
  .cap { width: 44px; height: 16px; }
  .key b { font-size: 8px; }
  .panel { gap: 10px; padding: 7px 10px 5px; }
  .tv-chin { height: 64px; }
  .osd-play { width: 34px; height: 34px; }
  .osd-bottom { gap: 10px; }
  .osd-credits .short { display: inline; }
  .spine { display: none; }
  .osd-credits .long { display: none; }
  .osd-credits dd { white-space: nowrap; }
  .screen { aspect-ratio: 1 / 1; }
  .grille, .brand small, .osd-hint { display: none; }
  .score { gap: .3em; }
  .clause { min-height: 0; }
  .tv { border-radius: 22px 22px 18px 18px; }
  .osd-credits dt { display: none; }
  .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .floor, .leak, .grain, .screen-video, .glass, .glint, body[data-state="idle"] .reels { animation: none !important; }
  .glint { display: none; }
}

/* ---------- About ---------- */

/* Held still: the same space and screen, no motion. */
.about-page .floor, .about-page .leak, .about-page .grain, .about-page .screen-video, .about-page .glass { animation: none; }

/* A credits-style crawl: whole paragraphs roll straight up the screen. */
.crawl {
  grid-row: 2;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
}
.crawl-tilt { position: absolute; inset: 0; }
.crawl-text {
  position: absolute; left: 0; right: 0; top: 100%;
  display: grid; justify-items: center; gap: 1em;
  font-size: clamp(13px, 2.3vw, 23px);
  will-change: transform;
}
.crawl-block { display: grid; justify-items: center; }
.crawl-line {
  position: relative;
  font: 800 1em/1.32 var(--karaoke);
  text-transform: uppercase; letter-spacing: .02em; white-space: nowrap;
  color: rgba(255, 255, 255, .88);
  -webkit-text-stroke: .08em #0b0820;
  paint-order: stroke fill;
}
.crawl-line .fill {
  position: absolute; inset: 0;
  color: var(--karaoke-green);
  clip-path: inset(0 100% 0 0);
  text-shadow: none;
}
.crawl-title { font-size: 1.7em; }
.osd-hint { opacity: .6; }

/* Read mode: plain text straight on the page, no card around it. */
.article {
  width: min(780px, 100%);
  font: 400 clamp(16px, 1.9vw, 19px)/1.65 "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: -.005em;
  color: #ece8ff;
  text-shadow: 0 1px 12px rgba(4, 3, 14, .9);
}
.article h1 {
  margin: 0 0 .5em;
  font: 800 clamp(34px, 6vw, 56px)/1 var(--karaoke);
  text-transform: uppercase;
  -webkit-text-stroke: .06em #0b0820;
  paint-order: stroke fill;
  text-shadow: -2px 0 rgba(255, 40, 110, .6), 2px 0 rgba(60, 200, 255, .6);
}
.article p { margin: 0 0 1em; }
.article .article-meta { margin: 1.6em 0 0; font: 500 11px/1.5 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--phosphor); }

/* Karaoke mode keeps the article for screen readers only; read mode swaps the TV for it. */
.about-page[data-mode="karaoke"] .article { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.about-page[data-mode="read"] .tv { display: none; }
.about-page[data-mode="read"] .stage { align-content: start; padding-top: clamp(32px, 10vh, 96px); padding-bottom: 64px; }

/* ---------- About figures ---------- */

.figure { margin: 1.8em 0 2.2em; }
.figure figcaption {
  margin-top: 1em;
  font: 500 11px/1.5 var(--mono);
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--phosphor); opacity: .85;
}

/* Side-by-side brand comparisons: same layout for every tile, only the name changes. */
.compare { display: grid; gap: clamp(10px, 1.8vw, 16px); }
.compare figure { margin: 0; display: grid; gap: .7em; }
.compare img { display: block; width: 100%; height: auto; border-radius: 8px; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); }
.compare figure figcaption { margin: 0; font: 500 11px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #cfc8e6; opacity: 1; }
.compare-logos { grid-template-columns: repeat(3, 1fr); }
.compare-logos img { aspect-ratio: 1; object-fit: cover; }
.compare-two { grid-template-columns: repeat(2, 1fr); }
.compare-two img { aspect-ratio: 1; object-fit: contain; background: #ececed; }
.compare-three { grid-template-columns: repeat(3, 1fr); }
.compare-three img { aspect-ratio: 4 / 5; object-fit: cover; }

.moodboard { columns: 3 160px; column-gap: 10px; }
.moodboard img { display: block; width: 100%; height: auto; margin: 0 0 10px; border-radius: 6px; break-inside: avoid; }

@media (max-width: 760px) {
  .compare-three { grid-template-columns: repeat(2, 1fr); }
  .moodboard { columns: 2; }
}
.figure-photo { display: block; width: 100%; height: auto; border-radius: 8px; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); }

/* Pictures in the crawl get the broadcast treatment: hot color, soft focus, RGB fringing. */
.crawl-figure { width: 84%; display: grid; justify-items: center; gap: .55em; margin: .3em 0; }
.crawl-grid { width: 100%; display: grid; gap: .45em; grid-template-columns: repeat(var(--cols, 1), 1fr); }
.crawl-grid[data-cols="1"] { --cols: 1; }
.crawl-grid[data-cols="2"] { --cols: 2; }
.crawl-grid[data-cols="3"] { --cols: 3; }
.crawl-grid[data-cols="4"] { --cols: 4; }
.crawl-tile { display: grid; justify-items: center; gap: .3em; }
.crawl-tile img {
  display: block; width: 100%; height: auto;
  border-radius: 3px;
  filter:
    saturate(1.45) contrast(1.15) brightness(.88) blur(.4px)
    drop-shadow(-2px 0 rgba(255, 40, 110, .6))
    drop-shadow(2px 0 rgba(60, 200, 255, .6));
  opacity: .93;
}
.crawl-grid[data-cols="3"] img, .crawl-grid[data-cols="4"] img { aspect-ratio: 1; object-fit: cover; }
.crawl-grid[data-cols="2"] img { aspect-ratio: 1; object-fit: contain; background: #d8d8dc; }
.crawl-tile span, .crawl-caption {
  font: 500 .42em/1.3 var(--mono);
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--phosphor);
  text-shadow: 0 0 6px rgba(185, 255, 201, .6);
  text-align: center;
}
.crawl-caption { font-size: .5em; }

/* Read mode keeps one way out: back to the karaoke screen, centered under the text. */
.about-page[data-mode="read"] .about-link { display: none; }
.about-page .controls { justify-content: center; }
