/* TIS Owls Live - design tokens and components.
   Style sources (see docs/DESIGN.md): the supplied "Editorial Cinematic" spec (Instrument Serif
   display, Inter UI, pill buttons, fade-rise entrance), Spotify (dark content-first surfaces,
   chips), Lamborghini (near-black with a single gold highlight). */

:root {
  /* TODO: replace blue and gold with the exact hex codes from the TIS logo file */
  --bg: #0a0f1a;
  --surface: #111827;
  --surface-2: #182033;
  --line: #263149;
  --text: #f3f6fc;
  --muted: #98a4bc;
  --blue: #2563eb;
  --blue-hover: #3b7bff;
  --blue-text: #7aaeff;
  --gold: #f6b93b;

  --display: "Instrument Serif", "Times New Roman", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 16px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1200px;
  --tabbar-h: 64px;
  --side: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  --ease: 200ms cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--sans);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img, svg, iframe { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #111; padding: 10px 14px; border-radius: 8px; z-index: 100; font-weight: 600; }
.skip:focus { left: 8px; }

/* ---------- top bar & navigation ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px;
  padding: 0 var(--side);
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(56px + env(safe-area-inset-top, 0px));
  background: rgba(10, 15, 26, .94);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; }
.brand-text { font: 400 28px/1 var(--display); letter-spacing: -.01em; }
.brand-text em { font-style: italic; color: var(--gold); }
.brand-eye { width: 30px; height: 14px; }
.topnav { display: none; gap: 8px; justify-content: center; }
.topcta { display: none; justify-self: end; }
.topnav a { padding: 10px 16px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 15px; transition: color var(--ease), background var(--ease); }
.topnav a:hover { color: var(--text); background: var(--surface); }
.topnav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(10, 15, 26, .96);
  border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 48px; padding: 0 4px; text-align: center; line-height: 1.15; color: var(--muted); font-size: 12px; font-weight: 600; transition: color var(--ease); }
.tabbar svg { width: 24px; height: 24px; fill: currentColor; }
.tabbar a[aria-current="page"] { color: var(--blue-text); }

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .topbar { grid-template-columns: 1fr auto 1fr; }
  .topnav { display: flex; }
  .topcta { display: inline-flex; }
}
@media (max-width: 899px) { .topcta { display: inline-flex; padding: 0 18px; min-height: 40px; font-size: 13px; } }

/* ---------- owl-eye mark ---------- */
.owl-eye .eye { fill: none; stroke: currentColor; stroke-width: 1.6; }
.owl-eye .pupil { fill: currentColor; transform-box: fill-box; transform-origin: center; }
.brand-eye { color: var(--gold); }
.live-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border-radius: 999px; background: var(--gold); color: #1a1405; font: 700 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.live-badge .owl-eye { width: 24px; height: 11px; }
.live-badge .pupil { animation: blink 2.4s infinite; }
@keyframes blink { 0%, 86%, 100% { transform: scaleY(1); } 92% { transform: scaleY(.1); } }
.owl-eye.watermark { position: absolute; right: 14px; top: 14px; width: 54px; height: 25px; color: var(--line); }
.court { position: absolute; inset: 0; width: 100%; height: 100%; color: #2b3f66; }
.owl-eye.big { width: 84px; height: 39px; color: var(--muted); }

/* ---------- type ---------- */
.eyebrow { font: 600 13px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--blue-text); }
.meta { color: var(--muted); font-size: 14px; }
.local:not(:empty)::before { content: " · "; }
.local { color: var(--muted); }
.page-title { font: 400 clamp(44px, 8vw, 80px)/.95 var(--display); letter-spacing: -.03em; }
.lede { color: var(--muted); max-width: 60ch; margin-top: 12px; }
.empty { color: var(--muted); padding: 24px 0; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.page { padding-top: 28px; padding-bottom: 48px; }
.narrow { max-width: 760px; }
.crumb { margin-bottom: 14px; font-size: 14px; }
.crumb a { color: var(--blue-text); }

.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head h2 { font: 400 36px/1 var(--display); letter-spacing: -.02em; }
.more { color: var(--blue-text); font-size: 14px; font-weight: 600; padding: 10px 0; }
.more:hover { color: var(--text); }

/* ---------- buttons & chips ---------- */
.btn-pill { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 24px; border-radius: 9999px; border: 0; background: var(--pill-bg, #fff); color: var(--pill-fg, #0f172a); font: 500 14px/1 var(--sans); cursor: pointer; transition: transform .3s ease-in-out; }
.btn-pill:hover { transform: scale(1.03); }
.btn-pill svg { width: 18px; height: 18px; fill: currentColor; }
.btn-pill-lg { padding: 20px 56px; font-size: 16px; min-height: 60px; }
body { --pill-bg: #fff; --pill-fg: #0f172a; }
body[data-tone="light"] { --pill-bg: #000; --pill-fg: #fff; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 24px; border-radius: 999px; border: 0; font: 700 15px/1 var(--sans); letter-spacing: .02em; cursor: pointer; transition: background var(--ease), transform var(--ease); }
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-primary:active { transform: scale(.98); }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--line); }
.btn-ghost svg { fill: none; }

.filters { margin-top: 20px; }
.chip-row { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); font: 600 14px/1 var(--sans); cursor: pointer; transition: background var(--ease), color var(--ease), border-color var(--ease); }
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--text); color: #0a0f1a; border-color: var(--text); }
.chip-divider { flex: none; width: 1px; height: 24px; background: var(--line); margin: 0 4px; }

/* ---------- hero (Editorial Cinematic spec, adapted for a dark sports site) ---------- */
body { --h-text: #fff; --h-muted: rgba(255, 255, 255, .74); }
body[data-tone="light"] { --h-text: #0f172a; --h-muted: hsl(215, 25%, 32%); }
.home .topbar { position: absolute; left: 0; right: 0; background: transparent; border-bottom: 0; }
.home[data-tone="light"] .topbar, .home[data-tone="light"] .brand-text { color: var(--h-text); }
.home[data-tone="light"] .topnav a { color: var(--h-muted); }
.home[data-tone="light"] .topnav a:hover { background: rgba(255, 255, 255, .4); color: var(--h-text); }

.hero { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 100svh; padding: 96px var(--side) 72px; background: hsl(201, 100%, 13%); }
.hero-media { position: absolute; inset: 0; z-index: -1; background: #050a15 url(/assets/hero-pitch.svg) center / cover no-repeat; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: rgba(5, 10, 21, .2); }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-content { width: 100%; max-width: 1280px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px; color: var(--h-text); }
.eyebrow-row { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.hero-kicker { font: 500 14px/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--h-muted); }
.hero-title { font: 400 48px/.95 var(--display); letter-spacing: -.031em; max-width: 14ch; overflow-wrap: anywhere; }
@media (min-width: 768px) { .hero-title { font-size: 80px; } }
.hero-title em { font-style: normal; color: var(--h-muted); }
.hero-sub { font: 400 18px/1.625 var(--sans); color: var(--h-muted); max-width: 670px; }
.hero-sub .local { color: inherit; opacity: .8; }
.hero-score { font: 400 clamp(88px, 18vw, 150px)/.9 var(--display); letter-spacing: -.03em; color: var(--gold); }
.hero-score i, .card-score i { font-style: normal; margin: 0 .14em; opacity: .5; }
.hero-actions { margin-top: 20px; }
.countdown { display: flex; align-items: flex-start; justify-content: center; gap: 10px; color: var(--gold); }
.countdown div { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.countdown b { font: 400 clamp(48px, 10vw, 76px)/.95 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; font-weight: 400; }
.countdown span { font-size: 12px; color: var(--h-muted); text-transform: uppercase; letter-spacing: .1em; }
.countdown i { font: 400 clamp(40px, 8vw, 60px)/1 var(--display); font-style: normal; opacity: .35; }
.video-wait .countdown { --h-muted: var(--muted); }

/* fade-rise entrance: 0.8s ease-out, staggered 200ms */
@keyframes fade-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.fx { opacity: 0; animation: fade-rise .8s ease-out forwards; }
.fx-1 { animation-delay: .2s; }
.fx-2 { animation-delay: .4s; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-one { grid-template-columns: minmax(0, 420px); }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: min(80%, 300px); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin-right: calc(var(--gutter) * -1); padding-right: var(--gutter); padding-bottom: 6px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
.rail > .empty { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .rail { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(3, 1fr); overflow: visible; margin-right: 0; padding-right: 0; }
}

.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid transparent; transition: transform var(--ease), border-color var(--ease), background var(--ease); }
.card:hover { transform: translateY(-3px); border-color: var(--line); background: var(--surface-2); }
.card.is-live { border-color: var(--gold); }
.card-link { display: block; }
.card-media { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #17213a 0%, #0f1628 100%); background-size: cover; background-position: center; }
.card-badge { position: absolute; left: 12px; top: 12px; }
.card-score { position: absolute; left: 14px; bottom: 8px; font: 400 56px/1 var(--display); letter-spacing: -.02em; color: var(--gold); text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.play-circle { position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; border-radius: 50%; background: var(--blue); display: grid; place-items: center; box-shadow: 0 8px 20px rgba(0, 0, 0, .45); transition: transform var(--ease), background var(--ease); }
.play-circle svg { width: 22px; height: 22px; fill: #fff; margin-left: 2px; }
.card:hover .play-circle { transform: scale(1.08); background: var(--blue-hover); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.card-title { font: 400 30px/1 var(--display); letter-spacing: -.02em; }

.team-card { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 140px; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid transparent; overflow: hidden; transition: transform var(--ease), border-color var(--ease), background var(--ease); }
.team-card:hover { transform: translateY(-3px); border-color: var(--line); background: var(--surface-2); }
.team-card h3 { font: 400 44px/1 var(--display); letter-spacing: -.02em; }
.team-card .meta { margin-top: auto; padding-top: 14px; }

/* ---------- game page ---------- */
.game-page { max-width: 1000px; }
.video { position: relative; aspect-ratio: 16 / 9; background: #05080f; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; text-align: center; color: var(--muted); background: radial-gradient(80% 90% at 50% 0%, rgba(59, 123, 255, .2), rgba(59, 123, 255, 0) 70%), #080c16; }
.video-wait .countdown { transform: scale(.7); transform-origin: top center; margin-bottom: -20px; }
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.sb-team { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.sb-away { align-items: flex-end; text-align: right; }
.sb-name { font: 400 clamp(20px, 4.5vw, 30px)/1.05 var(--display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.sb-num { font: 400 clamp(48px, 10vw, 76px)/.9 var(--display); letter-spacing: -.03em; color: var(--gold); font-variant-numeric: tabular-nums; }
.sb-mid { display: flex; justify-content: center; }
.sb-state { font: 600 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.game-head { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.game-head .page-title { margin: 4px 0 8px; }
.game-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.game-actions .btn { flex: 1 1 auto; padding: 0 18px; }
@media (min-width: 700px) { .game-head { flex-direction: row; justify-content: space-between; align-items: flex-end; } .game-actions .btn { flex: none; } }

/* ---------- about / prose ---------- */
.prose-block { margin-top: 28px; }
.prose-block h2 { font: 400 34px/1 var(--display); letter-spacing: -.02em; margin-bottom: 8px; }
.prose-block p { color: var(--muted); max-width: 62ch; }
.about-tag { margin-top: 40px; font: 400 26px/1 var(--display); font-style: italic; color: #4a5a7c; }

/* ---------- live strip (schedule) ---------- */
.live-strip { margin-top: 20px; }
.live-strip a { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--gold); min-height: 56px; }
.live-strip strong { font: 400 28px/1 var(--display); letter-spacing: -.01em; }
.live-strip .go { margin-left: auto; color: var(--blue-text); font-weight: 600; }

/* ---------- footer ---------- */
.footer { padding: 28px var(--side) 32px; border-top: 1px solid var(--line); margin-top: 24px; text-align: center; }
.footer-school { color: var(--muted); font-size: 14px; }
.footer-tag { margin-top: 6px; font: 400 18px/1 var(--display); font-style: italic; color: #6b7a99; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover, .team-card:hover, .btn-pill:hover { transform: none; }
  .fx { opacity: 1; }
}

/* ---------- admin (staff only) ---------- */
.btn-danger { background: transparent; color: #ff8a8a; border: 1px solid #5b2a33; }
.btn-danger:hover { background: #2a1519; }

.admin { padding-bottom: 48px; }
.adm-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.adm-modeline { margin-top: 6px; }
.adm-mode { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; }
.adm-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-note { margin-top: 16px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 14px; max-width: 70ch; }
.adm-msg { min-height: 24px; margin-top: 12px; color: var(--blue-text); font-size: 14px; font-weight: 600; }

.adm-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.adm-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 16px; align-content: start; }
.adm-card.is-live { border-color: var(--gold); }
.adm-card-head { display: flex; justify-content: space-between; gap: 12px; }
.adm-card-head .eyebrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-title { font: 400 28px/1.05 var(--display); letter-spacing: -.01em; margin-top: 4px; }
.adm-final { font: 400 40px/1 var(--display); color: var(--gold); white-space: nowrap; }
.adm-final i { font-style: normal; color: var(--muted); padding: 0 4px; }
.adm-warn { color: var(--gold); }

.adm-score { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adm-side { background: var(--surface-2); border-radius: 12px; padding: 12px; display: grid; gap: 8px; justify-items: center; }
.adm-side-name { font-size: 13px; font-weight: 600; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.adm-stepper { display: flex; align-items: center; gap: 10px; }
.adm-step { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 28px/1 var(--sans); cursor: pointer; transition: background var(--ease), transform var(--ease); }
.adm-step:hover { background: var(--line); }
.adm-step:active { transform: scale(.94); }
.adm-num { min-width: 2ch; text-align: center; font: 400 52px/1 var(--display); color: var(--gold); }
.adm-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.adm-form { display: grid; gap: 16px; max-width: 560px; margin-top: 12px; }
.adm-field { display: grid; gap: 6px; }
.adm-field label { font-size: 14px; font-weight: 600; }
.adm-input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 400 16px/1.2 var(--sans); }
.adm-input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
select.adm-input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.adm-help { color: var(--muted); font-size: 13px; }
.adm-error { color: #ff8a8a; font-size: 14px; font-weight: 600; }
.adm-field.has-error .adm-input { border-color: #ff8a8a; }
.adm-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adm-form-actions { padding-top: 4px; }
.adm-signin { max-width: 420px; }
@media (max-width: 480px) { .adm-score { grid-template-columns: 1fr; } .adm-step { width: 60px; height: 60px; } }
