/* Ported from rugbycritic-mockup.html — the approved design system. */

  :root {
    color-scheme: light;
    --surface-1:      #fcfcfb;
    --page:           #f9f9f7;
    --text-primary:   #0b0b0b;
    --text-secondary: #52514e;
    --text-muted:     #898781;
    --gridline:       #e1e0d9;
    --baseline:       #c3c2b7;
    --border:         rgba(11,11,11,0.10);
    --brand:          #2a78d6;
    --brand-ink:      #ffffff;
    --good:           #0ca30c;
    --warning:        #c98500;
    --critical:       #d03b3b;
    --live:           #d03b3b;
    --seq-100: #cde2fb; --seq-200: #9ec5f4; --seq-300: #6da7ec; --seq-400: #3987e5; --seq-500: #256abf;
    /* categorical slots 1 & 2 from the validated palette — Team A / Team B identity, not team-brand color */
    --team-a: #2a78d6;
    --team-b: #eb6834;
    --card-radius: 12px;
  }
  [data-theme="dark"] {
    color-scheme: dark;
    --surface-1:      #1a1a19;
    --page:           #0d0d0d;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --gridline:       #2c2c2a;
    --baseline:       #383835;
    --border:         rgba(255,255,255,0.10);
    --brand:          #3987e5;
    --brand-ink:      #ffffff;
    --good:           #0ca30c;
    --warning:        #fab219;
    --critical:       #e66767;
    --live:           #e66767;
    --team-a: #3987e5;
    --team-b: #d95926;
  }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--page);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
  }
  a { color: inherit; text-decoration: none; }
  .wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

  /* header */
  header.site {
    background: var(--surface-1);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 20;
  }
  .nav-row { display: flex; align-items: center; justify-content: space-between; height: 60px; position: relative; }
  .logo { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; display:flex; align-items:center; gap:6px;}
  .logo .critic { color: var(--brand); }
  nav.links { display: flex; gap: 26px; font-size: 14px; font-weight: 600; color: var(--text-secondary); }
  nav.links a:hover { color: var(--text-primary); }
  .nav-actions { display: flex; align-items: center; gap: 12px; }
  .btn {
    font-size: 13px; font-weight: 700; padding: 8px 16px; border-radius: 8px; cursor: pointer; border: none;
  }
  .btn-primary { background: var(--brand); color: var(--brand-ink); }
  .btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
  .theme-toggle { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-1); cursor: pointer; font-size: 15px; }

  @keyframes ctaPulse {
    0%   { box-shadow: 0 0 0 0 rgba(42,120,214,0.55); }
    70%  { box-shadow: 0 0 0 12px rgba(42,120,214,0); }
    100% { box-shadow: 0 0 0 0 rgba(42,120,214,0); }
  }
  .btn-primary.pulse { animation: ctaPulse 1.8s infinite; }
  .rate-btn-short { display: none; }

  /* profile chip */
  .profile-chip { display: none; align-items: center; gap: 7px; padding: 5px 12px 5px 5px; border: 1px solid var(--border); border-radius: 20px; cursor: pointer; font-size: 12.5px; font-weight: 700; }
  .profile-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; }
  .profile-pop { position: absolute; top: 52px; right: 20px; width: 230px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.18); display: none; z-index: 30; }
  .profile-pop.open { display: block; }
  .profile-pop-name { font-weight: 800; font-size: 13px; margin-bottom: 8px; }
  .profile-stat-row { display: flex; justify-content: space-between; font-size: 12px; padding: 5px 0; border-bottom: 1px solid var(--gridline); color: var(--text-secondary); }
  .profile-stat-row:last-of-type { border-bottom: none; }
  .profile-badge { display: inline-flex; align-items: center; gap: 4px; background: rgba(12,163,12,0.12); color: var(--good); font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; margin-top: 8px; }
  .profile-badge.locked { background: var(--gridline); color: var(--text-muted); }

  /* level / streak system */
  .level-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
  .level-badge { display: inline-flex; align-items: center; gap: 5px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; padding: 3px 11px; border-radius: 20px; }
  .streak-badge { display: inline-flex; align-items: center; gap: 4px; background: rgba(250,178,25,0.15); color: var(--warning); font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 20px; }
  .level-bar { height: 8px; background: var(--gridline); border-radius: 5px; overflow: hidden; margin-bottom: 5px; }
  .level-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--brand), var(--seq-500)); border-radius: 5px; transition: width .4s ease; }
  .level-points-label { font-size: 11px; color: var(--text-muted); text-align: right; margin-bottom: 4px; }
  .demo-controls { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
  .demo-label { font-size: 10px; color: var(--text-muted); margin-bottom: 7px; text-transform: uppercase; letter-spacing: .03em; font-weight: 800; }
  .demo-btn { font-size: 11px; font-weight: 700; padding: 6px 9px; border-radius: 7px; border: 1px solid var(--border); background: var(--page); cursor: pointer; margin-right: 6px; color: var(--text-primary); }
  .demo-btn.correct { color: var(--good); border-color: rgba(12,163,12,0.3); }
  .demo-btn.wrong { color: var(--critical); border-color: rgba(208,59,59,0.3); }
  .critic-level-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; color: var(--text-secondary); }
  .critic-level-badge .flame { color: var(--warning); }

  /* robust chevron toggle (CSS triangle, not a font glyph) */
  .chevron-btn { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); background: var(--page); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
  .chevron-icon { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 6px solid var(--text-secondary); transition: transform .18s; display: block; }
  .chevron-icon.rotated { transform: rotate(180deg); }
  .modal-note { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

  /* live ticker */
  .ticker-bar { background: var(--surface-1); border-bottom: 1px solid var(--gridline); }
  .ticker-scroll { display: flex; gap: 0; overflow-x: auto; padding: 10px 20px; }
  .ticker-item { display: flex; align-items: center; gap: 10px; padding: 0 18px; border-right: 1px solid var(--gridline); white-space: nowrap; font-size: 13px; }
  .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--live); display: inline-block; animation: pulse 1.6s infinite; }
  @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
  .live-tag { color: var(--live); font-weight: 800; font-size: 11px; letter-spacing: .04em; }
  .t-teams { color: var(--text-secondary); }
  .t-score { font-weight: 800; font-variant-numeric: tabular-nums; }

  main { padding: 28px 0 60px; }
  h1.page-title { font-size: 22px; margin: 18px 0 4px; }
  .subtitle { color: var(--text-secondary); font-size: 14px; margin: 0 0 22px; }

  /* featured match hero */
  .hero-card {
    background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--card-radius);
    padding: 24px; margin-bottom: 28px;
  }
  .hero-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px; }
  .comp-tag { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); margin-bottom: 8px; display:block;}
  .matchup { display: flex; align-items: center; gap: 22px; }
  .team { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 110px; }
  .crest { width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; color: #fff; }
  .team-name { font-size: 13px; font-weight: 700; text-align: center; }
  .score-block { text-align: center; }
  .score-big { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
  .match-status { font-size: 12px; color: var(--live); font-weight: 800; margin-top: 6px; }

  .rating-tile { text-align: center; min-width: 140px; }
  .rating-num { font-size: 34px; font-weight: 800; color: var(--good); font-variant-numeric: tabular-nums; }
  .rating-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px;}
  .rate-btn { margin-top: 10px; }

  /* homepage hero CTA — a full-width row of its own below the histogram,
     not squeezed into the narrow .rating-tile column (which is what made
     the old layout's pulse glow visually crowd/cover the rating number
     above it), so it stays full width on both desktop and mobile. */
  .hero-rate-btn { display: block; width: 100%; box-sizing: border-box; text-align: center; margin-top: 18px; padding: 13px; font-size: 14px; }

  .consensus { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--gridline); }
  .consensus-label { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
  .consensus-text { font-size: 15px; line-height: 1.5; color: var(--text-primary); }

  /* odds dropdown */
  .odds-block { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--gridline); }
  .odds-head { display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; }
  .odds-head-left { display: flex; align-items: center; gap: 8px; }
  .odds-body { margin-top: 12px; }
  .odds-body.collapsed { display: none; }
  .odds-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .odds-btn { border: 1px solid var(--border); background: var(--page); border-radius: 8px; padding: 8px; text-align: center; cursor: pointer; }
  .odds-btn.selected { border-color: var(--brand); background: rgba(42,120,214,0.08); }
  .odds-outcome { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
  .odds-value { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
  .gamble-note { font-size: 10.5px; color: var(--text-muted); margin-top: 8px; display: flex; align-items: center; gap: 5px; }
  .gamble-badge { border: 1px solid var(--baseline); border-radius: 4px; padding: 1px 5px; font-weight: 800; }

  .mc-odds { display: flex; gap: 6px; margin-top: 10px; }
  .mc-odds-btn { flex: 1; border: 1px solid var(--border); border-radius: 6px; padding: 5px; text-align: center; font-size: 11px; }
  .mc-odds-label { color: var(--text-muted); }
  .mc-odds-val { font-weight: 800; }

  .hist-row { display:flex; align-items:flex-end; gap:4px; height:34px; margin-top:14px; }
  .hist-bar { flex:1; background: var(--seq-300); border-radius: 3px 3px 0 0; }
  .hist-labels { display:flex; gap:4px; margin-top:4px; }
  .hist-labels span { flex:1; text-align:center; font-size:10px; color: var(--text-muted); }

  /* two column */
  .cols { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
  @media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }

  .section-title { font-size: 15px; font-weight: 800; margin: 0 0 14px; display:flex; align-items:center; justify-content:space-between; }
  .section-title a { font-size: 12px; font-weight: 700; color: var(--brand); }

  /* feed tabs — wraps at every width, not just the mobile breakpoint
     below, so a row that grows past its container (e.g. more toggle
     buttons than fit) never forces the page to scroll horizontally. */
  .feed-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
  .feed-tab { padding: 7px 15px; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-secondary); }
  .feed-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

  /* pagination */
  .pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
  .page-btn { min-width: 28px; height: 28px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-1); font-size: 12px; font-weight: 700; cursor: pointer; color: var(--text-secondary); }
  .page-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }

  /* match cards */
  .match-card {
    background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--card-radius);
    padding: 16px; margin-bottom: 14px; overflow: hidden;
  }
  .mc-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; gap: 8px; }
  .mc-comp { font-size: 11px; color: var(--text-muted); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .mc-badge { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 5px; flex-shrink: 0; }
  .badge-final { background: var(--gridline); color: var(--text-secondary); }
  .badge-live { background: rgba(208,59,59,0.12); color: var(--live); }
  /* Long team names + the crest icon must never push past the card edge,
     for any name length: each .mc-team gets a real, shrinkable flex track
     (min-width:0 + flex:1) so the browser is allowed to constrain it, the
     crest is pinned at its fixed size (flex-shrink:0) instead of being
     squashed or dragged along with the text, and the name itself ellipsizes
     rather than wrapping/overflowing once it runs out of room. */
  .mc-teams { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .mc-team { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; flex: 1; min-width: 0; }
  .mc-teams .mc-team:last-child { justify-content: flex-end; }
  .mc-team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .mc-crest-sm { width: 26px; height: 26px; border-radius: 6px; display:flex; align-items:center; justify-content:center; color:#fff; font-size:11px; font-weight:800; flex-shrink: 0; }
  .mc-score { font-variant-numeric: tabular-nums; font-weight: 800; flex-shrink: 0; padding: 0 4px; }
  .mc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gridline); }
  .mc-rating { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
  .rating-chip { background: rgba(12,163,12,0.12); color: var(--good); font-weight: 800; padding: 2px 7px; border-radius: 5px; font-size: 12px; }
  .mc-comment { font-size: 12px; color: var(--text-muted); font-style: italic; }
  .video-tag { display:flex; align-items:center; gap:5px; font-size:12px; color: var(--text-secondary); font-weight:600; }

  /* sidebar widgets */
  .widget { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--card-radius); padding: 16px; margin-bottom: 20px; }
  table.standings { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  table.standings th { text-align: left; color: var(--text-muted); font-weight: 700; padding-bottom: 8px; border-bottom: 1px solid var(--gridline); }
  table.standings td { padding: 7px 0; border-bottom: 1px solid var(--gridline); font-variant-numeric: tabular-nums; }
  table.standings td.team-cell { font-variant-numeric: normal; font-weight: 700; }
  table.standings tr:last-child td { border-bottom: none; }
  .pos { color: var(--text-muted); width: 18px; }

  .rank-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--gridline); font-size: 13px; }
  .rank-row:last-child { border-bottom: none; }
  .rank-left { display: flex; align-items: center; gap: 10px; }
  .rank-num { font-weight: 800; color: var(--text-muted); width: 16px; }
  .move { font-size: 11px; font-weight: 800; }
  .move-up { color: var(--good); }
  .move-down { color: var(--critical); }

  /* Shared filter bar — Power Rankings, Teams, and anywhere else that needs
     a row of dropdown/search filters above a list. */
  .filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
  .filter-select, .filter-search { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-1); font-size: 13px; font-weight: 600; color: var(--text-primary); font-family: inherit; }
  .filter-search { flex: 1; min-width: 160px; }
  .filter-clear { font-size: 12px; font-weight: 700; color: var(--text-muted); text-decoration: none; align-self: center; padding: 0 4px; }
  .filter-clear:hover { color: var(--text-primary); }
  .filter-empty-note { color: var(--text-muted); font-size: 13px; padding: 6px 0; }

  .critic-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--gridline); font-size: 13px; }
  .critic-row:last-child { border-bottom: none; }

  /* homepage "Latest Injuries" widget */
  .injury-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0 2px; border-top: 1px solid var(--gridline); font-size: 13px; }
  .injury-row:first-child { border-top: none; padding-top: 0; }
  .injury-main { display: flex; flex-direction: column; min-width: 0; }
  .injury-player { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .injury-team { font-size: 11px; color: var(--text-muted); }
  .injury-status { font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 5px; white-space: nowrap; flex-shrink: 0; }
  .injury-status-out { background: rgba(208,59,59,0.12); color: var(--critical); }
  .injury-status-injured { background: rgba(208,59,59,0.12); color: var(--critical); }
  .injury-status-doubtful { background: rgba(250,178,25,0.15); color: var(--warning); }
  .injury-status-returning { background: rgba(12,163,12,0.12); color: var(--good); }
  .injury-detail { font-size: 11.5px; color: var(--text-muted); padding-bottom: 6px; }
  .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:800; }
  .critic-name { font-weight: 700; flex: 1; }
  .critic-score { color: var(--good); font-weight: 800; font-size: 12px; }

  /* video row */
  .video-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
  @media (max-width: 860px) { .video-grid { grid-template-columns: repeat(2, 1fr); } }
  .video-card { border-radius: var(--card-radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface-1); }
  .video-thumb { height: 100px; background: linear-gradient(135deg, var(--seq-400), var(--seq-500)); position: relative; display:flex; align-items:center; justify-content:center; }
  .play-icon { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.9); display:flex; align-items:center; justify-content:center; color: var(--seq-500); font-size: 13px; }
  .video-info { padding: 10px 12px; }
  .video-title { font-size: 12.5px; font-weight: 700; margin-bottom: 3px; }
  .video-meta { font-size: 11px; color: var(--text-muted); }

  /* news */
  .news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  @media (max-width: 860px) { .news-grid { grid-template-columns: 1fr; } }
  .news-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--card-radius); overflow: hidden; }
  .news-thumb { height: 140px; background: linear-gradient(135deg, var(--seq-200), var(--seq-400)); position: relative; }
  .news-cat { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,0.6); color: #fff; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 5px; text-transform: uppercase; letter-spacing: .03em; }
  .news-body { padding: 13px 14px 14px; }
  .news-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 7px; }
  .news-title { font-size: 14.5px; font-weight: 800; line-height: 1.35; margin-bottom: 6px; }
  .news-excerpt { font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
  .news-foot { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--gridline); }

  /* directory widgets (tournaments / teams) */
  .list-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--gridline); font-size: 13px; font-weight: 700; cursor: pointer; }
  .list-row:last-child { border-bottom: none; }
  .list-left { display: flex; align-items: center; gap: 10px; }
  .list-icon { width: 24px; height: 24px; border-radius: 6px; background: var(--gridline); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
  .chevron { color: var(--text-muted); font-size: 13px; }

  footer { border-top: 1px solid var(--gridline); background: var(--surface-1); padding: 40px 0 0; margin-top: 40px; }
  .footer-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; gap: 10px; }

  /* mega footer — every major hub linked from every page, for internal-link depth */
  .footer-cols { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 24px; padding-bottom: 30px; }
  .footer-brand-col .logo { margin-bottom: 8px; }
  .footer-tagline { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; max-width: 220px; }
  .footer-col-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 12px; }
  .footer-col a { display: block; font-size: 13px; color: var(--text-secondary); padding: 5px 0; }
  .footer-col a:hover { color: var(--brand); }
  .footer-bottom { border-top: 1px solid var(--gridline); padding: 18px 0; }
  .footer-gamble-note { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; margin-top: 4px; }

  /* modals */
  .modal-overlay { position: fixed; inset: 0; background: rgba(11,11,11,0.55); display: flex; align-items: center; justify-content: center; z-index: 100; opacity: 0; pointer-events: none; transition: opacity .18s; }
  .modal-overlay.open { opacity: 1; pointer-events: auto; }
  .modal-box { background: var(--surface-1); border-radius: 14px; padding: 26px; width: 400px; max-width: 90vw; box-shadow: 0 25px 70px rgba(0,0,0,0.35); max-height: 86vh; overflow-y: auto; }
  .modal-close { float: right; cursor: pointer; font-size: 20px; color: var(--text-muted); line-height: 1; }
  .modal-title { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
  .modal-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.4; }
  .modal-match-row { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 13px; font-weight: 700; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--gridline); }
  .modal-section-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 8px; }
  .score-picker { display: flex; gap: 5px; flex-wrap: wrap; margin: 0 0 18px; }
  .score-btn { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--border); background: var(--page); font-weight: 700; font-size: 12px; cursor: pointer; color: var(--text-primary); }
  .score-btn.selected { background: var(--good); color: #fff; border-color: var(--good); }
  .modal-select { width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--page); font-size: 13px; color: var(--text-primary); margin-bottom: 20px; }
  .modal-btn-row { display: flex; gap: 10px; }
  .modal-btn-row .btn { flex: 1; text-align: center; padding: 10px; }
  .toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(16px); background: var(--text-primary); color: var(--surface-1); padding: 12px 22px; border-radius: 10px; font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transition: all .25s; z-index: 200; max-width: 90vw; text-align: center; }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  /* sign in / sign up / forgot password modal */
  .rc-auth-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
  .rc-auth-username-row { display: flex; gap: 8px; align-items: flex-start; }
  .rc-auth-username-row .modal-select { margin-bottom: 8px; }
  .rc-auth-username-row .btn { white-space: nowrap; padding: 9px 12px; font-size: 12px; }
  .rc-auth-msg { border-radius: 8px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 16px; line-height: 1.4; }
  .rc-auth-msg-error { background: rgba(208,59,59,0.1); color: var(--critical); }
  .rc-auth-msg-success { background: rgba(12,163,12,0.1); color: var(--good); }
  .rc-auth-loading { opacity: .6; pointer-events: none; }

  /* shared chevron (used inside the side drawer's accordion sections) */
  .nav-dd-arrow { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: .6; transition: transform .18s ease; margin-top: 2px; flex-shrink: 0; }

  /* header left group + universal menu button (opens the side drawer at every breakpoint) */
  .nav-left { display: flex; align-items: center; gap: 12px; }
  .menu-btn { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-1); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex-shrink: 0; }
  .menu-btn span { display: block; width: 17px; height: 2px; background: var(--text-primary); border-radius: 2px; }

  /* side drawer — the single nav for desktop AND mobile, replacing the old mega-menu system */
  .drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.45); opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 40; }
  .drawer-backdrop.open { opacity: 1; pointer-events: auto; }
  .side-drawer { position: fixed; top: 0; left: 0; bottom: 0; width: 320px; max-width: 85vw; background: var(--surface-1); z-index: 50; transform: translateX(-100%); transition: transform .25s ease; display: flex; flex-direction: column; box-shadow: 10px 0 30px rgba(0,0,0,0.15); }
  .side-drawer.open { transform: translateX(0); }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
  .drawer-close { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: var(--page); cursor: pointer; font-size: 13px; color: var(--text-primary); }
  .drawer-body { padding: 6px 18px 28px; overflow-y: auto; flex: 1; }
  .drawer-link { display: block; padding: 13px 2px; font-size: 14.5px; font-weight: 700; border-bottom: 1px solid var(--gridline); color: var(--text-primary); }
  .drawer-link.active { color: var(--brand); }
  .drawer-section { border-bottom: 1px solid var(--gridline); }
  .drawer-section-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 13px 2px; background: none; border: none; font-size: 14.5px; font-weight: 700; color: var(--text-primary); cursor: pointer; font-family: inherit; }
  .drawer-section-panel { display: none; grid-template-columns: repeat(2, 1fr); gap: 3px 12px; padding: 2px 2px 14px 10px; }
  .drawer-section-panel.open { display: grid; }
  .drawer-section-panel a { padding: 8px 0; font-size: 13px; color: var(--text-secondary); }
  .drawer-viewall { grid-column: 1 / -1; color: var(--brand) !important; font-weight: 800 !important; }

  /* live ticker marquee */
  .ticker-scroll { overflow: hidden; padding: 0; }
  .ticker-track { display: flex; width: max-content; animation: tickerScroll 32s linear infinite; padding: 10px 0; }
  .ticker-bar:hover .ticker-track { animation-play-state: paused; }
  @keyframes tickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

  /* share panel */
  .share-row { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
  .share-btn { flex: 1; min-width: 78px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 10px; border: 1px solid var(--border); background: var(--page); cursor: pointer; font-size: 11px; font-weight: 700; color: var(--text-primary); }
  .share-btn .share-icon { font-size: 18px; }
  .share-preview { background: var(--page); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 14px; }
  .share-preview b { color: var(--brand); }
  .btn-predicted, .btn:disabled { background: var(--gridline); color: var(--text-secondary); cursor: not-allowed; opacity: .85; }

  /* ============ RESPONSIVE SYSTEM ============ */
  html, body { overflow-x: hidden; width: 100%; }
  img, video, iframe { max-width: 100%; }

  /* Small tablet / large phone (≤860px): existing cols/grids collapse (already handled above) */
  @media (max-width: 860px) {
    .nav-actions .btn-ghost { display: none; }
    .footer-cols { grid-template-columns: 1fr 1fr; }
    .footer-brand-col { grid-column: 1 / -1; }
  }

  /* Phone (≤640px) */
  @media (max-width: 640px) {
    .wrap { padding: 0 14px; }
    .nav-row { height: 54px; }
    .logo { font-size: 17px; }
    .nav-actions { gap: 6px; }
    .theme-toggle { width: 30px; height: 30px; font-size: 13px; }
    .profile-chip { font-size: 11px; padding: 3px; gap: 0; }
    .profile-chip-name { display: none; }
    .profile-avatar { width: 26px; height: 26px; font-size: 9px; }
    .btn { font-size: 12px; padding: 7px 10px; }
    .rate-btn-full { display: none; }
    .rate-btn-short { display: inline; }
    .profile-pop { right: 10px; left: 10px; width: auto; top: 58px; }
    h1.page-title { font-size: 18px; }
    .subtitle { font-size: 12.5px; }
    .hero-card { padding: 16px; }
    .matchup { gap: 10px; }
    .team { width: auto; min-width: 64px; }
    .crest { width: 36px; height: 36px; font-size: 12px; }
    .team-name { font-size: 11px; }
    .score-big { font-size: 28px; }
    .rating-tile { min-width: auto; width: 100%; margin-top: 12px; }
    .hero-top { justify-content: center; text-align: center; }
    .odds-grid, .mc-odds { grid-template-columns: repeat(3, 1fr); }
    .score-picker .score-btn { width: 26px; height: 26px; font-size: 11px; }
    .modal-box { padding: 18px; width: 100%; }
    .share-btn { min-width: 70px; font-size: 10px; }
    .news-thumb, .video-thumb { height: 110px; }
    .drawer-section-panel { grid-template-columns: 1fr; }
    .feed-tabs { flex-wrap: wrap; }
    .footer-cols { grid-template-columns: 1fr; gap: 22px; }
    .footer-row { flex-direction: column; align-items: flex-start; }
  }

  /* Small phone (≤400px) */
  @media (max-width: 400px) {
    .video-grid, .news-grid { grid-template-columns: 1fr; }
    .team-name { display: none; }
    .rating-num { font-size: 26px; }
  }

  /* ============ AD SLOTS (backend-configurable) ============ */
  .ad-label { font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); text-align: center; margin-bottom: 8px; }
  .ad-banner-mid { background: var(--surface-1); border: 1px dashed var(--border); border-radius: var(--card-radius); padding: 18px; margin: 28px 0; text-align: center; display: none; }
  .ad-banner-mid.active { display: block; }
  .ad-banner-mid .ad-creative { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
  .ad-banner-mid .ad-logo { width: 40px; height: 40px; border-radius: 8px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
  .ad-banner-mid .ad-copy { font-size: 13px; font-weight: 800; color: var(--text-primary); text-align: left; }
  .ad-banner-mid .ad-copy span { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-secondary); margin-top: 2px; }

  .ad-sticky-bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface-1); border-top: 1px solid var(--border); box-shadow: 0 -8px 24px rgba(0,0,0,0.10); padding: 12px 16px; display: none; align-items: center; justify-content: center; gap: 16px; z-index: 150; }
  .ad-sticky-bar.active { display: flex; }
  .ad-sticky-bar .ad-sticky-inner { display: flex; align-items: center; gap: 14px; max-width: 1120px; width: 100%; flex-wrap: wrap; justify-content: center; }
  .ad-sticky-bar .ad-logo { width: 34px; height: 34px; border-radius: 8px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
  .ad-sticky-bar .ad-copy { font-size: 12.5px; font-weight: 800; color: var(--text-primary); }
  .ad-sticky-bar .ad-copy span { font-weight: 500; color: var(--text-secondary); margin-left: 4px; }
  .ad-sticky-close { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 4px; line-height: 1; flex-shrink: 0; }
  body.ad-bar-active { padding-bottom: 64px; }

  .bonus-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--gridline); }
  .bonus-row:last-child { border-bottom: none; }
  .bonus-logo { width: 34px; height: 34px; border-radius: 8px; background: var(--gridline); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
  .bonus-info { flex: 1; min-width: 0; }
  .bonus-name { font-size: 12.5px; font-weight: 800; }
  .bonus-offer { font-size: 11px; color: var(--text-secondary); margin-top: 1px; }
  .bonus-btn { flex-shrink: 0; font-size: 11.5px; font-weight: 800; padding: 7px 14px; border-radius: 7px; background: var(--brand); color: var(--brand-ink); border: none; cursor: pointer; text-decoration: none; }

  /* admin demo panel — not part of the live site, shows how backend toggles ad slots */
  .admin-demo-panel { max-width: 1160px; margin: 0 auto; padding: 24px 20px 50px; }
  .admin-demo-box { background: var(--surface-1); border: 1px dashed var(--border); border-radius: var(--card-radius); padding: 16px 18px; }
  .admin-demo-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin-bottom: 10px; line-height: 1.5; }
  .admin-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--gridline); font-size: 12.5px; font-weight: 700; gap: 12px; }
  .admin-toggle-row:last-child { border-bottom: none; }
  .admin-switch { position: relative; width: 38px; height: 21px; border-radius: 20px; background: var(--gridline); border: none; cursor: pointer; flex-shrink: 0; }
  .admin-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
  .admin-switch.on { background: var(--good); }
  .admin-switch.on::after { transform: translateX(17px); }

  /* ============ Empty-space fillers: trending comments / recently rated / fixtures ============ */
  .trend-comment-row { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--gridline); }
  .trend-comment-row:last-child { border-bottom: none; }
  .trend-comment-body { flex: 1; min-width: 0; }
  .trend-comment-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; margin-bottom: 3px; }
  .trend-comment-match { font-size: 11px; color: var(--text-muted); font-weight: 600; }
  .trend-comment-text { font-size: 13px; color: var(--text-primary); line-height: 1.5; }
  .trend-comment-votes { font-size: 11px; color: var(--good); font-weight: 700; margin-top: 5px; display: flex; align-items: center; gap: 4px; }

  .activity-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--gridline); font-size: 12.5px; }
  .activity-row:last-child { border-bottom: none; }
  .activity-text { flex: 1; color: var(--text-secondary); }
  .activity-text b { color: var(--text-primary); }
  .activity-score { font-weight: 800; color: var(--good); flex-shrink: 0; }
  .activity-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

  .fixture-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--gridline); font-size: 12.5px; }
  .fixture-row:last-child { border-bottom: none; }
  .fixture-day { width: 56px; flex-shrink: 0; font-weight: 800; color: var(--text-muted); font-size: 11px; text-transform: uppercase; }
  .fixture-teams { flex: 1; font-weight: 700; }
  .fixture-comp { font-size: 10.5px; color: var(--text-muted); font-weight: 600; display: block; margin-top: 1px; }
  .fixture-time { font-size: 11.5px; color: var(--text-secondary); font-weight: 700; flex-shrink: 0; }

  @media (max-width: 640px) {
    .ad-banner-mid .ad-copy { text-align: center; }
    .ad-sticky-bar .ad-copy span { display: block; margin-left: 0; }
    .fixture-day { width: 44px; }
  }

  /* ============ Comments: submission + moderation affordances ============ */
  .comment-textarea { width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--page); font-size: 13px; color: var(--text-primary); font-family: inherit; resize: vertical; min-height: 64px; box-sizing: border-box; }
  .comment-textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
  .comment-meta-row { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; margin-bottom: 18px; }
  .comment-guideline { font-size: 10.5px; color: var(--text-muted); line-height: 1.4; max-width: 78%; }
  .comment-char-count { font-size: 10.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
  .comment-char-count.near-limit { color: var(--warning); font-weight: 700; }

  .trend-comment-actions { display: flex; align-items: center; gap: 14px; margin-top: 7px; }
  .comment-agree-btn { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--good); background: none; border: none; cursor: pointer; padding: 2px 0; }
  .comment-agree-btn.agreed { color: var(--brand-ink); background: var(--good); padding: 2px 8px; border-radius: 10px; }
  .comment-report-btn { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--text-muted); background: none; border: none; cursor: pointer; padding: 2px 0; }
  .comment-report-btn:hover { color: var(--critical); }
  .comment-report-btn.reported { color: var(--critical); font-weight: 700; cursor: default; }
  .trend-comment-you { border: 1px dashed rgba(42,120,214,0.4); border-radius: 10px; padding: 10px; margin: -10px -10px 2px; background: rgba(42,120,214,0.04); }

/* ============ AUTH PAGES (login / register) ============ */
.guest-body { background: var(--page); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.guest-wrap { width: 100%; max-width: 420px; }
.guest-logo { display: flex; justify-content: center; margin-bottom: 22px; font-size: 24px; }
.guest-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--card-radius); padding: 28px 26px; box-shadow: 0 10px 30px rgba(0,0,0,0.06); }
.guest-footnote { text-align: center; margin-top: 18px; font-size: 12.5px; color: var(--text-muted); }
.guest-footnote a { color: var(--text-muted); }
.auth-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.auth-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.auth-errors { background: rgba(208,59,59,0.08); border: 1px solid rgba(208,59,59,0.25); color: var(--critical); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 12.5px; }
.auth-errors ul { margin: 0; padding-left: 18px; }
.auth-form { display: flex; flex-direction: column; gap: 4px; }
.auth-label { font-size: 11.5px; font-weight: 700; color: var(--text-secondary); margin-top: 12px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .03em; }
.auth-input { font-size: 14px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--page); color: var(--text-primary); width: 100%; box-sizing: border-box; }
.auth-input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.auth-check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); margin-top: 12px; }
.auth-submit { width: 100%; margin-top: 20px; padding: 11px; font-size: 14px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 12.5px; color: var(--text-muted); }

/* ============ NEW PAGES: teams / matches / standings / power rankings / leaderboard / profile / news / fixtures ============ */

.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text-primary); }

/* team index + show */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 28px; }
.team-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--card-radius); padding: 16px; text-align: center; text-decoration: none; color: inherit; display: block; }
.team-card:hover { border-color: var(--brand); }
.team-card .crest { margin: 0 auto 10px; }
.team-card .team-card-name { font-size: 13px; font-weight: 700; }
.team-hero { display: flex; align-items: center; gap: 18px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--card-radius); padding: 20px; margin-bottom: 22px; }
.team-hero .crest { width: 64px; height: 64px; font-size: 20px; flex-shrink: 0; }
.team-hero-name { font-size: 22px; font-weight: 800; }
.team-hero-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.team-stat-row { display: flex; gap: 24px; margin-top: 10px; flex-wrap: wrap; }
.team-stat { text-align: left; }
.team-stat-value { font-size: 20px; font-weight: 800; }
.team-stat-label { font-size: 11px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }

/* leaderboard */
.leaderboard-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--gridline); }
.leaderboard-row:last-child { border-bottom: none; }
.leaderboard-rank { width: 22px; font-weight: 800; color: var(--text-muted); font-size: 13px; flex-shrink: 0; }
.leaderboard-body { flex: 1; min-width: 0; }
.leaderboard-name { font-weight: 700; font-size: 13.5px; }
.leaderboard-sub { font-size: 11.5px; color: var(--text-muted); }
.leaderboard-points { font-weight: 800; font-size: 14px; color: var(--brand); flex-shrink: 0; }

/* profile */
.profile-hero { display: flex; align-items: center; gap: 16px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--card-radius); padding: 20px; margin-bottom: 22px; }
.profile-hero .profile-avatar { width: 56px; height: 56px; font-size: 18px; flex-shrink: 0; }
.profile-hero-name { font-size: 20px; font-weight: 800; }

/* news */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.article-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--card-radius); padding: 18px; text-decoration: none; color: inherit; display: block; }
.article-card:hover { border-color: var(--brand); }
.article-cover-emoji { font-size: 26px; margin-bottom: 10px; }
.article-card-title { font-size: 15px; font-weight: 800; margin-bottom: 6px; line-height: 1.3; }
.article-card-excerpt { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.article-card-meta { font-size: 11px; color: var(--text-muted); margin-top: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.article-body { font-size: 14.5px; line-height: 1.7; color: var(--text-primary); white-space: pre-line; }
.article-body p { margin-bottom: 14px; }

/* full standings / power rankings methodology note */
.methodology-note { font-size: 12px; color: var(--text-muted); background: var(--page); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 18px; line-height: 1.5; }

/* ============ COMPARE TEAMS TOOL (ported from rugbycritic-compare-mockup.html) ============ */

/* team selector */
.selector-bar { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--card-radius); padding: 18px; margin-bottom: 26px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.selector-field { flex: 1; min-width: 180px; }
.selector-label { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 6px; display: block; }
.team-select { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--page); font-size: 14px; font-weight: 700; color: var(--text-primary); font-family: inherit; }
.selector-vs { font-size: 13px; font-weight: 800; color: var(--text-muted); flex-shrink: 0; margin-top: 18px; }
.selector-swatch-a { border-left: 3px solid var(--team-a); }
.selector-swatch-b { border-left: 3px solid var(--team-b); }
.no-data-note { background: var(--page); border: 1px dashed var(--border); border-radius: 10px; padding: 14px 16px; font-size: 13px; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.5; }
.no-data-note b { color: var(--text-primary); }
.rivalry-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface-1); cursor: pointer; margin: 8px 6px 0 0; text-decoration: none; color: inherit; }
.rivalry-chip:hover { background: var(--page); }

/* legend for team identity, used throughout the page */
.team-legend { display: flex; gap: 18px; margin-bottom: 16px; font-size: 12.5px; font-weight: 700; }
.team-legend-item { display: flex; align-items: center; gap: 6px; }
.team-legend-line { width: 16px; height: 2px; border-radius: 2px; }

/* KPI row */
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.kpi-tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--card-radius); padding: 18px 10px; text-align: center; min-width: 0; }
.kpi-tile.mid { background: var(--page); }
.kpi-value { font-size: 34px; font-weight: 800; line-height: 1; margin-bottom: 6px; }
.kpi-label { font-size: 11.5px; color: var(--text-muted); font-weight: 700; }
.kpi-team-name { font-size: 12.5px; font-weight: 800; margin-bottom: 8px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* last 5 meetings */
.meeting-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--gridline); font-size: 13px; }
.meeting-row:last-child { border-bottom: none; }
.meeting-date { width: 92px; flex-shrink: 0; color: var(--text-muted); font-size: 11.5px; font-weight: 700; }
.meeting-mid { flex: 1; min-width: 0; }
.meeting-comp { font-size: 10.5px; color: var(--text-muted); font-weight: 600; display: block; margin-bottom: 2px; }
.meeting-score { font-weight: 800; font-variant-numeric: tabular-nums; }
.meeting-score .win { color: var(--text-primary); }
.meeting-score .lose { color: var(--text-muted); }
.meeting-winner-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* season comparison table */
table.compare-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.compare-table th { text-align: center; font-weight: 800; padding: 0 0 10px; border-bottom: 1px solid var(--gridline); }
table.compare-table th.metric-col { text-align: left; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
table.compare-table td { padding: 9px 8px; border-bottom: 1px solid var(--gridline); text-align: center; font-variant-numeric: tabular-nums; }
table.compare-table td.metric-label { text-align: left; color: var(--text-secondary); font-variant-numeric: normal; font-weight: 600; font-size: 12.5px; }
table.compare-table tr:last-child td { border-bottom: none; }
.lead-cell { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.lead-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.form-icons { display: flex; flex-wrap: nowrap; gap: 3px; justify-content: center; }
.form-icon { width: 18px; height: 18px; border-radius: 4px; font-size: 10px; font-weight: 800; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.form-w { background: var(--good); }
.form-l { background: var(--critical); }
.form-d { background: var(--baseline); color: var(--text-primary); }

/* charts */
.chart-card { margin-bottom: 24px; }
.chart-svg-wrap { width: 100%; }
.chart-tooltip { position: absolute; background: var(--text-primary); color: var(--surface-1); border-radius: 8px; padding: 8px 10px; font-size: 11.5px; pointer-events: none; opacity: 0; transition: opacity .1s; z-index: 5; min-width: 120px; }
.chart-tooltip.show { opacity: 1; }
.chart-tooltip .tt-row { display: flex; align-items: center; gap: 6px; justify-content: space-between; margin-top: 3px; }
.chart-tooltip .tt-key { width: 10px; height: 2px; border-radius: 2px; flex-shrink: 0; }
.chart-tooltip .tt-val { font-weight: 800; margin-left: auto; }
.chart-tooltip .tt-label { font-size: 10px; color: #c3c2b7; }
.chart-wrap-relative { position: relative; }
.table-toggle-btn { font-size: 11.5px; font-weight: 700; color: var(--brand); background: none; border: none; cursor: pointer; padding: 0; margin-top: 6px; }
.chart-table-view { display: none; margin-top: 12px; }
.chart-table-view.show { display: block; }

/* key stats bidirectional bars */
.stat-bar-row { padding: 12px 0; border-bottom: 1px solid var(--gridline); }
.stat-bar-row:last-child { border-bottom: none; }
.stat-bar-label { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.stat-bar-track { display: flex; align-items: center; height: 20px; }
.stat-bar-half { flex: 1; display: flex; height: 100%; }
.stat-bar-half.left { justify-content: flex-end; }
.stat-bar-fill { height: 20px; border-radius: 4px 0 0 4px; }
.stat-bar-half.right .stat-bar-fill { border-radius: 0 4px 4px 0; }
.stat-bar-center { width: 2px; height: 26px; background: var(--gridline); flex-shrink: 0; }
.stat-bar-value { font-size: 12px; font-weight: 800; width: 56px; flex-shrink: 0; }
.stat-bar-value.left-val { text-align: right; padding-right: 8px; }
.stat-bar-value.right-val { text-align: left; padding-left: 8px; }

/* critic verdict */
.verdict-kpi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.predict-split-bar { display: flex; height: 30px; border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.predict-split-a { background: var(--team-a); display: flex; align-items: center; justify-content: flex-start; padding-left: 10px; color: #fff; font-size: 12.5px; font-weight: 800; }
.predict-split-b { background: var(--team-b); display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; color: #fff; font-size: 12.5px; font-weight: 800; }
.predict-split-caption { font-size: 11px; color: var(--text-muted); text-align: center; margin-bottom: 20px; }

@media (max-width: 860px) {
  table.compare-table { font-size: 12px; }
}
@media (max-width: 640px) {
  .selector-bar { flex-direction: column; align-items: stretch; }
  .selector-vs { text-align: center; margin-top: 0; }
  .meeting-date { width: 70px; font-size: 10.5px; }
  .stat-bar-value { width: 42px; font-size: 11px; }

  /* keep every side-by-side comparison side-by-side — never stack A/B on top of each other */
  .kpi-row { gap: 6px; }
  .kpi-tile { padding: 10px 4px; }
  .kpi-value { font-size: 21px; margin-bottom: 3px; }
  .kpi-label { font-size: 8.5px; }
  .kpi-team-name { font-size: 9.5px; margin-bottom: 4px; }
  .verdict-kpi-row { gap: 8px; }

  table.compare-table { font-size: 10.5px; }
  table.compare-table td { padding: 7px 3px; }
  table.compare-table th.metric-col, table.compare-table td.metric-label { font-size: 10px; }
  .form-icons { gap: 2px; }
  .form-icon { width: 14px; height: 14px; font-size: 8px; border-radius: 3px; }
  .lead-dot { width: 5px; height: 5px; }
}
