/* Layout: a tape shelf. Header + scoreboard stats, a filter rail, then a grid of VHS-label cards; detail, sign-in and add-tape open as dialogs. */
:root {
  --bg: #eef1f4;          /* tape-sleeve paper, cool */
  --surface: #ffffff;
  --ink: #141c2b;         /* stadium navy */
  --muted: #5a6577;
  --line: #d3d9e1;
  --accent: #b3122b;      /* letterman red */
  --accent-ink: #ffffff;
  --gold: #c99a1c;        /* varsity gold */
  --osd: #1f6fd1;         /* VCR on-screen-display blue */
  --label: #f7f4ec;       /* VHS label stock */
  --label-ink: #1a1a1a;
  --font-display: "Graduate", "Rockwell", "Georgia", serif;
  --font-body: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --font-osd: "VT323", "Courier New", monospace;
  --radius: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1420; --surface: #152033; --ink: #e9edf3; --muted: #9aa6b8; --line: #2a3850;
    --accent: #e0384f; --accent-ink: #ffffff; --gold: #e4b843; --osd: #6aa8ff;
    --label: #e9e4d6; --label-ink: #141414; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, video, iframe { max-width: 100%; }
[hidden] { display: none !important; }
.wrap {
  max-width: 1180px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: var(--osd); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--osd); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
header.top { border-bottom: 1px solid var(--line); background: var(--surface); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; padding-block: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: inherit; }
.brand h1 { font-family: var(--font-display); font-size: 1.6rem; margin: 0; letter-spacing: .02em; font-weight: 400; }
.brand h1 span { color: var(--accent); }
.rec { font-family: var(--font-osd); font-size: 1.15rem; color: var(--accent); letter-spacing: .05em; }
.rec::before { content: ""; display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: var(--accent); margin-right: .35em; vertical-align: .05em; }
@media (prefers-reduced-motion: no-preference) { .rec::before { animation: blink 1.6s steps(1) infinite; } }
@keyframes blink { 50% { opacity: .15; } }
.account { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.who { color: var(--muted); font-size: .95rem; }
.badge { display: inline-block; min-width: 1.5em; padding: 0 .4em; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: .8rem; text-align: center; margin-left: 4px; font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 2px solid var(--ink); background: transparent; border-radius: var(--radius);
  padding: 10px 18px; font-weight: 600; text-decoration: none; color: var(--ink); line-height: 1.2;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 6px 12px; font-size: .9rem; border-width: 1.5px; }
.btn.danger { border-color: var(--accent); color: var(--accent); }
.btn.link { border: 0; padding: 4px 2px; color: var(--osd); text-decoration: underline; font-weight: 500; }

/* Intro + scoreboard */
.intro { padding-block: 36px 20px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: end; }
.intro h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.1; margin: 0 0 12px; text-wrap: balance; }
.intro p { margin: 0; color: var(--muted); max-width: 58ch; font-size: 1.08rem; }
.board { background: var(--ink); color: var(--bg); border-radius: var(--radius); display: grid; grid-template-columns: repeat(3, 1fr); padding: 14px 8px; }
.board div { text-align: center; padding-inline: 6px; }
.board div + div { border-left: 1px solid color-mix(in srgb, var(--bg) 20%, transparent); }
.board b { display: block; font-family: var(--font-osd); font-size: 2.6rem; line-height: 1; color: var(--gold); font-weight: 400; font-variant-numeric: tabular-nums; }
.board span { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; }
@media (max-width: 760px) { .intro { grid-template-columns: 1fr; gap: 20px; } }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; padding-block: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); display: block; margin-bottom: 4px; }
.field-inline { display: flex; flex-direction: column; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 8px 14px; cursor: pointer; font-weight: 500; font-size: .95rem; }
.seg button + button { border-left: 1.5px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.filters select, .filters input[type="search"] { border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 8px 10px; min-width: 0; }
.filters .grow { flex: 1 1 220px; min-width: 0; }
.filters .grow input { width: 100%; }

/* Shelf */
.shelf { padding-block: 24px 48px; }
.shelf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.shelf-head h3 { margin: 0; font-size: 1rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.count { color: var(--muted); font-size: .95rem; font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
@media (max-width: 400px) { .grid { grid-template-columns: 1fr; } }
.more { display: flex; justify-content: center; margin-top: 24px; }

.tape {
  display: flex; flex-direction: column; text-align: left; cursor: pointer; width: 100%;
  background: var(--ink); border: 0; border-radius: 4px; padding: 10px; color: var(--ink);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 30%, transparent);
  transition: transform .15s ease;
}
@media (prefers-reduced-motion: no-preference) { .tape:hover { transform: translateY(-3px); } }
.tape .reels { display: flex; justify-content: space-between; align-items: center; padding: 2px 6px 8px; font-family: var(--font-osd); color: color-mix(in srgb, var(--bg) 75%, transparent); font-size: 1rem; letter-spacing: .06em; }
.tape .label { background: var(--label); color: var(--label-ink); border-radius: 2px; padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; position: relative; }
.tape .label::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: repeating-linear-gradient(90deg, var(--accent) 0 40%, var(--gold) 40% 70%, var(--osd) 70% 100%); border-radius: 2px 2px 0 0; }
.tape .sport { font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-top: 4px; color: #6b5a2a; }
.tape .match { font-family: var(--font-display); font-size: 1.22rem; line-height: 1.15; text-wrap: balance; overflow-wrap: anywhere; }
.tape .match small { font-family: var(--font-body); font-size: .8rem; color: #555; display: block; margin: 2px 0; letter-spacing: .1em; }
.tape .meta { display: flex; justify-content: space-between; gap: 8px; font-size: .88rem; color: #3d3d3d; margin-top: auto; padding-top: 6px; border-top: 1px dashed #b9b2a0; }
.tape .meta b { font-variant-numeric: tabular-nums; }

.empty { border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 28px; align-items: center; }
.empty h4 { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; margin: 0 0 8px; }
.empty p { margin: 0 0 16px; color: var(--muted); max-width: 52ch; }
.example-tag { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 6px; display: block; text-align: center; }
.example .tape { cursor: default; opacity: .9; }
@media (max-width: 720px) { .empty { grid-template-columns: 1fr; } }
.notice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-top: 16px; color: var(--muted); font-size: .95rem; }

/* Dialogs */
dialog { border: 0; border-radius: 10px; padding: 0; width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--surface); color: var(--ink); }
dialog.narrow { width: min(460px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(8, 12, 20, .6); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dlg-head h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; overflow-wrap: anywhere; }
.x { border: 0; background: transparent; font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 4px 8px; color: var(--muted); }
.dlg-body { padding: 20px; display: flex; flex-direction: column; gap: 18px; }

.screen { background: #05070b; border-radius: 6px; aspect-ratio: 4 / 3; max-width: 100%; display: grid; place-items: center; overflow: hidden; position: relative; }
.screen.wide { aspect-ratio: 16 / 9; }
.screen video, .screen iframe { width: 100%; height: 100%; border: 0; object-fit: contain; background: #000; }
.screen .osd { position: absolute; top: 12px; left: 14px; font-family: var(--font-osd); color: #7fb4ff; font-size: 1.4rem; letter-spacing: .05em; }
.screen .linkout { text-align: center; color: #dfe6f1; padding: 20px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.screen .linkout p { margin: 0; color: #a9b4c6; font-size: .95rem; max-width: 40ch; }

.final { display: flex; align-items: stretch; border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.final div { flex: 1; padding: 10px 14px; min-width: 0; }
.final div + div { border-left: 2px solid var(--ink); }
.final span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.final strong { font-family: var(--font-display); font-weight: 400; font-size: 1.15rem; overflow-wrap: anywhere; }
.final b { font-family: var(--font-osd); font-size: 2.2rem; line-height: 1; float: right; font-weight: 400; font-variant-numeric: tabular-nums; }

dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0; }
dl.facts dt { color: var(--muted); font-size: .9rem; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.dlg-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); padding-top: 14px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Forms */
form.sub { display: flex; flex-direction: column; gap: 18px; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; min-width: 0; }
fieldset legend { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; margin-bottom: 10px; padding: 0; }
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f.full { grid-column: 1 / -1; }
.f label { font-weight: 600; font-size: .95rem; }
.f .opt { font-weight: 400; color: var(--muted); }
.f .hint { font-size: .85rem; color: var(--muted); }
.f input, .f select, .f textarea { border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--bg); padding: 10px 12px; width: 100%; }
.f textarea { min-height: 80px; resize: vertical; }
@media (max-width: 560px) { fieldset { grid-template-columns: 1fr; } }
.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; grid-column: 1 / -1; }
.choice label { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.choice label:has(input:checked) { border-color: var(--osd); background: color-mix(in srgb, var(--osd) 8%, transparent); }
.choice strong { display: block; }
.choice span { font-size: .85rem; color: var(--muted); }
@media (max-width: 560px) { .choice { grid-template-columns: 1fr; } }
.err { color: var(--accent); font-weight: 600; margin: 0; }
.ok { color: var(--osd); font-weight: 600; margin: 0; }
.progress { font-family: var(--font-osd); font-size: 1.2rem; color: var(--osd); font-variant-numeric: tabular-nums; }
.tips { background: var(--bg); border-radius: var(--radius); padding: 12px 14px; font-size: .9rem; color: var(--muted); grid-column: 1 / -1; }
.tips b { color: var(--ink); }

.tabs { display: flex; gap: 0; border-bottom: 1.5px solid var(--line); }
.tabs button { border: 0; background: transparent; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.report-list { display: flex; flex-direction: column; gap: 12px; }
.report { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.report .r-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.report .r-game { font-family: var(--font-display); }
.report .r-reason { font-weight: 600; }
.report .r-meta { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }

footer { border-top: 1px solid var(--line); padding-block: 24px; color: var(--muted); font-size: .9rem; }
footer .wrap { display: flex; flex-direction: column; gap: 6px; }

/* Hero call to action */
.kicker { display: inline-flex; align-items: center; gap: 10px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: 12px; }
.kicker .rec { font-size: 1rem; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.btn.big { padding: 14px 24px; font-size: 1.08rem; }
.calls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-block: 8px 28px; }
@media (max-width: 860px) { .calls { grid-template-columns: 1fr; } }
.call { background: var(--ink); color: var(--bg); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.call h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; line-height: 1.15; margin: 0; text-wrap: balance; }
.call p { margin: 0; color: color-mix(in srgb, var(--bg) 82%, transparent); font-size: .98rem; }
.call-tag { font-family: var(--font-osd); font-size: 1.1rem; letter-spacing: .06em; color: var(--gold); text-transform: uppercase; }
.foot-cta { font-family: var(--font-display); font-weight: 400; font-size: 1.15rem; color: var(--ink); }

/* Clubhouse */
.club { padding-block: 4px 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.club h3 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.35rem, 3vw, 1.75rem); margin: 0; text-wrap: balance; }
.club p { margin: 0; color: var(--muted); }
.tagline { font-size: .8rem; color: var(--muted); letter-spacing: .04em; border-left: 1px solid var(--line); padding-left: 10px; }
@media (max-width: 640px) { .tagline { display: none; } }
footer .legal a { color: inherit; }
#authForm > .hint { font-size: .85rem; color: var(--muted); }
