:root {
  color-scheme: dark;
  --ink: #050b1f;
  --panel: #0b1740;
  --panel-2: #15285c;
  --gold: #2de0ff;
  --gold-soft: #fff06a;
  --red: #ff4fa3;
  --cream: #f8fbff;
  --muted: #adc8ee;
  --line: rgba(45, 224, 255, .25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 50% -10%, hsla(var(--program-hue), 88%, 58%, .42), transparent 39rem),
    radial-gradient(circle at 7% 38%, rgba(255, 79, 163, .2), transparent 31rem),
    linear-gradient(180deg,  #081637 0%, var(--ink) 62%);
  color: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 66px;
  padding: 10px clamp(16px, 4vw, 56px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  background: rgba(5, 11, 31, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--cream); text-decoration: none; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-weight: 800; letter-spacing: .14em; }
.brand-mark { width: 38px; aspect-ratio: 1; display: grid; place-items: center; color: var(--ink); background: var(--gold); border-radius: 8px; font-size: .82rem; letter-spacing: 0; }
.on-air { padding: 8px 13px; border: 1px solid rgba(239,75,95,.55); border-radius: 999px; color: #ffd8dd; font-size: .78rem; font-weight: 900; letter-spacing: .16em; }
.on-air span, .live-button span { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 12px var(--red); }
#stationClock { justify-self: end; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }

main { width: min(1160px, calc(100% - 28px)); margin: 0 auto; }
.theater { position: relative; isolation: isolate; padding: clamp(30px, 5vw, 68px) 0 54px; }
.theater::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 -14px 18%;
  background-image: linear-gradient(180deg, rgba(9,7,15,.32), #09070f 93%), var(--program-art);
  background-size: cover;
  background-position: center;
  opacity: .45;
  filter: saturate(1.35);
  border-radius: 0 0 24px 24px;
}
.marquee { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.marquee p, .section-heading p { margin: 0 0 6px; color: var(--gold); font-size: .77rem; font-weight: 900; letter-spacing: .2em; }
h1, h2 { margin: 0; font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
h1 { max-width: 820px; font-size: clamp(2rem, 5vw, 4.6rem); line-height: .96; letter-spacing: -.04em; }
h2 { font-size: clamp(1.8rem, 4vw, 3.2rem); letter-spacing: -.025em; }
.program-time { flex: 0 0 auto; color: var(--muted); font-weight: 700; }

.screen-shell { position: relative; overflow: hidden; width: 100%; aspect-ratio: 16 / 9; display: grid; place-items: center; background-color: #000; background-image: linear-gradient(145deg, hsla(var(--program-hue),75%,26%,.72), rgba(0,0,0,.74)), var(--program-art); background-size: cover; background-position: center; border: 1px solid rgba(243,199,106,.55); border-radius: 9px; box-shadow: 0 34px 90px rgba(0,0,0,.6), 0 0 55px hsla(var(--program-hue),80%,52%,.25); }
.screen-glow { position: absolute; inset: -18%; background: radial-gradient(circle, rgba(243,199,106,.11), transparent 55%); pointer-events: none; }
.player, .player iframe { width: 100%; height: 100%; border: 0; }
.station-card { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 9px; text-align: center; background-image: linear-gradient(rgba(22,10,31,.7), rgba(8,5,12,.91)), var(--program-art); background-size: cover; background-position: center; }
.station-card[hidden] { display: none; }
.station-card p { margin: 0; color: var(--gold); font-size: .8rem; font-weight: 900; letter-spacing: .28em; }
.station-card strong { font: 700 clamp(2rem, 7vw, 5rem)/1 Inter, ui-sans-serif, system-ui, sans-serif; }
.station-card span { color: var(--muted); font-variant-numeric: tabular-nums; }
.enter-button { position: absolute; inset: 0; width: 100%; border: 0; display: grid; place-content: center; gap: 10px; color: var(--cream); background: radial-gradient(circle at 50% 45%, rgba(87,45,103,.92), rgba(6,4,9,.97) 65%); cursor: pointer; }
.enter-button span { font: 700 clamp(1.8rem, 6vw, 4rem)/1 Inter, ui-sans-serif, system-ui, sans-serif; color: var(--gold-soft); }
.enter-button small { font-size: clamp(.83rem, 2vw, 1rem); color: var(--muted); }
.enter-button[hidden] { display: none; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.controls button { min-height: 48px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; color: var(--cream); background: var(--panel); cursor: pointer; font-weight: 800; }
.controls button:hover, .controls button:focus-visible { border-color: var(--gold); background: var(--panel-2); outline: none; }
.controls .live-button { margin-left: auto; border-color: rgba(239,75,95,.45); }
.progress-wrap { margin-top: 18px; }
.progress-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: var(--muted); font-size: .82rem; }
.progress-track { height: 4px; overflow: hidden; background: #2b2432; border-radius: 999px; }
#progressBar { width: 0; height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); transition: width .5s linear; }

.next-up, .guide { padding: 58px 0; border-top: 1px solid var(--line); }
.section-heading { margin-bottom: 22px; }
.next-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.next-card { position: relative; isolation: isolate; overflow: hidden; min-height: 185px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(145deg, hsl(var(--card-hue) 52% 23%), #100d16); border: 1px solid var(--line); border-radius: 8px; }
.next-card::before { content:""; position:absolute; z-index:-1; inset:0; background-image:linear-gradient(180deg,rgba(7,4,11,.1),rgba(7,4,11,.94)),var(--card-art); background-size:cover; background-position:center; opacity:.72; }
.next-card time { color: var(--gold); font-weight: 900; }
.next-card h3 { margin: 22px 0 5px; font: 700 1.45rem/1.08 Inter, ui-sans-serif, system-ui, sans-serif; }
.next-card p { margin: 0; color: var(--muted); }
.guide-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
#guideDate { color: var(--muted); }
.guide-rows { border-top: 1px solid var(--line); }
.guide-row { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 18px; min-height: 72px; padding: 12px 5px; border-bottom: 1px solid var(--line); }
.guide-row time { color: var(--gold); font-weight: 900; }
.guide-row strong { font: 700 1.2rem Inter, ui-sans-serif, system-ui, sans-serif; }
.guide-row span { color: var(--muted); }
.guide-row.current { margin-inline: -12px; padding-inline: 17px; background: linear-gradient(90deg, rgba(239,75,95,.14), transparent); border-left: 3px solid var(--red); }
.guide-row.current::after { content: "NOW"; color: #ffd7dc; font-size: .72rem; font-weight: 900; letter-spacing: .12em; }

footer { min-height: 130px; padding: 32px max(16px, calc((100vw - 1160px) / 2)); display: flex; justify-content: space-between; gap: 20px; align-items: center; color: var(--muted); border-top: 1px solid var(--line); background: #060409; }
footer span { color: var(--gold); font: 700 1.25rem Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: .16em; }

@media (max-width: 720px) {
  .masthead { grid-template-columns: 1fr auto; }
  #stationClock { display: none; }
  .on-air { justify-self: end; }
  .marquee { align-items: start; flex-direction: column; }
  .program-time { font-size: .9rem; }
  .screen-shell { width: calc(100% + 28px); margin-left: -14px; border-radius: 0; }
  .controls { display: grid; grid-template-columns: 1fr 1fr; }
  .controls button { padding-inline: 10px; }
  .controls .live-button { grid-column: 1 / -1; margin: 0; }
  .next-grid { grid-template-columns: 1fr; }
  .next-card { min-height: 132px; }
  .guide-heading { align-items: start; flex-direction: column; }
  .guide-row { grid-template-columns: 82px 1fr; }
  .guide-row > span { display: none; }
  .guide-row.current::after { display: none; }
  footer { align-items: start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #progressBar { transition: none; }
}


/* Shared Infinity channel navigation */
.channel-menu { position: relative; justify-self: end; }
.channel-menu summary {
  min-width: 48px; min-height: 46px; padding: 0 13px; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; color: var(--cream); background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 850;
  list-style: none;
}
.channel-menu summary::-webkit-details-marker { display: none; }
.channel-menu summary > span:first-child { font-size: 1.45rem; line-height: 1; }
.channel-menu[open] summary, .channel-menu summary:focus-visible { border-color: var(--gold); outline: none; }
.channel-menu nav {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 40; width: min(260px, calc(100vw - 28px));
  padding: 8px; display: grid; gap: 4px; background: rgba(9,7,15,.98);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 22px 60px rgba(0,0,0,.58);
}
.channel-menu nav a {
  min-height: 46px; padding: 0 14px; display: flex; align-items: center; color: var(--cream);
  border-radius: 9px; text-decoration: none; font-weight: 800;
}
.channel-menu nav a:hover, .channel-menu nav a:focus-visible { background: var(--panel-2); outline: none; }
.channel-menu nav a[aria-current="page"] { color: var(--ink); background: var(--gold); }
.channel-directory {
  padding: 34px max(16px, calc((100vw - 1160px) / 2)); border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #09070f, #060409);
}
.channel-directory > p {
  margin: 0 0 15px; color: var(--gold); font-size: .78rem; font-weight: 900;
  letter-spacing: .16em; text-transform: uppercase;
}
.channel-directory nav { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 9px; }
.channel-directory a {
  min-height: 48px; padding: 10px 8px; display: grid; place-items: center; color: var(--cream);
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  text-align: center; text-decoration: none; font-weight: 850;
}
.channel-directory a:hover, .channel-directory a:focus-visible { border-color: var(--gold); background: var(--panel-2); outline: none; }
.channel-directory a[aria-current="page"] { color: var(--ink); background: var(--gold); border-color: var(--gold); }

@media (min-width: 721px) {
  .masthead { grid-template-columns: 1fr auto auto auto; }
}
@media (max-width: 900px) {
  .channel-directory nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .masthead { grid-template-columns: 1fr auto auto; gap: 9px; }
  .menu-label { display: none; }
  .channel-menu summary { padding-inline: 10px; }
  .channel-directory nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* StarCoin sharing and Infinity Phi web search */
.share-button { border-color: rgba(255,210,88,.58) !important; }
.share-status {
  min-height: 48px; padding: 0 8px; display: inline-flex; align-items: center;
  color: var(--gold-soft); font-size: .82rem; font-weight: 750;
}
.phi-web-search {
  padding: 36px max(16px, calc((100vw - 1160px) / 2)); display: grid;
  grid-template-columns: minmax(180px,.45fr) minmax(280px,1fr); gap: 22px; align-items: end;
  border-top: 1px solid var(--line); background: #09070f;
}
.phi-web-search p { margin: 0 0 7px; color: var(--gold); font-size: .76rem; font-weight: 900; letter-spacing: .2em; }
.phi-web-search h2 { margin: 0; }
.phi-web-search form {
  min-height: 58px; padding: 5px; display: grid; grid-template-columns: 1fr auto; gap: 7px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
}
.phi-web-search input {
  min-width: 0; padding: 0 16px; color: var(--cream); background: transparent; border: 0;
  outline: 0; font: inherit;
}
.phi-web-search button {
  min-height: 46px; padding: 0 18px; color: var(--ink); background: var(--gold);
  border: 0; border-radius: 999px; font: inherit; font-weight: 900; cursor: pointer;
}
@media (max-width: 720px) {
  .phi-web-search { grid-template-columns: 1fr; gap: 15px; }
  .share-status { flex-basis: 100%; }
}
