/* Spectator view styles (DEC-040). A static stylesheet so the CSP needs no 'unsafe-inline' (MX-W21 SEC-CSP). */
#spectate { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#spectate > * { pointer-events: auto; }
#spectate .sp-top { position: absolute; top: max(10px, env(safe-area-inset-top)); inset-inline: 12px; display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; pointer-events: none; }
#spectate .sp-top > * { pointer-events: auto; }
#spectate .sp-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#spectate .sp-badge { font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.78rem; border-radius: 6px; padding: 2px 8px; }
#spectate .sp-badge.live { background: #c62828; color: #fff; }
#spectate .sp-badge.replay { background: var(--accent); color: var(--accent-ink); }
#spectate .sp-actions { display: flex; gap: 6px; flex-wrap: wrap; }
#spectate .sp-actions button, #spectate .sp-replay button { font: inherit; font-size: 0.85rem; color: var(--text); background: var(--panel-solid); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
#spectate .sp-replay button.primary { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
#spectate .sp-replay button[aria-pressed="true"] { background: var(--teal); color: #001a17; font-weight: 700; }
#spectate .sp-status { position: absolute; top: 40%; inset-inline: 0; margin: 0 auto; width: fit-content; max-width: 90vw; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; }
#spectate .sp-status:empty { display: none; }
#spectate .sp-board { position: absolute; top: 64px; inset-inline-end: 12px; min-width: 240px; max-width: 46vw; }
#spectate .sp-board h3, #spectate .sp-results h3, #spectate .sp-replay h3 { margin: 0 0 4px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
#spectate .sp-board ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 0.85rem; }
#spectate .sp-board li { display: grid; grid-template-columns: 1.6em 0.9em 1fr auto; gap: 6px; align-items: center; white-space: nowrap; }
#spectate .sp-board .pos { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
#spectate .sp-board .sw { width: 0.9em; height: 0.9em; border-radius: 3px; background: var(--c); }
#spectate .sp-board .nm { overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
#spectate .sp-board .st { font-family: var(--mono); color: var(--muted); font-size: 0.78rem; unicode-bidi: isolate; }
#spectate .sp-lower { position: absolute; bottom: 92px; inset-inline-start: 16px; display: flex; align-items: stretch; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; min-width: 260px; max-width: 80vw; }
#spectate .sp-lower .bar { width: 8px; background: var(--c); }
#spectate .sp-lower .body { padding: 8px 14px; }
#spectate .sp-lower .name { font-size: 1.15rem; font-weight: 800; }
#spectate .sp-lower .meta { color: var(--muted); font-size: 0.85rem; }
#spectate .sp-results { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(640px, 94vw); max-height: 70vh; overflow: auto; }
#spectate .sp-state { font-size: 0.72rem; border-radius: 6px; padding: 1px 8px; margin-inline-start: 8px; vertical-align: 0.1em; text-transform: none; letter-spacing: 0; }
#spectate .sp-state.provisional { background: #5a4500; color: #ffe2a0; }
#spectate .sp-state.confirmed { background: #0f5a33; color: #c9f7dc; }
#spectate .sp-replay { position: absolute; bottom: max(12px, env(safe-area-inset-bottom)); inset-inline: 12px; display: grid; gap: 6px; }
#spectate .sp-replay .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#spectate .sp-replay input[type="range"] { flex: 1 1 240px; min-width: 160px; accent-color: var(--accent); }
#spectate .sp-replay select { font: inherit; color: var(--text); background: var(--panel-solid); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; max-width: 60vw; }
#spectate .sp-replay .clock { font-family: var(--mono); font-variant-numeric: tabular-nums; min-width: 4.5em; unicode-bidi: isolate; direction: ltr; }
#spectate .sp-hl { display: flex; gap: 6px; flex-wrap: wrap; }
#spectate .sp-hl button { font-size: 0.8rem; }
#spectate .sp-info { margin: 0; font-size: 0.75rem; color: var(--muted); font-family: var(--mono); overflow-wrap: anywhere; }
#spectate .sp-fine { position: absolute; bottom: 4px; inset-inline-start: 16px; margin: 0; font-size: 0.72rem; color: var(--muted); }
#spectate.replaying .sp-fine { display: none; }
#spectate.replaying .sp-lower { bottom: 190px; }
/* Sponsor lower-third (DEC-191, Volume XV BC-034): opposite corner, the advert's colours, dashed frame, black label chip. */
#spectate .sp-ad { position: absolute; bottom: 92px; inset-inline-end: 16px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; column-gap: 10px; align-items: center; width: min(420px, 40vw); padding: 6px 12px 8px; background: var(--ad-bg, #f4f4f4); color: var(--ad-fg, #10202c); border: 2px dashed var(--ad-accent, #d8342c); border-radius: 4px; }
#spectate .sp-ad .ad-chip { grid-column: 1 / -1; justify-self: start; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; background: #0b0d10; color: #fff; border-radius: 3px; padding: 1px 6px; margin-bottom: 4px; }
#spectate .sp-ad .ad-mark { width: 26px; height: 26px; border-radius: 50%; border: 4px solid var(--ad-accent, #d8342c); }
#spectate .sp-ad .ad-body { display: grid; min-width: 0; }
#spectate .sp-ad .ad-brand { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ad-accent, #d8342c); }
#spectate .sp-ad .ad-head { font-weight: 800; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#spectate .sp-ad .ad-sub { font-size: 0.78rem; opacity: 0.85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#spectate.replaying .sp-ad { bottom: 190px; }
@media (max-width: 760px) {
  #spectate .sp-board { top: auto; bottom: 110px; inset-inline-end: 8px; min-width: 0; max-width: 60vw; font-size: 0.78rem; }
  #spectate.replaying .sp-board { display: none; }
  #spectate .sp-lower { bottom: 28px; min-width: 0; }
  #spectate .sp-lower .name { font-size: 1rem; }
  /* No room beside the official graphics on narrow screens: the sponsor card is not shown (and not measured). */
  #spectate .sp-ad { display: none; }
}
