/*
MIT License

Copyright (c) 2026 mr-highball

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

.radio-overlay {
  z-index: 30;
  background: #172e2d88;
}
.boombox {
  --station-color: #e2976f;
  --pulse: 1;
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100dvh - 65px);
  overflow: auto;
  margin-top: 30px;
  border-radius: 18px;
  padding: 19px;
  background: linear-gradient(110deg, #4c5351, #333a39 48%, #434b48);
  color: #f4f0d9;
  border: 3px solid #6b726a;
  box-shadow:
    0 20px 70px #1119,
    inset 0 0 0 3px #242e2c;
}
.box-handle {
  position: absolute;
  width: 50%;
  height: 27px;
  border: 7px solid #303b37;
  border-bottom: 0;
  border-radius: 15px 15px 0 0;
  top: -26px;
  left: 25%;
}
.box-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: 2px;
  font-size: 12px;
  padding: 0 4px 14px;
}
.box-top b {
  color: var(--station-color);
}
.box-top small {
  display: block;
  font-size: 7px;
  letter-spacing: 1.4px;
  color: #acb6a7;
  margin-top: 4px;
}
.box-top button {
  color: #d9dfd0;
  background: #28302d;
  border: 1px solid #6c756b;
  font-size: 24px;
  width: 44px;
  padding: 0;
}
.box-body {
  display: grid;
  grid-template-columns: 1fr 2.1fr 1fr;
  gap: 14px;
  align-items: center;
}
.speaker {
  aspect-ratio: 1;
  background: repeating-radial-gradient(circle, #1d2523 0 2px, #424c45 3px 4px);
  border-radius: 50%;
  border: 7px solid #232c27;
  box-shadow:
    0 0 0 2px #7a8272,
    inset 0 0 20px black;
  display: grid;
  place-items: center;
}
.speaker i {
  width: 47%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #657168, #343f38 60%, #1b2822);
  border: 3px solid #202c24;
  transform: scale(var(--pulse));
}
.receiver {
  min-width: 0;
}
.radio-lcd {
  background: #b8c8a5;
  color: #244732;
  padding: 12px;
  border: 5px solid #1c2c25;
  border-radius: 7px;
  box-shadow: inset 0 2px 9px #304e4c55;
  text-shadow: 0 1px #dbebc7;
  font-family: Consolas, monospace;
}
.tuning {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  font-weight: bold;
}
.radio-lcd h2 {
  font-size: 23px;
  letter-spacing: -1px;
  margin: 10px 0 4px;
}
.radio-lcd > span {
  font-size: 9px;
}
.radio-lcd canvas {
  width: 100%;
  height: 40px;
  display: block;
  margin: 4px 0;
}
.track-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  font-size: 10px;
  align-items: center;
}
.track-row > b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-row > span {
  white-space: nowrap;
}
.radio-lcd > small {
  display: block;
  font-size: 8px;
  opacity: 0.8;
  margin-top: 5px;
}
.cassette {
  background: linear-gradient(#2b342f, #454a3e);
  border: 3px solid #1b2922;
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-top: 8px;
  padding: 8px;
  border-radius: 6px;
}
.reel {
  width: 34px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(
    #d8d4b7 0deg 45deg,
    #495449 45deg 90deg,
    #d8d4b7 90deg 135deg,
    #495449 135deg 180deg,
    #d8d4b7 180deg 225deg,
    #495449 225deg 270deg,
    #d8d4b7 270deg 315deg,
    #495449 315deg
  );
  border: 3px solid #bebd9f;
  display: grid;
  place-items: center;
  animation: reel 2s linear infinite;
  animation-play-state: paused;
}
.reel i {
  width: 8px;
  height: 8px;
  background: #1c3026;
  border-radius: 50%;
}
[data-playing='true'] .reel {
  animation-play-state: running;
}
.tape-label {
  font-family: Consolas, monospace;
  color: #cad0b2;
  font-size: 9px;
  text-align: center;
}
.tape-label span {
  display: block;
  font-size: 8px;
  margin-top: 4px;
}
@keyframes reel {
  to {
    transform: rotate(360deg);
  }
}
.box-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 17px 0 15px;
}
.box-controls button {
  background: linear-gradient(#d9dbc7, #9ca596);
  border: 1px solid #e3e5d1;
  border-bottom: 4px solid #7c8777;
  border-radius: 4px;
  font-size: 10px;
  min-height: 44px;
  padding: 8px 13px;
}
.box-controls button:first-child {
  background: var(--station-color);
  border-color: #f3d8af;
  color: #293d32;
}
.box-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 8px;
  letter-spacing: 1px;
}
.box-controls input {
  accent-color: var(--station-color);
  width: 100px;
}
.station-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.station-presets button {
  border: 1px solid #747f71;
  border-bottom: 4px solid #222d25;
  border-radius: 5px;
  background: #4a574b;
  color: #d7deca;
  font-size: 10px;
  padding: 9px 7px;
  text-align: left;
}
.station-presets b {
  display: block;
  letter-spacing: 0.1px;
}
.station-presets span {
  display: block;
  font-size: 8px;
  line-height: 1.3;
  margin-top: 5px;
  color: #b9c6ad;
}
.station-presets button[aria-pressed='true'] {
  border-top-color: var(--station-color);
  background: #25392f;
  box-shadow: inset 0 3px var(--station-color);
}
.box-status {
  font-family: Consolas, monospace;
  font-size: 10px;
  color: #cad3b7;
  padding: 12px 2px 5px;
}
.radio-credits {
  font-size: 10px;
  margin-top: 6px;
  color: #b6c2a8;
}
.radio-credits summary {
  cursor: pointer;
  padding: 7px 0;
  min-height: 34px;
}
.radio-credits p {
  font-size: 10px;
  line-height: 1.5;
}
.radio-credits a {
  color: #d4ddc7;
}
.radio-credits #station-credits {
  max-height: 120px;
  overflow: auto;
}
@media (max-width: 600px) {
  .radio-overlay {
    padding: 12px;
  }
  .boombox {
    padding: 13px;
    max-height: calc(100dvh - 50px);
    border-width: 2px;
  }
  .box-body {
    grid-template-columns: 38px 1fr 38px;
    gap: 8px;
  }
  .speaker {
    border-width: 3px;
  }
  .speaker i {
    border-width: 1px;
  }
  .radio-lcd {
    padding: 10px 8px;
    border-width: 3px;
  }
  .radio-lcd h2 {
    font-size: 20px;
  }
  .tuning {
    font-size: 8px;
  }
  .track-row {
    font-size: 8px;
  }
  .track-row > b {
    max-width: 115px;
  }
  .radio-lcd > small {
    font-size: 7px;
  }
  .cassette {
    padding: 6px;
  }
  .reel {
    width: 29px;
  }
  .box-controls {
    flex-wrap: wrap;
    margin: 12px 0;
  }
  .box-controls label {
    margin-left: 0;
    flex: 1;
    justify-content: space-between;
    min-width: 100%;
    min-height: 34px;
  }
  .box-controls input {
    width: 70%;
  }
  .box-controls button {
    flex: 1;
  }
  .station-presets {
    grid-template-columns: repeat(2, 1fr);
  }
  .station-presets button {
    min-height: 58px;
  }
  .box-top {
    font-size: 10px;
    padding-bottom: 12px;
  }
  .box-top small {
    font-size: 6px;
  }
  .box-status {
    font-size: 9px;
  }
  .radio-credits {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .reel {
    animation: none !important;
  }
  .speaker i {
    transform: none;
  }
}
.box-handle {
  position: relative;
  top: auto;
  left: auto;
  height: 20px;
  margin: 0 auto 14px;
  border-width: 6px;
}
.boombox {
  margin-top: 0;
}
.tape-import {
  border-top: 1px solid #798573;
  margin-top: 12px;
  padding-top: 5px;
  color: #dce1c9;
  font-size: 11px;
}
.tape-import summary {
  cursor: pointer;
  min-height: 44px;
  padding: 12px 2px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.tape-import summary span {
  display: block;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0;
  color: #bdc7ab;
  margin-top: 4px;
}
.tape-import p {
  font-size: 11px;
  line-height: 1.5;
}
.tape-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.tape-actions button {
  font-size: 10px;
  min-height: 44px;
  padding: 9px 11px;
  background: #d1c69e;
  color: #2d4436;
  border-bottom: 3px solid #969774;
}
.tape-import label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  margin: 5px 0;
}
.tape-import select {
  min-height: 44px;
  max-width: 65%;
  background: #2b3e31;
  color: #e3e4ca;
  border: 1px solid #7f8c73;
  padding: 7px;
  border-radius: 5px;
  font: inherit;
}
.tape-import small {
  font-size: 10px;
  line-height: 1.5;
  display: block;
  margin: 9px 0;
  overflow-wrap: anywhere;
}
#tape-title {
  font-size: 12px;
  display: block;
  margin-top: 12px;
  overflow-wrap: anywhere;
}
.station-presets button[data-station='custom'] {
  grid-column: 1/-1;
}
.tape-import #play-tape {
  background: #e2b879;
}
.radio-lcd h2 {
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .radio-lcd h2 {
    font-size: 18px;
  }
  #station-name {
    letter-spacing: -0.6px;
  }
}
