@import url('https://fonts.googleapis.com/css2?family=Libre+Franklin:wght@400;600;700;800&family=Playfair+Display:wght@700;800&display=swap');

:root {
  --ink: #1b1713;
  --paper: #efe1bf;
  --paper-dark: #d4bd8e;
  --gold: #c4933f;
  --gold-dark: #7c5724;
  --red: #7f2625;
  --cream: #fff6de;
  --shadow: rgba(0,0,0,.28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.08), transparent 22%),
    repeating-linear-gradient(90deg, #17130f 0, #17130f 3px, #1e1914 3px, #1e1914 6px);
  font-family: "Libre Franklin", Arial, sans-serif;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image:
    repeating-radial-gradient(circle at 0 0, transparent 0 3px, rgba(255,255,255,.15) 4px);
  mix-blend-mode: overlay;
}

.page-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 24px auto;
}

.hero {
  background: linear-gradient(180deg, #f3e3bd, #ddc28e);
  border: 4px solid #2d241b;
  box-shadow: 0 14px 36px var(--shadow), inset 0 0 0 2px #8f6a34;
  padding: 34px 28px 24px;
  text-align: center;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(59,39,18,.45);
  pointer-events: none;
}

.hero-badge,
.eyebrow {
  letter-spacing: .18em;
  font-size: .75rem;
  font-weight: 800;
  color: var(--red);
}

h1, h2 {
  font-family: "Playfair Display", Georgia, serif;
}

h1 {
  margin: 7px 0 2px;
  font-size: clamp(2.3rem, 5vw, 4.7rem);
  line-height: .96;
}

.tagline {
  margin: 8px 0 22px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .11em;
  font-size: .9rem;
}

.dial-line {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: .7rem;
  font-weight: 700;
}

.dial-line i {
  height: 2px;
  background: linear-gradient(90deg, transparent, #6e4d21, transparent);
}

.layout {
  display: grid;
  grid-template-columns: minmax(330px, .9fr) minmax(420px, 1.3fr);
  gap: 22px;
  margin-top: 22px;
}

.radio-card,
.library-card,
.about {
  border: 4px solid #2d241b;
  box-shadow: 0 12px 30px var(--shadow);
}

.radio-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(0,0,0,.07) 1px, transparent 1px),
    linear-gradient(#c79e62, #a9793e);
  background-size: 5px 100%, auto;
  min-height: 500px;
}

.radio-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(56,32,9,.55);
  pointer-events: none;
}

.speaker-grille {
  height: 155px;
  border-radius: 80px 80px 16px 16px;
  border: 5px solid #4a341d;
  margin: 0 auto 25px;
  width: min(330px, 92%);
  background:
    repeating-radial-gradient(circle, #332519 0 2px, #19120d 2px 5px);
  box-shadow: inset 0 0 0 8px #80603b, inset 0 0 18px #000;
}


.now-playing-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 18px;
  align-items: center;
  max-width: 420px;
  margin: 0 auto;
}

.cover-art-wrap {
  width: 108px;
  aspect-ratio: 1;
  border: 4px solid #49331c;
  background: #d6bd8b;
  box-shadow: 0 6px 14px rgba(0,0,0,.25), inset 0 0 0 2px #8a6637;
  overflow: hidden;
}

.cover-art,
.cover-placeholder {
  width: 100%;
  height: 100%;
}

.cover-art {
  display: block;
  object-fit: cover;
}

.cover-placeholder {
  display: grid;
  place-items: center;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 800;
  font-size: 2rem;
  color: #6f4b25;
  background:
    radial-gradient(circle at center, #e9d4a6 0 38%, transparent 39%),
    repeating-radial-gradient(circle at center, #7f2625 0 2px, #b8894e 3px 7px);
}

.cover-art.hidden,
.cover-placeholder.hidden {
  display: none;
}

.now-playing {
  text-align: center;
  position: relative;
  z-index: 1;
}

.now-playing h2 {
  margin: 6px 0 3px;
  font-size: 1.8rem;
}

.now-playing p {
  margin: 0;
  font-weight: 700;
  color: #4f3520;
}

.progress-wrap {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 10px;
  margin: 26px 0 18px;
  font-size: .76rem;
  font-weight: 700;
}

input[type="range"] {
  accent-color: var(--red);
  width: 100%;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
}

.controls button {
  border: 2px solid #342515;
  cursor: pointer;
  background: linear-gradient(#f5dfad, #bd9151);
  color: #2a1b10;
  box-shadow: 0 4px 0 #503619;
  transition: transform .12s ease, box-shadow .12s ease;
}

.controls button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #503619;
}

.round-control {
  width: 50px;
  height: 50px;
  border-radius: 50%;
}

.play-control {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  font-size: 1.55rem;
}

.small-control {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.15rem;
}

.small-control.active {
  background: var(--red);
  color: var(--cream);
}

.volume-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 9px;
  align-items: center;
  margin: 24px auto 0;
  max-width: 330px;
}

.library-card {
  background: var(--paper);
  padding: 26px;
  min-height: 500px;
}

.section-title {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title h2,
.about h2 {
  margin: 3px 0 0;
}

#searchBox {
  width: min(220px, 45%);
  padding: 10px 12px;
  border: 2px solid #6b4d2c;
  background: #fff7e3;
  font: inherit;
}

.playlist-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.playlist-tab {
  border: 1px solid #77552e;
  padding: 8px 12px;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.playlist-tab.active {
  background: var(--red);
  color: #fff;
}

.track-list {
  display: grid;
  gap: 8px;
  max-height: 370px;
  overflow: auto;
  padding-right: 4px;
}

.track-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(64,42,18,.25);
  padding: 10px 7px;
  cursor: pointer;
}

.track-row:hover,
.track-row.active {
  background: rgba(127,38,37,.1);
}

.track-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #79562b;
  border-radius: 50%;
  font-weight: 800;
}

.track-name {
  font-weight: 800;
}

.track-meta {
  display: block;
  font-size: .78rem;
  color: #6b5034;
  margin-top: 2px;
}

.track-time {
  font-size: .76rem;
  font-weight: 700;
  color: #6b5034;
}

.about {
  margin-top: 22px;
  background: linear-gradient(180deg, #efe1bf, #dac08a);
  padding: 24px 28px;
  display: grid;
  grid-template-columns: .9fr 1.2fr;
  gap: 30px;
  align-items: center;
}

.about p {
  margin: 0;
  line-height: 1.65;
}

code {
  background: rgba(0,0,0,.08);
  padding: 2px 5px;
}

footer {
  color: #d6c19d;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: .75rem;
  padding: 16px 4px 4px;
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 16px, 720px);
    margin-top: 8px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .radio-card,
  .library-card {
    min-height: auto;
  }

  .about {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .now-playing-wrap {
    grid-template-columns: 82px 1fr;
    gap: 12px;
  }

  .cover-art-wrap {
    width: 82px;
  }

  .now-playing h2 {
    font-size: 1.35rem;
  }

  .hero {
    padding: 28px 14px 20px;
  }

  .radio-card,
  .library-card,
  .about {
    padding: 20px 16px;
  }

  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  #searchBox {
    width: 100%;
  }

  .speaker-grille {
    height: 125px;
  }

  .controls {
    gap: 8px;
  }

  .round-control {
    width: 44px;
    height: 44px;
  }

  .small-control {
    width: 37px;
    height: 37px;
  }

  .play-control {
    width: 64px;
    height: 64px;
  }

  footer {
    flex-direction: column;
  }
}

.media-home-link {
  position:absolute; z-index:3; top:16px; left:18px; color:#54201f;
  font-size:.78rem; font-weight:800; text-decoration:none; letter-spacing:.03em;
}
.media-home-link:hover { text-decoration:underline; }
@media(max-width:560px){
  .media-home-link { position:relative; top:auto; left:auto; display:inline-block; margin-bottom:8px; }
}
