@font-face {
  font-family: 'Pricedown Bl';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('assets/fonts/pricedown-bl.woff') format('woff');
}
@font-face {
  font-family: 'Diploma';
  font-style: normal;
  font-weight: 5;
  font-display: swap;
  src: url('assets/fonts/diploma.woff') format('woff');
}
@font-face {
  font-family: 'BankGothic Md BT';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/bankgothic-md-bt.woff') format('woff');
}
@font-face {
  font-family: 'BankGothic Md BT';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/bankgothic-medium-bt.woff') format('woff');
}
@font-face {
  font-family: 'BankGothic Md BT';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/bank-gothic-medium-bt.woff') format('woff');
}
@font-face {
  font-family: 'Bank Gothic Light';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('assets/fonts/bank-gothic-light.woff') format('woff');
}
@font-face {
  font-family: 'BankGothic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/bankgothic-bold.woff') format('woff');
}

:root {
  /* Shared radio palette. Decorative scenery gradients keep their own colors. */
  --color-black: #000;
  --color-white: #fff;
  --color-ink: #020303;
  --color-canvas: #050708;
  --color-page: #06090b;
  --color-panel: #0b1113;
  --color-panel-raised: #11191c;
  --color-panel-hover: #172326;
  --color-panel-interactive: #22343c;
  --color-screen: #070d0f;
  --color-menu: #101a1e;
  --color-border: #42575f;
  --color-border-soft: #344348;
  --color-border-strong: #617d85;
  --color-text: #eef2f1;
  --color-text-bright: #d8e9ed;
  --color-text-strong: #c5d9de;
  --color-text-control: #a9bdc3;
  --color-text-muted: #9aafb5;
  --color-text-secondary: #8aa4ab;
  --color-text-subtle: #748a92;
  --color-signal: #9fb5bd;
  --color-accent: #b9d8df;
  --color-accent-ink: #071012;
  --color-knob: #c7d9dd;
  --color-warning: #e0ad57;
  --color-danger: #b55749;
  --color-danger-text: #d18377;
  --color-success: #99b78b;
  --color-lounge-bg: var(--color-canvas);
  --color-lounge-text: var(--color-text);
  --color-lounge-muted: var(--color-text-strong);
  --color-lounge-accent: var(--color-accent);
  --color-lounge-gold: var(--color-warning);
  --color-lounge-focus: var(--color-accent);
  --color-lounge-control: var(--color-panel);
  --color-lounge-hover: var(--color-panel-hover);
  --color-lounge-tone-0: #122420;
  --color-lounge-tone-1: #30241b;
  --color-lounge-tone-2: #242b34;
  --color-lounge-tone-3: #2b1d27;
  --color-lounge-tone-4: #20263a;
  --color-lounge-tone-5: #242c19;
  --color-accent-rgb: 185 216 223;
  --color-line-rgb: var(--color-accent-rgb);
  --color-warning-rgb: 224 173 87;
  --color-success-rgb: 153 183 139;
  --color-canvas-rgb: 5 7 8;
  --color-screen-rgb: 7 13 15;
  --color-border-rgb: 66 87 95;
  --color-shadow-rgb: 0 0 0;
  --color-white-rgb: 255 255 255;
  --shadow: 0 32px 90px rgb(var(--color-shadow-rgb) / .65);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--color-canvas); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--color-text);
  font-family: 'BankGothic Md BT', 'Arial Narrow', Arial, sans-serif;
  background: var(--color-page);
  overflow-x: hidden;
}
body.dialog-open { overflow: hidden; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4,8,10,.2) 0%, rgba(6,8,8,.56) 44%, #050606 100%),
    radial-gradient(circle at 70% 18%, rgba(230,148,82,.23), transparent 28%),
    linear-gradient(160deg, #21333a 0%, #a0785c 39%, #1b1b18 67%, #070808 100%);
}
.backdrop::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .22;
  background-image:
    repeating-linear-gradient(0deg, rgb(var(--color-white-rgb) / .025) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 20% 20%, transparent 0 34%, rgb(var(--color-shadow-rgb) / .22) 80%);
  mix-blend-mode: overlay;
}
.skyline {
  position: absolute;
  left: -2%; right: -2%; bottom: 0;
  height: 42vh;
  opacity: .72;
  background:
    linear-gradient(90deg,
      transparent 0 4%, var(--color-ink) 4% 7%, transparent 7% 9%, var(--color-ink) 9% 14%, transparent 14% 18%,
      var(--color-ink) 18% 23%, transparent 23% 26%, var(--color-ink) 26% 30%, transparent 30% 38%, var(--color-ink) 38% 44%,
      transparent 44% 49%, var(--color-ink) 49% 57%, transparent 57% 61%, var(--color-ink) 61% 66%, transparent 66% 71%,
      var(--color-ink) 71% 78%, transparent 78% 82%, var(--color-ink) 82% 89%, transparent 89% 92%, var(--color-ink) 92% 96%, transparent 96%);
  clip-path: polygon(0 57%, 4% 57%, 4% 40%, 7% 40%, 7% 55%, 9% 55%, 9% 24%, 14% 24%, 14% 53%, 18% 53%, 18% 34%, 23% 34%, 23% 60%, 26% 60%, 26% 18%, 30% 18%, 30% 55%, 38% 55%, 38% 40%, 44% 40%, 44% 62%, 49% 62%, 49% 31%, 57% 31%, 57% 57%, 61% 57%, 61% 21%, 66% 21%, 66% 58%, 71% 58%, 71% 35%, 78% 35%, 78% 55%, 82% 55%, 82% 27%, 89% 27%, 89% 52%, 92% 52%, 92% 39%, 96% 39%, 96% 56%, 100% 56%, 100% 100%, 0 100%);
}
.palms::before, .palms::after {
  content: '';
  position: absolute;
  bottom: -10vh;
  width: 16px;
  height: 70vh;
  background: var(--color-ink);
  transform-origin: bottom;
  box-shadow: 0 0 40px rgb(var(--color-shadow-rgb) / .6);
}
.palms::before { left: 8%; transform: rotate(-5deg); }
.palms::after { right: 10%; transform: rotate(7deg) scale(.82); }

.app {
  position: relative;
  z-index: 2;
  width: min(1260px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 40px;
}

.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 18px;
}
.brand { display: flex; align-items: center; gap: 18px; min-width: 0; }
.gta-logo {
  display: flex;
  flex-direction: column;
  width: 112px;
  flex: 0 0 112px;
  color: var(--color-white);
  font-family: 'Pricedown Bl', Impact, sans-serif;
  font-size: 39px;
  line-height: .62;
  letter-spacing: -1.5px;
  text-transform: lowercase;
  -webkit-text-stroke: 2px var(--color-black);
  text-shadow: 3px 4px 0 var(--color-black);
  transform: rotate(-2deg);
}
.gta-logo span { height: 26px; }
.brand-copy { min-width: 0; }
.sa-script {
  font-family: 'Diploma', Georgia, serif;
  font-size: clamp(32px, 4vw, 52px);
  line-height: .78;
  text-shadow: 2px 3px 0 var(--color-black);
  transform: rotate(-1deg);
  margin-bottom: 10px;
}
.brand-sub {
  max-width: 280px;
  color: var(--color-text-muted);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.menu-btn {
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid rgb(var(--color-line-rgb) / .22);
  color: var(--color-text-strong);
  background: linear-gradient(#172126, #080c0e);
  cursor: pointer;
  letter-spacing: .12em;
  font-size: 9px;
  box-shadow: inset 0 0 0 1px rgb(var(--color-white-rgb) / .02), 0 8px 22px rgb(var(--color-shadow-rgb) / .28);
}
.menu-btn:hover { color: var(--color-white); border-color: rgb(var(--color-line-rgb) / .55); }

.console {
  position: relative;
  background:
    linear-gradient(180deg, rgb(var(--color-white-rgb) / .03), transparent 16%),
    linear-gradient(135deg, #171e21, #070a0b 44%, #11171a);
  border: 2px solid var(--color-ink);
  outline: 1px solid rgb(var(--color-line-rgb) / .2);
  box-shadow: var(--shadow), 0 0 0 6px rgb(var(--color-shadow-rgb) / .28);
  overflow: hidden;
}
.console::after {
  content: attr(data-tagline);
  position: absolute;
  right: 18px;
  bottom: 9px;
  color: rgb(var(--color-line-rgb) / .17);
  font-size: 8px;
  letter-spacing: .2em;
}
.console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
}

.receiver {
  padding: 32px 34px 30px;
  border-right: 1px solid rgb(var(--color-line-rgb) / .09);
}
.receiver-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.model { color: var(--color-text-subtle); font-size: 9px; letter-spacing: .2em; }
.signal-state { display: flex; align-items: center; gap: 9px; color: var(--color-signal); font-size: 9px; letter-spacing: .16em; }
.signal-bars { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.signal-bars i { display: block; width: 3px; background: var(--color-border-soft); }
.signal-bars i:nth-child(1){height:3px}.signal-bars i:nth-child(2){height:6px}.signal-bars i:nth-child(3){height:9px}.signal-bars i:nth-child(4){height:12px}
.signal-state[data-state='onair'] { color: var(--color-accent); }
.signal-state[data-state='onair'] .signal-bars i.active { background: var(--color-accent); box-shadow: 0 0 6px rgb(var(--color-accent-rgb) / .45); }
.signal-state[data-state='loading'] .signal-bars i.active { background: var(--color-warning); }
.signal-state[data-state='error'] { color: var(--color-danger-text); }
.signal-state[data-state='error'] .signal-bars i.active { background: var(--color-danger); }

.screen {
  position: relative;
  min-height: 316px;
  padding: 22px;
  border: 1px solid var(--color-ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgb(var(--color-line-rgb) / .018) 3px 4px),
    radial-gradient(circle at 30% 25%, rgba(152,202,214,.08), transparent 34%),
    var(--color-screen);
  box-shadow: inset 0 0 60px rgb(var(--color-shadow-rgb) / .82), 0 12px 34px rgb(var(--color-shadow-rgb) / .42);
  overflow: hidden;
}
.screen::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0 48%, rgb(var(--color-white-rgb) / .015) 50%, transparent 52%);
}
.screen-top { display: grid; grid-template-columns: 220px 1fr; gap: 22px; min-height: 154px; }
.logo-stage { display: grid; place-items: center; min-width: 0; }
#stationLogo { max-width: 100%; max-height: 132px; object-fit: contain; filter: drop-shadow(0 8px 14px rgb(var(--color-shadow-rgb) / .5)); transition: opacity .18s ease, transform .18s ease, filter .18s ease; }
#stationLogo.switching { opacity: .18; transform: scale(.94); filter: blur(2px); }
.station-copy { min-width: 0; text-align: right; padding-top: 4px; }
.channel { color: var(--color-text-subtle); font-size: 10px; letter-spacing: .15em; }
#stationName { margin-top: 8px; color: var(--color-text-bright); font-size: clamp(28px, 4.6vw, 48px); line-height: .94; letter-spacing: .035em; text-transform: uppercase; text-shadow: 2px 2px var(--color-black), 0 0 20px rgba(164,211,222,.12); overflow: hidden; text-overflow: ellipsis; }
#stationGenre { margin-top: 10px; color: var(--color-text-secondary); font-size: 10px; line-height: 1.4; letter-spacing: .1em; text-transform: uppercase; }

.now-playing {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgb(var(--color-line-rgb) / .1);
  display: grid;
  grid-template-columns: 86px 1fr auto;
  align-items: center;
  gap: 14px;
}
.on-air {
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(var(--color-line-rgb) / .16);
  color: var(--color-text-muted);
  font-size: 9px;
  letter-spacing: .14em;
}
.on-air.active { color: var(--color-accent-ink); background: var(--color-accent); border-color: var(--color-accent); box-shadow: 0 0 22px rgb(var(--color-accent-rgb) / .15); }
.now-copy { min-width: 0; }
.now-kicker { color: var(--color-text-subtle); font-size: 8px; letter-spacing: .15em; margin-bottom: 4px; }
#nowTitle { color: var(--color-text-bright); font-size: 14px; letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#nowArtist { margin-top: 3px; color: var(--color-text-secondary); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#nowMeta { margin-top: 4px; color: var(--color-text-subtle); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-clock { text-align: right; color: var(--color-signal); font-size: 13px; letter-spacing: .08em; }
.live-clock small { display: block; margin-top: 4px; color: var(--color-text-subtle); font-size: 7px; letter-spacing: .14em; }

.control-deck {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
}
.deck-side { display: flex; align-items: center; gap: 12px; min-width: 0; }
.deck-side.right { justify-content: flex-end; }
.control-btn {
  width: 62px;
  height: 50px;
  border: 1px solid var(--color-ink);
  color: var(--color-text-strong);
  background: linear-gradient(145deg, #2a3438, var(--color-panel) 62%);
  box-shadow: inset 0 1px rgb(var(--color-white-rgb) / .05), 0 6px 12px rgb(var(--color-shadow-rgb) / .42), 0 0 0 2px var(--color-page), 0 0 0 3px var(--color-border-soft);
  cursor: pointer;
}
.control-btn:active { transform: translateY(1px); }
.control-btn svg { width: 24px; height: 24px; fill: currentColor; }
.play-btn {
  width: 82px;
  height: 64px;
  color: var(--color-accent-ink);
  background: linear-gradient(145deg, #e2eaE8, #9eb7bd 58%, #637f87);
  box-shadow: inset 0 1px 2px rgb(var(--color-white-rgb) / .55), 0 8px 18px rgb(var(--color-shadow-rgb) / .44), 0 0 0 3px var(--color-page), 0 0 0 4px var(--color-border);
}
.volume-wrap { display: flex; align-items: center; gap: 10px; color: var(--color-text-subtle); font-size: 8px; letter-spacing: .12em; }
#volume { width: min(210px, 24vw); accent-color: var(--color-accent); }
#volumeText { width: 34px; color: var(--color-text-control); text-align: right; }
.source-readout { color: var(--color-text-subtle); font-size: 8px; letter-spacing: .13em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tuner {
  padding: 28px 24px 30px;
  background:
    linear-gradient(180deg, rgba(22,35,40,.36), rgb(var(--color-shadow-rgb) / .25)),
    repeating-linear-gradient(90deg, rgb(var(--color-white-rgb) / .008) 0 1px, transparent 1px 5px);
}
.tuner-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.tuner-title { font-family: 'Diploma', Georgia, serif; font-size: 40px; line-height: .8; text-shadow: 2px 2px var(--color-black); }
.tuner-sub { color: var(--color-text-subtle); font-size: 8px; letter-spacing: .16em; text-align: right; }

.wheel {
  position: relative;
  height: 330px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-top: 1px solid rgb(var(--color-line-rgb) / .07);
  border-bottom: 1px solid rgb(var(--color-line-rgb) / .07);
}
.wheel::before {
  content: '';
  position: absolute;
  left: 50%; top: 20px; bottom: 20px;
  width: 1px;
  background: linear-gradient(transparent, rgb(var(--color-line-rgb) / .2), transparent);
}
.wheel-track { width: 100%; display: flex; align-items: center; justify-content: center; gap: 4px; perspective: 900px; }
.wheel-item {
  position: relative;
  width: 20%;
  min-width: 72px;
  max-width: 128px;
  height: 180px;
  border: 0;
  background: transparent;
  color: var(--color-text-subtle);
  cursor: pointer;
  opacity: .34;
  transform: scale(.7);
  transition: .2s ease;
}
.wheel-item img { width: 100%; height: 110px; object-fit: contain; filter: grayscale(.55) brightness(.76) drop-shadow(0 5px 8px rgb(var(--color-shadow-rgb) / .5)); }
.wheel-item span { display: block; margin-top: 10px; font-size: 8px; line-height: 1.2; letter-spacing: .08em; text-transform: uppercase; }
.wheel-item.offset-1 { opacity: .62; transform: scale(.86) rotateY(10deg); }
.wheel-item.offset-2 { opacity: .24; transform: scale(.65) rotateY(18deg); }
.wheel-item.active { opacity: 1; transform: scale(1.24); color: var(--color-text-bright); z-index: 3; }
.wheel-item.active img { filter: none; }
.wheel-item.active::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 0;
  width: 62%; height: 2px;
  background: var(--color-accent);
  transform: translateX(-50%);
  box-shadow: 0 0 12px rgb(var(--color-accent-rgb) / .6);
}

.station-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-top: 14px;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-soft) transparent;
}
.strip-station {
  position: relative;
  flex: 0 0 84px;
  min-height: 72px;
  padding: 7px 5px;
  border: 1px solid rgb(var(--color-line-rgb) / .08);
  background: rgb(var(--color-canvas-rgb) / .52);
  color: var(--color-text-subtle);
  cursor: pointer;
}
.strip-station img { width: 100%; height: 38px; object-fit: contain; filter: grayscale(.65) brightness(.7); }
.strip-station b { display: block; margin-top: 6px; font-size: 6px; line-height: 1.15; letter-spacing: .04em; text-transform: uppercase; }
.strip-station.active { border-color: rgb(var(--color-accent-rgb) / .55); color: var(--color-text-bright); background: rgb(var(--color-border-rgb) / .12); }
.strip-station.active img { filter: none; }
.load-dot { position: absolute; top: 5px; right: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--color-border-soft); }
.strip-station.loaded .load-dot { background: var(--color-success); box-shadow: 0 0 7px rgb(var(--color-success-rgb) / .7); }

.local-panel { margin-top: 16px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
#clearLocalBtn[hidden] { display: none; }
.file-btn, .secondary-btn {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgb(var(--color-line-rgb) / .18);
  background: var(--color-panel);
  color: var(--color-text-control);
  cursor: pointer;
  font-size: 8px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.file-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.secondary-btn { color: var(--color-text-subtle); }

.radio-dialog {
  position: fixed;
  inset: 0;
  width: min(860px, calc(100vw - 40px));
  max-width: none;
  max-height: min(84dvh, 790px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgb(var(--color-accent-rgb) / .42);
  color: var(--color-text);
  background: linear-gradient(150deg, var(--color-panel-raised), var(--color-lounge-bg) 43%, var(--color-page));
  box-shadow: 0 36px 100px rgb(var(--color-shadow-rgb) / .82), inset 0 1px rgb(var(--color-white-rgb) / .08);
}
.radio-dialog:not([open]) { display: none; }
.radio-dialog::backdrop { background: rgb(var(--color-shadow-rgb) / .78); backdrop-filter: blur(5px); }
.help-dialog { width: min(740px, calc(100vw - 40px)); }
.radio-dialog .help-head {
  position: relative;
  align-items: center;
  padding: 20px 24px 18px;
  border-bottom: 1px solid rgb(var(--color-line-rgb) / .18);
  background: linear-gradient(90deg, rgb(var(--color-border-rgb) / .32), rgb(var(--color-screen-rgb) / .96) 65%);
}
.radio-dialog .help-head::after {
  content: '';
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, rgb(var(--color-accent-rgb) / .65), transparent 56%);
}
.radio-dialog h2 { margin: 0; font-family: 'Diploma', Georgia, serif; font-size: 34px; font-weight: 400; line-height: 1.15; }
.radio-dialog .dialog-body { max-height: calc(min(84dvh, 790px) - 84px); overflow-y: auto; overscroll-behavior: contain; padding: 20px 24px 24px; scrollbar-color: var(--color-border-strong) var(--color-panel); }
.help-dialog p { color: var(--color-text-control); font-size: 11px; line-height: 1.7; }
.help-dialog p:first-child { margin-top: 0; }
.help-dialog p:last-child { margin-bottom: 0; }

.legal { margin-top: 18px; color: var(--color-text-subtle); font-size: 8px; line-height: 1.6; letter-spacing: .04em; }
.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  max-width: calc(100vw - 20px);
  overflow-wrap: anywhere;
  z-index: 30;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  padding: 11px 14px;
  border: 1px solid rgb(var(--color-accent-rgb) / .25);
  background: rgb(var(--color-screen-rgb) / .96);
  color: var(--color-text-bright);
  box-shadow: 0 12px 38px rgb(var(--color-shadow-rgb) / .45);
  font-size: 9px;
  letter-spacing: .06em;
  transition: .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

body.focus-mode .app { width: min(1500px, calc(100% - 20px)); padding-top: 10px; }
body.focus-mode .topbar { display: none; }
body.focus-mode .console { min-height: calc(100vh - 20px); }

@media (max-width: 940px) {
  .console-grid { grid-template-columns: minmax(0, 1fr); }
  .receiver, .tuner { min-width: 0; }
  .receiver { border-right: 0; border-bottom: 1px solid rgb(var(--color-line-rgb) / .09); }
  .station-strip { max-width: 100%; }
  .wheel { height: 280px; }
}
@media (min-width: 681px) and (max-width: 940px) {
  #stationName.long-name { font-size: clamp(24px, 3.5vw, 31px); letter-spacing: .01em; white-space: nowrap; }
}
@media (max-width: 680px) {
  .app { width: min(100% - 16px, 1260px); padding-top: 10px; }
  .topbar { align-items: flex-start; }
  .gta-logo { width: 72px; flex-basis: 72px; font-size: 26px; -webkit-text-stroke: 1.5px var(--color-black); }
  .gta-logo span { height: 18px; }
  .sa-script { font-size: 33px; }
  .brand-sub { display: none; }
  .top-actions { gap: 5px; }
  .menu-btn { min-height: 34px; padding: 0 8px; font-size: 7px; }
  .receiver { padding: 20px 16px 22px; }
  .screen { min-height: 360px; padding: 16px; }
  .screen-top { grid-template-columns: 1fr; gap: 10px; }
  .logo-stage { height: 110px; }
  #stationLogo { max-height: 100px; }
  .station-copy { text-align: center; }
  #stationName { font-size: 31px; }
  .now-playing { grid-template-columns: 70px 1fr; }
  .live-clock { display: none; }
  .control-deck { grid-template-columns: 1fr auto 1fr; gap: 8px; }
  .deck-side { gap: 6px; }
  .volume-wrap { display: none; }
  .source-readout { font-size: 7px; max-width: 110px; }
  .control-btn { width: 52px; height: 46px; }
  .play-btn { width: 66px; height: 56px; }
  .tuner { padding: 22px 12px 26px; }
  .wheel-item { min-width: 56px; }
  .wheel-item span { display: none; }
  .wheel-item.active { transform: scale(1.45); }
}
@media (max-width: 420px) {
  .sa-script { font-size: 28px; }
  .topbar { gap: 8px; }
  .menu-btn#fullscreenBtn { display: none; }
  .wheel { height: 220px; }
  .wheel-item { height: 140px; }
  .wheel-item img { height: 88px; }
  .station-strip { margin-top: 8px; }
  .strip-station { flex-basis: 74px; }
}

/* =========================
   V3 — responsive & touch UX
   ========================= */
html { -webkit-text-size-adjust: 100%; }
body {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  overscroll-behavior-x: none;
}
button, label, input[type="range"] { touch-action: manipulation; }
button:focus-visible, .file-btn:focus-within, input[type="range"]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Prevent the volume control from ever competing with Play. */
.control-deck {
  grid-template-columns: minmax(94px, 1fr) auto minmax(190px, 1fr);
  gap: clamp(12px, 1.5vw, 22px);
}
.deck-side { min-width: 0; }
.deck-side.right { min-width: 0; }
.volume-wrap {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 260px;
}
#volume {
  width: auto;
  min-width: 72px;
  max-width: 190px;
  flex: 1 1 120px;
}

.swipe-hint {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 7px;
  transform: translateX(-50%);
  color: var(--color-text-muted);
  font-size: 7px;
  letter-spacing: .15em;
  white-space: nowrap;
  pointer-events: none;
}

.help-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.help-close {
  display: block;
  min-width: 64px;
  min-height: 44px;
  border: 1px solid rgb(var(--color-line-rgb) / .18);
  background: var(--color-panel);
  color: var(--color-text-control);
  cursor: pointer;
  font-size: 8px;
  letter-spacing: .1em;
}
.help-close:hover { color: var(--color-text-bright); border-color: rgb(var(--color-line-rgb) / .58); background: var(--color-panel-hover); }

.station-strip {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
}
.strip-station { scroll-snap-align: center; }

@media (max-width: 1120px) and (min-width: 681px) {
  .control-deck { grid-template-columns: minmax(64px, 1fr) auto minmax(150px, 1fr); gap: 12px; }
  .source-readout { display: none; }
  .volume-wrap { gap: 7px; }
  #volume { min-width: 58px; max-width: 112px; }
  #volumeText { width: 30px; }
}

@media (max-width: 680px) {
  body { min-height: 100dvh; }
  .app {
    width: 100%;
    padding: max(8px, env(safe-area-inset-top, 0px)) 8px calc(28px + env(safe-area-inset-bottom, 0px));
  }
  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: 0;
    margin-bottom: 10px;
  }
  .brand { width: 100%; gap: 12px; }
  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .menu-btn {
    min-height: 44px;
    width: 100%;
    padding: 0 6px;
    font-size: 8px;
  }

  .console { border-width: 1px; outline: 0; box-shadow: 0 16px 46px rgb(var(--color-shadow-rgb) / .55); }
  .console::after { display: none; }
  .receiver { padding: 16px 12px 18px; }
  .receiver-head { margin-bottom: 9px; }
  .model {
    max-width: 62%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 7px;
  }
  .signal-state { font-size: 8px; }
  .screen { min-height: 0; padding: 14px 12px; }
  .screen-top { grid-template-columns: 1fr; min-height: 0; gap: 6px; }
  .logo-stage { height: 96px; }
  #stationLogo { max-height: 88px; }
  .station-copy { padding-top: 0; }
  .channel { font-size: 8px; }
  #stationName { font-size: clamp(27px, 9vw, 38px); margin-top: 6px; }
  #stationGenre { margin-top: 7px; }
  .now-playing {
    margin-top: 14px;
    padding-top: 12px;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 10px;
  }
  .on-air { height: 40px; font-size: 8px; }
  #nowTitle { font-size: 12px; }
  #nowArtist { font-size: 9px; }
  #nowMeta { font-size: 7px; }
  .live-clock { display: none; }

  .control-deck {
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
      "left play right"
      "volume volume volume";
    column-gap: 12px;
    row-gap: 14px;
    margin-top: 18px;
  }
  .control-deck > .deck-side:first-child { grid-area: left; justify-content: flex-start; }
  .play-btn { grid-area: play; justify-self: center; }
  .deck-side.right { display: contents; }
  .deck-side.right #nextBtn { grid-area: right; justify-self: end; }
  .deck-side.right .volume-wrap {
    grid-area: volume;
    display: flex;
    width: 100%;
    max-width: none;
    min-height: 48px;
    padding: 8px 11px;
    border: 1px solid rgb(var(--color-line-rgb) / .1);
    background: rgb(var(--color-canvas-rgb) / .42);
    gap: 9px;
  }
  #volume { width: 100%; min-width: 0; max-width: none; flex: 1 1 auto; }
  #volumeText { width: 38px; }
  .source-readout { display: none; }
  .control-btn { width: 56px; height: 50px; }
  .play-btn { width: 72px; height: 60px; }

  .tuner { padding: 18px 10px 20px; }
  .tuner-head { align-items: flex-start; margin-bottom: 8px; }
  .tuner-title { font-size: 34px; }
  .tuner-sub { font-size: 7px; line-height: 1.45; }
  .wheel { height: 220px; touch-action: pan-y; }
  .wheel-track { gap: 0; }
  .wheel-item { min-width: 52px; height: 142px; }
  .wheel-item img { height: 90px; }
  .wheel-item span { display: none; }
  .wheel-item.active { transform: scale(1.34); }
  .wheel-item.active span {
    display: block;
    margin-top: 4px;
    font-size: 6px;
    white-space: nowrap;
  }
  .swipe-hint { display: block; }

  .station-strip { gap: 7px; margin-top: 10px; padding: 5px 2px 10px; }
  .strip-station {
    flex-basis: 82px;
    min-height: 78px;
    padding: 8px 5px;
  }
  .strip-station img { height: 40px; }
  .strip-station b { font-size: 6.5px; }
  .local-panel { grid-template-columns: 1fr; gap: 7px; margin-top: 12px; }
  .file-btn, .secondary-btn { min-height: 48px; font-size: 8px; }

  .toast {
    left: max(10px, env(safe-area-inset-left, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    transform: translateY(18px);
    text-align: center;
  }
  .toast.show { transform: translateY(0); }
  .legal { padding: 0 4px; }
}

@media (max-width: 420px) {
  .gta-logo { width: 64px; flex-basis: 64px; font-size: 23px; }
  .gta-logo span { height: 16px; }
  .sa-script { font-size: 27px; margin-bottom: 5px; }
  .top-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-btn#fullscreenBtn { display: none; }
  .screen { padding-inline: 10px; }
  .logo-stage { height: 88px; }
  #stationLogo { max-height: 80px; }
  .now-playing { grid-template-columns: 58px minmax(0, 1fr); }
  .control-deck { column-gap: 8px; }
  .control-btn { width: 52px; height: 48px; }
  .play-btn { width: 68px; height: 58px; }
  .wheel { height: 196px; }
  .wheel-item { min-width: 48px; height: 128px; }
  .wheel-item img { height: 82px; }
  .strip-station { flex-basis: 78px; }
}

@media (pointer: coarse) {
  .menu-btn, .file-btn, .secondary-btn { min-height: 44px; }
  .strip-station { min-width: 78px; }
  .control-btn { -webkit-user-select: none; user-select: none; }
}

@media (max-width: 940px) and (orientation: landscape) and (max-height: 560px) {
  .topbar { margin-bottom: 6px; }
  .brand-sub { display: none; }
  .screen-top { grid-template-columns: 150px 1fr; align-items: center; }
  .logo-stage { height: 92px; }
  .station-copy { text-align: right; }
  .now-playing { margin-top: 8px; padding-top: 8px; }
  .wheel { height: 180px; }
}

/* Larger, reliable volume hit area on touch browsers. */
#volume { height: 28px; background: transparent; }
#volume::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgb(var(--color-accent-rgb) / .58), rgba(86,107,114,.48));
}
#volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -8px;
  border-radius: 50%;
  border: 2px solid var(--color-accent-ink);
  background: var(--color-knob);
  box-shadow: 0 0 0 2px var(--color-border-strong), 0 4px 9px rgb(var(--color-shadow-rgb) / .45);
}
#volume::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: rgba(86,107,114,.58);
}
#volume::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--color-accent-ink);
  background: var(--color-knob);
  box-shadow: 0 0 0 2px var(--color-border-strong), 0 4px 9px rgb(var(--color-shadow-rgb) / .45);
}

/* =============================
   V4 · PWA / SETTINGS / METADATA
   ============================= */
.game-select-wrap, .language-select-wrap {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid rgb(var(--color-line-rgb) / .14);
  background: rgba(4,8,10,.38);
  color: var(--color-text-muted);
  font-size: 7px;
  letter-spacing: .14em;
}
.game-select-wrap select, .language-select-wrap select {
  min-width: 126px;
  max-width: 190px;
  border: 0;
  outline: 0;
  color: var(--color-text-strong);
  background: transparent;
  font: inherit;
  font-size: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.game-select-wrap option, .language-select-wrap option { background: var(--color-screen); color: var(--color-text-strong); }
.language-select-wrap select { min-width: 72px; }

.meta-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-left: 8px;
  padding: 2px 6px;
  border: 1px solid rgba(172,206,213,.2);
  color: var(--color-text-subtle);
  font-size: 6px;
  letter-spacing: .12em;
  vertical-align: middle;
}
.meta-badge { color: var(--color-warning); border-color: rgb(var(--color-warning-rgb) / .26); background: rgb(var(--color-warning-rgb) / .07); }
.meta-badge[hidden], #nowArtist[hidden], #nowMeta[hidden] { display: none; }

.screen { position: relative; overflow: hidden; }
.tuning-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  background: rgb(var(--color-canvas-rgb) / .72);
  transition: opacity 90ms linear;
}
.tuning-overlay.active { opacity: 1; }
.tuning-noise {
  position: absolute;
  inset: -30%;
  opacity: .46;
  background:
    repeating-linear-gradient(0deg, rgba(220,240,242,.045) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 30% 20%, rgba(190,220,225,.10), transparent 25%),
    radial-gradient(circle at 70% 70%, rgba(190,220,225,.07), transparent 22%);
  animation: tuning-jitter 120ms steps(2,end) infinite;
}
.tuning-overlay[data-phase="scan"] .tuning-noise { opacity: .72; animation-duration: 70ms; }
.tuning-overlay[data-phase="lock"] .tuning-noise { opacity: .28; animation-duration: 160ms; }
.tuning-label {
  position: relative;
  z-index: 2;
  padding: 9px 12px;
  border: 1px solid rgb(var(--color-accent-rgb) / .26);
  background: rgb(var(--color-canvas-rgb) / .7);
  color: var(--color-knob);
  font-size: 8px;
  letter-spacing: .22em;
  text-transform: uppercase;
}
@keyframes tuning-jitter { 0% { transform: translate(-1%,0) scale(1.02); } 50% { transform: translate(1%,1%) scale(1.03); } 100% { transform: translate(0,-1%) scale(1.02); } }

.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.setting-row {
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 13px;
  border: 1px solid rgb(var(--color-line-rgb) / .11);
  background: rgb(var(--color-screen-rgb) / .55);
  cursor: pointer;
}
.setting-row b { display: block; color: var(--color-text-strong); font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.setting-row small { display: block; margin-top: 5px; color: var(--color-text-muted); font-size: 9px; line-height: 1.5; }
.setting-row input[type="checkbox"] {
  appearance: none;
  width: 42px;
  height: 24px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-panel-raised);
  position: relative;
  cursor: pointer;
}
.setting-row input[type="checkbox"]::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  left: 3px;
  top: 3px;
  background: #687a7f;
  transition: transform 130ms ease, background 130ms ease;
}
.setting-row input[type="checkbox"]:checked { border-color: var(--color-border-strong); background: var(--color-panel-hover); }
.setting-row input[type="checkbox"]:checked::after { transform: translateX(18px); background: var(--color-knob); }
.settings-actions { display: flex; gap: 8px; margin-top: 12px; }
.settings-actions > * { flex: 1 1 0; }
.settings-note { margin: 12px 0 0; color: var(--color-text-muted); font-size: 9px; line-height: 1.5; }
.install-btn:disabled { opacity: .45; cursor: default; }

.future-game {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background: var(--color-page);
}
.future-game[open] { display: grid; }
.future-game::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .38;
  background: radial-gradient(circle at 50% 20%, #3a251e 0, transparent 38%), linear-gradient(145deg,#0e1114,#040506 70%);
}
body[data-game="vc"] .future-game::before { background: radial-gradient(circle at 50% 20%, #7d2874 0, transparent 42%), linear-gradient(145deg,#151326,#05050a 70%); }
body[data-game="gta4"] .future-game::before { background: radial-gradient(circle at 50% 20%, #52606e 0, transparent 42%), linear-gradient(145deg,#101316,#020304 70%); }
body[data-game="gta5"] .future-game::before { background: radial-gradient(circle at 50% 20%, #356144 0, transparent 42%), linear-gradient(145deg,#111813,#030503 70%); }
.future-game-card { position: relative; z-index: 2; width: min(620px,100%); padding: 38px; border: 1px solid rgba(235,240,240,.19); background: rgba(5,7,8,.83); box-shadow: 0 35px 110px rgb(var(--color-shadow-rgb) / .7); text-align: center; }
.future-game-card h2 { margin: 9px 0 12px; font-family: 'Diploma', Georgia, serif; font-size: clamp(42px,9vw,76px); font-weight: 400; }
.future-game-card p { margin: 0 auto 24px; max-width: 520px; color: var(--color-text-subtle); font-size: 10px; line-height: 1.7; }
.future-kicker { color: var(--color-text-subtle); font-size: 8px; letter-spacing: .22em; }

@media (display-mode: standalone) {
  .legal { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  body::after { content: ''; position: fixed; left:0; right:0; bottom:0; height: env(safe-area-inset-bottom); background:var(--color-page); z-index:100; pointer-events:none; }
}

@media (max-width: 940px) {
  .settings-grid { grid-template-columns: 1fr; }
  .game-select-wrap, .language-select-wrap { min-height: 44px; }
}

@media (max-width: 680px) {
  .top-actions { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .game-select-wrap, .language-select-wrap { grid-column: 1 / -1; width: 100%; justify-content: space-between; }
  .game-select-wrap select, .language-select-wrap select { flex: 1 1 auto; max-width: none; text-align: right; }
  .radio-dialog { width: calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); max-height: min(86dvh, 760px); }
  .radio-dialog .help-head { padding: 16px; }
  .radio-dialog .help-head::after { left: 16px; right: 16px; }
  .radio-dialog h2 { font-size: 29px; }
  .radio-dialog .dialog-body { max-height: calc(min(86dvh, 760px) - 76px); padding: 16px; }
  .help-dialog p { font-size: 10px; }
  .settings-grid { gap: 7px; }
  .setting-row { min-height: 62px; }
  .settings-actions { flex-direction: column; }
  .future-game-card { padding: 28px 20px; }
  .meta-badge { margin-left: 4px; padding-inline: 4px; }
}

@media (max-width: 420px) {
  .top-actions { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .game-select-wrap, .language-select-wrap { grid-column: 1 / -1; }
  .menu-btn#fullscreenBtn { display: none; }
  .setting-row { gap: 9px; padding: 11px 10px; }
  .setting-row small { font-size: 9px; }
  .future-game-card h2 { font-size: 44px; }
}

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

/* Legibility: preserve the radio typography while giving controls and metadata room to grow. */
.brand-sub, .model, .channel, #stationGenre,
.now-kicker, #nowArtist, #nowMeta, .live-clock small,
.source-readout, .tuner-sub, .swipe-hint, .wheel-item span,
.volume-wrap, .on-air, .tuning-label, .future-kicker {
  font-size: .6875rem;
  line-height: 1.45;
  letter-spacing: .06em;
}
.menu-btn, .file-btn, .secondary-btn, .help-close,
.game-select-wrap, .language-select-wrap,
.game-select-wrap select, .language-select-wrap select {
  font-size: .75rem;
  line-height: 1.3;
  letter-spacing: .04em;
}
.menu-btn, .file-btn, .secondary-btn, .help-close { padding-block: 8px; }
.brand-sub { white-space: normal; overflow: visible; text-overflow: clip; }
.signal-state { font-size: .75rem; line-height: 1.3; letter-spacing: .04em; }
#stationName { overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.05; }
.now-playing { grid-template-columns: 86px minmax(0, 1fr) auto; align-items: start; }
.on-air { min-height: 42px; height: auto; padding: 7px 4px; text-align: center; }
.now-kicker { color: var(--color-text-secondary); }
.meta-badge { font-size: .625rem; line-height: 1.25; letter-spacing: .04em; }
#nowTitle { font-size: 1rem; line-height: 1.35; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
#nowArtist, #nowMeta { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
#nowArtist { color: var(--color-text-control); }
#nowMeta { color: var(--color-text-secondary); }
.live-clock small { color: var(--color-text-secondary); }
.source-readout { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.wheel-item { height: auto; min-height: 180px; }
.wheel-item span { overflow-wrap: anywhere; }
.strip-station { flex-basis: 100px; min-height: 90px; }
.strip-station b { font-size: .625rem; line-height: 1.25; overflow-wrap: anywhere; }
.help-dialog p, .future-game-card p { font-size: .875rem; line-height: 1.65; }
.legal { color: var(--color-text-muted); font-size: .75rem; line-height: 1.6; }
.toast { font-size: .75rem; line-height: 1.4; }
.setting-row b { font-size: .75rem; line-height: 1.4; letter-spacing: .04em; }
.setting-row small, .settings-note { font-size: .8125rem; line-height: 1.5; }
.setting-row > span { min-width: 0; overflow-wrap: anywhere; }
.settings-actions > * { white-space: normal; }

.sleep-timer-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgb(var(--color-line-rgb) / .2);
  background: rgb(var(--color-screen-rgb) / .65);
  color: var(--color-text-strong);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
}
.sleep-timer-indicator[hidden] { display: none; }
.sleep-timer-cancel {
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid rgb(var(--color-line-rgb) / .25);
  background: var(--color-panel-raised);
  color: var(--color-text-strong);
  cursor: pointer;
  font: inherit;
}
.sleep-timer-cancel:hover { border-color: rgb(var(--color-line-rgb) / .6); color: var(--color-white); }
.sleep-timer-cancel:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.sleep-timer-settings { margin-top: 18px; padding-top: 17px; border-top: 1px solid rgb(var(--color-line-rgb) / .18); }
.sleep-timer-settings h3 { margin: 0; color: var(--color-text-strong); font-size: .875rem; font-weight: 700; }
.sleep-timer-settings > p { margin: 5px 0 12px; color: var(--color-text-muted); font-size: .8125rem; line-height: 1.5; }
.sleep-timer-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sleep-timer-options .secondary-btn { min-width: 0; }
.sleep-timer-options .secondary-btn:disabled { opacity: .45; cursor: default; }
.sleep-timer-settings .sleep-timer-status { margin: 10px 0 0; color: var(--color-text-strong); font-variant-numeric: tabular-nums; }
@media (max-width: 680px) {
  .sleep-timer-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .console-grid { grid-template-columns: minmax(0, 1fr); }
  .receiver, .tuner, .station-strip { min-width: 0; }
  .station-strip { max-width: 100%; }
  .model { flex: 1 1 auto; min-width: 0; max-width: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .receiver-head { align-items: flex-start; }
  .signal-state { flex: 0 0 auto; }
  #stationName.long-name { font-size: clamp(18px, 6vw, 38px); letter-spacing: .01em; white-space: nowrap; }
  .now-playing { grid-template-columns: 70px minmax(0, 1fr); }
  .on-air { min-height: 40px; }
  .tuner-head { flex-wrap: wrap; }
  .tuner-sub { text-align: left; }
  .wheel-item.active span {
    position: relative;
    left: 50%;
    width: max-content;
    max-width: 220px;
    margin-top: 4px;
    transform: translateX(-50%);
    font-size: .625rem;
    white-space: nowrap;
    overflow-wrap: normal;
  }
  .strip-station { flex-basis: 132px; min-height: 94px; }
  .strip-station b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .file-btn, .secondary-btn { min-height: 48px; }
}

@media (max-width: 420px) {
  .now-playing { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .on-air { justify-self: start; min-width: 80px; }
}

/* Compact navigation: preferences and secondary actions share one disclosure. */
.top-actions { display: flex; flex-wrap: nowrap; align-items: center; }
.top-actions .game-select-wrap { width: auto; min-width: 0; }
.top-actions .game-select-wrap select { min-width: 0; }
.top-menu-wrap { position: relative; flex: 0 0 auto; }
.menu-toggle { display: flex; align-items: center; gap: 10px; }
.menu-toggle svg, .mute-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.top-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 230px; max-width: calc(100vw - 32px); padding: 6px; background: var(--color-menu); border: 1px solid var(--color-border); }
.top-menu[hidden] { display: none; }
.top-menu .menu-btn { display: block; width: 100%; min-height: 44px; text-align: left; border: 0; padding: 12px; }
.top-menu .menu-btn:hover, .top-menu .menu-btn:focus-visible { background: var(--color-panel-interactive); }
.top-menu .menu-btn#fullscreenBtn { display: block; }
.menu-toggle { min-height: 44px; }
.settings-dialog .language-select-wrap { display: flex; justify-content: space-between; margin-bottom: 18px; }
.mute-btn { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; color: var(--color-text-strong); background: transparent; border: 1px solid var(--color-border); cursor: pointer; }
.mute-btn:hover { color: var(--color-white); background: var(--color-panel-interactive); }
.mute-btn:focus-visible, .menu-toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.mute-btn .sound-off, .mute-btn[aria-pressed="true"] .sound-waves { display: none; }
.mute-btn[aria-pressed="true"] .sound-off { display: block; }
@media (max-width: 680px) {
  .top-actions .game-select-wrap { flex: 1 1 auto; }
  .top-actions .game-select-wrap select { width: 0; flex: 1 1 auto; }
}


/* Keep transport controls together at every screen size. */
.control-deck {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
}
.transport-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.transport-controls .control-btn { flex: 0 0 auto; width: 56px; height: 52px; }
.transport-controls .play-btn { width: 80px; height: 68px; }
.control-deck > .volume-wrap {
  display: flex;
  align-items: center;
  width: min(100%, 300px);
  max-width: none;
  gap: 12px;
}
.control-deck #volume { flex: 1 1 auto; width: 0; min-width: 0; max-width: none; }
.control-deck #volumeText { flex: 0 0 48px; width: 48px; font-variant-numeric: tabular-nums; }
.now-copy .source-readout { display: block; max-width: none; margin-top: 8px; color: var(--color-text-muted); }
@media (max-width: 680px) {
  .control-deck { gap: 14px; margin-top: 20px; }
  .transport-controls { gap: 18px; }
  .transport-controls .play-btn { width: 76px; height: 64px; }
}

/* TV listening view. Viewport units preserve the composition from 1080p to 4K. */
body.lounge-open { overflow: hidden; }
.lounge-player {
  --lounge-tone: var(--color-lounge-tone-0);
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: auto;
  background: var(--color-lounge-bg);
  color: var(--color-lounge-text);
  font-family: 'BankGothic Md BT', sans-serif;
}
.lounge-player::backdrop { background: var(--color-lounge-bg); }
.lounge-player [hidden] { display: none !important; }
.lounge-scenery {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background-color: var(--lounge-tone);
  background-image: linear-gradient(170deg, transparent, var(--color-screen) 75%);
  transition: background-color 1s ease;
}
.lounge-scenery::after {
  content: '';
  position: absolute;
  inset: -18%;
  opacity: .22;
  background: radial-gradient(ellipse at 28% 35%, rgba(188, 218, 189, .34), transparent 30%), radial-gradient(ellipse at 78% 62%, rgba(213, 170, 105, .22), transparent 34%);
  transform: scale(1);
  transform-origin: 50% 50%;
  animation: lounge-ambient-drift 42s ease-in-out infinite alternate;
  animation-play-state: paused;
  transition: opacity 1s ease;
}
.lounge-player[data-playing="true"] .lounge-scenery::after { animation-play-state: running; }
@keyframes lounge-ambient-drift {
  0% { transform: translate3d(-2%, -1%, 0) scale(1); opacity: .16; }
  50% { transform: translate3d(2%, 1%, 0) scale(1.08); opacity: .24; }
  100% { transform: translate3d(-1%, 2%, 0) scale(1.03); opacity: .19; }
}
.lounge-scenery .skyline { height: 38%; opacity: .3; }
.lounge-content {
  position: relative;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 2vh;
  padding: 5vh 5vw;
  transition: opacity 2s ease;
}
.lounge-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.lounge-brand { display: flex; align-items: center; gap: clamp(8px, 1vw, 24px); min-width: 0; }
.lounge-brand .gta-logo { width: clamp(60px, 7vw, 130px); flex: 0 0 auto; font-size: clamp(22px, 2.8vw, 48px); }
.lounge-brand .gta-logo span { height: .67em; }
.lounge-brand-script { font-family: 'Diploma', serif; font-size: clamp(26px, 3vw, 60px); line-height: 1; white-space: nowrap; }
#loungeClock { font-size: clamp(20px, 1.8vw, 72px); font-variant-numeric: tabular-nums; color: var(--color-lounge-muted); }
.lounge-hero { display: grid; grid-template-columns: 40% minmax(0, 1fr); align-items: center; gap: 4vw; padding: 2vh 0; }
.lounge-art { display: flex; align-items: center; justify-content: center; min-width: 0; }
#loungeLogo { display: block; width: 90%; height: 33vh; object-fit: contain; }
.lounge-copy { min-width: 0; }
#loungeStation { margin: 0; font-size: clamp(32px, 4.6vw, 176px); line-height: 1.08; font-weight: 400; overflow-wrap: anywhere; text-wrap: balance; }
.lounge-genre { margin: 1.6vh 0 0; color: var(--color-lounge-muted); font-size: clamp(16px, 1.5vw, 58px); line-height: 1.4; }
.lounge-status { margin: 1.8vh 0 0; color: var(--color-lounge-gold); font-size: clamp(14px, 1.2vw, 46px); line-height: 1.4; }
.lounge-status-row { display: flex; align-items: center; gap: 1.2vw; min-height: 3.5vh; }
.lounge-status-row .lounge-status { margin-bottom: 0; }
.lounge-meter { display: inline-flex; align-items: end; gap: .28vw; width: clamp(38px, 4vw, 150px); height: clamp(22px, 2.4vw, 88px); opacity: .28; transition: opacity .6s ease; }
.lounge-meter.is-active { opacity: .9; }
.lounge-meter i { display: block; width: 13%; height: 100%; background: var(--color-lounge-accent); transform: scaleY(var(--meter-scale, .18)); transform-origin: bottom; transition: transform .12s ease-out; }
.lounge-meter i:nth-child(2) { background: var(--color-lounge-gold); }
.lounge-meter i:nth-child(4) { background: var(--color-lounge-gold); }
.lounge-track { margin-top: 3vh; }
#loungeTitle { margin: 0; font-family: Arial, sans-serif; font-size: clamp(22px, 2.6vw, 100px); line-height: 1.15; text-wrap: balance; overflow-wrap: anywhere; }
#loungeArtist { margin: 1vh 0; font-family: Arial, sans-serif; font-size: clamp(18px, 1.8vw, 70px); color: var(--color-lounge-muted); overflow-wrap: anywhere; }
#loungeEstimate, #loungeSleep { font-size: clamp(12px, 1vw, 38px); color: var(--color-lounge-muted); }
.lounge-drawer {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition: grid-template-rows .65s cubic-bezier(.22, 1, .36, 1), opacity .35s ease .12s, visibility 0s;
}
.lounge-drawer-inner { min-height: 0; overflow: hidden; padding-inline: 1vw; }
.lounge-carousel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; width: min(76vw, 100%); gap: 2vw; margin: 0 auto; }
.lounge-station {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7vh;
  min-width: 0;
  min-height: 44px;
  padding: 1vh .5vw;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--color-lounge-muted);
  font: inherit;
  cursor: pointer;
  transition: opacity .35s ease, transform .35s ease;
}
.lounge-station img { width: 100%; height: 7vh; object-fit: contain; opacity: .55; transition: opacity .35s ease; }
.lounge-station span { font-size: clamp(12px, 1vw, 38px); line-height: 1.2; overflow-wrap: anywhere; }
.lounge-station small { min-height: 1.2em; color: var(--color-lounge-gold); font-size: clamp(10px, .7vw, 28px); }
.lounge-station.is-selected { color: var(--color-white); border-bottom-color: var(--color-lounge-accent); transform: scale(1.12); }
.lounge-station.is-selected img, .lounge-station:hover img { opacity: 1; }
.lounge-controls { display: flex; align-items: center; justify-content: center; gap: 1.2vw; margin-top: 2vh; }
.lounge-controls button { display: inline-flex; align-items: center; justify-content: center; min-height: max(44px, 4.8vh); padding: .7vh 1vw; border: 1px solid var(--color-border-strong); background: var(--color-lounge-control); color: var(--color-lounge-text); font: inherit; font-size: clamp(12px, 1vw, 38px); cursor: pointer; }
.lounge-controls button:hover { background: var(--color-lounge-hover); }
.lounge-controls svg { width: clamp(22px, 1.8vw, 68px); height: clamp(22px, 1.8vw, 68px); }
#loungePlay svg { fill: currentColor; }
#loungeMute svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lounge-pause-icon, .lounge-sound-off, [data-playing="true"] .lounge-play-icon { display: none; }
[data-playing="true"] .lounge-pause-icon { display: block; }
#loungeMute[aria-pressed="true"] .lounge-sound-on { display: none; }
#loungeMute[aria-pressed="true"] .lounge-sound-off { display: block; }
#loungeVolume { width: 12vw; min-width: 70px; height: max(44px, 4vh); accent-color: var(--color-lounge-accent); cursor: pointer; }
#loungeVolumeText { min-width: 4em; font-size: clamp(12px, 1vw, 38px); font-variant-numeric: tabular-nums; }
.lounge-hint { margin: 1.5vh 0 0; text-align: center; color: var(--color-lounge-muted); font-size: clamp(12px, .9vw, 34px); }
.lounge-player :is(button, input):focus-visible { outline: max(3px, .2vw) solid var(--color-lounge-focus); outline-offset: max(4px, .3vw); }
.lounge-player.is-idle { cursor: none; }
.lounge-player.is-idle .lounge-drawer {
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: grid-template-rows .65s cubic-bezier(.22, 1, .36, 1), opacity .2s ease, visibility 0s .65s;
}
.lounge-player.is-dimmed .lounge-content { opacity: .65; }
@media (max-aspect-ratio: 1/1) {
  .lounge-content { gap: 20px; padding: 5vh 6vw; }
  .lounge-hero { grid-template-columns: 1fr; gap: 20px; text-align: center; }
  #loungeLogo { height: 22vh; }
  #loungeStation { font-size: clamp(28px, 7vw, 70px); }
  .lounge-carousel { width: 100%; gap: 8px; }
  .lounge-station img { height: 6vh; }
  .lounge-station span { font-size: 10px; }
  .lounge-station small { font-size: 9px; }
  .lounge-controls { flex-wrap: wrap; gap: 10px; }
  #loungeVolume { width: 25vw; }
  .lounge-hint { line-height: 1.7; }
}
@media (max-width: 480px) {
  .lounge-content {
    gap: 10px;
    padding: max(16px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
      max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }
  .lounge-header { gap: 8px; }
  .lounge-brand { gap: 6px; }
  .lounge-brand .gta-logo { width: 50px; font-size: 18px; }
  .lounge-brand .gta-logo span { height: 12px; }
  .lounge-brand-script { font-size: 20px; }
  #loungeClock { font-size: 18px; }
  .lounge-hero { gap: 8px; padding: 0; }
  #loungeLogo { height: 17vh; min-height: 100px; }
  #loungeStation { font-size: clamp(20px, 6vw, 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #loungeStation.long-name { font-size: clamp(16px, 5vw, 24px); }
  .lounge-genre { margin-top: 6px; font-size: 13px; }
  .lounge-status { margin-top: 8px; font-size: 13px; }
  .lounge-carousel { position: relative; padding-bottom: 24px; }
  .lounge-station img { height: 40px; }
  .lounge-station.is-selected { transform: none; }
  .lounge-station span, .lounge-station small { display: none; }
  .lounge-station.is-selected span {
    position: absolute;
    top: calc(100% - 20px);
    left: 0;
    display: block;
    width: 100%;
    color: var(--color-text);
    font-size: 12px;
    white-space: nowrap;
    text-align: center;
  }
  .lounge-controls { gap: 8px; margin-top: 8px; }
  .lounge-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lounge-player *, .lounge-content { transition: none !important; transform: none !important; animation: none !important; }
  .lounge-meter i { height: 18%; }
}

.lounge-header, .lounge-hero { transform: translate(var(--lounge-shift-x, 0px), var(--lounge-shift-y, 0px)); }
