/* ============================================================
   SAMMY FM 28.7 — styles
   All colors + core sizing live in the variables below.
   Tweak these and the whole site follows.
   ============================================================ */

:root {
  /* --- Palette (the pink world) --- */
  --bg:            #FFF0F5;   /* soft blush page background */
  --bg-deep:       #FFE4EE;   /* slightly deeper blush, gradients */
  --card:          #FFFFFF;   /* white cards */
  --pink:          #EC4899;   /* primary rose accent */
  --pink-soft:     #F472B6;   /* lighter rose accent */
  --pink-faint:    #FBCFE4;   /* very light pink (borders, tracks) */
  --pink-wash:     #FDE7F1;   /* pink tint for hovers / highlights */
  --ink:           #4A2B36;   /* warm deep rose-brown text (not black) */
  --ink-soft:      #8A6472;   /* muted secondary text */
  --ink-faint:     #B998A4;   /* extra-muted text (footer, ticks) */
  --shadow:        0 10px 30px rgba(236, 72, 153, 0.10);
  --shadow-soft:   0 4px 16px rgba(236, 72, 153, 0.08);

  /* --- Type --- */
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* --- Layout --- */
  --radius: 18px;
  --radius-sm: 12px;
  --player-h: 84px;          /* player bar height (mobile) */
  --maxw: 980px;             /* content max width on desktop */
}

/* ---------- Reset-ish ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ============================================================
   SCREEN 1 — THE GATE
   ============================================================ */

#gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 700px at 80% -10%, var(--bg-deep), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, #FFE9F2, transparent 55%),
    var(--bg);
  transition: opacity .6s ease;
}
#gate.gate-leaving { opacity: 0; pointer-events: none; }
#gate.gate-gone { display: none; }

.gate-inner {
  width: 100%;
  max-width: 400px;
  text-align: center;
  animation: gate-rise .8s ease both;
}
@keyframes gate-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.gate-kicker {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.gate-logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(52px, 14vw, 72px);
  line-height: 1;
  letter-spacing: .04em;
  color: var(--ink);
}

/* --- The frequency dial (28.7) --- */
.dial {
  position: relative;
  margin: 22px auto 6px;
  width: min(280px, 80%);
  padding-bottom: 4px;
}
.dial-ticks {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 16px;
  border-bottom: 1.5px solid var(--pink-faint);
  padding-bottom: 5px;
}
.dial-ticks span {
  width: 1.5px;
  height: 8px;
  background: var(--pink-faint);
  border-radius: 1px;
}
.dial-ticks .tick-major { height: 14px; background: var(--pink); }
.dial-freq {
  margin-top: 10px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 34px;
  color: var(--pink);
  letter-spacing: .06em;
}
.dial-needle {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 2px;
  height: 26px;
  margin-left: -1px;
  background: var(--pink);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(236, 72, 153, .5);
}

.gate-tagline {
  margin: 20px 0 30px;
  font-size: 14px;
  color: var(--ink-soft);
  font-style: italic;
  font-family: var(--font-display);
  font-size: 18px;
}

/* --- Password form --- */
.gate-question {
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink);
}

.gate-field { margin-bottom: 12px; }

#gate-password {
  width: 100%;
  padding: 15px 18px;
  font-size: 16px;               /* 16px+ prevents iOS zoom-on-focus */
  text-align: center;
  letter-spacing: .12em;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--pink-faint);
  border-radius: 999px;
  outline: none;
  box-shadow: var(--shadow-soft);
  transition: border-color .2s, box-shadow .2s;
}
#gate-password::placeholder { color: var(--ink-faint); letter-spacing: .04em; }
#gate-password:focus {
  border-color: var(--pink-soft);
  box-shadow: 0 0 0 4px rgba(244, 114, 182, .15);
}

#gate-submit {
  width: 100%;
  padding: 15px 18px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--pink-soft), var(--pink));
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(236, 72, 153, .35);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
#gate-submit:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(236, 72, 153, .42); }
#gate-submit:active { transform: translateY(0) scale(.98); filter: brightness(.96); }

#gate-error {
  min-height: 22px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--pink);
}

/* wrong-password shake */
.shake { animation: shake .45s ease; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
  50%      { transform: translateX(-4px); }
}

/* --- "Tuning in..." transition --- */
#tuning {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 10;
}
#tuning.active { display: flex; }

/* faint animated static behind the tuning readout */
.tuning-static {
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image:
    repeating-linear-gradient(0deg, rgba(236,72,153,.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(244,114,182,.05) 0 1px, transparent 1px 4px);
  animation: static-jitter .18s steps(2) infinite;
}
@keyframes static-jitter {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(1px, -1px); }
  100% { transform: translate(-1px, 1px); }
}

.tuning-content { position: relative; text-align: center; }

.tuning-freq {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 56px;
  color: var(--pink);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

/* frequency sweep bars */
.tuning-wave {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  height: 40px;
  margin: 18px 0;
}
.tuning-wave span {
  width: 3px;
  height: 8px;
  border-radius: 2px;
  background: var(--pink-soft);
  animation: wave-bounce .7s ease-in-out infinite;
}
.tuning-wave span:nth-child(odd)  { animation-duration: .55s; }
.tuning-wave span:nth-child(3n)   { animation-delay: .1s; }
.tuning-wave span:nth-child(4n)   { animation-delay: .22s; height: 14px; }
.tuning-wave span:nth-child(5n)   { animation-delay: .34s; }
@keyframes wave-bounce {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(3.4); }
}

.tuning-label {
  font-size: 12px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ============================================================
   SCREEN 2 — THE STATION
   ============================================================ */

#app {
  min-height: 100vh;
  min-height: 100dvh;
  animation: app-in .7s ease both;
}
@keyframes app-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255, 240, 245, .85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(251, 207, 228, .6);
}

.wordmark { display: flex; align-items: center; gap: 10px; color: var(--pink); }
.wordmark-icon { width: 26px; height: 26px; }
.wordmark-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .05em;
  color: var(--ink);
}
.wordmark-text em {
  font-style: italic;
  color: var(--pink);
  margin-left: 2px;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--pink);
  background: var(--card);
  border: 1px solid var(--pink-faint);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
  animation: live-pulse 1.8s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, .45); }
  50%      { box-shadow: 0 0 0 6px rgba(236, 72, 153, 0); }
}

/* ---------- Main column ---------- */
.app-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 16px calc(var(--player-h) + env(safe-area-inset-bottom, 0px) + 28px);
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 26px 20px 30px;
  text-align: center;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-art {
  position: relative;
  width: min(230px, 62vw);
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(236, 72, 153, .25);
}
.hero-art img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* gradient + heart fallback sits underneath; if cover.jpg 404s, JS hides the img */
.hero-art-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, var(--pink-soft), var(--pink) 60%, #DB2777);
}
.hero-art-fallback svg { width: 46%; }

.hero-kicker {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--pink);
  font-weight: 600;
  margin-bottom: 8px;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 8vw, 48px);
  line-height: 1.05;
}
.hero-sub {
  margin-top: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}
.hero-stats {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}
.hero-stats strong { color: var(--ink); }
.dot-sep { margin: 0 4px; color: var(--pink-soft); }

.hero-schedule {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--pink);
}

/* live countdown chip to the next premiere */
.hero-countdown {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--pink-wash);
  border: 1px solid var(--pink-faint);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.hero-countdown strong { color: var(--pink); font-weight: 700; }
.hero-countdown .cd-date { color: var(--ink-faint); font-size: 12px; }

.hero-play-btn {
  margin-top: 18px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--pink-soft), var(--pink));
  box-shadow: 0 12px 28px rgba(236, 72, 153, .4);
  transition: transform .15s ease, box-shadow .15s ease;
}
.hero-play-btn:hover { transform: scale(1.06); box-shadow: 0 14px 32px rgba(236, 72, 153, .5); }
.hero-play-btn:active { transform: scale(.97); }
.hero-play-btn svg { width: 30px; height: 30px; fill: currentColor; }

/* play/pause icon swapping (shared with player bar button) */
.icon-pause { display: none; }
.is-playing .icon-play { display: none; }
.is-playing .icon-pause { display: block; }

/* ---------- Episode list ---------- */
.episodes {
  margin-top: 22px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 8px 10px;
}

.episodes-head {
  display: grid;
  grid-template-columns: 40px 1fr 48px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--pink-wash);
}
.episodes-head .col-num { text-align: center; }
.episodes-head .col-dur { display: flex; justify-content: flex-end; }
.episodes-head .col-dur svg { width: 15px; height: 15px; fill: currentColor; }

.ep-row {
  display: grid;
  grid-template-columns: 40px 1fr 48px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.ep-row:hover { background: var(--pink-wash); }

.ep-num {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* hover: number becomes a play glyph (desktop nicety) */
.ep-num .ep-play-glyph {
  display: none;
  width: 16px;
  height: 16px;
  fill: var(--pink);
}
@media (hover: hover) {
  .ep-row:hover .ep-num .ep-play-glyph { display: block; }
  .ep-row:hover .ep-num .ep-index { display: none; }
  .ep-row.playing:hover .ep-num .ep-play-glyph { display: none; }
}

.ep-title {
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ep-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-faint);
}

.ep-dur {
  text-align: right;
  font-size: 13px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* currently playing row */
.ep-row.playing { background: var(--pink-wash); }
.ep-row.playing .ep-title { color: var(--pink); font-weight: 600; }

/* animated equalizer bars replace the number while playing */
.eq[hidden] { display: none; }  /* keep display:flex from defeating the hidden attribute */
.eq {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 15px;
}
.eq span {
  width: 3px;
  border-radius: 1.5px;
  background: var(--pink);
  animation: eq-bounce .9s ease-in-out infinite;
}
.eq span:nth-child(1) { height: 60%; animation-delay: 0s; }
.eq span:nth-child(2) { height: 100%; animation-delay: .25s; }
.eq span:nth-child(3) { height: 45%; animation-delay: .5s; }
@keyframes eq-bounce {
  0%, 100% { transform: scaleY(.5); }
  50%      { transform: scaleY(1); }
}
/* freeze the bars when playback is paused on the current episode */
.ep-row.playing.paused .eq span { animation-play-state: paused; }

/* locked (not yet premiered) episodes */
.ep-row.locked { cursor: default; }
.ep-row.locked:hover { background: transparent; }
.ep-row.locked .ep-title { color: var(--ink-soft); }
.ep-row.locked .ep-sub { color: var(--pink); }
.ep-row.sealed .ep-sub { color: var(--ink-faint); }
.sealed-title { letter-spacing: .2em; color: var(--ink-faint) !important; }
.lock-icon {
  width: 15px;
  height: 15px;
  fill: var(--pink-faint);
  vertical-align: middle;
}
@media (hover: hover) {
  .ep-row.locked:hover .ep-num .ep-play-glyph { display: none; }
  .ep-row.locked:hover .ep-num .ep-index { display: flex; }
}

/* missing audio file → soft "coming soon" state */
.ep-row.unavailable { cursor: default; opacity: .5; }
.ep-row.unavailable:hover { background: transparent; }
.ep-row.unavailable .ep-dur { font-style: italic; font-size: 12px; }
@media (hover: hover) {
  .ep-row.unavailable:hover .ep-num .ep-play-glyph { display: none; }
  .ep-row.unavailable:hover .ep-num .ep-index { display: flex; }
}

/* ---------- Footer ---------- */
.app-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--ink-faint);
}

/* ---------- Player bar ---------- */
.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: var(--player-h);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--pink-faint);
  box-shadow: 0 -8px 30px rgba(236, 72, 153, .10);
}

.player-now {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.player-thumb {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-soft);
}
.player-thumb img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.player-thumb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, var(--pink-soft), var(--pink));
}
.player-thumb-fallback svg { width: 55%; }

.player-meta { min-width: 0; }
.player-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-sub {
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.player-buttons { display: flex; align-items: center; gap: 6px; }

.ctl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--ink-soft);
  transition: color .15s, transform .12s, background .15s;
}
.ctl-btn:hover { color: var(--ink); background: var(--pink-wash); }
.ctl-btn:active { transform: scale(.94); }
.ctl-btn svg { width: 20px; height: 20px; fill: currentColor; }

.ctl-play {
  width: 44px;
  height: 44px;
  color: #fff;
  background: linear-gradient(135deg, var(--pink-soft), var(--pink));
  box-shadow: 0 6px 16px rgba(236, 72, 153, .38);
}
.ctl-play:hover { color: #fff; background: linear-gradient(135deg, var(--pink-soft), var(--pink)); transform: scale(1.05); }
.ctl-play svg { width: 22px; height: 22px; }

/* seek row — hidden on the tightest phones only if needed; shown by default */
.player-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.time {
  font-size: 10.5px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
}
#time-elapsed { text-align: right; }

/* ---------- Range inputs (seek + volume), pink-styled ---------- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--pink) 0%, var(--pink) var(--fill, 0%), var(--pink-faint) var(--fill, 0%));
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--pink);
  box-shadow: 0 1px 4px rgba(236, 72, 153, .4);
  transition: transform .12s ease;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--pink);
  box-shadow: 0 1px 4px rgba(236, 72, 153, .4);
}
input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: transparent;
}

#seek { flex: 1; }

/* volume — desktop only */
.player-volume {
  display: none;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
}
.player-volume svg { width: 18px; height: 18px; fill: currentColor; }
#volume { width: 90px; }

/* ============================================================
   MOBILE LAYOUT (default above is mobile-ish; this tightens it)
   ============================================================ */
@media (max-width: 719px) {
  /* stack: now-playing info on top row, controls below */
  .player {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    row-gap: 6px;
  }
  .player-now { justify-self: stretch; }
}

/* ============================================================
   DESKTOP
   ============================================================ */
@media (min-width: 720px) {
  .app-header { padding: 16px 32px; }
  .app-main { padding-left: 24px; padding-right: 24px; }

  /* hero goes side-by-side like Spotify's playlist header */
  .hero {
    flex-direction: row;
    text-align: left;
    align-items: flex-end;
    gap: 32px;
    padding: 34px;
  }
  .hero-art { width: 232px; }
  .hero-info { flex: 1; }
  .hero-title { font-size: 56px; }

  /* three-zone Spotify player: now / controls / volume */
  .player {
    grid-template-columns: 1fr minmax(320px, 46%) 1fr;
    padding-left: 24px;
    padding-right: 24px;
  }
  .player-now { justify-self: start; max-width: 320px; }
  .player-volume { display: flex; justify-self: end; }
  .player-title { font-size: 14px; }
  .player-sub { font-size: 12px; }
}
