:root {
  --navy: #0B1020;
  --panel: #151C33;
  --panel-2: #1E2747;
  --line: #1F2742;
  --yellow: #FFD23F;
  --cyan: #22D3EE;
  --white: #F4F6FB;
  --muted: #A9B1C7;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--navy); color: var(--white); }
body { font-family: 'DM Sans', system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--cyan); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }

.app { max-width: 720px; margin: 0 auto; min-height: 100vh; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + var(--safe-top)) 16px 10px; position: sticky; top: 0; z-index: 20; background: rgba(11,16,32,.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--white); }
.word { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 24px; letter-spacing: -0.03em; }
.install { background: var(--yellow); color: var(--navy); border: 0; border-radius: 999px; font-weight: 700; font-size: 14px; padding: 9px 14px; }

/* Player */
.stage { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }

.hud { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 10px; pointer-events: none; transition: opacity .3s ease; background: linear-gradient(rgba(11,16,32,.65), transparent 30%, transparent 70%, rgba(11,16,32,.65)); }
.hud.hidden { opacity: 0; }
.hud > * { pointer-events: auto; }
.hud-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tag { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--navy); background: var(--cyan); border-radius: 5px; padding: 4px 7px; }
.tag.vod { background: var(--yellow); }
.hud-channel { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.hud-bottom { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.pill { background: rgba(34,211,238,.92); color: var(--navy); border: 0; border-radius: 999px; font-weight: 700; font-size: 13px; padding: 8px 13px; }
.pill[hidden] { display: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(11,16,32,.75); color: var(--white); font-size: 22px; line-height: 1; display: grid; place-items: center; }

/* "Up next" card */
.bumper { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; gap: 4%; padding: 0 5%; background-color: var(--navy); background-image: linear-gradient(#131A31 1px, transparent 1px), linear-gradient(90deg, #131A31 1px, transparent 1px); background-size: 24px 24px; transition: opacity .25s ease; }
.bumper.off { opacity: 0; pointer-events: none; }
.bumper-text { flex: 1 1 52%; min-width: 0; }
.bumper-label { font-weight: 700; font-size: clamp(10px, 2.6vw, 15px); letter-spacing: .18em; color: var(--yellow); }
.bumper-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: clamp(16px, 5vw, 32px); line-height: 1.02; margin: 4px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bumper-channel { font-size: clamp(10px, 2.6vw, 15px); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dots { display: flex; gap: 7px; margin-top: 10px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); animation: pulse 1s ease-in-out infinite; }
.dots i:nth-child(2) { background: var(--yellow); animation-delay: .17s; }
.dots i:nth-child(3) { animation-delay: .34s; }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.bumper-thumb { flex: 0 0 42%; aspect-ratio: 16 / 9; border: 3px solid var(--cyan); border-radius: 10px; padding: 4px; background: var(--panel); }
.bumper-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; display: block; }
.bumper-thumb img:not([src]), .bumper-thumb img[src=""] { visibility: hidden; }

.status { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; text-align: center; padding: 24px; background: var(--navy); color: var(--muted); font-size: 15px; }
.status[hidden] { display: none; }
.status button { margin-top: 12px; background: var(--yellow); color: var(--navy); border: 0; border-radius: 999px; padding: 10px 16px; font-weight: 700; }

/* Below the player */
.below { padding: 14px 16px calc(24px + var(--safe-bottom)); }
.eyebrow, .section-head { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.playing-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 22px; line-height: 1.15; margin-top: 4px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 10px; }
.hint { letter-spacing: .08em; text-transform: none; font-size: 12px; }

.ch-row { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 4px 16px 8px; scrollbar-width: none; }
.ch-row::-webkit-scrollbar { display: none; }
.ch { flex: none; width: 150px; scroll-snap-align: start; border: 0; padding: 0; background: var(--panel-2); border-radius: 12px; overflow: hidden; text-align: left; box-shadow: 0 0 0 2px transparent; }
.ch .art { position: relative; display: block; aspect-ratio: 16 / 9; }
.ch .art img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ch .num { position: absolute; top: 5px; left: 5px; font-size: 10px; font-weight: 700; background: rgba(11,16,32,.85); border-radius: 4px; padding: 2px 5px; }
.ch .live { position: absolute; bottom: 5px; right: 5px; font-size: 9px; font-weight: 700; letter-spacing: .1em; color: var(--navy); background: var(--cyan); border-radius: 4px; padding: 2px 5px; }
.ch .lab { display: block; padding: 7px 9px 9px; }
.ch .name { display: block; font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch .sub { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.ch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--yellow); }
.ch[aria-pressed="true"] .lab { background: var(--yellow); color: var(--navy); }
.ch[aria-pressed="true"] .sub { color: var(--navy); }

.nownext { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.nn { background: var(--panel); border-radius: 12px; padding: 12px; }
.nn-label { font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.nn-label.on { color: var(--yellow); }
.nn-label.next { color: var(--cyan); }
.nn-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 17px; margin: 4px 0 2px; line-height: 1.15; }
.nn-desc { font-size: 13px; color: var(--muted); line-height: 1.35; }

.sched { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sched li { display: grid; grid-template-columns: 104px 1fr; gap: 10px; align-items: baseline; background: var(--panel); border-radius: 10px; padding: 10px 12px; border-left: 3px solid transparent; }
.sched .t { white-space: nowrap; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sched .n { font-weight: 700; font-size: 14px; }
.sched li.now { border-left-color: var(--yellow); background: var(--panel-2); }
.sched li.now .n::after { content: "ON NOW"; margin-left: 8px; font-size: 10px; letter-spacing: .12em; color: var(--navy); background: var(--yellow); border-radius: 4px; padding: 2px 5px; vertical-align: 2px; }

.ios-tip { position: relative; margin-top: 20px; background: var(--panel-2); border: 1px solid var(--cyan); border-radius: 12px; padding: 12px 40px 12px 12px; font-size: 14px; line-height: 1.4; }
.ios-tip[hidden] { display: none; }
.ios-tip button { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border: 0; background: none; font-size: 22px; color: var(--muted); }

.foot { margin-top: 28px; text-align: center; font-size: 13px; color: var(--muted); line-height: 1.8; }

/* Phone turned sideways: the player takes the whole screen */
@media (orientation: landscape) and (max-height: 520px) {
  .top, .below { display: none; }
  .app { max-width: none; }
  .stage { position: fixed; inset: 0; aspect-ratio: auto; height: 100vh; height: 100dvh; z-index: 30; }
}

@media (prefers-reduced-motion: reduce) {
  .dots i { animation: none; opacity: .8; }
  .hud, .bumper { transition: none; }
}
