/* =========================================================================
   GrindFM event-first layout: events in the middle, the radio as a compact card
   ========================================================================= */
.radio { max-width: 1360px; }
.radio-head { display: grid; grid-template-columns: 1fr auto 1fr; }
.radio-head .listeners { justify-self: end; grid-column: -2 / -1; grid-row: 1; } /* far right, also when the ticker is hidden */

/* Ticker: the next event, always in sight */
.ev-ticker { justify-self: center; display: inline-flex; align-items: center; gap: 10px; max-width: min(620px, 56vw); padding: 9px 20px; border-radius: 999px; border: 1px solid rgba(226, 182, 90, .45); background: linear-gradient(90deg, rgba(226, 182, 90, .14), rgba(226, 182, 90, .05)); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; box-shadow: 0 0 24px rgba(226, 182, 90, .12); transition: transform .15s, box-shadow .2s; }
.ev-ticker:hover { transform: translateY(-1px); box-shadow: 0 0 34px rgba(226, 182, 90, .25); }
.ev-ticker b { color: var(--gold); font-variant-numeric: tabular-nums; }
.ev-ticker .dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.ev-ticker.live { border-color: rgba(255, 92, 122, .6); background: linear-gradient(90deg, rgba(255, 92, 122, .22), rgba(255, 92, 122, .06)); }
.ev-ticker.live .dot { background: #ff5c7a; box-shadow: 0 0 12px #ff5c7a; animation: pulse 1.4s infinite; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 22px; align-items: start; }
.main-col, .side-col { display: grid; gap: 22px; min-width: 0; }
.side-col { position: sticky; top: 16px; }
.main-col .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Next event: a big card with the countdown */
.ev-area { min-width: 0; }
.ev-next { position: relative; overflow: hidden; padding: 34px 36px; border-radius: 26px; border: 1px solid rgba(226, 182, 90, .28); background: radial-gradient(120% 140% at 0% 0%, rgba(226, 182, 90, .20), transparent 55%), radial-gradient(90% 120% at 100% 100%, rgba(255, 92, 122, .12), transparent 60%), var(--card); backdrop-filter: blur(18px); }
.ev-next::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(115deg, transparent 40%, rgba(255, 240, 200, .06) 50%, transparent 60%); background-size: 250% 100%; animation: sheen 6s ease-in-out infinite; }
@keyframes sheen { 0%, 100% { background-position: 120% 0; } 50% { background-position: -20% 0; } }
.ev-next-label { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.ev-next-title { margin: 14px 0 6px; font-size: clamp(28px, 4vw, 46px); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; text-transform: none; color: var(--text); }
.ev-next-desc { margin: 0 0 18px; max-width: 640px; color: #cfc6b8; font-size: 15px; }
.ev-count { display: flex; gap: 12px; margin: 8px 0 16px; }
.ev-count div { min-width: 86px; padding: 14px 10px 10px; border-radius: 18px; text-align: center; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
.ev-count b { display: block; font-size: 40px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; background: linear-gradient(180deg, #fff6dc, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ev-count span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.ev-next-when { margin-bottom: 18px; color: var(--muted); font-size: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-small { padding: 7px 14px; font-size: 13px; }

/* Live: the stage */
.ev-live { padding: 14px; border-radius: 26px; border: 1px solid rgba(255, 92, 122, .4); background: var(--card); backdrop-filter: blur(18px); box-shadow: 0 0 60px rgba(255, 92, 122, .12); }
.ev-live-head { display: flex; align-items: baseline; gap: 12px; padding: 4px 6px 12px; min-width: 0; }
.ev-live-head b { font-size: 20px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-live-head span:last-child { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-live-badge { flex: none; padding: 3px 10px; border-radius: 999px; background: #ff3b5c; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .08em; animation: onairpulse 1.6s ease-in-out infinite; }

.stage { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #000; }
.stage-main, .stage-main iframe, .stage-ov { position: absolute; inset: 0; }
.stage-main iframe, .stage-pip iframe { width: 100%; height: 100%; border: 0; display: block; }
.stage-main iframe.fade-in { opacity: 0; transition: opacity 1s ease; }
.stage-main iframe.fade-in.on { opacity: 1; }
.stage-pip { position: absolute; width: 28%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 2px solid rgba(255, 255, 255, .7); box-shadow: 0 10px 30px rgba(0, 0, 0, .6); z-index: 2; transition: all .4s ease; }
.stage-pip.hidden { display: none; }

/* Screen shares (Share to GrindFM) play in a video element of their own */
.share-player { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, #1b1822, #000 75%); }
.stage-main .share-player.fade-in { opacity: 0; transition: opacity 1s ease; }
.stage-main .share-player.fade-in.on { opacity: 1; }
.share-player video { width: 100%; height: 100%; object-fit: contain; display: block; opacity: 0; transition: opacity .5s ease; }
.share-player.playing video { opacity: 1; }
.share-note { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 8%; text-align: center; color: var(--muted); font-size: clamp(11px, 1.5vw, 15px); transition: opacity .4s ease; }
.share-note b { font-weight: 600; }
.share-player.playing .share-note { opacity: 0; pointer-events: none; }
.share-spin { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(226, 182, 90, .2); border-top-color: var(--gold); animation: sharespin 1s linear infinite; }
.stage-pip .share-spin { width: 14px; height: 14px; }
.stage-pip .share-note b { display: none; }
@keyframes sharespin { to { transform: rotate(360deg); } }
.share-sound { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); z-index: 4; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--gold); background: rgba(11, 10, 13, .85); color: var(--gold); font: inherit; font-weight: 700; cursor: pointer; }
.pip-tl { top: 3%; left: 2%; } .pip-tr { top: 3%; right: 2%; } .pip-bl { bottom: 4%; left: 2%; } .pip-br { bottom: 4%; right: 2%; }
.stage-ov { z-index: 3; pointer-events: none; }
.ov-win { position: absolute; inset: 0; }

/* Frame overlay (e.g. the GrindFM frame). "Inside": the picture, picture-in-picture and the
   other overlays move into the frame's window (measured on the frame's transparent middle,
   kept at 16:9; the frame may overlap its edges a little, it always lies on top). */
.stage { --fx: 17.5%; --fy: 7%; --fw: 69%; --fh: 69%; }
.ov-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.stage-main { transition: left .6s ease, top .6s ease, width .6s ease, height .6s ease; }
.stage.framed { background: radial-gradient(ellipse at 50% 40%, #2a1512, #0b0a0d 70%); }
.stage.framed .stage-main, .stage.framed .ov-win { inset: auto; left: var(--fx); top: var(--fy); width: var(--fw); height: var(--fh); }
.stage.framed .stage-main { background: #000; }
.stage.framed .stage-pip { width: calc(var(--fw) * .3); border-width: 1px; }
.stage.framed .pip-tl { top: calc(var(--fy) + var(--fh) * .04); left: calc(var(--fx) + var(--fw) * .025); }
.stage.framed .pip-tr { top: calc(var(--fy) + var(--fh) * .04); right: calc(100% - var(--fx) - var(--fw) + var(--fw) * .025); }
.stage.framed .pip-bl { bottom: calc(100% - var(--fy) - var(--fh) + var(--fh) * .05); left: calc(var(--fx) + var(--fw) * .025); }
.stage.framed .pip-br { bottom: calc(100% - var(--fy) - var(--fh) + var(--fh) * .05); right: calc(100% - var(--fx) - var(--fw) + var(--fw) * .025); }
.stage-empty { position: absolute; inset: 0; display: none; place-items: center; color: var(--muted); }
.stage.is-empty .stage-empty { display: grid; }

/* Overlays */
.ov { position: absolute; animation: ovin .5s ease; }
@keyframes ovin { from { opacity: 0; transform: translateY(10px); } }
.ov-lower { left: 4%; bottom: 8%; max-width: 70%; padding: 12px 20px 12px 18px; border-left: 4px solid var(--gold); border-radius: 4px 14px 14px 4px; background: linear-gradient(90deg, rgba(11, 10, 13, .92), rgba(11, 10, 13, .7)); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.ov-lower b { display: block; font-size: clamp(16px, 2.2vw, 28px); font-weight: 800; color: #fff; }
.ov-lower span { display: block; color: var(--gold); font-size: clamp(12px, 1.4vw, 17px); }
.ov-ticker { left: 0; right: 0; bottom: 0; overflow: hidden; padding: 7px 0; background: rgba(11, 10, 13, .85); border-top: 2px solid var(--gold); }
.ov-ticker div { display: inline-flex; gap: 80px; white-space: nowrap; animation: marquee 22s linear infinite; padding-left: 100%; }
.ov-ticker span { color: #fff; font-weight: 600; font-size: clamp(12px, 1.4vw, 16px); }
@keyframes marquee { to { transform: translateX(-100%); } }
.ov-count { padding: 10px 16px; border-radius: 14px; background: rgba(11, 10, 13, .82); border: 1px solid rgba(226, 182, 90, .5); text-align: center; }
.ov-count small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.ov-count b { display: block; color: var(--gold); font-size: clamp(16px, 2vw, 26px); font-weight: 800; font-variant-numeric: tabular-nums; }
.ov-image { max-width: 22%; max-height: 30%; object-fit: contain; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .6)); }
.ov-tl { top: 4%; left: 3%; } .ov-tr { top: 4%; right: 3%; } .ov-bl { bottom: 10%; left: 3%; } .ov-br { bottom: 10%; right: 3%; }
.ov-c { top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* Radio as a compact card */
.radio-card { display: grid; gap: 0; }
.radio-card .hero { padding: 18px; gap: 20px; border-radius: 22px 22px 0 0; }
.radio-card .cover-wrap { flex-basis: 132px; }
.radio-card .title { font-size: clamp(20px, 2.4vw, 28px); margin-top: 10px; }
.radio-card .artist { font-size: 16px; }
.radio-card .eq { margin: 12px 0 8px; height: 20px; }
.radio-card .controls { margin: 0; border-radius: 0 0 22px 22px; border-top: 0; }
/* While an event is live the radio card is dimmed, but its volume stays usable: it sets the stream's volume then. */
.radio-card.paused .hero { opacity: .45; pointer-events: none; filter: grayscale(.4); }
.radio-card.paused .controls .skip { opacity: .45; pointer-events: none; }
.radio-paused { padding: 10px 16px; border-radius: 14px 14px 0 0; background: rgba(255, 92, 122, .14); color: #ffb3c1; font-size: 13px; font-weight: 600; }

/* Upcoming events: calendar list */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.ev-panel { padding: 18px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(16px); }
.ev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ev-list li { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: 16px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); transition: border-color .2s, transform .2s; }
.ev-list li:hover { transform: translateX(3px); border-color: rgba(226, 182, 90, .45); }
.ev-list li.next { border-color: rgba(226, 182, 90, .55); background: linear-gradient(90deg, rgba(226, 182, 90, .12), rgba(0, 0, 0, .2)); }
.ev-date { flex: none; width: 54px; padding: 6px 0; border-radius: 12px; text-align: center; background: linear-gradient(180deg, rgba(226, 182, 90, .3), rgba(226, 182, 90, .1)); border: 1px solid rgba(226, 182, 90, .35); }
.ev-date b { display: block; font-size: 22px; font-weight: 800; line-height: 1; color: #fff3d0; }
.ev-date span { display: block; margin-top: 2px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.ev-info { min-width: 0; }
.ev-info b, .ev-info span, .ev-info em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-info b { font-weight: 700; }
.ev-info span { color: var(--muted); font-size: 12px; }
.ev-info em { font-style: normal; color: var(--gold); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ev-empty { color: var(--muted); font-size: 13px; justify-content: center; }
.side-col .chat-log { height: 420px; }

/* Hand-in dialog */
.submit-dialog { width: min(460px, 92vw); padding: 0; border: 1px solid var(--line); border-radius: 22px; background: #15131a; color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.submit-dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); }
.submit-dialog form { display: grid; gap: 12px; padding: 24px; }
.submit-dialog h2 { margin: 0; font-size: 18px; color: var(--text); letter-spacing: 0; text-transform: none; }
.submit-dialog .field { width: 100%; margin: 0; }

/* While an event is live the page leans into it */
body.event-live .backdrop { filter: blur(80px) saturate(1.4) brightness(.35); }

/* The DJ monitor keeps showing only the radio */
body.monitor .layout { grid-template-columns: minmax(0, 1fr); }
body.monitor .ev-area, body.monitor .ev-panel, body.monitor .main-col .grid, body.monitor .ev-ticker { display: none !important; }

@media (max-width: 1060px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side-col { position: static; }
}
@media (max-width: 760px) {
  .radio-head { grid-template-columns: 1fr auto; }
  .ev-ticker { grid-column: 1 / -1; grid-row: 2; max-width: 100%; justify-self: stretch; justify-content: center; }
  .ev-next { padding: 22px 18px; }
  .ev-count div { min-width: 0; flex: 1; padding: 10px 4px 8px; }
  .ev-count b { font-size: 28px; }
  .main-col .grid { grid-template-columns: minmax(0, 1fr); }
  .radio-card .hero { flex-direction: row; align-items: center; }
  .radio-card .cover-wrap { flex: 0 0 96px; width: 96px; margin: 0; }
}

/* Per-event stream hand-in */
.ev-list li .ev-info { flex: 1; }
.ev-stream { flex: none; padding: 6px 10px; border-radius: 10px; border: 1px solid rgba(226, 182, 90, .45); background: transparent; color: var(--gold); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; opacity: .85; transition: background .15s, opacity .15s; }
.ev-stream:hover { opacity: 1; background: var(--gold-soft); }

/* =========================================================================
   The screen in the middle: live broadcast, or off air the GrindFM frame with the
   countdown to the next broadcast. The radio sits beside it.
   ========================================================================= */
.screen { padding: 14px; border-radius: 26px; border: 1px solid var(--line); background: var(--card); backdrop-filter: blur(18px); transition: border-color .4s, box-shadow .4s; }
.screen.live { border-color: rgba(255, 92, 122, .4); box-shadow: 0 0 60px rgba(255, 92, 122, .12); }
.screen-head { display: flex; align-items: baseline; gap: 12px; min-width: 0; padding: 4px 6px 12px; }
.screen-head b { font-size: 20px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen-head > #evlivedesc { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen:not(.live) .ev-live-badge { background: rgba(255, 255, 255, .08); color: var(--muted); animation: none; }
.screen .ev-live { padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; }
.screen-box { container-type: inline-size; }

.standby { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: radial-gradient(ellipse at 50% 35%, rgba(70, 26, 20, .9), #0b0a0d 72%); }
.sb-frame { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; }
.sb-win { position: absolute; z-index: 1; left: 17.5%; top: 7%; width: 69%; height: 69%; display: grid; place-items: center; }
.standby .ev-next { position: relative; z-index: 1; padding: 2cqw 3cqw 7cqw; border: 0; border-radius: 0; background: none; backdrop-filter: none; text-align: center; display: grid; justify-items: center; }
.standby .ev-next::after { display: none; }
.standby .ev-next-label { padding: .4cqw 1.4cqw; font-size: max(10px, 1.05cqw); background: rgba(255, 255, 255, .08); color: #d7d2c8; }
.sb-in { margin-top: 1.6cqw; color: var(--gold); font-size: max(11px, 1.3cqw); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.standby .ev-count { justify-content: center; gap: 1cqw; margin: 1cqw 0 1.4cqw; }
.standby .ev-count div { min-width: 8.5cqw; padding: 1.2cqw .8cqw .9cqw; border-radius: 1.4cqw; background: rgba(0, 0, 0, .5); }
.standby .ev-count b { font-size: max(20px, 4.4cqw); }
.standby .ev-count span { margin-top: .5cqw; font-size: max(9px, .95cqw); }
.standby .ev-next-title { margin: .4cqw 0; font-size: max(18px, 3cqw); }
.standby .ev-next-when { margin-bottom: 1.4cqw; font-size: max(12px, 1.25cqw); }
.standby .ev-next-desc { max-width: 46cqw; margin: .8cqw auto 1.4cqw; font-size: max(12px, 1.3cqw); }
.standby .btn-row { justify-content: center; }
.standby .btn { padding: max(7px, .8cqw) max(14px, 1.8cqw); font-size: max(12px, 1.2cqw); }
.sb-np { display: flex; align-items: center; gap: 1.2cqw; max-width: 44cqw; padding: .9cqw 1.6cqw .9cqw .9cqw; border-radius: 1.4cqw; background: rgba(0, 0, 0, .45); border: 1px solid var(--line); text-align: left; }
.sb-np:empty { display: none; }
.sb-np img, .sb-np i { flex: none; width: max(36px, 4.6cqw); height: max(36px, 4.6cqw); border-radius: .8cqw; object-fit: cover; display: grid; place-items: center; background: #15131a; font-style: normal; color: var(--gold); font-size: max(16px, 2cqw); }
.sb-np span { min-width: 0; display: grid; line-height: 1.25; }
.sb-np small { color: #6ee7a0; font-size: max(9px, .9cqw); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.sb-np b, .sb-np em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-np b { font-size: max(13px, 1.4cqw); }
.sb-np em { color: var(--muted); font-style: normal; font-size: max(11px, 1.15cqw); }
/* Too small for the frame (phones): the countdown fills the screen. */
@container (max-width: 420px) {
  .standby { aspect-ratio: auto; }
  .sb-frame { display: none; }
  .sb-win { position: relative; inset: auto; width: 100%; height: auto; padding: 22px 10px; }
  .standby .ev-next { padding: 6px; }
  .standby .ev-count div { min-width: 0; flex: 1; }
  .sb-np, .standby .ev-next-desc { max-width: 100%; }
}

/* The radio beside the screen */
.side-col { position: static; }
.side-col .radio-card .hero { flex-direction: row; align-items: center; gap: 16px; padding: 16px; }
.side-col .radio-card .cover-wrap { flex: 0 0 104px; width: 104px; }
.side-col .radio-card .onair b { font-size: 40px; }
.side-col .radio-card .onair span { width: 70px; height: 70px; }
.side-col .radio-card .title { font-size: 21px; margin-top: 8px; }
.side-col .radio-card .artist { font-size: 15px; }
.side-col .radio-card .album { font-size: 12px; }
.side-col .radio-card .eq { margin: 8px 0 6px; height: 16px; }
.side-col .radio-card .controls { gap: 8px; padding: 10px 12px; }
.side-col .radio-card .controls input[type=range] { max-width: none; }
.side-col .radio-card .reactions { margin-left: 0; order: 3; flex: 1; justify-content: space-between; }
.side-col .radio-card .reactions button { width: 36px; height: 36px; font-size: 18px; }
.side-col .radio-card .skip { order: 4; height: 38px; padding: 0 14px; }
/* Events and chat under the screen: two cards of the same height */
.under-screen { align-items: stretch; }
.under-screen > .panel { display: flex; flex-direction: column; padding: 18px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(16px); }
.under-screen .panel-head, .under-screen .chat > h2 { flex: none; min-height: 32px; display: flex; align-items: center; margin: 0 0 12px; }
.under-screen .ev-list { flex: 1; min-height: 0; overflow-y: auto; align-content: start; }
.under-screen .chat-log { height: 300px; }
@media (min-width: 1061px) {
  .under-screen > .panel { height: 440px; }
  .under-screen .chat-log { flex: 1; min-height: 0; height: auto; }
}
.under-screen .chat-form { flex: none; }
/* One column: screen, radio, events, channels, hunting grounds, chat, recently played. */
@media (max-width: 1060px) {
  .main-col, .side-col, .under-screen, .side-pair { display: contents; }
  .layout > * { min-width: 0; }
  .screen { order: 1; }
  .radio-card { order: 2; }
  .ev-panel { order: 3; }
  .vote-panel { order: 4; }
  .hunt-panel { order: 5; }
  .chat { order: 6; }
  .recent-panel { order: 7; }
}

/* Channel vote and recently played, small and side by side in the right column */
@media (min-width: 1061px) {
  .side-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
  .side-pair h2 { margin-bottom: 10px; font-size: 11px; }
  .side-pair .channels { gap: 6px; }
  .side-pair .chan-btn { padding: 8px 10px; border-radius: 10px; font-size: 13px; gap: 6px; }
  .side-pair .chan-btn:hover:not(:disabled) { transform: translateX(2px); }
  .side-pair .chan-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-pair .chan-name small { display: inline-block; width: 7px; height: 7px; margin-left: 6px; padding: 0; font-size: 0; vertical-align: middle; border-radius: 50%; box-shadow: 0 0 8px var(--gold); }
  .side-pair .chan-votes { font-size: 12px; }
  .side-pair .chan-votes i { display: none; }
  .side-pair .hint { margin-top: 8px; font-size: 11px; line-height: 1.4; }
  .side-pair .history { gap: 6px; }
  .side-pair .history li { gap: 8px; padding: 5px; border-radius: 10px; }
  .side-pair .history li:nth-child(n+6) { display: none; }
  .side-pair .history img, .side-pair .history .ph { flex-basis: 32px; width: 32px; height: 32px; border-radius: 6px; }
  .side-pair .history b { font-size: 12px; }
  .side-pair .history span { font-size: 11px; }
  .side-pair .history .empty { font-size: 11px; }
}

/* Header artwork on top of the page, the banner with its torn edge as the end of the page.
   Only once tuned in; the start page has its own artwork. */
/* Header and footer art: slim bands over the full width of the window, edge to edge
   (artwork 2000 x 172, logo in the middle; the sides crop away on narrow screens). */
.site-header, .site-banner { position: relative; isolation: isolate; overflow: hidden; display: block; width: 100vw; height: var(--h); margin-left: calc(50% - 50vw); background: #000; }
/* Behind: the same artwork, blurred, for screens wider than the picture at this height. */
.site-header::before, .site-banner::before { content: ""; position: absolute; inset: -30px; z-index: -2; background: var(--art) center / cover no-repeat; filter: blur(18px) brightness(.55); }
/* The artwork itself, always whole in height (the logo is never cut), soft at its ends. */
.site-header::after, .site-banner::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--shade), var(--art) center / auto 100% no-repeat;
  -webkit-mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent) center / calc(var(--h) * 11.78) 100% no-repeat; mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent) center / calc(var(--h) * 11.78) 100% no-repeat; }
.site-header { --art: url("media/brand/header.webp"); --h: clamp(56px, 8.5vw, 150px); margin-top: -22px; margin-bottom: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .6);
  --shade: radial-gradient(ellipse 22% 85% at 50% 50%, rgba(0, 0, 0, .18) 40%, rgba(0, 0, 0, .6) 100%); }
.site-banner { --art: url("media/brand/banner.webp"); --h: clamp(40px, 8.5vw, 150px); margin-top: 34px; margin-bottom: -56px; pointer-events: none; --shade: linear-gradient(rgba(0, 0, 0, .5), rgba(0, 0, 0, .5));
  -webkit-mask-image: linear-gradient(transparent, #000 30%); mask-image: linear-gradient(transparent, #000 30%); }
.radio:has(#gate:not(.hidden)) .site-header { display: none; }
.radio:has(#gate.hidden) .radio-head h1 { visibility: hidden; }
@media (max-width: 760px) { .site-header { margin-bottom: 10px; } }

/* The page background (castle artwork) a good deal darker, so the cards and the screen stand out */
.scene {
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(11, 10, 13, .78), rgba(11, 10, 13, .5) 75%),
    linear-gradient(180deg, rgba(11, 10, 13, .55) 0%, rgba(11, 10, 13, .72) 45%, rgba(11, 10, 13, .94) 100%),
    url("media/brand/scene.webp") 68% center / cover no-repeat,
    #0b0a0d;
}

/* =========================================================================
   Desktop: one screen, no scrolling. The GrindFM artwork fills the whole background, the logo
   sits on top in the middle, and our cards are laid out around the big screen:
   left the radio, hunting grounds and events, in the middle the screen with channel vote and
   recently played under it, right the chat over the full height. Long lists scroll inside
   their card. Smaller or lower screens keep the normal scrolling page.
   ========================================================================= */
.head-logo { display: none; }
@media (min-width: 1200px) and (min-height: 700px) {
  body:has(#gate.hidden) { overflow: hidden; }
  body:has(#gate.hidden) .scene { background: linear-gradient(rgba(8, 7, 10, .30), rgba(8, 7, 10, .50)), url("media/brand/bg-full.webp") center / cover no-repeat, #0b0a0d; }
  body:has(#gate.hidden) .backdrop { display: none; }

  .radio:has(#gate.hidden) { max-width: 1840px; height: 100vh; padding: 10px 24px 18px; display: flex; flex-direction: column; }
  .radio:has(#gate.hidden) .site-header, .radio:has(#gate.hidden) .site-banner { display: none; }

  /* Top bar: next event on the left, logo in the middle, listeners on the right */
  .radio:has(#gate.hidden) .radio-head { flex: none; margin: 0 0 10px; align-items: center; }
  .radio:has(#gate.hidden) .radio-head h1 { display: none; }
  /* The animated logo from the start page, as a see-through video (logo-alpha.webm) */
  .radio:has(#gate.hidden) .head-logo { --lh: clamp(88px, 14.5vh, 156px); display: block; grid-column: 2; grid-row: 1; height: var(--lh); aspect-ratio: 1440 / 664; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .35)); }
  .radio:has(#gate.hidden) .head-logo :is(video, img) { display: block; width: 100%; height: 100%; object-fit: contain; }
  .radio:has(#gate.hidden) .ev-ticker { grid-column: 1; grid-row: 1; justify-self: start; }

  .radio:has(#gate.hidden) #player { flex: 1; min-height: 0; }
  .radio:has(#gate.hidden) .layout { height: 100%; gap: 14px; align-items: stretch;
    grid-template-columns: minmax(280px, 330px) repeat(2, minmax(0, 1fr)) minmax(300px, 360px);
    grid-template-rows: auto 150px minmax(0, 1fr);
    grid-template-areas:
      "radio  screen screen chat"
      "events vote   recent chat"
      "events .      .      chat"; }
  .radio:has(#gate.hidden) :is(.main-col, .side-col, .under-screen, .side-pair) { display: contents; }
  .radio:has(#gate.hidden) .screen { grid-area: screen; min-height: 0; }
  .radio:has(#gate.hidden) .radio-card { grid-area: radio; align-self: start; }
  .radio:has(#gate.hidden) .hunt-panel { align-self: start; }
  .radio:has(#gate.hidden) .screen { align-self: start; }
  .radio:has(#gate.hidden) .hunt-panel { grid-area: hunt; }
  /* Events start right under the radio card (its height comes from the script, --radio-h) */
  .radio:has(#gate.hidden) .ev-panel { grid-column: 1; grid-row: 1 / 4; margin-top: calc(var(--radio-h, 0px) + 14px); contain: size; }
  .radio:has(#gate.hidden) .vote-panel { grid-area: vote; }
  .radio:has(#gate.hidden) .recent-panel { grid-area: recent; }
  .radio:has(#gate.hidden) .chat { grid-area: chat; }

  /* The screen as big as the height allows, kept at 16:9 */
  /* The screen as big as the free height allows (worked out by the script, --sw), at 16:9 */
  .radio:has(#gate.hidden) .screen-box { width: var(--sw, 100%); margin: 0 auto; }
  .radio:has(#gate.hidden) :is(.vote-panel, .recent-panel) { padding: 10px 12px; }

  /* Every card dark enough to read on the bright artwork */
  .radio:has(#gate.hidden) :is(.screen, .radio-card .hero, .radio-card .controls, .hunt-panel, .vote-panel, .recent-panel, .ev-panel, .chat) {
    background: rgba(10, 9, 12, .80); border: 1px solid rgba(255, 255, 255, .08); backdrop-filter: blur(14px); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); }
  .radio:has(#gate.hidden) :is(.hunt-panel, .vote-panel, .recent-panel) { padding: 14px; border-radius: 18px; }
  .radio:has(#gate.hidden) :is(.vote-panel, .recent-panel, .ev-panel) { min-height: 0; overflow-y: auto; }
  .radio:has(#gate.hidden) .under-screen > .panel { height: auto; }
  .radio:has(#gate.hidden) .chat { min-height: 0; display: flex; flex-direction: column; }
  .radio:has(#gate.hidden) .chat .chat-log { flex: 1; min-height: 0; height: auto; }
  .radio:has(#gate.hidden) .ev-panel .ev-list { flex: 1; min-height: 0; overflow-y: auto; }
  .radio:has(#gate.hidden) .hunt-panel .spot-list { max-height: 30vh; overflow-y: auto; }

  /* Compact channel vote and recently played */
  .radio:has(#gate.hidden) .vote-panel .channels { gap: 6px; }
  .radio:has(#gate.hidden) .vote-panel .chan-btn { padding: 7px 10px; border-radius: 10px; font-size: 13px; }
  .radio:has(#gate.hidden) .vote-panel .chan-votes i { display: none; }
  .radio:has(#gate.hidden) .vote-panel .chan-name small { display: inline-block; width: 7px; height: 7px; margin-left: 6px; padding: 0; font-size: 0; vertical-align: middle; border-radius: 50%; box-shadow: 0 0 8px var(--gold); }
  .radio:has(#gate.hidden) .vote-panel .hint { font-size: 11px; margin-top: 8px; }
  .radio:has(#gate.hidden) .recent-panel .history li { padding: 5px; gap: 8px; }
  .radio:has(#gate.hidden) .recent-panel .history img, .radio:has(#gate.hidden) .recent-panel .history .ph { flex-basis: 32px; width: 32px; height: 32px; }
  .radio:has(#gate.hidden) .recent-panel .history b { font-size: 12px; }
  .radio:has(#gate.hidden) .recent-panel .history span { font-size: 11px; }
  .radio:has(#gate.hidden) :is(.hunt-panel, .vote-panel, .recent-panel) h2 { margin-bottom: 10px; font-size: 11px; }
}


/* Running text in the screen head: the next broadcast, or that none is planned */
.sh-marquee { flex: 1; min-width: 80px; align-self: center; margin-left: 10px; overflow: hidden; white-space: nowrap; font-size: 13px; color: #d7d2c8;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.sh-track { display: inline-flex; animation: shmarquee var(--dur, 30s) linear infinite; }
.sh-track span { flex: none; padding-right: 60px; }
.sh-track b { color: var(--gold); font-weight: 700; }
.sh-track i { font-style: normal; color: #ff8ba0; font-weight: 800; }
@keyframes shmarquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .sh-track { animation: none; } }

/* No listener count in the top bar */
.radio-head .listeners { display: none !important; }

/* Fullscreen and pop-out buttons in the screen head */
.sh-actions { flex: none; display: flex; gap: 6px; margin-left: 8px; align-self: center; }
.sh-btn { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 9px; border: 1px solid var(--line); background: rgba(0, 0, 0, .35); color: var(--text); font-size: 16px; line-height: 1; cursor: pointer; transition: border-color .15s, color .15s; }
.sh-btn:hover { border-color: var(--gold); color: var(--gold); }
@media (hover: none), (max-width: 760px) { #popout { display: none; } }
.full-close { display: none; }
/* iPhone fallback: the screen fills the page, with a close button */
body.screen-full { overflow: hidden; }
/* Blur and shadows on the cards would pin the fixed screen to its card: off while it fills the page. */
body.screen-full :is(.screen, .ev-area, .main-col, .layout, .player, .radio) { backdrop-filter: none !important; filter: none !important; transform: none !important; }
body.screen-full .fx-layer { display: none; }
body.screen-full .radio { z-index: 2000; }
body.screen-full .standby { aspect-ratio: 16 / 9; }
body.screen-full .full-close { display: grid; place-items: center; position: fixed; top: 12px; right: 12px; z-index: 1001; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); background: rgba(0, 0, 0, .6); color: #fff; font-size: 18px; cursor: pointer; }
/* Pop-out window (?watch): nothing but the screen */
body.watch { overflow: hidden; background: #000; }
body.watch :is(.scene, .backdrop, .fx-layer, .radio-head, .site-header, .site-banner, .side-col, .under-screen, .screen-head, #gate) { display: none !important; }
body.watch .radio { max-width: none; height: 100vh; padding: 0 !important; }
body.watch .screen { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; padding: 0; border: 0; border-radius: 0; background: #000 !important; box-shadow: none !important; backdrop-filter: none !important; }
body.watch .screen-box { width: min(100vw, 177.78vh) !important; margin: 0; }
body.watch .stage, body.watch .standby { border-radius: 0; }

/* Reactions: a bar under the screen; whatever anyone sends pops up around the screen */
.screen { position: relative; z-index: 3; }
.screen-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 12px 6px 2px; }
.screen-foot > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.screen-foot > small { margin-left: auto; color: var(--muted); font-size: 12px; }
.screen-foot .reactions { display: flex; gap: 6px; margin: 0; }
.screen-foot .reactions button { width: 42px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); font-size: 20px; cursor: pointer; transition: transform .15s, background .15s, border-color .15s; }
.screen-foot .reactions button:hover { transform: translateY(-3px); background: var(--gold-soft); border-color: rgba(226, 182, 90, .5); }
.screen-foot .reactions button.pop { animation: rxbtn .35s ease; }
@keyframes rxbtn { 40% { transform: scale(1.3) rotate(-8deg); } }
.react-ring { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.rx { position: absolute; font-size: calc(32px * var(--s, 1)); line-height: 1; white-space: nowrap; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .55)); animation: rxpop 2.6s cubic-bezier(.2, .8, .2, 1) forwards; }
.rx-tag { padding: 7px 15px; border-radius: 999px; background: var(--gold); color: #1a1407; font-size: 15px; font-weight: 800; box-shadow: 0 10px 28px rgba(226, 182, 90, .4); filter: none; }
@keyframes rxpop {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  14% { transform: translate(-50%, -50%) scale(1.3) rotate(var(--r)); opacity: 1; }
  28% { transform: translate(-50%, -50%) scale(1) rotate(var(--r)); }
  75% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.85) rotate(calc(var(--r) * 2)); opacity: 0; }
}
.hunt-lead { margin: -4px 0 10px; font-size: 12px; }
@media (max-width: 760px) { .screen-foot > small { display: none; } }

/* Fullscreen (and the iPhone stand-in, and the pop-out window): the picture at 16:9 on black,
   the react bar floating at the bottom, reactions popping up inside the picture. */
.screen:fullscreen { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100vw; height: 100vh; padding: 0; border: 0; border-radius: 0; background: #000; }
.screen:-webkit-full-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100vw; height: 100vh; padding: 0; border: 0; border-radius: 0; background: #000; }
body.screen-full .screen { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 0; background: #000 !important; }
:is(.screen:fullscreen, body.screen-full .screen, body.watch .screen) .screen-head { display: none; }
.screen:-webkit-full-screen .screen-head { display: none; }
:is(.screen:fullscreen, body.screen-full .screen, body.watch .screen) .screen-box { width: min(100vw, 177.78vh) !important; margin: 0; }
.screen:-webkit-full-screen .screen-box { width: min(100vw, 177.78vh) !important; margin: 0; }
:is(.screen:fullscreen, body.screen-full .screen, body.watch .screen) .screen-foot {
  position: absolute; left: 50%; bottom: 14px; z-index: 50; transform: translateX(-50%); flex-wrap: wrap; justify-content: center; width: max-content; max-width: calc(100vw - 20px); padding: 8px 14px; border-radius: 16px;
  background: rgba(10, 9, 12, .78); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(10px); opacity: .4; transition: opacity .3s; }
.screen:-webkit-full-screen .screen-foot { position: absolute; left: 50%; bottom: 14px; z-index: 50; transform: translateX(-50%); padding: 8px 14px; border-radius: 16px; background: rgba(10, 9, 12, .78); opacity: .4; }
:is(.screen:fullscreen, body.screen-full .screen, body.watch .screen) .screen-foot:is(:hover, :focus-within) { opacity: 1; }
@media (hover: none) { :is(.screen:fullscreen, body.screen-full .screen, body.watch .screen) .screen-foot { opacity: .92; } }
body.screen-full .stage, body.screen-full .standby, .screen:fullscreen .stage, .screen:fullscreen .standby { border-radius: 0; }

/* The react bar: your spot and the spot picker */
.spot-box { position: relative; display: flex; align-items: center; gap: 6px; margin-left: auto; }
.spot-me, .spot-chip { height: 38px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--text); font: inherit; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.spot-me:hover { border-color: var(--gold); color: var(--gold); }
.spot-chip { border-color: rgba(226, 182, 90, .6); background: var(--gold-soft); color: var(--gold); }
.spot-chip:hover { transform: translateY(-2px); background: rgba(226, 182, 90, .28); }
.spot-chip:active { transform: scale(.95); }
.spot-pop { position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 60; width: min(380px, 92vw); max-height: min(460px, 70vh); display: flex; flex-direction: column; gap: 8px; padding: 14px;
  border-radius: 18px; background: #16131b; border: 1px solid rgba(226, 182, 90, .35); box-shadow: 0 24px 60px rgba(0, 0, 0, .65); }
.spot-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.spot-pop-head b { font-size: 15px; }
.spot-x { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.spot-pop .hint { margin: 0; font-size: 12px; }
.spot-pop h3 { margin: 4px 0 0; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.spot-pop .tags { max-height: 90px; overflow-y: auto; }
.spot-pop .field { width: 100%; margin: 0; }
.spot-pop .spot-list { flex: 1; min-height: 0; max-height: none; margin-top: 2px; }
.spot-pop .tag-add { margin: 0; align-self: flex-start; }
.tag-new { border-style: dashed; border-color: var(--gold); color: var(--gold); }
@media (max-width: 760px) { .spot-box { margin-left: 0; width: 100%; } .spot-me { flex: 1; } .spot-pop { right: auto; left: 0; } }
.spot-pop > :not(.spot-list) { flex: none; }
:is(.screen:fullscreen, body.screen-full .screen, body.watch .screen) .spot-box { width: auto; margin-left: 0; }

/* Lists still scroll (wheel, touch), but without a visible scroll bar */
:is(.vote-panel, .recent-panel, .ev-panel, .ev-list, .chat-log, .spot-list, .spot-pop .tags) { scrollbar-width: none; }
:is(.vote-panel, .recent-panel, .ev-panel, .ev-list, .chat-log, .spot-list, .spot-pop .tags)::-webkit-scrollbar { display: none; }

/* Desktop without scrolling, final arrangement: left the radio, channel vote and recently
   played stacked; in the middle the screen with the upcoming events wide under it; right the chat. */
@media (min-width: 1200px) and (min-height: 700px) {
  .radio:has(#gate.hidden) .layout {
    grid-template-columns: minmax(280px, 330px) minmax(0, 1fr) minmax(300px, 360px);
    grid-template-rows: auto 132px minmax(0, 1fr);
    grid-template-areas:
      "side screen chat"
      "side events chat"
      "side .      chat"; }
  .radio:has(#gate.hidden) .side-col { display: flex; flex-direction: column; gap: 14px; grid-area: side; min-height: 0; position: static; }
  .radio:has(#gate.hidden) .side-pair { display: flex; flex-direction: column; align-items: stretch; gap: 14px; flex: 1; min-height: 0; }
  .radio:has(#gate.hidden) .radio-card { flex: none; }
  .radio:has(#gate.hidden) .vote-panel { flex: none; overflow: visible; }
  .radio:has(#gate.hidden) .recent-panel { flex: 1; min-height: 0; overflow: hidden; }
  .radio:has(#gate.hidden) .vote-panel .hint { display: none; }

  /* Events: a wide strip under the screen, the events side by side */
  .radio:has(#gate.hidden) .ev-panel { grid-area: events; grid-column: auto; grid-row: auto; margin-top: 0; contain: none; height: auto; padding: 12px 14px; overflow: hidden; }
  .radio:has(#gate.hidden) .ev-panel .panel-head { min-height: 0; margin-bottom: 8px; }
  .radio:has(#gate.hidden) .ev-panel .ev-list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 10px; overflow-x: auto; overflow-y: hidden; }
  .radio:has(#gate.hidden) .ev-panel .ev-list li { padding: 8px 10px; }
  .radio:has(#gate.hidden) .ev-panel .ev-list li:hover { transform: translateY(-2px); }
  .radio:has(#gate.hidden) .ev-panel .ev-empty { grid-column: 1 / -1; }
}

/* Players in boxes under 534 px wide run at 534 x 300 and are scaled down (see stage.js) */
:is(.stage-main, .stage-pip).small iframe { width: 534px !important; height: 300px !important; transform: scale(var(--fs, 1)); transform-origin: 0 0; }

/* Events: calendar and list. On the desktop view the card takes all the height under the
   screen, the calendar on the left and the list scrolling on the right. */
.ev-body { display: grid; gap: 14px; }
.ev-cal { padding: 8px 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cal-head b { font-size: 13px; text-transform: capitalize; }
.cal-head button { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.cal-head button:hover { color: var(--gold); border-color: var(--gold); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.cal-grid > span { padding: 0 0 2px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.cal-d { position: relative; height: 24px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 12px; font-variant-numeric: tabular-nums; cursor: default; }
.cal-d.other { color: rgba(255, 255, 255, .25); }
.cal-d.today { border-color: rgba(255, 255, 255, .35); font-weight: 800; }
.cal-d.has { cursor: pointer; background: var(--gold-soft); color: #fff3d0; font-weight: 800; }
.cal-d.has:hover { background: rgba(226, 182, 90, .3); }
.cal-d i { position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.ev-list li.flash { animation: evflash 1.2s ease; }
@keyframes evflash { 30% { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); } }
@media (min-width: 1200px) and (min-height: 700px) {
  .radio:has(#gate.hidden) .layout { grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "side screen chat" "side events chat"; }
  .radio:has(#gate.hidden) .ev-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 10px 14px 12px; }
  .radio:has(#gate.hidden) .ev-panel .panel-head { margin-bottom: 8px; min-height: 0; }
  .radio:has(#gate.hidden) .ev-panel .panel-head .btn-small { padding: 5px 12px; }
  .radio:has(#gate.hidden) .ev-body { flex: 1; min-height: 0; grid-template-columns: minmax(230px, 280px) minmax(0, 1fr); align-items: stretch; }
  .radio:has(#gate.hidden) .ev-cal { align-self: start; }
  .radio:has(#gate.hidden) .ev-panel .ev-list { display: grid; grid-auto-flow: row; grid-auto-columns: auto; align-content: start; gap: 8px; min-height: 0; overflow-x: hidden; overflow-y: auto; }
}

/* Desktop view: no "NEXT" pill in the top bar (the screen and the events card show it) */
@media (min-width: 1200px) and (min-height: 700px) { .radio:has(#gate.hidden) .ev-ticker { display: none !important; } }

/* Until the first click, the page asks for it to switch the sound on */
.sound-hint { position: fixed; left: 50%; bottom: 22px; z-index: 3000; transform: translateX(-50%); padding: 12px 22px; border-radius: 999px; border: 1px solid var(--gold); background: rgba(11, 10, 13, .9); color: var(--gold); font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; box-shadow: 0 12px 40px rgba(0, 0, 0, .6), 0 0 30px rgba(226, 182, 90, .25); animation: soundhint 1.8s ease-in-out infinite; }
@keyframes soundhint { 50% { box-shadow: 0 12px 40px rgba(0, 0, 0, .6), 0 0 0 8px rgba(226, 182, 90, 0); transform: translateX(-50%) scale(1.04); } }

/* With a frame the video still fills the whole screen; the frame lies over its edges.
   Overlays and picture-in-picture stay in the open middle (--fx/--fy/--fw/--fh). */
.stage.framed .stage-main { inset: 0; left: 0; top: 0; width: 100%; height: 100%; }

/* The frame over the full-size video, pulled outwards: drawn 12% bigger than the screen and
   cut off at its edges, so its borders get slimmer; it grows away from the GrindFM logo
   (bottom left), which stays whole. PiP and overlays sit in the opening (--fx..). */
.ov-frame { transform: scale(1.12); transform-origin: 17% 52%; }
.stage { --fx: 17.55%; --fy: 1.6%; --fw: 77.3%; --fh: 77.3%; }
.ov-matte { display: none; }

/* Players through the Twitch / YouTube APIs: a box with the platform's iframe inside */
.embed-player, .embed-holder { position: absolute; inset: 0; }
.embed-player iframe { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; display: block; }
.stage-main > .fade-in { opacity: 0; transition: opacity 1s ease; }
.stage-main > .fade-in.on { opacity: 1; }
/* Small boxes: the player runs at 534 x 300 and is scaled down (Twitch's minimum size) */
:is(.stage-main, .stage-pip).small > :is(.embed-player, iframe) { inset: auto; left: 0; top: 0; width: 534px !important; height: 300px !important; transform: scale(var(--fs, 1)); transform-origin: 0 0; }
:is(.stage-main, .stage-pip).small iframe { transform: none; }
:is(.stage-main, .stage-pip).small > iframe { transform: scale(var(--fs, 1)); }
/* Arming: until a new player plays it must be uncovered and unscaled, or Twitch will not start it.
   The frame, overlays and pictures-in-picture come in (fading) once it plays. */
.stage-ov, .stage-pip { transition: opacity .6s ease; }
.stage.arming :is(.stage-ov, .stage-pip) { visibility: hidden; opacity: 0; }
.stage:has(.stage-pip.arming) .stage-ov { visibility: hidden; opacity: 0; }
:is(.stage-main, .stage-pip).small.arming > :is(.embed-player, iframe) { transform: none; }
/* Listener page: the players take no mouse input, so no hover overlays from Twitch / YouTube */
.stage.passive:not(.arming) .stage-main, .stage.passive .stage-pip:not(.arming) { pointer-events: none; }

/* The embers lie behind the content: a layer over a player counts as covering it for Twitch */
.fx-layer { z-index: 0 !important; }
.stage.passive.needs-click .stage-main { pointer-events: auto; }

/* Live poll pinned on top of the chat */
.chat-poll { flex: none; margin: 0 0 10px; padding: 12px; border-radius: 14px; border: 1px solid rgba(226, 182, 90, .5); background: linear-gradient(135deg, rgba(226, 182, 90, .14), rgba(0, 0, 0, .3)); box-shadow: 0 0 24px rgba(226, 182, 90, .12); }
.chat-poll.fresh { animation: cpin .6s cubic-bezier(.2, .8, .2, 1); }
@keyframes cpin { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
.chat-poll.closed { border-color: var(--line); background: rgba(0, 0, 0, .25); box-shadow: none; }
.cp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cp-tag { color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.chat-poll.closed .cp-tag { color: var(--muted); }
.cp-left { padding: 1px 8px; border-radius: 999px; background: rgba(255, 92, 122, .18); color: #ff8ba0; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cp-q { display: block; margin-bottom: 8px; font-size: 14px; line-height: 1.3; }
.cp-opts { display: grid; gap: 6px; }
.cp-opt { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; transition: border-color .15s, transform .1s; }
.cp-opt:hover:not(:disabled) { border-color: rgba(226, 182, 90, .6); }
.cp-opt:active:not(:disabled) { transform: scale(.98); }
.cp-opt:disabled { cursor: default; }
.cp-opt i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(226, 182, 90, .22); transition: width .5s ease; }
.cp-opt span, .cp-opt em { position: relative; }
.cp-opt span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cp-opt em { flex: none; font-style: normal; color: var(--muted); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cp-opt.mine { border-color: var(--gold); }
.cp-opt.mine i { background: rgba(226, 182, 90, .35); }
.cp-opt.win { border-color: var(--gold); box-shadow: 0 0 14px rgba(226, 182, 90, .3); }
.cp-opt.win em { color: var(--gold); }
.cp-foot { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }

/* Sound choice while a stream is live */
.radio-paused { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.radio-paused.hidden { display: none; }
.snd-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.snd-seg button { padding: 4px 10px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.snd-seg button.on { background: var(--gold-soft, rgba(232, 185, 79, .18)); color: var(--gold, #e8b94f); font-weight: 600; }
/* The sound choice sits on the page background: solid, so it reads on the bright artwork */
.radio-paused { margin-bottom: 8px; padding: 10px 12px 10px 16px; border-radius: 16px; background: rgba(16, 13, 10, .92); border: 1px solid rgba(232, 185, 79, .45); color: #f3e6c8; box-shadow: 0 6px 20px rgba(0, 0, 0, .45); backdrop-filter: blur(10px); }
.snd-seg { border-color: rgba(232, 185, 79, .35); background: rgba(0, 0, 0, .35); }
.snd-seg button { padding: 6px 14px; color: #cfc4ad; font-size: 13px; font-weight: 600; }
.snd-seg button:hover { color: #fff; }
.snd-seg button.on { background: #e8b94f; color: #1b1408; }

/* Asking for a share link */
#reqfields { display: grid; gap: 10px; }
#reqfields.hidden, .req-state.hidden { display: none; }
.req-state { display: grid; gap: 8px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.req-state p { margin: 0; color: var(--muted); font-size: 14px; }
.req-link { display: flex; gap: 8px; }
.req-link .field { margin: 0; flex: 1; min-width: 0; }

/* Streamer rules and the choice of platform in the request form */
.req-rules { display: grid; gap: 8px; max-height: 38vh; overflow: auto; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.req-rules ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.req-rules ol b { color: var(--text); }
.req-agree { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
.req-agree input { width: 18px; height: 18px; accent-color: #e8b94f; }
.req-kind { display: grid; gap: 8px; transition: opacity .2s; }
.req-kind.locked { opacity: .4; pointer-events: none; }
.req-kinds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.req-kinds label { cursor: pointer; }
.req-kinds input { position: absolute; opacity: 0; pointer-events: none; }
.req-kinds span { display: grid; gap: 2px; height: 100%; padding: 8px 6px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); text-align: center; font-size: 13px; font-weight: 600; }
.req-kinds span small { font-weight: 400; font-size: 10px; color: var(--muted); }
.req-kinds input:checked + span { border-color: #e8b94f; background: rgba(232, 185, 79, .14); color: #ffd88a; }
.req-kinds input:focus-visible + span { outline: 2px solid #e8b94f; }
#requrl.hidden { display: none; }
#reqsend:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 480px) { .req-kinds { grid-template-columns: repeat(2, 1fr); } }
/* Streamer account: login and profile in the request dialog */
.req-login { display: grid; gap: 10px; }
.req-login.hidden, #reqloginhint.hidden, #reqintro.hidden { display: none; }
.req-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.req-pair .field { margin: 0; min-width: 0; }
.req-profile { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.req-profile summary { cursor: pointer; font-weight: 600; }
.req-profile[open] { display: grid; gap: 10px; }
.req-profile .field { margin: 0; }

/* Stream picker under the screen: everyone sharing live, plus Auto (follow GrindFM) */
.live-pick { display: flex; align-items: center; gap: 8px; padding: 8px 12px; overflow-x: auto; scrollbar-width: thin; background: rgba(10, 8, 6, .85); border-top: 1px solid var(--line); }
.live-pick.hidden { display: none; }
.lp-label { flex: none; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #ff6b81; margin-right: 4px; }
.lp-item { flex: none; display: flex; align-items: center; gap: 8px; height: 46px; padding: 3px 12px 3px 3px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.lp-item:hover { border-color: rgba(232, 185, 79, .6); }
.lp-item img { width: 70px; height: 40px; object-fit: cover; border-radius: 9px; background: #000; }
.lp-item.lp-auto { flex-direction: column; justify-content: center; align-items: flex-start; gap: 0; padding: 3px 12px; }
.lp-item.lp-auto small { font-size: 10px; color: var(--muted); }
.lp-item.on { border-color: #e8b94f; background: rgba(232, 185, 79, .16); color: #ffd88a; }
/* "Stream on GrindFM" must stand out: solid gold with a soft glow */
#reqopen { background: linear-gradient(180deg, #f4cf6a, #e0a93a); border-color: #f4cf6a; color: #1b1408; font-weight: 700; padding: 7px 16px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 4px 16px rgba(232, 185, 79, .35); }
#reqopen:hover { filter: brightness(1.08); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 6px 22px rgba(232, 185, 79, .55); }

/* Everyone live: the overview over the screen, with a search */
.lp-item.lp-all { padding: 3px 14px; color: #ffd88a; border-color: rgba(232, 185, 79, .5); }
.pick-all { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: rgba(8, 6, 4, .94); backdrop-filter: blur(8px); border-radius: inherit; }
.pick-all.hidden { display: none; }
.pa-head { display: flex; align-items: center; gap: 10px; }
.pa-head b { flex: none; color: #ff6b81; font-size: 14px; }
.pa-head .field { flex: 1; margin: 0; min-width: 0; }
.pa-x { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--text); font-size: 16px; cursor: pointer; }
.pa-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; scrollbar-width: thin; }
.pa-card { display: grid; gap: 3px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pa-card:hover { border-color: rgba(232, 185, 79, .6); }
.pa-card.on { border-color: #e8b94f; background: rgba(232, 185, 79, .16); }
.pa-img { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.pa-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pa-img i { position: absolute; left: 6px; top: 6px; padding: 1px 6px; border-radius: 6px; background: #e8344e; color: #fff; font-size: 9px; font-style: normal; font-weight: 700; letter-spacing: .05em; }
.pa-card b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-card small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-none { color: var(--muted); grid-column: 1 / -1; text-align: center; }
@media (max-width: 600px) { .pa-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } }
/* No still picture yet (share just started): a quiet screen icon instead of a broken image */
.pa-img, .lp-thumb { background: #0c0a08 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8b94f' stroke-opacity='.5' stroke-width='1.6'%3E%3Crect x='3' y='5' width='18' height='12' rx='2'/%3E%3Cpath d='M8 21h8M12 17v4'/%3E%3C/svg%3E") center / 26px no-repeat; }
.lp-thumb { flex: none; display: block; width: 70px; height: 40px; border-radius: 9px; overflow: hidden; background-size: 18px; }
.lp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Stream picker strip: name buttons instead of picture tiles */
.live-pick { gap: 8px; padding: 10px 12px; }
.lp-item.lp-name, .lp-item.lp-auto, .lp-item.lp-all { height: 36px; padding: 0 16px; border-radius: 999px; gap: 8px; flex-direction: row; align-items: center; font-size: 13px; font-weight: 600;
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)); border: 1px solid rgba(232, 185, 79, .28); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); transition: transform .12s, border-color .15s, background .15s, box-shadow .15s; }
.lp-item.lp-name:hover, .lp-item.lp-auto:hover, .lp-item.lp-all:hover { transform: translateY(-1px); border-color: rgba(232, 185, 79, .7); box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.lp-item.lp-name b, .lp-item.lp-auto b { font-weight: 700; letter-spacing: .01em; }
.lp-item.lp-name small { font-size: 11px; font-weight: 600; color: var(--muted); padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .07); }
.lp-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff4560; box-shadow: 0 0 0 0 rgba(255, 69, 96, .6); animation: lp-pulse 1.8s ease-out infinite; flex: none; }
@keyframes lp-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 69, 96, .55); } 70% { box-shadow: 0 0 0 7px rgba(255, 69, 96, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 69, 96, 0); } }
.lp-item.lp-name.on, .lp-item.lp-auto.on { background: linear-gradient(180deg, #f4cf6a, #d9a136); border-color: #f4cf6a; color: #1b1408; box-shadow: 0 4px 16px rgba(232, 185, 79, .35); }
.lp-item.lp-name.on small { color: #3a2a0c; background: rgba(0, 0, 0, .12); }
.lp-item.lp-name.on .lp-dot { background: #b0102a; }
.lp-item.lp-name.air:not(.on) { border-color: rgba(255, 69, 96, .55); }

/* ---------- Chat rooms: GrindFM chat / streamer chat, viewers, follow ---------- */
.chat-top { display: flex; align-items: center; gap: 8px; min-height: 32px; margin: 0 0 12px; }
.chat-top h2 { margin: 0; }
.under-screen .chat .chat-top { flex: none; }
.chat-tabs { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.chat-tab { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12px; font-weight: 800; letter-spacing: .04em; cursor: pointer; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-tab:hover { color: var(--text); }
.chat-tab.on { color: #160f05; background: var(--gold); border-color: var(--gold); }
.room-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.room-viewers { border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; padding: 4px 0; }
.room-viewers:hover { color: var(--gold); }
.room-follow.on { color: #160f05; background: var(--gold); border-color: var(--gold); }
.room-names { flex: none; display: flex; flex-wrap: wrap; gap: 6px; max-height: 96px; overflow-y: auto; margin: 0 0 8px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 12px; }
.room-names span { padding: 2px 8px; border-radius: 999px; background: rgba(226, 182, 90, .12); color: var(--gold); }
.room-names em { color: var(--muted); font-style: normal; padding: 2px 4px; }
.room-names:empty::before { content: 'Nobody here yet.'; color: var(--muted); }
.follow-toast { position: fixed; right: 22px; top: 22px; z-index: 3000; padding: 12px 18px; border-radius: 14px; border: 1px solid #ff3b5c; background: rgba(11, 10, 13, .92); color: #fff; font-weight: 800; box-shadow: 0 12px 40px rgba(0, 0, 0, .6); }
/* Imported chat messages: a small platform mark before the name */
.chat-src { flex: none; font-style: normal; font-size: 10px; line-height: 16px; width: 16px; text-align: center; border-radius: 4px; color: #fff; align-self: center; }
.chat-src.yt { background: #e62117; }
