/* Playoff Beard: ice-white and rink-navy, goal-light red accent. Tokens
   are redefined for dark mode (system setting, or the toggle). */
:root {
  --bg: #f5f7f9; --panel: #ffffff; --panel-2: #eef2f5; --border: #d9e0e6; --text: #101820; --muted: #5b6874; --faint: #8a96a1;
  --navy: #0f2a44; --brand: #c8102e; --accent: var(--brand); --accent-ink: #ffffff; --chip: #eef2f5; --shadow: rgba(15, 42, 68, 0.08);
  /* league colors (light mode: darker shades so text stays readable) */
  --c-nhl: #0277b6; --c-nfl: #15803d; --c-nba: #c2410c; --c-mlb: #a16207; --c-ufc: #7c3aed; --c-soccer: #0f766e;
  /* league icons (pb/icons.py, from RTYB): light mode outlines */
  --ball-puck-top: #2A2E36; --ball-puck-side: #16181D; --ball-puck-grip: #3D434E; --ball-puck-rim: #16181D;
  --ball-shine: rgba(255, 255, 255, 0.16); --ball-leather: #8A4B22; --ball-leather-edge: #4E2610; --ball-leather-rim: transparent;
  --ball-lace: #F4EFE6; --ball-orange: #E8772E; --ball-orange-edge: #7A3510; --ball-seam: #2B1406;
  --ball-white: #F5F3EC; --ball-white-edge: #8A919C; --ball-stitch: #D7263D;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1218; --panel: #121b23; --panel-2: #18232d; --border: #24323e; --text: #e8eef3; --muted: #9aa8b4; --faint: #6f7d89;
    --navy: #e8f1f8; --brand: #ff4d5e; --accent-ink: #0b1218; --chip: #18232d; --shadow: rgba(0, 0, 0, 0.35);
    --c-nhl: #38bdf8; --c-nfl: #4ade80; --c-nba: #fb923c; --c-mlb: #facc15; --c-ufc: #a78bfa; --c-soccer: #2dd4bf; --soccer-edge: #8B93A3;
    --ball-puck-rim: #8B93A3; --ball-leather-rim: #8B93A3; --ball-white-edge: #9AA0A8;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1218; --panel: #121b23; --panel-2: #18232d; --border: #24323e; --text: #e8eef3; --muted: #9aa8b4; --faint: #6f7d89;
  --navy: #e8f1f8; --brand: #ff4d5e; --accent-ink: #0b1218; --chip: #18232d; --shadow: rgba(0, 0, 0, 0.35);
  --c-nhl: #38bdf8; --c-nfl: #4ade80; --c-nba: #fb923c; --c-mlb: #facc15; --c-ufc: #a78bfa; --c-soccer: #2dd4bf; --soccer-edge: #8B93A3;
  --ball-puck-rim: #8B93A3; --ball-leather-rim: #8B93A3; --ball-white-edge: #9AA0A8;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 'Inter', system-ui, sans-serif; }
a { color: inherit; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.top-in { display: flex; align-items: center; gap: 18px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 0.25em; text-decoration: none; color: var(--navy); font: 700 1.4rem 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.02em; flex-shrink: 0; white-space: nowrap; min-height: 44px; }
.brand b { color: var(--brand); font-weight: 700; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a { font: 600 0.95rem 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); text-decoration: none;
  padding: 0 12px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 8px; white-space: nowrap; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); border-radius: 0; }
.theme { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); color: var(--muted); cursor: pointer; font-size: 1rem; flex-shrink: 0; }

.hero { padding: 36px 0 12px; }
.hero h1 { font: 700 clamp(2.6rem, 8vw, 4.4rem)/0.95 'Oswald', sans-serif; text-transform: uppercase; color: var(--navy); }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--muted); margin-top: 10px; font-size: 1.05rem; }
.hero-links { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.hero-links a { font: 600 0.9rem 'Oswald', sans-serif; letter-spacing: 0.05em; text-decoration: none; border: 1px solid var(--border); background: var(--panel);
  border-radius: 999px; padding: 0 18px; min-height: 40px; display: inline-flex; align-items: center; }
.hero-links a:first-child { background: var(--navy); color: var(--bg); border-color: var(--navy); }

.sec { margin: 26px 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--navy); padding-bottom: 6px; margin-bottom: 14px; }
.sec-head h2 { font: 700 1.6rem 'Oswald', sans-serif; text-transform: uppercase; color: var(--navy); }
.sec-head a { color: var(--accent); font-weight: 600; text-decoration: none; font-size: 0.9rem; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 2px var(--shadow); }
.card.big { grid-column: span 2; grid-row: span 2; }
.thumb { display: block; aspect-ratio: 16 / 9; background: var(--panel-2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.meta { font-size: 0.76rem; color: var(--faint); }
.meta .lg { color: var(--accent); font-weight: 700; text-decoration: none; }
.card h3 { font: 600 1.02rem/1.3 'Inter', sans-serif; }
.card.big h3 { font: 700 1.5rem/1.15 'Oswald', sans-serif; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { color: var(--muted); font-size: 0.88rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card.big p { -webkit-line-clamp: 5; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 0.74rem; font-weight: 600; text-decoration: none; background: var(--chip);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px 2px 4px; min-height: 28px; }
.chip:hover { border-color: var(--accent); }

.logo { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo img { width: 100%; height: 100%; object-fit: contain; }
.logo .lg-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo .lg-light { display: none; } :root:not([data-theme="light"]) .logo .lg-dark { display: block; } }
:root[data-theme="dark"] .logo .lg-light { display: none; }
:root[data-theme="dark"] .logo .lg-dark { display: block; }
.logo-fallback { border-radius: 50%; background: var(--panel-2); font: 700 0.6rem 'Inter', sans-serif; color: var(--muted); }

.lg-head { padding: 28px 0 8px; }
.lg-head h1, .team-head h1 { font: 700 clamp(2rem, 6vw, 3rem)/1 'Oswald', sans-serif; text-transform: uppercase; color: var(--navy); }
.lg-head h1 span { color: var(--accent); }
.lg-head p, .team-head p { color: var(--muted); margin-top: 6px; }
.teams-box { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 4px 14px 14px; margin-top: 14px; }
.teams-box summary { font: 600 1rem 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.div-group { margin-top: 10px; }
.div-group h4 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin-bottom: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.tile { display: flex; align-items: center; gap: 8px; text-decoration: none; padding: 6px 8px; border-radius: 8px; border: 1px solid transparent; min-height: 44px; font-weight: 600; font-size: 0.86rem; }
.tile:hover { border-color: var(--border); background: var(--panel-2); }
.tile small { margin-left: auto; color: var(--faint); font-weight: 500; }
.back { display: inline-flex; margin-top: 20px; color: var(--accent); font-weight: 600; text-decoration: none; min-height: 32px; align-items: center; }
.team-head { display: flex; align-items: center; gap: 16px; padding: 12px 0 6px; }
.rivals { margin-top: 8px; align-items: center; }

.foot { border-top: 1px solid var(--border); margin-top: 40px; padding: 22px 0 36px; font-size: 0.8rem; color: var(--muted); }
.foot p + p { margin-top: 6px; }

@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .card.big { grid-column: auto; grid-row: auto; }
  .brand { font-size: 1.1rem; }
  .top-in { gap: 8px; }
  .nav a { padding: 0 9px; }
}

/* league icons */
.sport-icon { display: inline-block; width: 1.25em; height: 1.25em; flex-shrink: 0; vertical-align: -0.25em; margin-right: 0.35em; }
.nav a .sport-icon { width: 1.15em; height: 1.15em; }
.sec-head h2, .lg-head h1, .nav a, .hero-links a { display: inline-flex; align-items: center; }
.sport-icon .bi-puck-side { fill: var(--ball-puck-side); }
.sport-icon .bi-puck-top { fill: var(--ball-puck-top); stroke: var(--ball-puck-rim); stroke-width: 1; }
.sport-icon .bi-puck-grip { stroke: var(--ball-puck-grip); }
.sport-icon .bi-puck-shine { fill: var(--ball-shine); }
.sport-icon .bi-rim { stroke: var(--ball-puck-rim); }
.sport-icon .bi-leather { fill: var(--ball-leather); stroke: var(--ball-leather-edge); }
.sport-icon .bi-leather-rim { stroke: var(--ball-leather-rim); }
.sport-icon .bi-stripe, .sport-icon .bi-lace { stroke: var(--ball-lace); }
.sport-icon .bi-basketball { fill: var(--ball-orange); stroke: var(--ball-orange-edge); }
.sport-icon .bi-seam { stroke: var(--ball-seam); }
.sport-icon .bi-baseball { fill: var(--ball-white); stroke: var(--ball-white-edge); }
.sport-icon .bi-stitch { stroke: var(--ball-stitch); }
.hero-links a:first-child .sport-icon { --ball-puck-rim: #8B93A3; }   /* the puck on the filled NHL button */

/* league and team pages: the home page's hero and day sections */
.hero h1 { display: flex; align-items: center; flex-wrap: wrap; column-gap: 0.25em; }
.hero h1 .hero-icon { width: 0.9em; height: 0.9em; margin-right: 0.1em; vertical-align: middle; }
.sec-n { color: var(--faint); font-size: 0.82rem; }
.hero .teams-box { margin-top: 18px; }
.team-hero .back { margin: 0 0 14px; display: inline-flex; align-items: center; }
.team-title { display: flex; align-items: center; gap: 18px; }
.team-title h1 { line-height: 0.95; }
.hero-links.rivals a:first-child { background: var(--panel); color: var(--text); border-color: var(--border); }
.hero-links.rivals a { gap: 6px; }
@media (max-width: 600px) { .team-title { gap: 12px; } .team-title .logo { width: 56px !important; height: 56px !important; } }

/* league pages: every team's logo in one row */
.logo-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; margin-top: 20px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 6px; }
.logo-row a { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 8px; transition: transform 0.12s, background 0.12s; }
.logo-row a:hover { background: var(--panel-2); transform: translateY(-2px); }
.logo-row .logo { max-width: 100%; }
@media (max-width: 900px) {
  .logo-row { grid-auto-columns: 44px; overflow-x: auto; scrollbar-width: none; }
  .logo-row::-webkit-scrollbar { display: none; }
}
.lr-nhl .logo img { transform: scale(1.45); }   /* NHL's SVGs carry extra padding */

/* each league's pages (and its home-page section) use the league's color */
.lg-nhl { --accent: var(--c-nhl); }
.lg-nfl { --accent: var(--c-nfl); }
.lg-nba { --accent: var(--c-nba); }
.lg-mlb { --accent: var(--c-mlb); }
.lg-ufc { --accent: var(--c-ufc); }
.lg-soccer { --accent: var(--c-soccer); }
.sec .sec-head { border-bottom-color: var(--accent); }
.home .hero h1 span { color: var(--brand); }
.hero-links a:first-child { background: var(--panel); color: var(--text); border-color: var(--border); }
.home .hero-links a { border-color: var(--border); }
.home .hero-links a:hover { border-color: var(--text); }
.sport-icon .bi-soccer-white { fill: #f5f3ec; }
.sport-icon .bi-soccer-patch { fill: #16181d; }
.sport-icon .bi-soccer-seam { stroke: #16181d; }
.sport-icon .bi-soccer-edge { stroke: var(--soccer-edge, #16181d); }
.sport-icon .bi-oct-fence { fill: #1b1d22; stroke: var(--ball-puck-rim); }
.sport-icon .bi-oct-mat { fill: #ece7dc; }
.sport-icon .bi-oct-post { fill: #8B93A3; }
.sport-icon .bi-oct-mark { stroke: #c8102e; }

/* soccer: one logo row per competition; UFC: weight classes as name pills */
.lr-label { font: 600 0.72rem 'Inter', sans-serif; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin: 18px 0 -12px 4px; }
.lr-label + .logo-row { margin-top: 16px; }
.name-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.name-row a { font: 600 0.9rem 'Oswald', sans-serif; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; border: 1px solid var(--border);
  background: var(--panel); border-radius: 999px; padding: 0 16px; min-height: 40px; display: inline-flex; align-items: center; }
.name-row a:hover { border-color: var(--accent); color: var(--accent); }
.logo .logo-icon { width: 100%; height: 100%; margin: 0; vertical-align: 0; }
.ranks { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 18px; }
.ranks li { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 8px; background: var(--panel); border: 1px solid var(--border); font-weight: 600; font-size: 0.9rem; }
.ranks li span { width: 1.6em; text-align: center; color: var(--faint); font-variant-numeric: tabular-nums; }
.ranks li.champ { grid-column: 1 / -1; border-color: var(--accent); }
.ranks li.champ span { color: var(--accent); font-weight: 700; }

/* highlights: a thumbnail until clicked, then YouTube's player in place */
.yt { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; background: #000; cursor: pointer; overflow: hidden; }
.yt img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }
.yt-play { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; transform: translate(-50%, -50%); border-radius: 50%;
  background: rgba(0, 0, 0, 0.6); border: 2px solid #fff; transition: background 0.12s, border-color 0.12s; }
.yt-play::after { content: ''; position: absolute; left: 54%; top: 50%; transform: translate(-50%, -50%);
  border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent #fff; }
.yt:hover img, .c-vid:hover .yt img { transform: scale(1.04); }
.yt:hover .yt-play, .c-vid:hover .yt-play { background: var(--accent); border-color: var(--accent); }
.yt-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.hl-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 270px); gap: 14px; overflow-x: auto;
  padding-bottom: 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.hl { scroll-snap-align: start; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px var(--shadow); }
.hl-body { padding: 10px 12px 12px; }
.hl-game { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.95rem; line-height: 1.25; }
.hl-game span { margin-left: 2px; }
.hl .meta { margin-top: 4px; }
.c-vid { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px; min-height: 44px; }
.c-vid:hover { border-color: var(--accent); }
.c-vid .yt { width: 96px; flex-shrink: 0; border-radius: 5px; }
.c-vid .yt-play { width: 28px; height: 28px; border-width: 1.5px; }
.c-vid .yt-play::after { border-width: 6px 0 6px 10px; }
.c-vid-label { font-weight: 600; font-size: 0.86rem; line-height: 1.25; }
.c-vid-label small { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 700; }
.c-body .yt-frame { border-radius: 8px; }
