* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at center, #17394a 0%, #071218 55%, #020405 100%);
  color: #d8f6ff;
  font-family: "Courier New", monospace;
  overflow-x: hidden;
}

/* 🔥 FIXED GRID LAYOUT */
.site-layout {
  width: min(1900px, 98vw);
  min-height: calc(100vh - 48px);
  margin: 24px auto;
  display: grid;
  grid-template-columns: 340px minmax(640px, 820px) 340px;
  grid-template-areas: "left main right";
  gap: 24px;
  align-items: stretch;
}

/* CENTER PANEL FIX */
.radio-shell {
  grid-area: main;
  width: 100%;
  max-width: 820px;
  height: calc(100vh - 48px);
  margin: 0 auto;
  padding: 22px;
  border: 2px solid #7de7ff;
  background: rgba(3, 15, 22, 0.88);
  box-shadow:
    0 0 25px rgba(125, 231, 255, 0.35),
    inset 0 0 30px rgba(125, 231, 255, 0.08);
  overflow: hidden;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: calc(100vh - 48px);
  position: sticky;
  top: 24px;
}

.left-panel {
  grid-area: left;
}

.right-panel {
  grid-area: right;
}

.left-panel .promo-box {
  flex: 1;
}

.right-panel .info-box,
.right-panel .ticker,
.right-panel footer {
  flex-shrink: 0;
}

/* HEADERS */

header {
  text-align: center;
  border-bottom: 1px dashed #7de7ff;
  padding-bottom: 18px;
}

.badge,
.panel-label {
  display: inline-block;
  margin: 0 0 10px;
  padding: 6px 12px;
  color: #001014 !important;
  background: #7de7ff;
  font-weight: bold;
  letter-spacing: 2px;
  font-size: 0.75rem !important;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 6vw, 5.7rem);
  letter-spacing: 6px;
  text-shadow:
    3px 3px 0 #006f86,
    0 0 18px #7de7ff;
}

.subtitle {
  margin-bottom: 0;
  color: #a7d9e8;
  font-size: 1rem;
}

.station-description {
  max-width: 620px;
  margin: 10px auto 0;
  color: #a7d9e8;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* BOXES */

.player-card,
.promo-box,
.info-box {
  border: 1px solid #7de7ff;
  background:
    linear-gradient(180deg, rgba(23, 57, 74, 0.85), rgba(2, 8, 12, 0.95));
  box-shadow:
    0 0 18px rgba(125, 231, 255, 0.18),
    inset 0 0 16px rgba(125, 231, 255, 0.08);
}

.player-card {
  margin: 24px auto 0;
  padding: 22px;
  max-width: 640px;
  width: 100%;
  text-align: center;
}

.promo-box,
.info-box {
  padding: 18px;
}

.promo-box {
  min-height: 150px;
}

.tall-promo {
  min-height: unset;
}

.promo-box h3 {
  margin: 8px 0 10px;
  color: #ffffff;
  font-size: 1rem;
  letter-spacing: 1px;
}

.promo-box p,
.info-box p {
  color: #a7d9e8;
  font-size: 0.85rem;
  line-height: 1.4;
}

.contact-link {
  display: inline-block;
  margin-top: 8px;
  color: #9cffc7;
  font-size: 0.85rem;
  text-decoration: none;
  word-break: break-word;
}

.contact-link:hover {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(156, 255, 199, 0.5);
}

/* PLAYER */

.seal-icon {
  font-size: 3rem;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 8px #7de7ff);
}

.tuner {
  margin-bottom: 18px;
}

.frequency span {
  font-size: 4.4rem;
  font-weight: bold;
  color: #ffffff;
}

.frequency small {
  font-size: 1.5rem;
  color: #7de7ff;
}

.dial {
  position: relative;
  height: 22px;
  margin: 12px auto 6px;
  border: 1px solid #7de7ff;
  background: linear-gradient(90deg, #061820, #17394a, #061820);
  max-width: 460px;
}

.dial-marker {
  position: absolute;
  left: 55%;
  top: -6px;
  width: 4px;
  height: 32px;
  background: #9cffc7;
  box-shadow: 0 0 10px #9cffc7;
}

.dial-labels {
  display: flex;
  justify-content: space-between;
  max-width: 460px;
  margin: 0 auto;
  font-size: 0.75rem;
  color: #a7d9e8;
}

.status {
  margin: 10px 0 18px;
  color: #9cffc7;
  letter-spacing: 2px;
}

.album-art {
  width: 190px;
  height: 190px;
  object-fit: cover;
  display: block;
  margin: 0 auto 14px;
  border: 2px solid #7de7ff;
  background: #020405;
  box-shadow: 0 0 18px rgba(125, 231, 255, 0.3);
}

audio {
  display: none;
}

/* CUSTOM PLAYER */

.custom-player {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 18px 0 0;
  padding: 12px;
  border: 1px solid #7de7ff;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 12px rgba(125, 231, 255, 0.12);
}

.play-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid #9cffc7;
  background:
    radial-gradient(circle, #17394a 0%, #061820 70%);
  color: #9cffc7;
  font-size: 1.6rem;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow:
    0 0 16px rgba(156, 255, 199, 0.35),
    inset 0 0 14px rgba(156, 255, 199, 0.12);
}

.play-button:hover {
  background: #9cffc7;
  color: #001014;
}

.player-info {
  text-align: left;
  flex: 1;
}

.player-label {
  display: block;
  color: #9cffc7;
  letter-spacing: 2px;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

#playerState {
  color: #d8f6ff;
  font-size: 0.95rem;
}

.volume-control {
  min-width: 160px;
  text-align: left;
}

.volume-control label {
  display: block;
  margin-bottom: 6px;
  color: #9cffc7;
  font-size: 0.75rem;
  letter-spacing: 2px;
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

#volumeSlider {
  width: 130px;
  accent-color: #9cffc7;
  cursor: pointer;
}

#volumeValue {
  min-width: 42px;
  color: #d8f6ff;
  font-size: 0.85rem;
}

/* RIGHT PANEL */

.now-playing {
  text-align: center;
}

.now-playing p,
.song-history p {
  margin: 0 0 8px;
  color: #9cffc7;
  letter-spacing: 2px;
}

.now-playing h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #ffffff;
}

.playlist-name {
  margin-top: 10px !important;
  color: #a7d9e8 !important;
  font-size: 0.8rem;
}

.share-track-button {
  width: 100%;
  margin-top: 14px;
  padding: 9px 12px;
  font-size: 0.78rem;
}

.share-status {
  min-height: 1.2em;
  margin: 8px 0 0 !important;
  color: #9cffc7 !important;
  font-size: 0.76rem !important;
}

.song-history {
  text-align: left;
}

.song-history p {
  text-align: center;
}

.song-history ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.song-history li {
  padding: 9px 0;
  border-bottom: 1px solid rgba(125, 231, 255, 0.2);
  color: #d8f6ff;
  font-size: 0.9rem;
}

.song-history li:last-child {
  border-bottom: none;
}

/* BUTTONS */

.buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.side-buttons {
  flex-direction: column;
  align-items: stretch;
}

button {
  background: #061820;
  color: #7de7ff;
  border: 1px solid #7de7ff;
  padding: 10px 18px;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 1px;
}

button:hover:not(:disabled) {
  background: #7de7ff;
  color: #001014;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* TICKER + FOOTER */

.ticker {
  overflow: hidden;
  border: 1px dashed #7de7ff;
  padding: 12px;
  white-space: normal;
  color: #a7d9e8;
  background: rgba(0, 0, 0, 0.25);
}

footer {
  text-align: center;
  color: #6baabc;
  font-size: 0.85rem;
}

/* EFFECTS */

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.04),
    rgba(255,255,255,0.04) 1px,
    transparent 1px,
    transparent 4px
  );
  z-index: 10;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 9;
}

/* SPONSOR BUTTON */

.funding-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #ff7bd5;
  background: linear-gradient(135deg, #1b0f1f, #2a0f2f);
  color: #ff7bd5;
  text-decoration: none;
  font-weight: bold;
  letter-spacing: 1px;
  box-shadow:
    0 0 12px rgba(255, 123, 213, 0.4),
    inset 0 0 10px rgba(255, 123, 213, 0.15);
}

.funding-link:hover {
  background: #ff7bd5;
  color: #001014;
}

.support-text {
  text-align: center;
  font-size: 0.8rem;
  color: #a7d9e8;
}

/* RESPONSIVE */

@media (max-width: 1500px) {
  .site-layout {
    width: min(1220px, 96vw);
    grid-template-columns: minmax(620px, 1fr) 320px;
    grid-template-areas:
      "main right"
      "left left";
    align-items: start;
  }

  .radio-shell {
    min-height: calc(100vh - 48px);
    height: auto;
  }

  .side-panel {
    height: auto;
  }

  .left-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .left-panel .promo-box {
    min-height: 190px;
  }

  .right-panel {
    align-self: start;
    position: sticky;
  }
}

@media (max-width: 1050px) {
  .site-layout {
    width: min(820px, 94vw);
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "right"
      "left";
  }

  .radio-shell {
    min-height: auto;
    overflow: visible;
  }

  .side-panel {
    position: static;
  }

  .right-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .right-panel .song-history,
  .right-panel .ticker,
  .right-panel footer {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  body {
    overflow-x: hidden;
  }

  .site-layout {
    width: calc(100% - 24px);
    max-width: 560px;
    margin: 12px auto;
    gap: 14px;
  }

  header {
    padding-bottom: 14px;
  }

  h1 {
    font-size: clamp(2.45rem, 13vw, 4rem);
    letter-spacing: 3px;
  }

  .radio-shell,
  .player-card {
    padding: 16px;
  }

  .player-card {
    margin-top: 18px;
  }

  .seal-icon {
    font-size: 2.6rem;
  }

  .frequency span {
    font-size: 3.7rem;
  }

  .album-art {
    width: 180px;
    height: 180px;
  }

  .custom-player {
    flex-direction: column;
    text-align: center;
  }

  .player-info {
    text-align: center;
  }

  .volume-control {
    width: 100%;
    text-align: center;
  }

  .volume-row {
    justify-content: center;
  }

  #volumeSlider {
    width: min(220px, 70vw);
  }

  .right-panel,
  .left-panel {
    display: flex;
  }

  .now-playing {
    order: -1;
    position: sticky;
    top: 0;
    z-index: 8;
    background:
      linear-gradient(180deg, rgba(23, 57, 74, 0.96), rgba(2, 8, 12, 0.98));
  }

  .ticker {
    white-space: normal;
  }
}

@media (max-width: 420px) {
  .badge,
  .panel-label {
    letter-spacing: 1px;
  }

  .frequency span {
    font-size: 3.2rem;
  }

  .album-art {
    width: 150px;
    height: 150px;
  }

  button {
    padding: 10px 12px;
  }
}
