/* Analog faceplate for the existing radio controls. */
#radio-root .radio-system {
  --tuner-inset: clamp(19px, 5.3cqw, 28px);
  --tuner-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='144' height='144' viewBox='0 0 144 144'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' seed='27' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Cpath fill='%23fff' d='M0 0h144v144H0z' filter='url(%23grain)' opacity='.23'/%3E%3C/svg%3E");
  --tuner-key: linear-gradient(160deg, #f6f2e7, #ded9ca);
  --tuner-key-edge: #8b8575;
  --tuner-amber: #de792b;
  color: #262b23;
  border: 1px solid #afa897;
  border-radius: 15px;
  background: var(--tuner-grain), linear-gradient(150deg, #f1eee4 0%, #e8e4d8 49%, #ded9cb 100%);
  background-blend-mode: soft-light, normal;
  box-shadow: inset 0 0 0 2px #fffaf0, inset 0 0 0 3px #aaa391, 0 3px 0 #aca694, 0 10px 25px #49433120;
  scrollbar-color: #aaa18d #e8e4d8;
}
#radio-root .radio-system:focus { outline: none; }

#radio-root .radio-heading {
  min-height: 0;
  padding: clamp(17px, 5.6cqw, 26px) var(--tuner-inset) clamp(18px, 5.9cqw, 27px);
}
#radio-root .radio-heading h1 {
  color: #242b22;
  font-size: clamp(29px, 8.1cqw, 39px);
  letter-spacing: -.065em;
  font-weight: 400;
}
#radio-root .radio-signal { gap: 9px; font-size: 10px; color: #555748; white-space: nowrap; }
#radio-root .radio-signal i {
  width: 10px;
  height: 10px;
  border-color: #757261;
  background: radial-gradient(circle at 40% 34%, #a9aa96, #7d7e6c 70%);
  box-shadow: inset 0 1px 2px #26292366, 0 0 0 2px #fff6;
}
#radio-root .radio-system[data-state="playing"] .radio-signal { color: #303c24; }
#radio-root .radio-system[data-state="playing"] .radio-signal i {
  border-color: #4f6429;
  background: radial-gradient(circle at 39% 36%, #d4ee86, #8eaf44 55%, #46682d);
  box-shadow: inset 0 1px 2px #28411188, 0 0 0 2px #f0f4d3, 0 0 7px #9db84d99;
}

#radio-root .radio-body { padding: 3px var(--tuner-inset) clamp(17px, 5.2cqw, 24px); }
#radio-root .radio-dial {
  padding: clamp(12px, 3.7cqw, 18px) clamp(13px, 4.2cqw, 20px) 12px;
  color: #353b35;
  border: 1px solid #a1a39a;
  border-radius: 7px;
  background: var(--tuner-grain), radial-gradient(ellipse at 52% 0%, #fff 0%, #f7f7f4 61%, #edede9 100%);
  background-blend-mode: soft-light, normal;
  box-shadow: inset 0 2px 7px #40443a38, inset 0 0 0 1px #fff9, 0 0 0 2px #9f9885, 0 0 0 3px #c6bfad, 0 3px 0 2px #fcf8eb;
}
#radio-root .radio-dial-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 6px;
  color: #414740;
  font-size: clamp(9px, 2.6cqw, 11px);
  letter-spacing: .07em;
  white-space: nowrap;
}
#radio-root .radio-dial-top > :last-child { text-align: right; }
#radio-root .radio-dial-top > [data-radio-frequency] {
  color: #252b26;
  font-size: clamp(29px, 8.9cqw, 44px);
  letter-spacing: .065em;
}
#radio-root .radio-system[data-source="recording"] [data-radio-frequency] { font-size: clamp(21px, 6.4cqw, 32px); }
#radio-root .radio-scale { height: 36px; padding-top: 7px; margin-top: 10px; border-color: #83887e; }
#radio-root .radio-ticks { height: 15px; background: repeating-linear-gradient(90deg, #4d544b 0 1px, transparent 1px 7.14%); }
#radio-root .radio-ticks::after { background: repeating-linear-gradient(90deg, #6c7368 0 1px, transparent 1px 1.785%); }
#radio-root .radio-frequencies { color: #414740; font-size: 9px; margin-top: 4px; }
#radio-root .radio-needle { height: 29px; background: var(--tuner-amber); box-shadow: inset -1px 0 #9d481e; }
#radio-root .radio-needle::before { border-top-color: #f08c3c; }

#radio-root .radio-stations {
  margin-top: 16px;
  padding: 5px;
  gap: 7px;
  border-color: #aaa38f;
  border-radius: 7px;
  background: #c4beac;
  box-shadow: inset 0 1px 3px #4b422b42, 0 1px #fff8;
}
/* The station bank uses recessed physical keys. Override the shared pixel keys here. */
#radio-root .radio-stations > button {
  min-height: 45px;
  padding: 6px 4px;
  color: #2b2d22 !important;
  border: 1px solid var(--tuner-key-edge) !important;
  border-radius: 5px;
  background: var(--tuner-key) !important;
  box-shadow: inset 0 1px #fffdfa, inset 0 -1px #aca38e, 0 1px 1px #39322280 !important;
  filter: none;
}
#radio-root .radio-stations > button > span { font-size: clamp(11px, 3.25cqw, 15px); letter-spacing: -.045em; }
#radio-root .radio-stations > button::before,
#radio-root .radio-stations > button::after { display: none; }
#radio-root .radio-stations > button:hover { background: linear-gradient(#fffbf0, #e8e3d4) !important; }
#radio-root .radio-stations > button[aria-pressed="true"] {
  border-color: #6c6655 !important;
  padding-bottom: 12px;
  background: linear-gradient(#cfc8b5, #e8e2d2) !important;
  box-shadow: inset 0 2px 5px #50463070, inset 0 0 0 1px #e9e1cb, 0 1px #f3edde !important;
  transform: none;
}
#radio-root .radio-stations > button[aria-pressed="true"]::after {
  display: block;
  inset: auto auto 5px 50%;
  width: 12px;
  height: 3px;
  border-radius: 2px;
  transform: translateX(-50%);
  z-index: 0;
  clip-path: none;
  background: #d48132;
  box-shadow: inset 0 1px #985019, 0 0 4px #f5a74f88;
}
#radio-root .radio-stations > button:focus-visible { outline: 2px dashed #464c36; outline-offset: 3px; }

#radio-root .radio-player { margin-top: 19px; padding-top: 13px; border-color: #aaa28f; box-shadow: inset 0 1px #fff8; }
#radio-root .radio-player-title { color: #34372b; font-size: clamp(13px, 3.7cqw, 17px); }
#radio-root .radio-time { color: #555648; font-size: clamp(11px, 3cqw, 14px); gap: 6px; }
#radio-root .radio-player .radio-controls { gap: clamp(12px, 4.3cqw, 22px); margin-top: 5px; }
#radio-root .radio-system .radio-power { min-width: 0; gap: 10px; font-size: clamp(11px, 3.2cqw, 14px); }
#radio-root .radio-power svg {
  width: 18px;
  height: 18px;
  padding: 11px;
  color: #384034;
  border-color: #9b9380;
  background: linear-gradient(135deg, #faf5e6, #d9d3c1);
  box-shadow: inset 0 0 0 2px #f5eed9, inset 0 1px #fff, 0 2px 0 #817969, 0 3px 4px #40342130;
}
#radio-root .radio-power:hover svg { background: linear-gradient(135deg, #fff9eb, #e2dccb); }
#radio-root .radio-power[aria-pressed="true"] svg { background: linear-gradient(135deg, #ddd6c3, #f2ebd8); box-shadow: inset 0 2px 5px #79715d66, 0 1px #f8f4e9; }
#radio-root .radio-pause-symbol,
#radio-root .radio-power[aria-pressed="true"] .radio-play-symbol { display: none; }
#radio-root .radio-power[aria-pressed="true"] .radio-pause-symbol { display: inline; }
#radio-root .radio-seek-track { background: #999982; border-color: #777a64; }
#radio-root .radio-buffered > span { background: #ddd9c4; }
#radio-root .radio-played { background: linear-gradient(#d58b46, #b3652c); }

#radio-root .radio-levels { gap: clamp(10px, 4.3cqw, 20px); margin-top: 10px; }
#radio-root .radio-volume label { color: #454839; font-size: clamp(10px, 2.85cqw, 13px); gap: 4px; }
#radio-root .radio-volume output { color: #252d22; }
#radio-root .radio-volume input::-webkit-slider-runnable-track { background: #8b9179; border-color: #737962; }
#radio-root .radio-volume input::-moz-range-track { background: #858c73; }
#radio-root input[type="range"]::-webkit-slider-thumb {
  border-color: #777963;
  border-radius: 3px;
  background: linear-gradient(90deg, #b6b6a0, #f6f3e2 34%, #e2ddc8 57%, #a8a990);
  box-shadow: inset 0 1px #fffdf3, 0 2px 3px #49442a40;
}
#radio-root input[type="range"]::-moz-range-thumb {
  border-color: #777963;
  border-radius: 3px;
  background: linear-gradient(90deg, #b6b6a0, #f3f0df 36%, #aaa990);
  box-shadow: inset 0 1px #fffdf3, 0 2px 3px #49442a40;
}

#radio-root .radio-library {
  min-height: 47px;
  margin-top: 18px;
  padding: 10px clamp(12px, 3.55cqw, 18px);
  color: #33382a;
  font-size: clamp(12px, 3.4cqw, 15px);
  border-color: #8d8773;
  border-radius: 5px;
  background: var(--tuner-key);
  box-shadow: inset 0 1px #fffdf6, inset 0 0 0 2px #faf4e580, 0 2px 0 #8f8875;
}
#radio-root .radio-library:hover { background: linear-gradient(#fffaf0, #e7e2d3); }
#radio-root .radio-library:active { box-shadow: inset 0 2px 4px #5c54394d; }
#radio-root .radio-footer { padding: 0 var(--tuner-inset); min-height: 47px; border-color: #b2aa97; box-shadow: inset 0 1px #fbf6e9; }
#radio-root .radio-footer button { font-size: clamp(11px, 3cqw, 13px); }
#radio-root .radio-footer-grille {
  width: 61px;
  height: 16px;
  opacity: 1;
  background: repeating-linear-gradient(90deg, #827e6c 0 2px, #a6a18c 2px 3px, #f1edde 3px 4px, transparent 4px 6px);
  border-radius: 2px;
}

@media (min-width: 761px) {
  .flat-mode:not(.mobile-mode) .radio-anchor { width: min(474px, calc(100vw - 48px)); }
}
@media (max-height: 760px) and (min-width: 761px) {
  #radio-root .radio-heading { padding-block: 16px; }
  #radio-root .radio-dial { padding-block: 11px; }
  #radio-root .radio-player { margin-top: 15px; padding-top: 10px; }
  #radio-root .radio-library { margin-top: 13px; }
}
.mobile-mode .radio-anchor #radio-root {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
    12px max(10px, env(safe-area-inset-left));
  background: #f5f3ed;
}
.mobile-mode #radio-root .radio-system { height: auto; max-height: 100%; width: min(100%, 474px); }
.mobile-mode #radio-root .radio-stations > button { min-height: 50px; }
.mobile-mode #radio-root .radio-library { min-height: 48px; }
.mobile-mode #radio-root .radio-footer { display: flex; justify-content: flex-end; min-height: 34px; }
.mobile-mode #radio-root .radio-footer button { display: none; }
@media (max-height: 500px) {
  .mobile-mode #radio-root .radio-heading { padding-block: 12px; }
  .mobile-mode #radio-root .radio-stations { margin-top: 4px; }
}
