:root {
  color-scheme: dark;
  --bg: #040506;
  --screen: #071019;
  --screen-deep: #03070c;
  --panel: rgba(11, 18, 27, 0.88);
  --line: rgba(226, 215, 190, 0.18);
  --line-strong: rgba(244, 201, 93, 0.52);
  --text: #f5f3ee;
  --muted: #9ca7b3;
  --dim: #65717d;
  --gold: #f4c95d;
  --amber: #ffad45;
  --orange: #ff6136;
  --blue: #1d6cff;
  --danger: #ff8a8a;
  --shadow: 0 34px 110px rgba(0, 0, 0, 0.62);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0%, rgba(244, 201, 93, 0.16), transparent 27rem),
    linear-gradient(180deg, #1a140f 0%, #050607 36%, #020304 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 5rem 5rem;
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 75%, transparent);
}

button {
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 3px solid rgba(244, 201, 93, 0.78);
  outline-offset: 4px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(0.8rem, 3vw, 2rem);
  overflow: hidden;
}

.console-frame {
  position: relative;
  width: min(100%, 82rem);
  min-height: min(45rem, calc(100vh - 2rem));
  border-radius: 3.8rem;
  padding: clamp(1.1rem, 2.4vw, 2rem);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.04) 18%, rgba(0, 0, 0, 0.8) 72%),
    linear-gradient(180deg, #17110d, #070708 45%, #15110d);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.console-frame::before {
  content: "";
  position: absolute;
  inset: 0.45rem;
  border-radius: 3.35rem;
  border: 1px solid rgba(244, 201, 93, 0.24);
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 2.2rem rgba(255, 255, 255, 0.05);
}

.leather-band {
  position: absolute;
  left: 2rem;
  right: 2rem;
  top: 0.55rem;
  height: 4.5rem;
  border-radius: 3rem 3rem 0 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 0.45rem, rgba(244, 201, 93, 0.7) 0.45rem 0.55rem, transparent 0.55rem 1rem),
    linear-gradient(180deg, rgba(88, 65, 42, 0.9), rgba(18, 14, 11, 0.28));
  background-position: 0 2.9rem, 0 0;
  background-size: auto, auto;
  opacity: 0.5;
  pointer-events: none;
}

.ambient-light {
  position: absolute;
  left: 3rem;
  right: 3rem;
  bottom: 2.15rem;
  height: 0.32rem;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #0c55ff 16%, #37a0ff 48%, #0c55ff 82%, transparent);
  box-shadow: 0 0 1.2rem rgba(29, 108, 255, 0.85), 0 0 3rem rgba(29, 108, 255, 0.35);
}

.console-inner {
  position: relative;
  min-height: inherit;
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 2vw, 1.8rem);
  padding: clamp(1rem, 2vw, 1.7rem);
  border-radius: 2.8rem;
  background:
    radial-gradient(circle at 8% 50%, rgba(244, 201, 93, 0.08), transparent 8rem),
    linear-gradient(180deg, rgba(0, 0, 0, 0.88), rgba(3, 4, 6, 0.94));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.dashboard-clock {
  display: grid;
  place-items: center;
}

.clock-face {
  position: relative;
  width: 7.7rem;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 0.22rem solid rgba(244, 201, 93, 0.34);
  background:
    radial-gradient(circle, rgba(244, 201, 93, 0.14) 0 0.25rem, transparent 0.28rem),
    radial-gradient(circle at 50% 50%, #101012, #020303 73%);
  box-shadow:
    0 0 1.2rem rgba(244, 201, 93, 0.14),
    inset 0 0 0 0.55rem rgba(255, 255, 255, 0.04);
}

.tick {
  position: absolute;
  color: #f5d884;
  font-size: 1.15rem;
  font-weight: 700;
}

.tick-12 {
  left: 50%;
  top: 0.45rem;
  transform: translateX(-50%);
}

.tick-3 {
  right: 0.78rem;
  top: 50%;
  transform: translateY(-50%);
}

.tick-6 {
  left: 50%;
  bottom: 0.42rem;
  transform: translateX(-50%);
}

.tick-9 {
  left: 0.78rem;
  top: 50%;
  transform: translateY(-50%);
}

.hand {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.14rem;
  transform-origin: 50% 100%;
  border-radius: 999px;
  background: #f7e3b0;
  box-shadow: 0 0 0.4rem rgba(244, 201, 93, 0.45);
}

.hour-hand {
  height: 2.1rem;
  transform: translate(-50%, -100%) rotate(300deg);
}

.minute-hand {
  height: 3rem;
  transform: translate(-50%, -100%) rotate(52deg);
}

.second-hand {
  width: 0.08rem;
  height: 3.28rem;
  background: linear-gradient(#ff7a3a, #f4c95d);
  transform: translate(-50%, -100%) rotate(0deg);
  box-shadow: 0 0 0.55rem rgba(255, 122, 58, 0.7);
}

.clock-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--amber);
  transform: translate(-50%, -50%);
}

.hmi-screen {
  position: relative;
  min-height: 30rem;
  display: grid;
  grid-template-columns: 5.8rem minmax(18rem, 0.75fr) minmax(24rem, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.05rem;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent 18%, transparent 80%, rgba(255, 255, 255, 0.04)),
    radial-gradient(circle at 75% 16%, rgba(29, 108, 255, 0.12), transparent 22rem),
    linear-gradient(135deg, #07101a 0%, #02060a 100%);
  box-shadow:
    0 0 0 0.35rem rgba(0, 0, 0, 0.7),
    0 1.2rem 4rem rgba(0, 0, 0, 0.65),
    inset 0 0 5rem rgba(0, 0, 0, 0.48);
}

.icon-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  padding: 1.4rem 0;
  border-right: 1px solid var(--line);
  background: rgba(2, 7, 12, 0.5);
}

.rail-icon {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 0.6rem;
  color: rgba(245, 243, 238, 0.72);
  font-size: 1.55rem;
}

.rail-icon.active {
  color: var(--gold);
  text-shadow: 0 0 1rem rgba(244, 201, 93, 0.65);
}

.preset-panel {
  padding: clamp(1.4rem, 2.6vw, 2.4rem);
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(2, 7, 12, 0.28);
}

.preset-panel h2 {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: clamp(1rem, 2vw, 1.22rem);
  font-weight: 500;
}

.preset-list {
  display: grid;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.preset-item {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  align-items: center;
  min-height: 4.65rem;
  padding: 0 1.05rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(245, 243, 238, 0.82);
}

.preset-trigger {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 100%;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
}

.preset-trigger:hover {
  color: var(--gold);
}

.preset-trigger:focus-visible {
  outline: 2px solid rgba(244, 201, 93, 0.72);
  outline-offset: 0.2rem;
}

.preset-number {
  color: rgba(245, 243, 238, 0.66);
  font-size: 1.55rem;
}

.preset-name {
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-item.selected {
  position: relative;
  border: 1px solid rgba(244, 201, 93, 0.82);
  border-radius: 0.55rem;
  color: var(--amber);
  background:
    linear-gradient(90deg, rgba(244, 201, 93, 0.16), rgba(244, 201, 93, 0.04)),
    rgba(0, 0, 0, 0.2);
  box-shadow:
    0 0 1.3rem rgba(244, 201, 93, 0.12),
    inset 0 0 1.3rem rgba(244, 201, 93, 0.08);
}

.preset-item.selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  bottom: 0.55rem;
  width: 0.22rem;
  border-radius: 999px;
  background: linear-gradient(var(--orange), var(--gold));
  box-shadow: 0 0 0.8rem rgba(255, 173, 69, 0.82);
}

.preset-item.selected .preset-number,
.preset-item.selected .preset-name {
  color: var(--amber);
}

body.is-secret-tuned #smgPresetItem {
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(245, 243, 238, 0.72);
  background: transparent;
  box-shadow: none;
}

body.is-secret-tuned #smgPresetItem::before {
  opacity: 0;
}

body.is-secret-tuned #smgPresetItem .preset-number,
body.is-secret-tuned #smgPresetItem .preset-name {
  color: rgba(245, 243, 238, 0.72);
}

body.is-secret-tuned #zundaPresetItem {
  position: relative;
  border: 1px solid rgba(160, 231, 90, 0.82);
  border-radius: 0.55rem;
  color: #b7f36b;
  background:
    linear-gradient(90deg, rgba(160, 231, 90, 0.15), rgba(244, 201, 93, 0.04)),
    rgba(0, 0, 0, 0.2);
  box-shadow:
    0 0 1.3rem rgba(160, 231, 90, 0.14),
    inset 0 0 1.3rem rgba(160, 231, 90, 0.08);
}

body.is-secret-tuned #zundaPresetItem::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  bottom: 0.55rem;
  width: 0.22rem;
  border-radius: 999px;
  background: linear-gradient(#b7f36b, var(--gold));
  box-shadow: 0 0 0.8rem rgba(160, 231, 90, 0.72);
}

body.is-secret-tuned #zundaPresetItem .preset-number,
body.is-secret-tuned #zundaPresetItem .preset-name {
  color: #b7f36b;
}

.mini-spectrum {
  display: inline-grid;
  grid-template-columns: repeat(6, 0.18rem);
  align-items: end;
  gap: 0.16rem;
  height: 1.35rem;
}

.mini-spectrum i {
  display: block;
  border-radius: 999px;
  background: linear-gradient(var(--gold), var(--orange));
  box-shadow: 0 0 0.45rem rgba(244, 201, 93, 0.5);
}

.mini-spectrum i:nth-child(1) { height: 35%; }
.mini-spectrum i:nth-child(2) { height: 55%; }
.mini-spectrum i:nth-child(3) { height: 75%; }
.mini-spectrum i:nth-child(4) { height: 100%; }
.mini-spectrum i:nth-child(5) { height: 68%; }
.mini-spectrum i:nth-child(6) { height: 48%; }

.now-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  padding: clamp(1.35rem, 2.6vw, 2.4rem);
  overflow: hidden;
}

.now-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.system-state {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0 0.55rem;
  border: 1px solid rgba(244, 201, 93, 0.3);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(244, 201, 93, 0.08);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0.35rem 0 0;
  color: #f8f6f1;
  font-size: clamp(2.6rem, 5.1vw, 4.35rem);
  line-height: 0.95;
  font-weight: 600;
  text-shadow: 0 0 1.8rem rgba(255, 255, 255, 0.12);
}

.station-code-letter {
  display: inline-block;
  padding: 0 0.01em;
  border-radius: 0.12em;
  color: inherit;
  background: transparent;
  font: inherit;
  line-height: inherit;
  text-shadow: inherit;
  transition: color 160ms ease, text-shadow 160ms ease, transform 160ms ease;
}

.station-code-letter:hover,
.station-code-letter.is-armed {
  color: var(--gold);
  text-shadow: 0 0 1rem rgba(244, 201, 93, 0.74);
}

.station-code-letter:active {
  transform: translateY(0.03em) scale(0.98);
}

.station-code-letter:focus-visible {
  outline: 2px solid rgba(244, 201, 93, 0.72);
  outline-offset: 0.06em;
}

.station-name-tail {
  display: inline-block;
}

.stereo-cluster {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.1rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.stereo-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 1rem rgba(244, 201, 93, 0.8);
}

.signal-bars {
  display: inline-grid;
  grid-template-columns: repeat(4, 0.28rem);
  align-items: end;
  gap: 0.18rem;
  height: 1.45rem;
  margin-left: 0.5rem;
}

.signal-bars i {
  display: block;
  border-radius: 999px;
  background: rgba(245, 243, 238, 0.8);
}

.signal-bars i:nth-child(1) { height: 34%; }
.signal-bars i:nth-child(2) { height: 52%; }
.signal-bars i:nth-child(3) { height: 72%; }
.signal-bars i:nth-child(4) { height: 100%; }

.broadcast-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.wave-rings {
  position: absolute;
  right: 10%;
  top: 12%;
  width: 12rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, rgba(244, 201, 93, 0.22) 0 1px, transparent 1px 1.1rem);
  opacity: 0.62;
}

.radio-tower {
  position: absolute;
  right: 16%;
  top: 31%;
  width: 3.2rem;
  height: 7rem;
  transform: translateY(-30%);
}

.radio-tower::before,
.radio-tower::after,
.radio-tower span {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0.12rem;
  height: 100%;
  background: rgba(245, 243, 238, 0.72);
  transform-origin: bottom;
}

.radio-tower::before {
  transform: translateX(-50%) rotate(-18deg);
}

.radio-tower::after {
  transform: translateX(-50%) rotate(18deg);
}

.radio-tower span {
  height: 86%;
  transform: translateX(-50%);
}

.dot-field {
  position: absolute;
  right: 3%;
  top: 42%;
  width: 64%;
  height: 9rem;
  opacity: 0.45;
  background-image:
    radial-gradient(circle, rgba(255, 173, 69, 0.78) 0 1px, transparent 1px),
    radial-gradient(circle, rgba(29, 108, 255, 0.7) 0 1px, transparent 1px);
  background-size: 1rem 0.72rem, 1.35rem 0.9rem;
  background-position: 0 0, 0.3rem 2.5rem;
  mask-image: radial-gradient(ellipse at center, #000 0 30%, transparent 75%);
}

.program-panel {
  position: relative;
  z-index: 1;
  align-self: end;
  padding-top: clamp(4rem, 8vw, 7rem);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.program-label {
  margin: 0 0 0.65rem;
  color: var(--gold);
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  font-weight: 700;
}

.program-panel h2 {
  min-height: 2.5rem;
  margin: 0;
  color: #f5f3ee;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.18;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.progress-console {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(7rem, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.7rem;
}

.time-code {
  min-width: 4.9rem;
  color: rgba(245, 243, 238, 0.75);
  font-size: clamp(0.95rem, 2.2vw, 1.3rem);
  font-variant-numeric: tabular-nums;
}

.time-code:last-child {
  text-align: right;
}

.progress-track {
  position: relative;
  height: 0.46rem;
  overflow: visible;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--amber), var(--gold));
  box-shadow: 0 0 0.9rem rgba(255, 173, 69, 0.44);
  transition: width 260ms ease;
}

.progress-knob {
  position: absolute;
  left: var(--progress-left, 0%);
  top: 50%;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe8a3, var(--gold));
  box-shadow: 0 0 1rem rgba(244, 201, 93, 0.68);
  transform: translate(-50%, -50%);
}

.console-controls {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(6rem, 1fr) minmax(8rem, 1.28fr) minmax(6rem, 1fr);
  align-items: center;
  gap: 0;
  margin-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.control-button,
.tuning-button {
  min-height: 5.6rem;
  background: transparent;
}

.control-button {
  display: grid;
  place-items: center;
  gap: 0.2rem;
  color: rgba(245, 243, 238, 0.76);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: color 160ms ease, background 160ms ease;
}

.control-button:hover {
  color: var(--gold);
  background: rgba(255, 255, 255, 0.035);
}

.control-icon {
  display: grid;
  place-items: center;
  font-size: 1.85rem;
  line-height: 1;
  min-height: 1.85rem;
}

.pause-icon {
  position: relative;
  width: 1.45rem;
  height: 1.45rem;
  border: 1px solid rgba(245, 243, 238, 0.36);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0.8rem rgba(255, 255, 255, 0.04),
    0 0 0.7rem rgba(244, 201, 93, 0.08);
}

.pause-icon::before,
.pause-icon::after {
  content: "";
  position: absolute;
  top: 0.38rem;
  bottom: 0.38rem;
  width: 0.22rem;
  border-radius: 999px;
  background: currentColor;
}

.pause-icon::before {
  left: 0.48rem;
}

.pause-icon::after {
  right: 0.48rem;
}

.control-button span:last-child {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.tuning-button {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 6.4rem;
  color: var(--gold);
  letter-spacing: 0.06em;
  font-weight: 700;
}

.knob-ring {
  position: absolute;
  width: 5.85rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, #07090c 0 48%, transparent 49%),
    conic-gradient(from 12deg, rgba(244, 201, 93, 0.18), var(--gold), rgba(255, 255, 255, 0.35), var(--amber), rgba(244, 201, 93, 0.16));
  box-shadow:
    0 0 1.4rem rgba(244, 201, 93, 0.2),
    inset 0 0 0 0.32rem rgba(0, 0, 0, 0.8);
}

.knob-ring::after {
  content: "";
  position: absolute;
  inset: 0.72rem;
  border-radius: 50%;
  border: 1px solid rgba(244, 201, 93, 0.38);
  box-shadow: inset 0 0 1.1rem rgba(244, 201, 93, 0.08);
}

.tuning-label {
  position: relative;
  z-index: 1;
  font-size: 1rem;
  text-shadow: 0 0 0.7rem rgba(244, 201, 93, 0.55);
}

body.is-listening .stereo-dot,
body.is-listening .signal-bars i,
body.is-listening .mini-spectrum i {
  animation: signalPulse 1.7s ease-in-out infinite;
}

body.is-listening .knob-ring {
  box-shadow:
    0 0 2.2rem rgba(244, 201, 93, 0.38),
    inset 0 0 0 0.32rem rgba(0, 0, 0, 0.8);
}

body.is-listening .hmi-screen {
  box-shadow:
    0 0 0 0.35rem rgba(0, 0, 0, 0.7),
    0 1.2rem 4rem rgba(0, 0, 0, 0.65),
    0 0 3rem rgba(244, 201, 93, 0.08),
    inset 0 0 5rem rgba(0, 0, 0, 0.48);
}

body.is-secret-tuned .program-label,
body.is-secret-tuned .stereo-cluster,
body.is-secret-tuned .system-state {
  color: #b7f36b;
}

body.is-secret-tuned .stereo-dot {
  background: #b7f36b;
  box-shadow: 0 0 1rem rgba(160, 231, 90, 0.75);
}

body.is-secret-tuned .progress-fill {
  background: linear-gradient(90deg, #75d65b, var(--gold), var(--amber));
  box-shadow: 0 0 0.9rem rgba(160, 231, 90, 0.38);
}

body.is-secret-tuned .wave-rings {
  background:
    repeating-radial-gradient(circle, rgba(160, 231, 90, 0.2) 0 1px, transparent 1px 1.1rem);
}

body.is-opening-special .program-label,
body.is-opening-special .stereo-cluster,
body.is-opening-special .system-state {
  color: var(--gold);
}

body.is-opening-special .stereo-dot {
  background: var(--gold);
  box-shadow: 0 0 1.25rem rgba(244, 201, 93, 0.86);
}

body.is-opening-special .progress-fill {
  background: linear-gradient(90deg, var(--orange), var(--amber), #ffe28a);
  box-shadow: 0 0 1rem rgba(244, 201, 93, 0.5);
}

body.is-opening-special .wave-rings {
  background:
    repeating-radial-gradient(circle, rgba(255, 173, 69, 0.22) 0 1px, transparent 1px 1.1rem);
}

body.is-opening-special .hmi-screen {
  box-shadow:
    0 0 0 0.35rem rgba(0, 0, 0, 0.7),
    0 1.2rem 4rem rgba(0, 0, 0, 0.65),
    0 0 3.2rem rgba(255, 173, 69, 0.1),
    inset 0 0 5rem rgba(0, 0, 0, 0.48);
}

.error-message {
  min-height: 1.4rem;
  margin: 0.5rem 0 0;
  color: var(--danger);
  font-size: 0.82rem;
  line-height: 1.4;
}

audio {
  display: none;
}

@keyframes signalPulse {
  0%, 100% {
    opacity: 0.64;
    filter: brightness(0.95);
  }
  50% {
    opacity: 1;
    filter: brightness(1.35);
  }
}

@media (max-width: 58rem) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .app-shell {
    min-height: 100dvh;
    min-height: 100svh;
    height: 100dvh;
    height: 100svh;
    align-items: stretch;
    padding: 0.45rem;
    overflow: hidden;
  }

  .console-frame {
    width: 100%;
    min-height: 0;
    height: 100%;
    border-radius: 1.15rem;
    padding: 0.45rem;
  }

  .console-frame::before,
  .leather-band {
    display: none;
  }

  .ambient-light {
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0.55rem;
    height: 0.22rem;
  }

  .console-inner {
    min-height: 0;
    height: 100%;
    grid-template-columns: 1fr;
    padding: 0.35rem;
    border-radius: 0.85rem;
  }

  .dashboard-clock {
    display: grid;
    position: absolute;
    top: 0.8rem;
    right: 1rem;
    z-index: 5;
    padding: 0;
    pointer-events: none;
  }

  .clock-face {
    width: 3.85rem;
    border-width: 0.16rem;
  }

  .tick {
    font-size: 0.68rem;
  }

  .hour-hand {
    height: 0.95rem;
  }

  .minute-hand {
    height: 1.35rem;
  }

  .second-hand {
    height: 1.52rem;
    width: 0.06rem;
  }

  .clock-pin {
    width: 0.48rem;
    height: 0.48rem;
  }

  .hmi-screen {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
    height: 100%;
    border-radius: 0.8rem;
  }

  .icon-rail {
    display: none;
  }

  .now-panel {
    order: 1;
    min-height: 0;
    padding: 0.85rem;
    overflow: hidden;
  }

  .preset-panel {
    order: 2;
    padding: 0.7rem 0.85rem 0.85rem;
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .preset-panel h2 {
    margin-bottom: 0.45rem;
    font-size: 0.92rem;
  }

  .preset-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.36rem;
  }

  .program-panel {
    padding-top: clamp(2.1rem, 12dvh, 4rem);
  }

  .broadcast-art {
    opacity: 0.55;
  }

  .wave-rings {
    right: 8%;
    top: 19%;
    width: 9rem;
  }

  .radio-tower {
    right: 17%;
    top: 35%;
    width: 2.6rem;
    height: 5.7rem;
  }

  .dot-field {
    top: 48%;
    height: 6rem;
  }

  .system-state {
    min-height: 1.35rem;
    font-size: 0.62rem;
  }

  h1 {
    font-size: clamp(2.05rem, 12vw, 3.1rem);
  }

  .program-label {
    margin-bottom: 0.42rem;
    font-size: 0.95rem;
  }

  .program-panel h2 {
    min-height: 0;
    font-size: clamp(1.55rem, 7vw, 2.1rem);
  }

  .stereo-cluster {
    font-size: 0.82rem;
    padding-right: 4.4rem;
  }

  .signal-bars {
    display: none;
  }

  .preset-item {
    min-height: 2.65rem;
    grid-template-columns: 1.55rem minmax(0, 1fr) auto;
    padding: 0 0.58rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.44rem;
  }

  .preset-trigger {
    grid-template-columns: 1.55rem minmax(0, 1fr) auto;
  }

  .preset-number {
    font-size: 1.05rem;
  }

  .preset-name {
    font-size: 0.92rem;
  }

  .mini-spectrum {
    grid-template-columns: repeat(5, 0.13rem);
    height: 0.9rem;
    gap: 0.1rem;
  }

  .mini-spectrum i:nth-child(6) {
    display: none;
  }

  .progress-console {
    grid-template-columns: 1fr 1fr;
    gap: 0.36rem;
    margin-top: 1rem;
  }

  .time-code {
    min-width: 0;
    order: 2;
    font-size: 0.98rem;
  }

  .time-code:last-child {
    text-align: right;
  }

  .progress-track {
    grid-column: 1 / -1;
    order: 1;
  }

  .console-controls {
    grid-template-columns: 1fr 1.1fr 1fr;
    margin-top: 0.75rem;
  }

  .control-button,
  .tuning-button {
    min-height: 3.85rem;
  }

  .knob-ring {
    width: 3.75rem;
  }

  .tuning-label {
    font-size: 0.78rem;
  }

  .control-icon {
    font-size: 1.28rem;
    min-height: 1.28rem;
  }

  .control-button span:last-child {
    font-size: 0.66rem;
  }

  .error-message {
    margin-top: 0.35rem;
    font-size: 0.7rem;
    min-height: 0;
  }
}

@media (max-width: 30rem) {
  .now-topline {
    display: flex;
  }

  .console-controls {
    gap: 0.25rem;
  }

  .control-button span:last-child {
    font-size: 0.68rem;
  }

  .control-icon {
    font-size: 1.45rem;
    min-height: 1.45rem;
  }

  .pause-icon {
    width: 1.35rem;
    height: 1.35rem;
  }

  .pause-icon::before,
  .pause-icon::after {
    top: 0.36rem;
    bottom: 0.36rem;
    width: 0.2rem;
  }

  .pause-icon::before {
    left: 0.44rem;
  }

  .pause-icon::after {
    right: 0.44rem;
  }

  .tuning-label {
    font-size: 0.8rem;
  }

  .knob-ring {
    width: 3.75rem;
  }
}

@media (max-width: 30rem) and (max-height: 46rem) {
  .app-shell {
    padding: 0.25rem;
  }

  .console-frame {
    padding: 0.32rem;
  }

  .console-inner {
    padding: 0.24rem;
  }

  .dashboard-clock {
    top: 0.55rem;
    right: 0.72rem;
  }

  .clock-face {
    width: 3.25rem;
  }

  .tick {
    font-size: 0.58rem;
  }

  .hour-hand {
    height: 0.78rem;
  }

  .minute-hand {
    height: 1.12rem;
  }

  .second-hand {
    height: 1.28rem;
  }

  .now-panel {
    padding: 0.68rem;
  }

  .system-state {
    min-height: 1.18rem;
    font-size: 0.56rem;
  }

  h1 {
    margin-top: 0.22rem;
    font-size: clamp(1.82rem, 10vw, 2.55rem);
  }

  .stereo-cluster {
    min-height: 1.5rem;
    padding-right: 3.6rem;
    font-size: 0.74rem;
  }

  .stereo-dot {
    width: 0.58rem;
    height: 0.58rem;
  }

  .program-panel {
    padding-top: 1.15rem;
  }

  .program-label {
    margin-bottom: 0.28rem;
    font-size: 0.82rem;
  }

  .program-panel h2 {
    font-size: clamp(1.22rem, 6.2vw, 1.7rem);
  }

  .progress-console {
    margin-top: 0.72rem;
  }

  .time-code {
    font-size: 0.82rem;
  }

  .progress-track {
    height: 0.36rem;
  }

  .progress-knob {
    width: 0.82rem;
    height: 0.82rem;
  }

  .console-controls {
    margin-top: 0.55rem;
  }

  .control-button,
  .tuning-button {
    min-height: 3.15rem;
  }

  .knob-ring {
    width: 3.05rem;
  }

  .tuning-label {
    font-size: 0.66rem;
  }

  .control-icon {
    font-size: 1.1rem;
    min-height: 1.1rem;
  }

  .control-button span:last-child {
    font-size: 0.58rem;
  }

  .preset-panel {
    padding: 0.5rem 0.68rem 0.62rem;
  }

  .preset-panel h2 {
    margin-bottom: 0.32rem;
    font-size: 0.78rem;
  }

  .preset-list {
    gap: 0.26rem;
  }

  .preset-item {
    min-height: 2.12rem;
    padding: 0 0.46rem;
  }

  .preset-number {
    font-size: 0.9rem;
  }

  .preset-name {
    font-size: 0.8rem;
  }

  .mini-spectrum {
    height: 0.7rem;
  }

  .wave-rings {
    width: 7.5rem;
  }

  .radio-tower {
    height: 4.6rem;
  }

  .dot-field {
    height: 4.6rem;
  }
}

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