:root {
  color-scheme: dark;
  font-family: "Courier New", monospace;
  background: #111210;
  color: #e7e5df;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 18px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 0%, #292a26 0, transparent 55%),
    #111210;
}

button,
input {
  font: inherit;
}

.radio {
  width: min(680px, 100%);
  padding: 24px 32px 20px;
  border: 1px solid #30312d;
  border-radius: 4px;
  background: #1b1c19;
  box-shadow:
    0 22px 60px #0008,
    inset 0 1px #ffffff08;
}

.radio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.radio-header h1 {
  margin: 0;
  color: #f0eee7;
  font-family: Georgia, serif;
  font-size: 30px;
  line-height: 1;
}

.power-control {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #aaa9a2;
  font-size: 8px;
  letter-spacing: 1px;
}

.power-switch {
  width: 43px;
  height: 23px;
  padding: 3px;
  border: 1px solid #b08784;
  border-radius: 20px;
  background: #252522;
  cursor: pointer;
}

.power-switch:disabled {
  opacity: 0.4;
  cursor: default;
}

.power-light {
  display: block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #b87874;
  box-shadow: 0 0 8px #d88a8544;
  transition: transform 120ms, background 120ms;
}

.power-switch[aria-checked="true"] .power-light {
  transform: translateX(18px);
  background: #f09a94;
  box-shadow: 0 0 10px #f09a9477;
}

/* Shorter dial and needle than the reference image. */
.dial-window {
  position: relative;
  height: 158px;
  overflow: hidden;
  border: 1px solid #393a35;
  border-radius: 3px;
  background:
    linear-gradient(180deg, #30312c 0, #20211e 22%, #1d1e1b 100%);
  box-shadow: inset 0 1px 8px #0006;
}

.frequency-display {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 14px;
  min-width: 116px;
  padding: 12px 14px;
  border: 1px solid #373833;
  color: #b9b9b1;
  background: #20211e;
  font-size: 13px;
  text-align: center;
  letter-spacing: 1px;
}

.frequency-display small {
  margin-left: 5px;
  font-size: 10px;
}

.needle-track {
  position: absolute;
  top: 13px;
  right: 18px;
  left: 18px;
  height: 92px;
  pointer-events: none;
}

.needle {
  position: absolute;
  top: 0;
  left: 63.5%;
  width: 2px;
  height: 88px;
  background: #d88a85;
  box-shadow: 0 0 5px #d88a8544;
  transform: translateX(-50%);
  transition: left 70ms linear;
}

.needle::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -4px;
  width: 0;
  height: 0;
  border-right: 5px solid transparent;
  border-bottom: 7px solid #d88a85;
  border-left: 5px solid transparent;
}

.needle::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d88a85;
}

.scale {
  position: absolute;
  right: 18px;
  bottom: 15px;
  left: 18px;
}

.scale-numbers {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: #deddd5;
  font-size: 10px;
}

.ticks {
  height: 19px;
  border-right: 1px solid #aaa9a0;
  border-left: 1px solid #aaa9a0;
  background: repeating-linear-gradient(
    90deg,
    #aaa9a0 0,
    #aaa9a0 1px,
    transparent 1px,
    transparent 2.5%
  );
}

.controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 20px;
  margin: 24px 0 20px;
}

.knob-control,
.band-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.knob-shell {
  position: relative;
  display: block;
  width: 76px;
  height: 76px;
}

.knob-shell:focus-within {
  outline: 2px solid #d88a85;
  outline-offset: 4px;
  border-radius: 50%;
}

.knob-face {
  position: absolute;
  inset: 0;
  border: 1px solid #343530;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #2b2c28, #20211e 70%);
  box-shadow: 0 5px 12px #0005;
}

.knob-face::after {
  content: "";
  position: absolute;
  top: 11px;
  left: calc(50% - 1px);
  width: 2px;
  height: 22px;
  background: #c8c7bf;
  transform: rotate(var(--angle, -135deg));
  transform-origin: 1px 27px;
}

.knob-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}

.knob-input:disabled {
  cursor: default;
}

.control-label {
  color: #aaa9a1;
  font-size: 9px;
  letter-spacing: 1.5px;
}

.band-switch {
  display: flex;
  margin-bottom: 13px;
  border: 1px solid #3a3b36;
  border-radius: 4px;
  overflow: hidden;
}

.band-switch span {
  padding: 9px 20px;
  color: #888981;
  background: #22231f;
  font-family: Arial, sans-serif;
  font-size: 13px;
}

.band-switch .selected {
  color: #f0eee7;
  background: #2b2c27;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.presets button {
  width: 47px;
  height: 34px;
  border: 1px solid #3c3d37;
  border-radius: 3px;
  color: #c4c3bb;
  background: #20211e;
  font-size: 12px;
  cursor: pointer;
}

.presets button:hover:not(:disabled),
.presets button[aria-pressed="true"] {
  border-color: #b87874;
  color: #f0aaa4;
  background: #2b2522;
}

.presets button:disabled {
  opacity: 0.45;
  cursor: default;
}

.status {
  min-height: 13px;
  margin: 18px 0 0;
  color: #9d9c94;
  font-size: 8px;
  line-height: 1.5;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

@media (max-width: 560px) {
  body {
    padding: 8px;
  }

  .radio {
    padding: 20px 14px 16px;
  }

  .scale-numbers {
    font-size: 7px;
  }

  .controls {
    gap: 8px;
  }

  .knob-shell {
    width: 64px;
    height: 64px;
  }

  .knob-face::after {
    top: 8px;
    height: 18px;
    transform-origin: 1px 24px;
  }

  .band-switch span {
    padding: 8px 12px;
  }

  .presets {
    gap: 6px;
  }

  .presets button {
    width: 39px;
  }
}