/* ===========================================================
   Go Jam Channel: our reels back to back, like a broadcast.
   Landscape: the video fills the screen; a top bar, a lower third, "up next" and the
   controls sit over it and fade away while it plays. Portrait (phones): the video sits
   under the bar and everything else stacks beneath it. One dark look, like the site.
   =========================================================== */
:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --text: #f6f6f8;
  --soft: #d4d4dc;
  --muted: #a0a0aa;
  --gold: #f0b544;
  --amber: #d97b2b;
  --grad: linear-gradient(100deg, #f0b544 0%, #d97b2b 100%);
  --azure: #47c4ff;
  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --mono: "Space Mono", ui-monospace, Menlo, "Courier New", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gl: max(20px, env(safe-area-inset-left, 0px));
  --gr: max(20px, env(safe-area-inset-right, 0px));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #000; color: var(--text); font-family: var(--mono); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--azure); outline-offset: 3px; }

#ch { position: fixed; inset: 0; overflow: hidden; }
#stage { position: absolute; inset: 0; background: #000; overflow: hidden; }
#player, #poster { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
#player iframe { display: block; width: 100%; height: 100%; border: 0; }
#poster { background: #000 center / cover no-repeat; transition: opacity 0.9s var(--ease); pointer-events: none; z-index: 1; }
#ch.playing #poster { opacity: 0; }

/* readability over any frame */
.scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0) 22%),
    linear-gradient(0deg, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0) 40%);
  transition: opacity 0.6s var(--ease);
}
/* camera corner guides, the same viewfinder motif as Go Jam TV */
.guides { position: absolute; inset: 22px; pointer-events: none; transition: opacity 0.6s var(--ease); }
.guides i { position: absolute; width: 34px; height: 34px; border: 0 solid rgba(255, 255, 255, 0.45); }
.guides .tl { left: 0; top: 0; border-left-width: 2px; border-top-width: 2px; }
.guides .tr { right: 0; top: 0; border-right-width: 2px; border-top-width: 2px; }
.guides .bl { left: 0; bottom: 0; border-left-width: 2px; border-bottom-width: 2px; }
.guides .br { right: 0; bottom: 0; border-right-width: 2px; border-bottom-width: 2px; }

/* ---------- top bar ---------- */
.bar {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: max(20px, env(safe-area-inset-top, 0px)) var(--gr) 18px var(--gl);
  transition: opacity 0.6s var(--ease);
}
.brand img { display: block; height: 36px; width: auto; }
.station { display: flex; align-items: center; gap: 12px; font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase; }
.station b { font-weight: 700; }
.onair { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px 2px rgba(240, 181, 68, 0.7); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.clock { color: var(--azure); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.links { display: flex; gap: 10px; }
.links a {
  text-decoration: none; padding: 10px 16px; border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.24); background: rgba(10, 10, 11, 0.45);
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.links a.book { background: var(--grad); border-color: transparent; color: #1a1206; }

/* ---------- filters ---------- */
.filters { position: absolute; top: 86px; left: var(--gl); display: flex; flex-wrap: wrap; gap: 8px; transition: opacity 0.6s var(--ease); }
.filters button {
  cursor: pointer; padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.2); background: rgba(10, 10, 11, 0.5);
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.filters button.on { color: var(--gold); border-color: rgba(240, 181, 68, 0.6); }

/* ---------- lower third ---------- */
.l3 {
  position: absolute; left: var(--gl); bottom: 124px; max-width: min(1100px, 68vw);
  display: flex; gap: 22px; transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.l3.out { opacity: 0; transform: translateX(-30px); }
.l3-bar { flex: none; width: 10px; border-radius: 3px; background: var(--grad); }
.kicker { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold); }
.l3 h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(34px, 5.2vw, 84px); line-height: 0.95; text-transform: uppercase; text-wrap: balance; }
.by { margin: 12px 0 0; font-size: clamp(14px, 1.3vw, 19px); color: var(--soft); }

/* ---------- up next ---------- */
.upnext {
  position: absolute; right: var(--gr); bottom: 132px; max-width: 30vw; text-align: right;
  font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
  transition: opacity 0.6s var(--ease);
}
.upnext b { display: block; margin-top: 6px; font-size: 16px; letter-spacing: 0.02em; text-transform: none; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- controls ---------- */
.controls {
  position: absolute; left: 0; right: 0; bottom: max(28px, env(safe-area-inset-bottom, 0px));
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px;
  padding: 0 var(--gr) 0 var(--gl); transition: opacity 0.6s var(--ease);
}
.ctl {
  cursor: pointer; width: 52px; height: 52px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.3); background: rgba(10, 10, 11, 0.55);
  display: grid; place-items: center;
}
.ctl-main { width: 64px; height: 64px; background: var(--grad); border-color: transparent; color: #1a1206; }
.ctl-main .i-play { display: none; }
.ctl-main.paused .i-play { display: block; }
.ctl-main.paused .i-pause { display: none; }
.pill {
  cursor: pointer; height: 44px; display: inline-flex; align-items: center; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.25); background: rgba(10, 10, 11, 0.55); text-decoration: none;
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
#sound.on { color: var(--azure); border-color: rgba(71, 196, 255, 0.6); }

.unmute {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3;
  cursor: pointer; padding: 16px 30px; border: 0; border-radius: 999px; background: var(--grad); color: #1a1206;
  font-size: 14px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.8);
}
#ch.paused .unmute { display: none; }
.status {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; max-width: 80vw;
  margin: 0; padding: 16px 24px; border-radius: 14px; background: rgba(10, 10, 11, 0.9); text-align: center; font-size: 15px;
}

/* ---------- while it plays, the chrome steps aside ---------- */
#ch.idle { cursor: none; }
#ch.idle .bar,
#ch.idle .filters,
#ch.idle .controls,
#ch.idle .upnext,
#ch.idle .guides { opacity: 0; pointer-events: none; }
#ch.idle .scrim { opacity: 0.55; }

/* ---------- portrait and small screens: stack it ---------- */
@media (max-aspect-ratio: 1/1), (max-width: 700px) {
  body { overflow-y: auto; }
  #ch { position: static; display: flex; flex-direction: column; min-height: 100%; background: var(--bg); }
  .bar { position: static; order: 1; padding-bottom: 14px; }
  .station { display: none; }
  #stage { position: relative; order: 2; inset: auto; width: 100%; aspect-ratio: 16 / 9; }
  .l3 { position: static; order: 3; max-width: none; margin: 22px var(--gr) 0 var(--gl); }
  .l3.out { opacity: 1; transform: none; }
  .controls { position: static; order: 4; margin-top: 24px; }
  .upnext { position: static; order: 5; max-width: none; margin: 26px var(--gr) 0 var(--gl); text-align: left; }
  .filters { position: static; order: 6; margin: 22px var(--gr) 36px var(--gl); }
  .scrim, .guides { display: none; }
  #ch.idle { cursor: auto; }
  #ch.idle .bar, #ch.idle .filters, #ch.idle .controls, #ch.idle .upnext { opacity: 1; pointer-events: auto; }
  .links a:not(.book) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .onair { animation: none; }
  .l3, .bar, .filters, .controls, .upnext, .scrim, .guides, #poster { transition: none; }
}
