:root {
  --bg-a: #9a6036;
  --bg-b: #402316;
  --panel: #5e3b28;
  --line: rgba(96, 55, 30, 0.42);
  --ink: #f8dba5;
  --muted: #d7b379;
  --accent: #de6f34;
  --accent-soft: #f3b04d;
  --forest: #4d8d6a;
  --wood-1: #7b4a2d;
  --wood-2: #5c351f;
  --wood-3: #3f2518;
  --brass-1: #f3cb88;
  --brass-2: #b97b3f;
  --shadow-lg: 0 28px 58px rgba(49, 24, 11, 0.28);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% -20%, rgba(241, 181, 97, 0.4), transparent 36%),
    radial-gradient(circle at 95% 115%, rgba(72, 122, 93, 0.16), transparent 30%),
    linear-gradient(165deg, #aa6a3c 0%, #5f351f 45%, #2f1a11 100%);
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  padding: 24px 16px 30px;
}

.app-card {
  max-width: 1250px;
  margin: 0 auto;
  border-radius: 26px;
  border: 10px solid var(--wood-1);
  background:
    linear-gradient(180deg, rgba(255, 226, 166, 0.05), transparent 20%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, transparent 35%, rgba(0, 0, 0, 0.12) 100%),
    linear-gradient(145deg, var(--wood-1) 0%, var(--wood-2) 46%, var(--wood-3) 100%);
  box-shadow:
    inset 0 0 0 2px rgba(35, 20, 12, 0.6),
    inset 0 0 0 3px rgba(227, 170, 94, 0.22),
    var(--shadow-lg);
  padding: 18px;
  position: relative;
  contain: layout paint;
}

.app-card::before,
.app-card::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  width: 20px;
  border-radius: 10px;
  background: linear-gradient(180deg, #8e5734 0%, #6a3f26 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 210, 143, 0.18);
}

.app-card::before {
  left: 10px;
}

.app-card::after {
  right: 10px;
}

.top-strip,
.radio-stage,
.panel.results {
  position: relative;
  z-index: 1;
}

.top-strip {
  margin-bottom: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(223, 166, 89, 0.45);
  background:
    linear-gradient(180deg, rgba(255, 217, 150, 0.09), transparent 45%),
    linear-gradient(145deg, #3e2619 0%, #25170f 100%);
}

.eyebrow,
.label,
.stat-label,
.list-title {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
}

h1,
h2,
.year-display {
  font-family: "Abril Fatface", serif;
}

h1 {
  margin: 3px 0 4px;
  font-size: clamp(3.2rem, 8vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: var(--brass-1);
  text-shadow: 0 1px 0 rgba(27, 13, 8, 0.7);
}

.hero-copy {
  margin: 0 auto;
  max-width: 60ch;
  color: #cda876;
  line-height: 1.5;
}

.brand-rail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(224, 169, 93, 0.2);
  border-bottom: 1px solid rgba(224, 169, 93, 0.2);
  padding: 4px 0;
}

.on-air {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(236, 180, 93, 0.36);
  background: rgba(14, 8, 6, 0.58);
  color: #f4c47a;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.05rem;
}

.lamp {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5e2f;
  box-shadow:
    0 0 0 4px rgba(255, 94, 47, 0.2),
    0 0 16px rgba(255, 94, 47, 0.8);
  animation: pulse 1.6s ease-in-out infinite;
}

.radio-stage {
  display: grid;
  grid-template-columns: 1fr 1.9fr;
  gap: 12px;
  align-items: stretch;
}

.radio-panel {
  background:
    linear-gradient(180deg, rgba(255, 220, 158, 0.08), transparent 30%),
    linear-gradient(145deg, #533322 0%, #3c2418 100%);
  border: 1px solid rgba(229, 175, 100, 0.26);
  border-radius: 14px;
  padding: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 216, 151, 0.08);
}

.radio-panel .sub {
  margin-top: 18px;
}

.status-text {
  margin: 10px 0 0;
  line-height: 1.55;
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.pill {
  margin-top: 12px;
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(127, 176, 146, 0.36);
  background: rgba(77, 141, 106, 0.14);
  color: #cbe7d7;
  font-size: 0.9rem;
}

.center-console {
  position: relative;
  border-radius: 16px;
  border: 2px solid rgba(218, 163, 88, 0.4);
  background:
    linear-gradient(180deg, rgba(255, 214, 145, 0.08), transparent 24%),
    linear-gradient(145deg, #4f3122 0%, #352115 100%);
  box-shadow:
    inset 0 8px 18px rgba(255, 231, 187, 0.08),
    inset 0 -10px 16px rgba(36, 21, 13, 0.4),
    0 18px 32px rgba(61, 31, 16, 0.22);
  padding: 14px 14px 16px;
  text-align: center;
  contain: layout paint;
}

.center-console::before,
.center-console::after {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  width: 16px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 207, 133, 0.2), transparent 26%),
    linear-gradient(145deg, #7f4f30 0%, #5f3a24 100%);
  border: 1px solid rgba(224, 169, 93, 0.25);
  box-shadow: inset 0 0 0 1px rgba(41, 24, 15, 0.45);
}

.center-console::before {
  left: 8px;
}

.center-console::after {
  right: 8px;
}

.center-label {
  margin-bottom: 4px;
}

.year-window {
  width: fit-content;
  margin: 6px auto 10px;
  padding: 8px 28px;
  border-radius: 8px;
  border: 2px solid rgba(235, 176, 94, 0.46);
  background:
    linear-gradient(180deg, rgba(255, 189, 85, 0.22), transparent 60%),
    linear-gradient(145deg, #25160f 0%, #130c09 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 213, 142, 0.22),
    0 0 22px rgba(239, 139, 53, 0.15);
}

.year-display {
  margin: 0;
  font-size: clamp(2.8rem, 7vw, 5rem);
  line-height: 0.9;
  color: #f7be62;
  text-shadow:
    0 0 10px rgba(247, 190, 98, 0.45),
    0 0 2px rgba(247, 190, 98, 0.9);
}

.dial-theatre {
  margin-top: 8px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(220, 163, 92, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 220, 164, 0.13), transparent 30%),
    linear-gradient(145deg, #493022 0%, #2f1e15 100%);
}

.dial-legend {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: #deb073;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.year-dial {
  position: relative;
  width: min(66vw, 340px);
  height: min(66vw, 340px);
  margin: 12px auto 14px;
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from -110deg,
      rgba(242, 188, 102, 0.22) 0deg 1deg,
      transparent 1deg 4deg
    ),
    radial-gradient(circle at 28% 24%, rgba(255, 213, 141, 0.2), transparent 22%),
    radial-gradient(circle at 68% 76%, rgba(58, 34, 22, 0.52), transparent 38%),
    linear-gradient(145deg, #77503a 0%, #5a3a29 60%, #3d2519 100%);
  border: 3px solid rgba(228, 171, 94, 0.52);
  box-shadow:
    inset -24px -24px 30px rgba(36, 21, 14, 0.44),
    inset 14px 14px 18px rgba(173, 119, 68, 0.26),
    0 22px 30px rgba(65, 31, 15, 0.28);
}

.dial-ring {
  position: absolute;
  border-radius: 50%;
}

.ring-outer {
  inset: 20px;
  border: 2px solid rgba(223, 167, 94, 0.5);
}

.ring-inner {
  inset: 48px;
  border: 2px solid rgba(86, 54, 35, 0.8);
}

.year-dial-cap {
  position: absolute;
  inset: 102px;
  border-radius: 50%;
  background: linear-gradient(180deg, #2d1e16 0%, #1d130f 100%);
  box-shadow: 0 10px 16px rgba(16, 9, 6, 0.52);
}

.year-dial-core {
  position: absolute;
  inset: 126px;
  border-radius: 50%;
  background: linear-gradient(180deg, #efb756 0%, #c2692e 100%);
  box-shadow: 0 0 0 4px rgba(255, 218, 144, 0.48);
}

.year-dial-needle {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 7px;
  height: 132px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f4bb56 0%, #bc5a29 100%);
  transform-origin: center bottom;
  transform: translateX(-50%) rotate(-135deg);
  box-shadow: 0 0 0 1px rgba(238, 184, 95, 0.24);
}

.dial-slider-wrap {
  padding: 2px 6px 0;
}

.year-range {
  width: 100%;
  appearance: none;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(214, 159, 88, 0.32);
  background: linear-gradient(90deg, rgba(245, 185, 86, 0.35) 0%, rgba(111, 74, 49, 0.22) 100%);
}

.year-range::-webkit-slider-runnable-track {
  height: 16px;
  background: transparent;
}

.year-range::-webkit-slider-thumb {
  appearance: none;
  width: 36px;
  height: 36px;
  margin-top: -10px;
  border-radius: 50%;
  border: 0;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 241, 200, 0.6), transparent 32%),
    linear-gradient(180deg, #f1bb57 0%, #c06b2f 100%);
  box-shadow:
    inset 0 0 0 4px rgba(87, 52, 31, 0.4),
    0 8px 16px rgba(66, 31, 15, 0.33);
  cursor: grab;
}

.year-range::-moz-range-track {
  height: 16px;
  border: 0;
  background: transparent;
}

.year-range::-moz-range-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 241, 200, 0.6), transparent 32%),
    linear-gradient(180deg, #f1bb57 0%, #c06b2f 100%);
  box-shadow:
    inset 0 0 0 4px rgba(87, 52, 31, 0.4),
    0 8px 16px rgba(66, 31, 15, 0.33);
  cursor: grab;
}

.control-row {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  align-items: center;
}

.transmission-tag {
  margin: 10px 0 2px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.1rem;
  color: #dca96d;
  border-top: 1px solid rgba(224, 168, 94, 0.25);
  border-bottom: 1px solid rgba(224, 168, 94, 0.25);
  padding: 3px 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  padding: 12px 18px;
  font-weight: 700;
  transition: transform 130ms ease, opacity 130ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.button.secondary {
  background: linear-gradient(140deg, #60754a 0%, #3d4a2f 100%);
  color: #fff5de;
  box-shadow: inset 0 0 0 1px rgba(255, 235, 197, 0.24);
}

.button.primary {
  background: linear-gradient(140deg, #e08a45 0%, #b9542a 100%);
  color: #fff4df;
  box-shadow: inset 0 0 0 1px rgba(255, 228, 184, 0.24);
}

.button.ghost {
  background: rgba(243, 214, 164, 0.08);
  border: 1px solid rgba(222, 173, 97, 0.45);
  color: #f6cc87;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.toggle input {
  accent-color: var(--forest);
}

.select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}

.select-wrap span {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
}

.select-wrap select {
  appearance: none;
  border: 1px solid rgba(222, 173, 97, 0.45);
  border-radius: 8px;
  background: linear-gradient(145deg, #4d2e20 0%, #331f15 100%);
  color: #f6cc87;
  padding: 7px 10px;
}

.private-caveat {
  color: var(--muted);
  font-size: 0.83rem;
}

.private-caveat a {
  color: #f6cc87;
}

.chart-size-warning {
  color: #f1b870;
  font-size: 0.83rem;
}

.progress-bar {
  height: 11px;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(34, 19, 12, 0.5);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  transition: width 180ms ease;
}

.stats.compact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.stat-card {
  border: 1px solid rgba(228, 170, 94, 0.2);
  border-radius: 8px;
  background: rgba(28, 17, 11, 0.34);
  padding: 10px 12px;
}

.stat-card strong {
  display: block;
  margin-top: 3px;
  font-size: 1.04rem;
}

code[data-callback-url] {
  display: block;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(17, 10, 7, 0.35);
  color: #eac184;
  word-break: break-all;
  font-size: 0.86rem;
}

.panel.results {
  position: relative;
  margin-top: 16px;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(228, 170, 94, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 223, 167, 0.08), transparent 24%),
    linear-gradient(145deg, #5a3a29 0%, #442a1d 100%);
  contain: layout paint;
}

.panel.results::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 8px;
  height: 8px;
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(255, 215, 153, 0.2), transparent 22%, rgba(0, 0, 0, 0.22) 100%),
    linear-gradient(145deg, #6e452d 0%, #523422 100%);
  opacity: 0.7;
}

.embed-panel {
  margin-top: 14px;
  padding: 12px 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(235, 175, 97, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 223, 167, 0.09), transparent 24%),
    linear-gradient(145deg, #4b2f1e 0%, #2f1d15 100%);
}

.embed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.monitor-pill {
  border: 1px solid rgba(235, 175, 97, 0.28);
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(18, 11, 8, 0.45);
  color: #f0c27f;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.monitor-frame {
  border-radius: 12px;
  border: 1px solid rgba(201, 144, 74, 0.55);
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 196, 110, 0.12), transparent 35%),
    linear-gradient(90deg, rgba(255, 219, 161, 0.08), transparent 35%, rgba(0, 0, 0, 0.2) 100%),
    linear-gradient(145deg, #4a2f20 0%, #2e1c14 100%);
  box-shadow:
    inset 0 0 0 1px rgba(245, 193, 117, 0.26),
    0 8px 18px rgba(0, 0, 0, 0.28);
}

.monitor-chassis {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
}

.side-knob {
  width: 48px;
  height: 106px;
  border-radius: 12px;
  border: 1px solid rgba(218, 158, 82, 0.35);
  background:
    linear-gradient(180deg, rgba(255, 214, 150, 0.09), transparent 28%),
    linear-gradient(145deg, #3b261b 0%, #261912 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(245, 193, 117, 0.14);
}

.knob-cap {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(232, 174, 96, 0.42);
  background:
    radial-gradient(circle at 32% 30%, rgba(255, 233, 196, 0.45), transparent 36%),
    linear-gradient(160deg, #b6793f 0%, #7a4825 100%);
  box-shadow:
    inset 0 0 0 1px rgba(45, 26, 15, 0.5),
    0 3px 8px rgba(0, 0, 0, 0.34);
}

.monitor-screen {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 205, 132, 0.2);
  background: #0d0a09;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.monitor-screen iframe {
  display: block;
  width: 100%;
  min-height: 280px;
  aspect-ratio: 16 / 9;
  border: 0;
  position: relative;
  z-index: 1;
}

.monitor-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 214, 149, 0.07), transparent 24%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.03) 0px,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 3px
    );
}

.vu-strip {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(220, 166, 93, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 216, 148, 0.08), transparent 34%),
    linear-gradient(145deg, #2f1e15 0%, #1e1410 100%);
}

.vu-bar {
  height: 10px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #f5cb6e 0%, #d56e34 100%);
  box-shadow: 0 0 8px rgba(245, 177, 88, 0.3);
  animation: vumeter 1050ms ease-in-out infinite;
}

.vu-bar:nth-child(1) {
  animation-delay: 80ms;
}
.vu-bar:nth-child(2) {
  animation-delay: 210ms;
}
.vu-bar:nth-child(3) {
  animation-delay: 350ms;
}
.vu-bar:nth-child(4) {
  animation-delay: 120ms;
}
.vu-bar:nth-child(5) {
  animation-delay: 420ms;
}
.vu-bar:nth-child(6) {
  animation-delay: 280ms;
}
.vu-bar:nth-child(7) {
  animation-delay: 480ms;
}
.vu-bar:nth-child(8) {
  animation-delay: 160ms;
}
.vu-bar:nth-child(9) {
  animation-delay: 540ms;
}
.vu-bar:nth-child(10) {
  animation-delay: 240ms;
}

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

h2 {
  margin: 8px 0 0;
  line-height: 1.08;
  font-size: clamp(1.45rem, 2.7vw, 1.95rem);
}

.track-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.track-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  min-height: 210px;
}

.track-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(235, 175, 97, 0.3);
}

.track-list li:last-child {
  border-bottom: 0;
}

.track-title {
  font-weight: 600;
}

.track-meta {
  color: var(--muted);
}

.track-rank {
  color: #f0b35b;
  white-space: nowrap;
  font-weight: 600;
}

.muted .track-title,
.muted .track-meta {
  color: var(--muted);
}

.hidden {
  display: none;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.82;
  }
  50% {
    opacity: 1;
  }
}

@keyframes vumeter {
  0%,
  100% {
    transform: scaleY(0.55);
    opacity: 0.75;
  }
  25% {
    transform: scaleY(1.5);
    opacity: 1;
  }
  50% {
    transform: scaleY(0.9);
    opacity: 0.9;
  }
  75% {
    transform: scaleY(1.8);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lamp,
  .vu-bar {
    animation: none;
  }

  .button,
  .progress-bar span {
    transition: none;
  }
}

@media (max-width: 1040px) {
  .radio-stage {
    grid-template-columns: 1fr;
  }

  .center-console {
    order: -1;
  }
}

@media (max-width: 760px) {
  .app-card {
    padding: 16px;
    box-shadow:
      inset 0 0 0 2px rgba(35, 20, 12, 0.6),
      inset 0 0 0 3px rgba(227, 170, 94, 0.22),
      0 14px 24px rgba(20, 11, 7, 0.32);
  }

  .brand-rail {
    flex-direction: column;
    align-items: center;
  }

  .dial-legend {
    font-size: 0.58rem;
  }

  .year-dial {
    width: min(86vw, 300px);
    height: min(86vw, 300px);
  }

  .year-dial-cap {
    inset: 88px;
  }

  .year-dial-core {
    inset: 110px;
  }

  .year-dial-needle {
    height: 116px;
  }

  .track-lists,
  .stats.compact {
    grid-template-columns: 1fr;
  }

  .results-head {
    flex-direction: column;
  }

  .monitor-chassis {
    grid-template-columns: 1fr;
  }

  .side-knob {
    display: none;
  }

  .monitor-screen iframe {
    min-height: 190px;
  }

  .monitor-screen::after {
    background: linear-gradient(180deg, rgba(255, 214, 149, 0.05), transparent 24%);
  }

  .vu-strip {
    gap: 4px;
    padding: 6px 8px;
  }

  .vu-bar {
    animation-duration: 1500ms;
  }

  .year-dial {
    box-shadow:
      inset -16px -16px 22px rgba(36, 21, 14, 0.36),
      inset 10px 10px 14px rgba(173, 119, 68, 0.2),
      0 14px 22px rgba(65, 31, 15, 0.24);
  }
}
