:root {
  --bg: #0d0708;
  --surface: #1a0f11;
  --line: #3a2226;
  --text: #f6ece8;
  --muted: #c9b3ad;
  --crimson: #b91c3c;
  --rose: #f28ba0;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Space Grotesk", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.skip-link { position: absolute; left: -999px; top: 0; }
.skip-link:focus { left: 16px; top: 16px; background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { display: flex; align-items: center; gap: 10px; padding: 16px; max-width: 880px; margin: 0 auto; }
.wordmark { font-family: Righteous, "Space Grotesk", sans-serif; font-size: 1.6rem; letter-spacing: 0.01em; }

main { max-width: 880px; margin: 0 auto; padding: 0 16px 48px; }

.tabs { display: flex; gap: 8px; margin: 8px 0 20px; border-bottom: 1px solid var(--line); }
.tabs button {
  appearance: none; border: 0; background: none; color: var(--muted);
  font: inherit; font-weight: 500; padding: 12px 4px; margin-right: 16px;
  border-bottom: 2px solid transparent; cursor: pointer;
  touch-action: manipulation; user-select: none;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--crimson); }

.live { display: flex; align-items: center; gap: 8px; color: var(--muted); margin: 0 0 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--crimson); box-shadow: 0 0 0 4px rgb(185 28 60 / 0.25); }

/* 16:9 box; the YouTube player must stay visible and at least 200x200 (YouTube RMF). */
.screen { position: relative; aspect-ratio: 16 / 9; min-height: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.screen iframe, #yt-player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.empty { display: grid; place-items: center; height: 100%; margin: 0; padding: 24px; text-align: center; color: var(--muted); }
#sets-empty { min-height: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

.controls { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.controls button {
  font: inherit; font-weight: 700; border-radius: 999px; padding: 12px 20px; min-height: 44px;
  cursor: pointer; touch-action: manipulation; user-select: none;
  transition: transform 120ms ease-out, background-color 160ms ease-out;
}
.controls button:active { transform: scale(0.97); }
.primary { background: var(--crimson); color: #fff; border: 0; }
.ghost { background: none; color: var(--text); border: 1px solid var(--line); }

@media (hover: hover) and (pointer: fine) {
  .primary:hover { background: #d0244a; }
  .ghost:hover { border-color: var(--muted); }
  .tabs button:hover { color: var(--text); }
  .meta a:hover { color: var(--rose); }
}

:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }

.meta { display: grid; gap: 8px; margin: 8px 0 16px; }
.meta div { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: baseline; }
.meta dt { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.meta dd { margin: 0; overflow-wrap: anywhere; }
.meta a { color: var(--text); }
.meta small { color: var(--muted); }

.fine { color: var(--muted); font-size: 0.85rem; }

.sc iframe { width: 100%; height: 450px; border: 0; border-radius: var(--radius); }

@media (prefers-reduced-motion: reduce) {
  .controls button { transition: none; }
}
