/* The removable radio chassis sits against the moving cab. Native range inputs retain keyboard operation. */
:root {
  --enamel: #a8aa94;
  --letter: #222b28;
  --key-font: "Arial Narrow", "Bahnschrift Condensed", Bahnschrift, sans-serif;
}
#cab {
  transition: filter 0.45s;
}
body[data-screen="settings"] #cab,
body[data-screen="radio"] #cab {
  filter: brightness(0.79);
}
#chassis,
#radio-room {
  pointer-events: auto;
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(620px, 94vw);
  color: var(--letter);
  padding: 24px 26px 18px;
  border-radius: 12px 12px 16px 16px;
  border: 2px solid #333831;
  box-shadow:
    inset 0 3px 0 #d0cbad,
    inset 0 -5px 0 #444d45,
    0 2px 0 #131a18,
    0 10px 0 #242b26,
    0 19px 35px #080e0bbf;
  background-color: var(--enamel);
  background-image:
    linear-gradient(119deg, #d6cfaa4f, transparent 32%, #46544a37 93%), url("assets/enamel.png");
  font-family: var(--key-font);
}
#chassis::before,
#radio-room::before {
  content: "";
  position: absolute;
  inset: 9px;
  pointer-events: none;
  background:
    linear-gradient(155deg, transparent 44%, #202822 45% 56%, transparent 57%) top left/8px 8px no-repeat,
    linear-gradient(26deg, transparent 44%, #202822 45% 56%, transparent 57%) bottom right/8px 8px
      no-repeat;
}
#chassis header,
#radio-room header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid #4d574a;
  padding-bottom: 8px;
}
#chassis h2,
#radio-room h2 {
  font: 700 18px/1.2 var(--key-font);
  text-transform: uppercase;
  letter-spacing: 0.094em;
  margin: 0;
}
.grille {
  width: 33%;
  height: 17px;
  background: repeating-linear-gradient(90deg, #4c554a 0 2px, #bfc0a3 2px 4px, transparent 4px 7px);
  clip-path: inset(0 round 3px);
}
.tuner {
  position: relative;
  border: 5px solid #3d453d;
  border-bottom-color: #c3c1a5;
  margin: 13px 0 16px;
  padding: 10px 12px 13px;
  background: #242e28;
  box-shadow: inset 2px 3px 5px #101710a3;
  color: #d8caa4;
}
.tuner-face {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font: 600 13px var(--key-font);
  letter-spacing: 0.04em;
}
.tuner-face output {
  font:
    16px "Courier New",
    monospace;
  color: #f2cf84;
}
.tuner-scale {
  height: 10px;
  position: relative;
  margin-top: 4px;
  background: repeating-linear-gradient(90deg, #b9b79b 0 1px, transparent 1px 2.5%);
  border-bottom: 1px solid #c8c6aa88;
}
.tuner-scale i {
  height: 15px;
  width: 2px;
  background: #e67f55;
  position: absolute;
  bottom: -2px;
  left: var(--needle, 85%);
  box-shadow: 0 0 4px #ef9b665c;
}
#dial-bank {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}
.module {
  text-align: center;
}
.module > label {
  display: block;
  text-transform: uppercase;
  font: 700 11px var(--key-font);
  letter-spacing: 0.055em;
  color: #29342b;
}
.rotor {
  position: relative;
  width: 78px;
  height: 76px;
  margin: 5px auto 0;
  touch-action: none;
}
.rotor::before {
  content: "";
  position: absolute;
  inset: 1px 3px 5px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 225deg, #354138 0 2deg, transparent 2deg 21deg);
  mask-image: radial-gradient(circle, #0000 0 58%, #000 60%);
  clip-path: polygon(0 0, 100% 0, 100% 93%, 64% 93%, 50% 70%, 36% 93%, 0 93%);
}
.wheel {
  pointer-events: none;
  position: absolute;
  inset: 10px 11px 11px;
  border: 2px solid #1f251f;
  border-radius: 50%;
  background: repeating-conic-gradient(#303731 0deg 5deg, #4d554a 6deg 8deg, #29332c 9deg 12deg);
  box-shadow:
    2px 4px 2px #20282094,
    inset 1px 1px 2px #b5b69f;
  transform: rotate(var(--angle));
}
.wheel::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: linear-gradient(125deg, #60695b, #353c35 68%);
  box-shadow: inset 0 1px 2px #a5aa91;
}
.wheel::after {
  content: "";
  position: absolute;
  left: calc(50% - 1.5px);
  top: 4px;
  width: 3px;
  height: 15px;
  background: #e9d7a6;
  box-shadow: 1px 0 #242e24;
}
.rotor input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ns-resize;
  touch-action: none;
}
.rotor:focus-within {
  outline: 1px dashed #2c4134;
  outline-offset: 2px;
  border-radius: 50%;
}
.module output {
  font:
    600 12px "Courier New",
    monospace;
  font-variant-numeric: tabular-nums;
}
.console-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid #646e60;
}
.rocker {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  position: relative;
  color: #263128;
  font: 600 13px var(--key-font);
}
.rocker input {
  position: absolute;
  width: 36px;
  height: 25px;
  opacity: 0;
}
.rocker i {
  width: 35px;
  height: 20px;
  border: 2px solid #333e34;
  background: linear-gradient(90deg, #737a6b 0 45%, #424e42 46% 95%);
  box-shadow:
    inset 0 -2px #1e271f,
    inset 0 1px #b1b69e;
}
.rocker input:checked + i {
  background: linear-gradient(90deg, #485448 0 48%, #c6aa6b 52% 94%);
}
.rocker input:focus-visible + i {
  outline: 2px dotted #354534;
  outline-offset: 3px;
}
.deck-button {
  color: #202b23;
  background: linear-gradient(#e8ddbb, #c3b998);
  border: 1px solid #626859;
  border-bottom: 3px solid #616554;
  border-radius: 3px;
  padding: 6px 14px;
  font: 700 13px var(--key-font);
  box-shadow: 0 2px 0 #49514366;
}
.deck-button:active {
  transform: translateY(1px);
}
.deck-button:focus-visible {
  outline: 2px dashed #202b23;
  outline-offset: 3px;
}
#radio-room {
  max-width: 460px;
}
#radio-room label {
  display: block;
  font: 600 12px var(--key-font);
  margin: 12px 0 5px;
}
#radio-address {
  width: 100%;
  background: #222d27;
  color: #f1d8a9;
  padding: 9px 12px;
  border: 3px inset #8c9582;
  font: 14px monospace;
}
#radio-message {
  font: 14px/1.3 var(--key-font);
  margin: 0.75rem 0;
}
#radio-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
#radio-room .deck-button,
#chassis .deck-button {
  pointer-events: auto;
}
#chassis label,
#chassis input,
#radio-room input {
  pointer-events: auto;
}
#dash-note {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  color: #f4e5bf;
  background: #141b15d6;
  padding: 7px 12px;
  font-size: 13px;
}
#dash-note:empty {
  display: none;
}
@media (max-width: 520px) {
  #chassis,
  #radio-room {
    padding: 18px;
  }
  #dial-bank {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 6px;
  }
  .rotor {
    width: 66px;
    height: 61px;
  }
  #chassis {
    max-width: 340px;
    top: 49%;
  }
  .wheel::after {
    height: 11px;
  }
  #chassis .tuner {
    margin: 8px 0;
  }
  .grille {
    width: 25%;
  }
}
@media (max-height: 530px) {
  #chassis {
    top: 50%;
    padding-top: 12px;
    padding-bottom: 10px;
  }
  .rotor {
    height: 58px;
    width: 61px;
  }
  .console-foot {
    margin-top: 4px;
  }
  #chassis .tuner {
    margin: 6px 0;
    padding: 5px 9px;
  }
}

.rocker i {
  pointer-events: none;
}
.rocker input {
  z-index: 2;
}

#cab {
  transform-origin: 77% 64%;
  transition:
    transform 0.58s cubic-bezier(0.2, 0.67, 0.29, 1),
    filter 0.45s;
}
body[data-screen="settings"] #cab,
body[data-screen="radio"] #cab {
  transform: scale(1.38);
  filter: brightness(0.83);
}
#chassis,
#radio-room {
  top: 56%;
  background-size:
    auto,
    100% 100%;
  outline: 5px solid #383b31;
  outline-offset: 1px;
  box-shadow:
    inset 0 2px 0 #c9c3a5,
    inset 0 -4px 0 #555d4f,
    0 3px 0 7px #222820,
    0 13px 14px 4px #0e120edb;
}
#chassis::before,
#radio-room::before {
  inset: 7px;
  background:
    linear-gradient(147deg, transparent 42%, #33392d 44% 55%, transparent 57%) 0 0/7px 7px no-repeat,
    linear-gradient(35deg, transparent 42%, #33392d 44% 55%, transparent 57%) 100% 0/7px 7px no-repeat,
    linear-gradient(165deg, transparent 42%, #33392d 44% 55%, transparent 57%) 100% 100%/7px 7px no-repeat,
    linear-gradient(35deg, transparent 42%, #33392d 44% 55%, transparent 57%) 0 100%/7px 7px no-repeat,
    radial-gradient(circle at center, #8f927d 0 35%, #40473b 54%, #c4c0a9 65%, transparent 74%) 0 0/7px
      7px no-repeat,
    radial-gradient(circle at center, #8f927d 0 35%, #40473b 54%, #c4c0a9 65%, transparent 74%) 100% 0/7px
      7px no-repeat,
    radial-gradient(circle at center, #8f927d 0 35%, #40473b 54%, #c4c0a9 65%, transparent 74%) 100%
      100%/7px 7px no-repeat,
    radial-gradient(circle at center, #8f927d 0 35%, #40473b 54%, #c4c0a9 65%, transparent 74%) 0 100%/7px
      7px no-repeat;
}
body:has(#cab.still) #cab {
  transition: none;
}
body[data-screen="slots"] #cab {
  transform:scale(1.12);
  filter:brightness(.79);
}
#save-book {
  pointer-events:auto;
  position:absolute;
  top:51%; left:50%;
  transform:translate(-50%,-50%);
  width:min(490px,calc(100vw - 34px));
  max-height:calc(100% - 60px);
  overflow:auto;
  padding:20px 24px 15px 35px;
  color:#352d24;
  background:
    linear-gradient(90deg,#3b342b 0 9px,#625747 9px 14px,#9b8869 14px 16px,#827258 16px 17px,transparent 17px),
    linear-gradient(100deg,#b3a086,#dad0b7 28%,#d2c4a7 72%,#c7b99d);
  border:1px solid #3b342a;
  border-radius:3px 6px 5px 3px;
  box-shadow:1px 2px 0 #8d8067,2px 4px 0 #574c3c,2px 6px 0 #302b24,0 16px 25px #100e0bc4;
}
#save-book h2 {
  margin:0 0 12px;padding-bottom:9px;
  border-bottom:3px double #786d58;
  color:#42372c;
  font:600 clamp(21px,3vw,27px)/1.1 Georgia,serif;
  letter-spacing:-.02em;
}
.book-row {display:flex;align-items:stretch;border-bottom:1px solid #73634e55}
.slot-entry {
  flex:1;min-width:0;display:flex;align-items:center;gap:12px;
  padding:10px 6px 10px 2px;text-align:left;color:#312c25;background:none;border:none;
}
.folio {
  color:#70644e;align-self:stretch;display:grid;place-items:center;
  padding-right:10px;border-right:1px solid #927d6675;
  font:bold 14px/1 "Courier New",monospace;
}
.entry-copy {min-width:0;flex:1;display:grid;gap:3px}
.entry-copy strong {font:600 17px/1.15 Georgia,serif}
.entry-copy small {font:12px/1.25 var(--body);color:#534a3d}
.entry-action,.erase-key,.book-key {font:600 13px/1.25 var(--key-font)}
.entry-action {padding:4px 7px;color:#453c2e;border-bottom:1px solid #7b6c54}
.erase-key {align-self:center;color:#715140;border:0;background:transparent;padding:7px 2px 7px 7px}
.slot-entry:hover,.slot-entry:focus-visible {background:#876e4616}
.book-key {
  color:#393026;background:linear-gradient(#dacfb6,#c9b99a);
  border:1px solid #89795d;border-bottom:2px solid #73634d;
  padding:5px 13px;border-radius:2px;
}
#book-back {margin-top:12px}
#save-book button:focus-visible {outline:2px solid #584637;outline-offset:-2px}
#book-status {margin:9px 0 0;font:13px/1.3 var(--body)}
#book-status:empty {display:none}
#erase-page {padding:7px 0 4px}
#erase-page h3 {margin:0;font:600 19px Georgia,serif}
#erase-page p {margin:8px 0 18px;font:14px/1.4 var(--body)}
.erase-actions {display:flex;gap:10px}
#erase-save {background:#704535;border-color:#52382c;color:#fff0db}
@media(max-width:420px){
  #save-book{padding:15px 13px 12px 24px}
  .slot-entry{gap:6px}.folio{padding-right:6px}
  .entry-copy strong{font-size:15px}.entry-copy small{font-size:11px}
  .entry-action{padding:3px}.erase-key{font-size:12px}
}
@media(max-height:410px){
  #save-book{top:47%;padding-top:12px;padding-bottom:9px}
  #save-book h2{margin-bottom:4px;padding-bottom:5px;font-size:20px}
  .slot-entry{padding-top:6px;padding-bottom:6px}
}
@media (max-height: 530px) {
  #chassis,
  #radio-room {
    top: 50%;
  }
}
