/* A late-1960s walnut tabletop set: wood wrap, charcoal mask, champagne
   aluminium control panel, rotary VHF tuner. Everything inside .tv is sized
   in cqw so the whole set scales as one object. */

:root {
  --cream: #efe4c8;
  --ink: #2b2118;
  --alu-hi: #e4d3a6;
  --alu: #c2ad7c;
  --alu-lo: #8f7b50;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
  color: #b7a88f;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  /* An evening room: one lamp off to the left, wall falling into shadow. */
  background:
    radial-gradient(ellipse 70% 60% at 18% 8%, rgba(255,196,120,.16), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0 2px, transparent 2px 46px),
    linear-gradient(180deg, #2c2a25 0%, #1d1b18 55%, #0f0e0c 100%);
  background-attachment: fixed;
}

.defs { position: absolute; }

.room {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px 20px;
}

.tv {
  container-type: inline-size;
  width: min(100%, 1120px, calc((100vh - 250px) / 0.735));
  min-width: 288px;
}

/* ── Rabbit ears ─────────────────────────────────────────── */

.antenna { position: relative; height: 12cqw; }
.antenna-base {
  position: absolute;
  left: 50%;
  bottom: -0.3cqw;
  width: 9cqw;
  height: 2.6cqw;
  margin-left: -4.5cqw;
  border-radius: 50% 50% 12% 12% / 100% 100% 12% 12%;
  background: radial-gradient(ellipse at 40% 10%, #5a544d, #1d1b19 65%);
  box-shadow: inset 0 0.15cqw 0 rgba(255,255,255,.18);
}
.rod {
  position: absolute;
  left: 50%;
  bottom: 1.4cqw;
  width: 0.42cqw;
  height: 21cqw;
  margin-left: -0.21cqw;
  transform-origin: 50% 100%;
  border-radius: 0.3cqw;
  background: linear-gradient(90deg, #6d6d6d, #f6f6f6 35%, #9a9a9a 60%, #4c4c4c);
  box-shadow: 0.2cqw 0.2cqw 0.5cqw rgba(0,0,0,.4);
}
.rod::after { /* tip */
  content: '';
  position: absolute;
  left: 50%;
  top: -0.5cqw;
  width: 0.9cqw;
  height: 0.9cqw;
  margin-left: -0.45cqw;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #8a8a8a 60%, #3a3a3a);
}
.rod-l { transform: rotate(-58deg); }
.rod-r { transform: rotate(52deg); }

/* ── Cabinet ─────────────────────────────────────────────── */

.cabinet {
  position: relative;
  padding: 1.9cqw 1.9cqw 2.1cqw;
  border-radius: 1.1cqw;
  background:
    linear-gradient(180deg, rgba(255,235,200,.22) 0, rgba(255,235,200,0) 5%, rgba(0,0,0,0) 80%, rgba(0,0,0,.45) 100%),
    linear-gradient(90deg, rgba(0,0,0,.35) 0, rgba(0,0,0,0) 4%, rgba(0,0,0,0) 96%, rgba(0,0,0,.4) 100%),
    url(wood.svg) center / 100% 100%;
  box-shadow:
    inset 0 0.12cqw 0 rgba(255,240,210,.35),
    inset 0 -0.3cqw 0.5cqw rgba(0,0,0,.6),
    0 0.3cqw 0 #170d07,
    0 3cqw 5cqw rgba(0,0,0,.7);
}

/* The moulded front: charcoal plastic inside a thin aluminium trim. */
.fascia {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 23cqw;
  gap: 1.2cqw;
  padding: 1.2cqw;
  border-radius: 0.7cqw;
  background: linear-gradient(170deg, #2a2927, #131211 60%);
  box-shadow:
    0 0 0 0.16cqw var(--alu-lo),
    0 0 0 0.32cqw var(--alu-hi),
    0 0 0 0.42cqw #5f512f,
    inset 0 0 1.2cqw rgba(0,0,0,.9);
}

.mask {
  padding: 2.4cqw;
  border-radius: 3.2cqw;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.07), transparent 60%),
    linear-gradient(165deg, #33312e, #0b0a0a 70%);
  box-shadow:
    inset 0 0.15cqw 0.2cqw rgba(255,255,255,.14),
    inset 0 -0.2cqw 0.4cqw rgba(0,0,0,.8),
    0 0 0 0.1cqw #000;
}

/* ── The tube ────────────────────────────────────────────── */

.screen {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 7.5% / 9.5%;
  background: #030303;
  isolation: isolate;
  box-shadow: 0 0 0 0.25cqw #050505, 0 0 0 0.4cqw rgba(255,255,255,.07);
}
.screen > * { position: absolute; inset: 0; }

.picture { background: #000; will-change: transform, filter; }
video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  filter: contrast(1.1) saturate(.86) brightness(1.08) blur(.4px);
}

/* Scanlines plus a faint shadow-mask triad. */
.phosphor {
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,.3) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255,0,0,.05) 0 1px, rgba(0,255,0,.04) 1px 2px, rgba(0,0,255,.05) 2px 3px);
}

/* Curved glass: lamp reflection, edge falloff, and the tube's inner shadow. */
.glass {
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(ellipse 34% 22% at 22% 14%, rgba(255,236,200,.20), transparent 70%),
    linear-gradient(118deg, transparent 30%, rgba(255,255,255,.035) 38%, transparent 46%),
    radial-gradient(ellipse at 50% 50%, transparent 52%, rgba(0,0,0,.42) 88%, rgba(0,0,0,.8) 100%);
  box-shadow: inset 0 0 3cqw rgba(0,0,0,.85), inset 0 0 0.6cqw #000;
}
.tv.on .glass { animation: flicker 5s steps(1) infinite; }

/* Switched off, a tube is grey-green and mirrors the room, not black. */
.blackout {
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 30% 22%, #4a5450 0%, transparent 70%),
    radial-gradient(ellipse at 50% 50%, #2a302e, #121514 85%);
}
.tv.on .blackout { animation: warm-up 1.1s ease-out forwards; }
.tv.off-anim .blackout { animation: shut-off .5s ease-in forwards; }

@keyframes warm-up {
  0%   { clip-path: inset(0); filter: brightness(1); }
  18%  { clip-path: inset(0); filter: brightness(3.2); }
  30%  { clip-path: polygon(0 0, 100% 0, 100% 49.5%, 0 49.5%, 0 50.5%, 100% 50.5%, 100% 100%, 0 100%); filter: brightness(1); }
  100% { clip-path: polygon(0 0, 100% 0, 100% 0, 0 0, 0 100%, 100% 100%, 100% 100%, 0 100%); filter: brightness(1); }
}
@keyframes shut-off {
  0%   { clip-path: polygon(0 0, 100% 0, 100% 0, 0 0, 0 100%, 100% 100%, 100% 100%, 0 100%); }
  75%  { clip-path: polygon(0 0, 100% 0, 100% 49.5%, 0 49.5%, 0 50.5%, 100% 50.5%, 100% 100%, 0 100%); }
  100% { clip-path: inset(0); }
}
@keyframes flicker { 0%, 100% { opacity: 1; } 47% { opacity: .94; } 49% { opacity: 1; } 81% { opacity: .97; } 83% { opacity: 1; } }

/* ── Snow and weak signal ────────────────────────────────── */

.static { width: 100%; height: 100%; image-rendering: pixelated; }
.static[hidden], .card[hidden] { display: none; }
.static.haze { opacity: .34; mix-blend-mode: screen; }

.humbar {
  display: none;
  pointer-events: none;
  inset: auto 0 auto 0;
  top: 0;
  height: 22%;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.16) 45%, rgba(255,255,255,.05) 55%, transparent);
  mix-blend-mode: screen;
}

/* Signal fading: the picture tears sideways, loses colour and vertical hold. */
.screen.weak .picture {
  filter: url(#tear) saturate(.3) contrast(1.3);
  animation: lose-hold 3.4s linear infinite, fade-signal .9s steps(3) infinite;
}
.screen.weak .humbar { display: block; animation: hum 2.3s linear infinite; }

@keyframes lose-hold {
  0%    { transform: translateY(0) skewX(0); }
  6%    { transform: translateY(1.6%) skewX(0); }
  8%    { transform: translateY(-1.2%) skewX(0); }
  11%   { transform: translateY(0) skewX(0); }
  33%   { transform: translateY(0) skewX(0); }
  34%   { transform: translateY(0) skewX(-7deg); }
  37%   { transform: translateY(0) skewX(4deg); }
  39%   { transform: translateY(0) skewX(0); }
  55%   { transform: translateY(0); }
  68%   { transform: translateY(104%); }
  68.01% { transform: translateY(-104%); }
  80%   { transform: translateY(0); }
  88%   { transform: translateY(-2%); }
  90%   { transform: translateY(0); }
  100%  { transform: translateY(0) skewX(0); }
}
@keyframes fade-signal { 0% { opacity: 1; } 33% { opacity: .72; } 66% { opacity: .9; } }
@keyframes hum { from { transform: translateY(-110%); } to { transform: translateY(460%); } }

/* ── Station cards ───────────────────────────────────────── */

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  container-type: size;
  filter: blur(.4px) saturate(.9);
}
.card p { margin: 0; }

.card-bumper { background: #1d3f5e; color: #ffe9b0; overflow: hidden; }
.bumper-rays {
  position: absolute;
  inset: -60%;
  background: repeating-conic-gradient(from 0deg, #24507a 0 10deg, #1d3f5e 10deg 20deg);
  animation: spin 40s linear infinite;
}
.card-bumper p { position: relative; }
.bumper-big {
  font: italic 700 13cqw/1.02 Georgia, serif;
  text-shadow: .5cqw .5cqw 0 #c2452d, 1cqw 1cqw 0 rgba(0,0,0,.35);
  margin: 2cqh 0 !important;
}
.bumper-small { font: 600 3cqw/1.2 'Helvetica Neue', Arial, sans-serif; letter-spacing: .35em; text-transform: uppercase; }

.card-ident {
  background: #c2452d;
  box-shadow: inset 0 0 0 3cqw #1b1a18, inset 0 0 0 4cqw #e9dcc0;
  color: #f4ead2;
}
.ident-small, .ident-tag { font: 600 2.6cqw/1.2 'Helvetica Neue', Arial, sans-serif; letter-spacing: .3em; text-transform: uppercase; }
.ident-number { font: 700 30cqw/.9 Georgia, serif; text-shadow: .6cqw .6cqw 0 rgba(0,0,0,.3); }
.ident-name { font: italic 700 6cqw/1.1 Georgia, serif; margin-top: 1cqh !important; }
.ident-tag { margin-top: 2cqh !important; opacity: .8; }

.card-standby { background: #111; color: #fff; }
.bars { position: absolute; inset: 0; display: flex; }
.bars i { flex: 1; }
.bars i:nth-child(1) { background: #c0c0c0; }
.bars i:nth-child(2) { background: #c0c000; }
.bars i:nth-child(3) { background: #00c0c0; }
.bars i:nth-child(4) { background: #00c000; }
.bars i:nth-child(5) { background: #c000c0; }
.bars i:nth-child(6) { background: #c00000; }
.bars i:nth-child(7) { background: #0000c0; }
.standby-text, .standby-sub {
  position: relative;
  background: #000;
  padding: .3em .8em;
  text-transform: uppercase;
  letter-spacing: .2em;
}
.standby-text { font-size: 6cqw; font-weight: 700; }
.standby-sub { font-size: 2.2cqw; margin-top: 1cqh !important; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Control panel ───────────────────────────────────────── */

.panel {
  --dial: 14.5cqw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1cqw;
  padding: 1.5cqw 1.2cqw 1.3cqw;
  border-radius: 0.5cqw;
  color: var(--ink);
  /* Brushed champagne aluminium. */
  background:
    linear-gradient(100deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,0) 22%, rgba(255,255,255,.14) 48%, rgba(0,0,0,.10) 76%, rgba(255,255,255,.10) 100%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.07) 0 1px, rgba(0,0,0,.05) 1px 2px, transparent 2px 3px),
    linear-gradient(180deg, var(--alu-hi), var(--alu) 40%, var(--alu-lo));
  box-shadow: inset 0 0.1cqw 0 rgba(255,255,255,.6), inset 0 -0.1cqw 0 rgba(0,0,0,.4), inset 0 0 0 0.08cqw rgba(0,0,0,.35);
}

.badge { text-align: center; line-height: 1; }
.badge b {
  display: block;
  font: italic 700 2.3cqw/1 Georgia, 'Times New Roman', serif;
  letter-spacing: .01em;
  color: #2a1f12;
  text-shadow: 0 0.08cqw 0 rgba(255,255,255,.55);
}
.badge small { display: block; margin-top: .45cqw; font-size: max(.72cqw, 6px); font-weight: 700; letter-spacing: .22em; text-transform: uppercase; opacity: .7; }

.legend {
  font-size: max(.82cqw, 7px);
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255,255,255,.4);
}

/* A recessed well with the knob sitting in it. */
.dial-well {
  position: relative;
  width: var(--dial);
  height: var(--dial);
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle, #0d0c0b 62%, #2a2520 70%, #6b5c3c 71%, #e9dab0 73%, #8f7b50 76%);
  box-shadow: inset 0 0.3cqw 0.6cqw rgba(0,0,0,.8), 0 0.08cqw 0 rgba(255,255,255,.5);
}
.well-small { --dial: 7.6cqw; }

.dial {
  --turn: 0deg;
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  transform: rotate(var(--turn));
  transition: transform .16s cubic-bezier(.3, 1.7, .5, 1);
}
/* The numbered skirt: black bakelite with cream numerals. */
.dial-skirt {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,255,255,.10), transparent 55%),
    radial-gradient(circle, #1b1917 0 60%, #0f0e0d 100%);
  box-shadow: 0 0.5cqw 0.9cqw rgba(0,0,0,.7), inset 0 0.1cqw 0 rgba(255,255,255,.16);
}
.dial-skirt span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2em;
  margin: -0.5em 0 0 -1em;
  font: 700 calc(var(--dial) * .082)/1 'Helvetica Neue', Arial, sans-serif;
  text-align: center;
  color: var(--cream);
}
.dial-skirt span.dead { color: #8d8571; }
.dial-grip {
  position: absolute;
  inset: 21%;
  border-radius: 50%;
  /* Knurled edge, lit from above-left. */
  background:
    radial-gradient(circle at 36% 28%, rgba(255,255,255,.30), transparent 46%),
    repeating-conic-gradient(#0c0c0c 0 3deg, #3a3835 3deg 6deg);
  box-shadow: 0 0.6cqw 0.9cqw rgba(0,0,0,.75), 0 0.15cqw 0.2cqw rgba(0,0,0,.9), inset 0 0 0 0.12cqw #000;
}
/* Spun-aluminium cap. */
.dial-grip i {
  position: absolute;
  inset: 17%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(0,0,0,.25) 0 4%, transparent 5%),
    conic-gradient(#f5f5f2, #8c8c88, #fbfbf8, #77746e, #efefec, #94918a, #fdfdfb, #807d77, #f5f5f2);
  box-shadow: inset 0 0 0 0.1cqw rgba(0,0,0,.5), 0 0.1cqw 0.2cqw rgba(0,0,0,.6);
}
.dial-grip b { /* pointer line on the volume knob */
  position: absolute;
  left: 50%;
  top: 3%;
  width: 6%;
  height: 22%;
  margin-left: -3%;
  border-radius: 1px;
  background: var(--cream);
}
.well-small .dial { inset: 9%; }
.well-small .dial-grip { inset: 0; }

/* Fixed index mark above the tuner, lit when the set is on. */
.dial-pointer {
  position: absolute;
  left: 50%;
  top: -0.9cqw;
  z-index: 2;
  width: 0;
  height: 0;
  margin-left: -0.6cqw;
  border: 0.6cqw solid transparent;
  border-top: 0.9cqw solid #5c2a1c;
  border-bottom: 0;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.4));
}
.tv.on .dial-pointer { border-top-color: #ff7b45; filter: drop-shadow(0 0 0.5cqw #ff7b45); }

.turn {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  z-index: 3;
}
.turn-l { left: 0; border-radius: 999px 0 0 999px; }
.turn-r { right: 0; border-radius: 0 999px 999px 0; }
.turn:focus-visible, .power:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.row { display: flex; justify-content: space-around; align-items: flex-end; width: 100%; }
.knob-col { display: flex; flex-direction: column; align-items: center; gap: .7cqw; }

/* Push-button switch with a jewel pilot lamp. */
.power {
  position: relative;
  width: 5.4cqw;
  height: 5.4cqw;
  margin-bottom: 1.1cqw;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: radial-gradient(circle at 38% 30%, #56524c, #1a1917 68%);
  box-shadow: 0 0.35cqw 0.5cqw rgba(0,0,0,.7), 0 0 0 0.3cqw #0d0c0b, 0 0 0 0.45cqw #e9dab0, 0 0 0 0.6cqw #7a6841;
  transition: transform .08s, box-shadow .08s;
}
.power[aria-pressed="true"], .power:active {
  transform: translateY(0.12cqw) scale(.97);
  box-shadow: 0 0.1cqw 0.2cqw rgba(0,0,0,.7), 0 0 0 0.3cqw #0d0c0b, 0 0 0 0.45cqw #e9dab0, 0 0 0 0.6cqw #7a6841;
}
.lamp {
  position: absolute;
  inset: 32%;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #7a2a1a, #2c0d07);
  box-shadow: inset 0 0 0 0.08cqw #000;
}
.tv.on .lamp {
  background: radial-gradient(circle at 38% 30%, #ffe0b0, #ff5a2a 45%, #a11d06);
  box-shadow: 0 0 1cqw #ff5a2a, 0 0 2.4cqw rgba(255,90,42,.6);
}

.trims { display: flex; justify-content: space-around; width: 100%; }
.trims div { display: flex; flex-direction: column; align-items: center; gap: .45cqw; }
.trims i {
  width: 2.6cqw;
  height: 2.6cqw;
  border-radius: 50%;
  background:
    linear-gradient(var(--a, 30deg), transparent 44%, #0a0a0a 44% 56%, transparent 56%),
    conic-gradient(#e8e8e4, #8a8883, #f8f8f5, #7a7771, #e8e8e4);
  box-shadow: 0 0.2cqw 0.3cqw rgba(0,0,0,.6), 0 0 0 0.15cqw #17140f;
}
.trims div:nth-child(2) i { --a: -50deg; }
.trims div:nth-child(3) i { --a: 80deg; }
.trims span { font-size: max(.66cqw, 6px); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

/* Speaker cloth behind a trim frame. */
.grille {
  flex: 1;
  min-height: 3cqw;
  width: 100%;
  border-radius: 0.3cqw;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(0,0,0,.55) 100%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.55) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255,220,160,.10) 0 1px, transparent 1px 3px),
    #3a2d1d;
  box-shadow: inset 0 0.25cqw 0.5cqw rgba(0,0,0,.85), 0 0 0 0.1cqw #5f512f, 0 0.1cqw 0 0.1cqw rgba(255,255,255,.4);
}

/* ── Sideboard and the listings clipping ─────────────────── */

.shelf {
  position: relative;
  width: 150cqw;
  margin-left: -25cqw;
  min-height: 108px;
  padding: 16px 25cqw 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  border-top: 1px solid rgba(255,230,190,.25);
  background:
    radial-gradient(ellipse 36% 60% at 50% 0%, rgba(0,0,0,.8), transparent 75%),
    linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.55)),
    url(wood.svg) center / 100% 240%;
  box-shadow: 0 8px 0 #1a0f08, 0 9px 0 rgba(255,220,170,.12), 0 30px 40px rgba(0,0,0,.6);
}
/* Light from the tube spilling onto the wood. */
.shelf::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 30% 90% at 40% 0%, rgba(170,195,255,.22), transparent 70%);
  opacity: 0;
  transition: opacity 1.4s;
  pointer-events: none;
}
.tv.on .shelf::before { opacity: 1; animation: flicker 3.7s steps(1) infinite; }

.guide {
  position: relative;
  width: min(100%, 430px);
  padding: 9px 16px 11px;
  transform: rotate(-1.3deg);
  color: #1d1a16;
  font-family: Georgia, 'Times New Roman', serif;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.018) 0 1px, transparent 1px 3px),
    linear-gradient(175deg, #efe6cf, #d9cdaf);
  box-shadow: 0 1px 1px rgba(0,0,0,.5), 0 8px 14px rgba(0,0,0,.55);
  clip-path: polygon(0 3%, 3% 0, 30% 2%, 62% 0, 100% 2%, 99% 96%, 70% 100%, 33% 97%, 1% 100%);
}
.guide-head {
  font: 700 10px/1 'Helvetica Neue', Arial, sans-serif;
  letter-spacing: .32em;
  text-transform: uppercase;
  text-align: center;
  padding-bottom: 5px;
  border-bottom: 3px double #1d1a16;
}
.guide-row { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
.guide-row b {
  min-width: 1.5em;
  padding: 1px 5px;
  font: 700 15px/1.2 'Helvetica Neue', Arial, sans-serif;
  text-align: center;
  color: #efe6cf;
  background: #1d1a16;
}
.guide-row span { font: 700 13px/1.2 'Helvetica Neue', Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.guide-title { margin-top: 3px; font-size: 16px; line-height: 1.3; }
.guide-title i { opacity: .7; }

.hint, .credit { margin: 0; max-width: 64ch; text-align: center; font-size: 12.5px; line-height: 1.5; color: #8d806c; }
.credit { font-size: 11.5px; color: #675d4f; }
.credit a { color: inherit; }
.keys { display: block; }
kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 .35em;
  margin: 0 1px;
  border-radius: 4px;
  border: 1px solid #554b3e;
  font: 11px/1.5 ui-monospace, Menlo, monospace;
  color: #b7a88f;
}

.extras { margin: 0; display: flex; gap: 10px; }
.extras button {
  padding: 5px 12px;
  border: 1px solid #554b3e;
  border-radius: 999px;
  background: none;
  color: #b7a88f;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.extras button:hover { border-color: #b7a88f; color: #efe4c8; }
.extras button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.extras button[hidden] { display: none; }

/* ── Full screen: only the tube, on the whole display ───── */

.cast-tip { display: none; }
body.picture-only { overflow: hidden; }
body.picture-only.idle, body.picture-only.idle .screen { cursor: none; }
/* Containment on .tv would trap the fixed tube inside it. */
body.picture-only .tv { container-type: normal; }
body.picture-only .screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  margin: auto;
  width: min(100vw, 100vh * 4 / 3);
  width: min(100vw, 100dvh * 4 / 3);
  cursor: pointer;
  border-radius: 4% / 5.3%;
  box-shadow: 0 0 0 100vmax #000;
}
body.picture-only .cast-tip {
  display: block;
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 21;
  transform: translateX(-50%);
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,.7);
  color: #efe4c8;
  font-size: 12.5px;
  white-space: nowrap;
  pointer-events: none;
  animation: tip-fade 4s forwards;
}
@keyframes tip-fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* ── Narrow screens: controls move under the tube ────────── */

@media (max-width: 720px) {
  .tv { width: 100%; }
  .antenna { height: 14cqw; }
  .fascia { grid-template-columns: 1fr; }
  .panel { --dial: 30cqw; flex-direction: row; flex-wrap: wrap; justify-content: space-around; align-items: center; padding: 4cqw 2cqw 3cqw; }
  .badge, .trims, .grille, .panel > .legend { display: none; }
  .row { width: auto; gap: 7cqw; }
  .well-small { --dial: 19cqw; }
  .power { width: 14cqw; height: 14cqw; margin-bottom: 2.5cqw; }
  .dial-pointer { top: -2.2cqw; margin-left: -1.4cqw; border-width: 1.4cqw; border-top-width: 2cqw; }
  .legend { font-size: 9px; }
  .knob-col { gap: 2cqw; }
  .keys { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tv.on .glass, .tv.on .shelf::before, .bumper-rays { animation: none; }
  .dial { transition: none; }
  .screen.weak .picture { animation: fade-signal .9s steps(3) infinite; }
}
