/* =========================================================================
   Phat Choons Radio — public site styles  ·  v2 "Lane 1 / Acid-Bright"
   Direction: the same 90s FM head unit, recoloured for a 90s-rave palette.
   Near-black chassis, neon CYAN dot-matrix LCD, hot-magenta brand accent,
   and meters that run a cyan->magenta->yellow gradient with a soft bloom.
   The player is still the page. Structure & behaviour unchanged from v1.2.
   ========================================================================= */

:root {
  --chassis:    #0b0b14;
  --panel:      #14141f;
  --panel-hi:   #1c1c2a;
  --panel-edge: #2c2c40;
  --lcd-bg:     #050810;   /* cool near-black so cyan glows off it */
  --lcd-neon:   #18e0ff;   /* the LCD colour (was amber) */
  --lcd-dim:    #2a6d7a;   /* dim idle teal */
  --accent:     #ff1e8c;   /* hot magenta — primary brand accent */
  --cyan:       #18e0ff;   /* electric secondary hero */
  --yellow:     #ffe000;   /* acid accent, used sparingly */
  --paper:      #f3f1f6;
  --muted:      #9aa0b5;
  --radius:     14px;
  --font-body:  "Archivo", system-ui, sans-serif;
  --font-disp:  "Archivo Black", "Archivo", sans-serif;
  --font-lcd:   "VT323", monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(120% 90% at 50% -10%, #160b2e 0%, var(--chassis) 60%);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { width: min(680px, 92vw); margin: 0 auto; flex: 1; }

a { color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ----- Header / wordmark ------------------------------------------------ */

.site-head {
  width: min(680px, 92vw);
  margin: 0 auto;
  padding: 22px 0 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.wordmark {
  font-family: var(--font-disp);
  font-size: clamp(20px, 4.5vw, 26px);
  letter-spacing: 0.02em;
  text-decoration: none;
  transform: skewX(-6deg);
  display: inline-block;
  white-space: nowrap;
}
.wordmark-phat   { color: var(--cyan); }
.wordmark-choons { color: var(--paper); margin-left: 0.18em; }
.wordmark-radio  {
  color: var(--chassis);
  background: var(--paper);
  font-size: 0.42em;
  padding: 0.25em 0.5em;
  margin-left: 0.7em;
  border-radius: 3px;
  vertical-align: 0.45em;
  letter-spacing: 0.18em;
}

.site-nav { display: flex; gap: 4px; }
.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
}
.site-nav a:hover { color: var(--paper); background: var(--panel); }
.site-nav a[aria-current="page"] { color: var(--paper); }
.site-nav a[aria-current="page"]::after {
  content: "";
  display: block;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  margin-top: 2px;
}

/* ----- Strapline --------------------------------------------------------- */

.strap {
  margin: 26px 0 14px;
  font-size: clamp(17px, 3.6vw, 21px);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.strap-uk { color: var(--muted); font-weight: 400; }

/* ----- The unit ----------------------------------------------------------- */

.unit {
  background: linear-gradient(180deg, var(--panel-hi) 0%, var(--panel) 18%, var(--panel) 100%);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  padding: 16px 18px 20px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 18px 40px -18px rgba(0,0,0,0.7);
}

.unit-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.unit-brand {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--muted);
}
.onair {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--muted);
}
.onair-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4a4f58;
}
.onair.is-live { color: var(--paper); }
.onair.is-live .onair-dot {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.45; } }

/* ----- LCD ---------------------------------------------------------------- */

.lcd {
  background: var(--lcd-bg);
  border: 1px solid #000;
  border-radius: 8px;
  padding: 12px 14px 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6) inset;
  font-family: var(--font-lcd);
  color: var(--lcd-neon);
  text-shadow: 0 0 8px rgba(24,224,255,0.45), 0 0 2px rgba(24,224,255,0.55);
  overflow: hidden;
}

.lcd-line { white-space: nowrap; overflow: hidden; }

.lcd-marquee { font-size: clamp(24px, 6vw, 34px); line-height: 1.1; }
.lcd-scroll {
  display: inline-block;
  padding-left: 0;
  animation: lcd-scroll 16s linear infinite;
}
@keyframes lcd-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.lcd-sub {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 6px;
  font-size: 17px;
  color: var(--lcd-dim);
}

/* meters: idle = flat dim teal, .is-live = dancing neon gradient + bloom.
   Animated via transform (not height) — composited, reliable in every
   browser including ones that throttle layout animations. */
.lcd-meters { display: inline-flex; gap: 3px; align-items: flex-end; height: 18px; }
.lcd-meters i {
  width: 5px;
  height: 18px;
  background: var(--lcd-dim);
  display: inline-block;
  transform: scaleY(0.17);
  transform-origin: bottom;
}
.lcd-meters.is-live i {
  background: linear-gradient(to top, var(--cyan) 0%, var(--accent) 55%, var(--yellow) 100%);
  box-shadow: 0 0 6px rgba(255,30,140,0.45), 0 0 11px rgba(24,224,255,0.28);
  animation: meter 0.9s ease-in-out infinite;
}
.lcd-meters.is-live i:nth-child(1)  { animation-duration: 0.74s; }
.lcd-meters.is-live i:nth-child(2)  { animation-duration: 0.92s; animation-delay: 0.08s; }
.lcd-meters.is-live i:nth-child(3)  { animation-duration: 0.66s; animation-delay: 0.14s; }
.lcd-meters.is-live i:nth-child(4)  { animation-duration: 1.02s; animation-delay: 0.05s; }
.lcd-meters.is-live i:nth-child(5)  { animation-duration: 0.81s; animation-delay: 0.18s; }
.lcd-meters.is-live i:nth-child(6)  { animation-duration: 0.71s; animation-delay: 0.02s; }
.lcd-meters.is-live i:nth-child(7)  { animation-duration: 0.95s; animation-delay: 0.11s; }
.lcd-meters.is-live i:nth-child(8)  { animation-duration: 0.69s; animation-delay: 0.21s; }
.lcd-meters.is-live i:nth-child(9)  { animation-duration: 0.88s; animation-delay: 0.07s; }
.lcd-meters.is-live i:nth-child(10) { animation-duration: 0.78s; animation-delay: 0.16s; }
@keyframes meter { 0%,100% { transform: scaleY(0.17); } 50% { transform: scaleY(1); } }

/* ----- Dial strip ----------------------------------------------------------- */

.dial { position: relative; height: 30px; margin: 14px 2px 4px; }
.dial-ticks {
  position: absolute; inset: 10px 0 10px;
  background:
    repeating-linear-gradient(90deg,
      var(--panel-edge) 0 1px, transparent 1px 9%),
    repeating-linear-gradient(90deg,
      #4a4f58 0 1px, transparent 1px 3%);
  background-position: 0 0, 0 3px;
  background-size: 100% 100%, 100% 5px;
  background-repeat: no-repeat, repeat-y;
  opacity: 0.9;
}
.dial-marker {
  position: absolute;
  left: 68%;
  top: 0;
  transform: translateX(-50%);
  text-align: center;
}
.dial-marker::before {
  content: "";
  display: block;
  width: 2px; height: 18px;
  margin: 0 auto 2px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}
.dial-marker span {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--cyan);
}

/* ----- Transport --------------------------------------------------------- */

.transport {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 14px;
}

.play {
  flex: none;
  width: 84px; height: 84px;
  border-radius: 50%;
  border: 1px solid var(--panel-edge);
  background:
    radial-gradient(circle at 35% 30%, #2a2a3a 0%, var(--panel) 60%);
  color: var(--paper);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 8px 18px -8px rgba(0,0,0,0.8);
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.play:hover {
  box-shadow:
    0 0 0 3px rgba(24,224,255,0.28),
    0 0 20px rgba(24,224,255,0.22),
    0 8px 18px -8px rgba(0,0,0,0.8);
}
.play:active { transform: scale(0.97); }
.play .ic { width: 34px; height: 34px; fill: currentColor; }
.play .ic-stop { display: none; }
.play[aria-pressed="true"] { color: var(--cyan); }
.play[aria-pressed="true"] .ic-play { display: none; }
.play[aria-pressed="true"] .ic-stop { display: block; }
.play.is-loading { color: var(--muted); }

.transport-side { flex: 1; min-width: 0; display: grid; gap: 12px; }

.vol { display: flex; align-items: center; gap: 10px; }
.vol-label { font-size: 10px; letter-spacing: 0.2em; color: var(--muted); }
.vol input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--panel-edge);
  cursor: pointer;
}
.vol input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px; height: 26px;
  border-radius: 3px;
  background: linear-gradient(180deg, #d9dadd, #aeb1b6);
  border: 1px solid #74777d;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.vol input[type="range"]::-moz-range-thumb {
  width: 14px; height: 26px;
  border-radius: 3px;
  background: linear-gradient(180deg, #d9dadd, #aeb1b6);
  border: 1px solid #74777d;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.quality { display: flex; gap: 8px; }
.quality button {
  font: 600 11px/1 var(--font-body);
  letter-spacing: 0.14em;
  color: var(--muted);
  background: var(--chassis);
  border: 1px solid var(--panel-edge);
  border-radius: 5px;
  padding: 7px 12px;
  cursor: pointer;
}
.quality button[aria-pressed="true"] {
  color: var(--paper);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.unit-msg {
  margin: 14px 2px 0;
  font-size: 14px;
  color: var(--lcd-neon);
}

/* ----- Cast button (revealed only when a Cast device is present) ----------- */

.cast {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 11px/1 var(--font-body);
  letter-spacing: 0.14em;
  color: var(--muted);
  background: var(--chassis);
  border: 1px solid var(--panel-edge);
  border-radius: 5px;
  padding: 7px 12px;
  cursor: pointer;
}
.cast .ic-cast { width: 14px; height: 14px; fill: currentColor; }
.cast:hover { color: var(--paper); }
.cast[aria-pressed="true"] {
  color: var(--paper);
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan) inset;
}

/* ----- Long-session check ("are you still there?") ------------------------- */

.still {
  margin: 14px 2px 0;
  padding: 14px 16px;
  background: var(--panel-hi);
  border: 1px solid var(--accent);
  border-radius: 10px;
}
.still-title {
  margin: 0 0 4px;
  font: 600 15px/1.3 var(--font-body);
  color: var(--paper);
}
.still-line {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
}
.still-count {
  display: inline-block;
  margin-left: 4px;
  font-family: var(--font-lcd);
  font-size: 18px;
  color: var(--lcd-neon);
}
.still-yes {
  font: 600 12px/1 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  cursor: pointer;
}
.still-yes:hover { filter: brightness(1.1); }

/* ----- Sponsor strip (future, dormant until cfg.adsEndpoint set) ----------- */

.sponsor { margin-top: 22px; }
.sponsor-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.sponsor-card {
  display: block;
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px;
}
.sponsor-card:hover { background: var(--panel-hi); }
.sponsor-name { display: block; font-weight: 600; }
.sponsor-line { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }

/* ----- Recently played ------------------------------------------------------ */

.history { margin: 34px 0 50px; }
.history-title {
  font-family: var(--font-disp);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 10px 2px;
  border-bottom: 1px solid var(--panel);
  font-size: 15px;
}
.history-time {
  flex: none;
  font-family: var(--font-lcd);
  font-size: 17px;
  color: var(--lcd-dim);
  min-width: 58px;
}
.history-song { min-width: 0; }
.history-song b { font-weight: 600; }
.history-song span { color: var(--muted); }
.history-empty { color: var(--muted); border-bottom: none !important; }

/* ----- Content pages (about / advertise / contact / privacy) ---------------- */

.page { margin: 30px 0 60px; }
.page h1 {
  font-family: var(--font-disp);
  font-size: clamp(26px, 6vw, 34px);
  letter-spacing: 0.01em;
  margin: 0 0 18px;
  transform: skewX(-4deg);
}
.page h2 {
  font-size: 18px;
  margin: 28px 0 8px;
}
.page p { color: #c9ccd2; max-width: 58ch; }
.page .lead { font-size: 18px; color: var(--paper); }
/* content links pop cyan — but NOT the .cta button (it sets its own colour) */
.page p a, .page li a { color: var(--cyan); }
.page p a:hover, .page li a:hover { text-decoration: underline; }

.page ul.plain { color: #c9ccd2; max-width: 60ch; padding-left: 1.1em; }
.page ul.plain li { margin: 6px 0; }
.page .muted-note { font-size: 13px; color: var(--muted); }

.usps { list-style: none; margin: 18px 0; padding: 0; display: grid; gap: 10px; }
.usps li {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 10px;
  padding: 13px 16px;
}
.usps b { display: block; margin-bottom: 2px; }
.usps span { font-size: 14px; color: var(--muted); }

/* ----- Advertise: placeholder rate cards ------------------------------------ */

.rates {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin: 22px 0 10px;
}
.rate {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  padding: 16px 18px;
}
.rate.is-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.rate h3 { margin: 0 0 4px; font-size: 16px; }
.rate .price { font-family: var(--font-disp); font-size: 26px; color: var(--cyan); line-height: 1.1; }
.rate .price small { font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0.04em; }
.rate ul { list-style: none; margin: 10px 0 0; padding: 0; }
.rate li { font-size: 13px; color: var(--muted); padding: 3px 0; }
.rate-note { font-size: 13px; color: var(--muted); font-style: italic; margin-top: 6px; }

.cta {
  display: inline-block;
  margin-top: 8px;
  background: var(--accent);
  color: #0b0b14;
  font-weight: 600;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 8px;
}
.cta:hover { filter: brightness(1.08); box-shadow: 0 0 18px rgba(255,30,140,0.35); }

/* ----- Footer ----------------------------------------------------------------- */

.site-foot {
  width: min(680px, 92vw);
  margin: 0 auto;
  padding: 20px 0 28px;
  border-top: 1px solid var(--panel);
  font-size: 13px;
  color: var(--muted);
}
.site-foot p { margin: 4px 0; }
.foot-small { font-size: 12px; }
.foot-credit { margin: 4px 0; }

/* licence credits — PRS for Music + PPL.
   Each slot reserves space for the OFFICIAL logo artwork (do not redraw).
   Drop the supplied file in as <img ... height="30"> and delete the
   .logo-ph placeholder span. Online minimum size is 35px wide; the dashed
   chip below keeps clear space around the mark. PPL allows a white/reversed
   or white-monochrome version on dark backgrounds — use that here. */
.foot-licences {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.licence-logo { display: inline-flex; align-items: center; min-height: 34px; text-decoration: none; }
.licence-logo img { height: 30px; width: auto; display: block; }
.logo-ph {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border: 1px dashed var(--panel-edge);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.licence-logo:hover .logo-ph { color: var(--paper); border-color: var(--cyan); }

.foot-meta { display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0; }
.foot-meta a { color: var(--muted); text-decoration: none; font-size: 13px; }
.foot-meta a:hover { color: var(--paper); }

/* ----- Small screens ------------------------------------------------------------ */

@media (max-width: 480px) {
  .transport { gap: 16px; }
  .play { width: 72px; height: 72px; }
  .site-nav a { padding: 6px 7px; }
}

/* ----- Reduced motion ------------------------------------------------------------
   The LCD marquee keeps scrolling: it is functional (the only way to read a
   long track name), slow, and linear. Meters slow to a gentle pulse rather
   than freezing; the pulsing ON AIR dot becomes static. */

@media (prefers-reduced-motion: reduce) {
  .lcd-meters.is-live i { animation-duration: 3s !important; }
  .onair.is-live .onair-dot { animation: none; }
}
/* The same player remains mounted when site content changes. */
.unit [hidden], #sponsor[hidden], .pc-nav-notice[hidden] { display: none !important; }
.pc-has-mini { padding-bottom: 280px; }
.unit.pc-mini {
  position: fixed; z-index: 20; bottom: 12px; left: 12px; right: 12px;
  width: auto; max-width: 760px; margin: 0 auto;
  padding: 12px 18px; max-height: 70vh; overflow-y: auto;
  box-shadow: 0 8px 35px #000b;
}
.pc-mini .dial, .pc-mini .unit-brand { display: none; }
.pc-mini .unit-top { margin-bottom: 6px; }
.pc-mini .lcd { margin-bottom: 8px; }
.pc-mini .transport { padding-top: 0; }
.pc-mini .play { width: 52px; height: 52px; flex-shrink: 0; }
.pc-mini .vol { display: none; }
.pc-mini .quality { flex-wrap: wrap; }
.pc-mini .transport-side { min-width: 0; }
.pc-diagnostics { display: block; margin: 10px auto 0; font: inherit; font-size: .75rem; cursor: pointer; }
.pc-test-banner, .pc-nav-notice { padding: 10px 16px; margin: 0; text-align: center; background: #ffca42; color: #161421; }
@media (max-width: 480px) {
  .pc-mini .quality button { padding: 6px; font-size: .7rem; }
  .unit.pc-mini { padding: 10px; bottom: 6px; left: 6px; right: 6px; }
}
