:root {
  --bg: #ffffff;
  --surface: #f4f4f6;
  --border: #e3e3e6;
  --text: #15151a;
  --muted: #6b7280;
  --green: #16a34a;
  --amber: #c2750f;
  --red: #dc2626;
  --blue: #2563eb;
  --pulse: #c2750f;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.5; }
a { color: var(--blue); text-decoration: none; }

/* Header */
header { padding: 14px 8px 10px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.site-logo { height: 22px; width: auto; display: block; }
#last-updated { font-size: 12px; color: var(--muted); }
.header-right { display: flex; align-items: center; gap: 12px; }
.lang-switch {
  font-size: 12px; font-weight: 700; color: var(--muted); text-decoration: none;
  border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px;
}
.lang-switch:hover { background: #f4f4f6; color: #15151a; }
.refresh-btn {
  font-size: 14px; line-height: 1; color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px; background: #fff;
  padding: 3px 7px; cursor: pointer;
}
.refresh-btn:hover { background: #f4f4f6; color: #15151a; }
.refresh-btn:disabled { cursor: default; opacity: 0.6; }
.refresh-btn.spinning { animation: refresh-spin 0.6s linear infinite; }
@keyframes refresh-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Page headline — descriptive, plain-text mention of the tournament (not a
   logo/crest treatment), so the page actually says what it's tracking. */
.page-headline { font-size: 22px; font-weight: 800; padding: 18px 8px 0; }

/* Sections */
.section { padding: 20px 8px 8px; }
.section-title { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
/* The first section right under the tab nav doesn't need the full 20px -
   that gap was designed for section-to-section spacing, not tab-to-content.
   The Lab tab's first .section isn't actually :first-child - #lab-notifications
   sits before it in the DOM - so it needs its own selector too. */
.tab-panel > .section:first-child,
.lab-notifications + .section { padding-top: 10px; }
/* Empty on most loads (no active notices) - margin-bottom on an empty box
   still pushes the next element down, which was adding dead space above
   the bracket on every tab that uses it (currently just Build Your Bracket). */
.lab-notifications:empty { margin-bottom: 0; }

/* Tabs — styled like real file/browser tabs: inactive tabs sit on a grey
   background behind the nav's bottom rule, the active tab is white and
   paints a 1px white line over that rule (the box-shadow below) so it
   visually fuses with the white content panel beneath it. */
.tab-nav { display: flex; gap: 4px; padding: 16px 8px 0; border-bottom: 1px solid var(--border); }
.tab-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 9px 14px;
  cursor: pointer;
}
.tab-btn.active { color: var(--text); background: #fff; box-shadow: 0 1px 0 #fff; }
.tab-btn:hover:not(.active) { color: var(--text); background: #ececef; }

/* Flags */
.flag-img { width: 20px; height: 15px; object-fit: cover; border-radius: 2px; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0,0,0,0.15); }

/* Today's games day-strip */
#today-section { display: none; }
.today-strip-wrap { display: flex; align-items: center; gap: 8px; }
.today-strip {
  display: flex; flex-wrap: nowrap; gap: 12px; overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: none; min-width: 0;
}
.today-strip::-webkit-scrollbar { display: none; }
.today-nav-arrow {
  flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border);
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.15); cursor: pointer;
  font-size: 16px; font-weight: 700; color: #15151a;
  display: flex; align-items: center; justify-content: center;
}
.today-nav-arrow:hover { background: #f4f4f5; }
.today-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 200px;
  flex: 0 0 auto;
}
.today-card.live { border: 2px solid var(--red); }
.today-card.finished { background: #f4f4f6; }
.today-card-top { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.today-match-num { font-size: 11px; font-weight: 600; color: var(--muted); }
.today-group { font-size: 14px; font-weight: 800; flex: 1; }
.today-status { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.today-status.live { color: var(--red); display: inline-flex; align-items: center; gap: 4px; }
.today-status.countdown { color: var(--red); }
.today-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); animation: pulse-red 1.2s infinite; }
@keyframes pulse-red { 0%,100%{opacity:1} 50%{opacity:.5} }
.today-team-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 14px; font-weight: 600; }
.today-team-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-team-score { font-size: 16px; font-weight: 800; }
.today-team-score.live { color: var(--red); }
.today-team-row.loser .today-team-name,
.today-team-row.loser .today-team-score { opacity: 0.38; }
.today-card-odds { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }

/* Bracket tree: 7-column mirrored layout.
   Cols 1/7 = R32 (8 per side), cols 2/6 = R16, cols 3/5 = QF+SF integrated
   (bracket-int-group: QF top, SF middle, QF bottom), col 4 = Final+Bronze.
   8 data rows (one per R32 match per side). */
.bracket-tree-wrap {
  overflow-x: auto;
  padding: 0 16px 8px;
  /* Full-viewport breakout from .max-w */
  width: 100vw;
  margin-left: calc(50% - 50vw);
}
.bracket-tree {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: 22px repeat(8, auto);
  gap: 2px 10px;
  width: 100%;
  min-width: 900px;
}
/* Integrated QF+SF column — flex container holding QF, SF, QF cards
   with spacers so the SF sits centered between the two QFs */
.bracket-int-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.bracket-int-spacer { flex: 1; min-height: 10px; }
.bracket-int-group { display: flex; flex-direction: column; align-self: center; }
/* Cards inside .bracket-int-group must fill the column width.
   .tie-card.later-round has specificity (0,2,0) with align-self:center — these
   selectors use (0,3,0) to win without !important. */
.bracket-int-group > .tie-card.later-round,
.bracket-int-group > .tbd-card.later-round { align-self: stretch; width: 100%; }
.bracket-int-group .result-card.later-round { align-self: stretch; width: 100%; }
.bracket-int-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-align: center;
  padding-bottom: 3px;
  margin-top: 4px;
}
.bracket-int-group:first-child .bracket-int-label { margin-top: 0; }
.round-title { grid-row: 1; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; text-align: center; align-self: center; }

.tie-card {
  background: #fff;
  color: #15151a;
  border: 1px solid #e3e3e6;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.3s;
  grid-column: 1;
  align-self: start;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.tie-card.later-round { align-self: center; }
.tie-card.finished { background: #f8f8fa; }
.tie-card.just-updated {
  animation: pulse-border 2s ease-out;
}
@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(245,158,11,0.5); }
  70% { box-shadow: 0 0 0 6px rgba(245,158,11,0); }
  100% { box-shadow: none; }
}
.tie-card.live { border-color: var(--red); }
.tie-card.live .tie-score,
.tie-card.live .result-right.scored { color: var(--red); }
.live-slot-badge { display: flex; align-items: center; gap: 4px; color: var(--red); font-size: 10px; font-weight: 700; }
.live-slot-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); animation: pulse-red 1.2s infinite; flex-shrink: 0; }
.live-result-num { width: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.tie-top { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid #ececef; margin-bottom: 8px; }
.match-num { font-size: 13px; font-weight: 800; color: #15151a; }
.match-date { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
.updating-badge { font-size: 10px; color: var(--pulse); font-weight: 700; }
/* ── Team row classes ─────────────────────────────────────────────────────────
   Two semantic states, three layout variants. Pick by TEAM STATE, not card type:

   CONFIRMED team  →  .tie-team   (black name, real flag, optional prob pill)
   PENDING / TBD   →  .tbd-team   (grey name, ? placeholder, feeder code grey)

   Layout variants of the confirmed state:
     .tie-team          vertical-stack card (Live Standings actual tab)
     .result-team       horizontal-layout card (Lab, Predicted bracket)

   Rule: never use .tbd-team for a team that is actually known.
         never use .tie-team/.result-team for a team that is TBD.
   ──────────────────────────────────────────────────────────────────────────── */
.tie-team { display: flex; align-items: center; gap: 7px; padding: 3px 0; font-size: 13px; font-weight: 600; transition: opacity 0.15s; }
.tie-team .seed { font-size: 10px; font-weight: 700; color: #9aa0ad; min-width: 28px; flex-shrink: 0; }
.tie-team .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #15151a; }
.tie-team.loser .name,
.tie-team.loser .tie-score,
.tie-team.loser .team-prob-pill,
.tie-team.loser .detail { opacity: 0.38; }
.team-prob-pill { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 8px; flex-shrink: 0; }
.team-prob-pill.tier-green  { background: #c1eec6; color: #4aa250; }
.team-prob-pill.tier-yellow { background: #e2eec1; color: #84a24a; }
.team-prob-pill.tier-orange { background: #ffd9b8; color: #cd7221; }
.team-prob-pill.tier-red    { background: #f8dbd0; color: #a32828; }
.team-prob-pill.tier-grey   { background: #e5e7eb; color: #4b5563; }
.tie-score { font-size: 13px; font-weight: 800; color: #15151a; flex-shrink: 0; }
.pen-score { font-size: 10px; font-weight: 700; color: var(--muted); margin-left: 2px; }

.tbd-card .match-num, .tbd-card .match-date { color: #b4b8c2; }
.tbd-team { display: flex; align-items: center; gap: 7px; padding: 3px 0; font-size: 13px; font-weight: 600; }
.tbd-team .name { color: #b4b8c2; }
.tbd-team .seed { font-size: 10px; font-weight: 700; color: #b4b8c2; min-width: 28px; flex-shrink: 0; }
.tbd-team .result-right.muted { color: #b4b8c2; font-size: 10px; font-weight: 700; flex-shrink: 0; white-space: nowrap; }
.flag-placeholder {
  width: 20px; height: 15px; flex-shrink: 0; border-radius: 2px;
  background: #ececef; box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #b4b8c2;
}

/* Result-style card — shared by the Odds-Based Standings bracket and the
   Simulator bracket. Reuses .tie-card's shell (border, radius, padding,
   shadow) unchanged, just lays the inside out differently: match number on
   the left, two stacked team rows on the right with no "vs" divider and no
   probability pill, each row's right-hand slot showing the seed code until
   a score exists, then the score itself. */
.result-card { display: flex; align-items: center; gap: 10px; }
.result-num { font-size: 11px; font-weight: 700; color: #9aa0ad; flex-shrink: 0; width: 20px; text-align: center; }
.result-rows { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.result-team { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; transition: opacity 0.15s; }
.result-team .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-team.loser .name,
.result-team.loser .result-right { opacity: 0.38; }
.result-right { flex-shrink: 0; }
.result-right.muted { font-size: 11px; font-weight: 700; color: #9aa0ad; }
.result-right.scored { font-size: 15px; font-weight: 800; color: #15151a; }
.result-right.scored .pen-score { font-size: 10px; font-weight: 700; color: var(--muted); vertical-align: middle; }
/* Same shape/colors as .pos-badge's qualify-green (group standings), so a
   predicted match winner reads the same way a qualifying group position does. */
.winner-badge {
  width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
  background: #1a7a40; color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Lab ("Make your own predictions!") — a condensed bracket where each R32
   matchup is clickable, opening a modal scoped to just the groups feeding
   that slot. Reuses the same engine logic as the actual bracket/standings
   (ported to JS, see the LAB_* section of the script), just fed
   user-edited and odds-predicted results instead of real ones. */
.lab-section-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.info-bubble {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: #eef2ff; color: #3b4a8a; border: 1px solid #dbe3fb;
  border-radius: 10px; padding: 8px 14px; font-size: 12px; font-weight: 600;
  width: 100%; text-align: center;
}
.info-bubble .icon { font-size: 13px; }
/* Only when the bubble sits directly in a .section (Live Standings / Odds-
   Based Projection) - inside .lab-section-head's own flex gap already
   spaces it from what follows, adding this there would double up. */
.section > .info-bubble:first-child { margin-bottom: 12px; }
.lab-reset-btn {
  background: #fff; color: #15151a; border: 1px solid var(--border); border-radius: 6px;
  font-size: 11px; font-weight: 700; padding: 5px 10px; cursor: pointer; flex-shrink: 0;
  align-self: flex-end;
}
.lab-reset-btn:hover { background: #f4f4f6; }
/* Replaces the info bubble once at least one edit exists - same box shape
   as .info-bubble (full width, centered) so it visually "takes over" that
   slot instead of looking like a second, smaller control underneath it. */
.lab-reset-btn.standalone {
  width: 100%; align-self: stretch; padding: 8px 14px; font-size: 12px;
  border-radius: 10px;
}
.futures-bet-banner {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; margin-top: 16px; text-align: center;
}
.futures-bet-text { font-size: 13px; }
.futures-bet-actions { display: flex; gap: 10px; }
.futures-bet-btn {
  background: #15151a; color: #fff; border: none; border-radius: 6px;
  font-size: 12px; font-weight: 700; padding: 7px 14px; cursor: pointer;
}
.futures-bet-btn:hover { background: #2a2a33; }
.futures-bet-disclosure { font-size: 10px; color: var(--muted); line-height: 1.5; }
.futures-bet-disclosure a { color: var(--muted); text-decoration: underline; }

.lab-card { cursor: pointer; }
.lab-card:hover { border-color: #b4b8c2; }
.lab-card.lab-flash, .lab-modal-sticky.lab-flash { animation: pulse-border 1.4s ease-out; }
.lab-card.lab-picked { border-left: 3px solid #1a7a40; }
.lab-card.lab-concluded { cursor: default; }
.lab-card.lab-concluded:hover { border-color: var(--border); }
.lab-tbd {
  background: #f4f4f6; border: 1px dashed #d7d7db; border-radius: 7px;
  padding: 6px; text-align: center; align-self: center; justify-self: stretch;
  font-size: 14px; color: var(--muted); font-weight: 700;
}

/* Upstream-change notifications: shown when editing a group game clears a
   R32 prediction because different teams now occupy that slot. */
.lab-notifications { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.lab-notice {
  background: #fff7e0; border: 1px solid #f0d999; border-radius: 8px;
  padding: 8px 10px; font-size: 12px; color: #7a5a00;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.lab-notice button { background: none; border: none; color: #7a5a00; font-weight: 700; cursor: pointer; flex-shrink: 0; }

/* Modal */
.lab-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.lab-modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 1180px;
  max-height: 85vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.lab-modal-sticky { position: sticky; top: 0; z-index: 6; background: #fff; border-radius: 12px 12px 0 0; }
.lab-modal-header {
  background: #14141a; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; font-size: 14px; font-weight: 700;
}
.lab-modal-close { background: none; border: none; color: #fff; font-size: 16px; cursor: pointer; padding: 0 4px; }
#lab-modal-pick { padding: 12px 16px 14px; border-bottom: 2px solid #ececef; }
.lab-modal-body { padding: 16px; }
.lab-modal-footer {
  position: sticky; bottom: 0; background: #fff;
  padding: 10px 16px; border-top: 1px solid #ececef;
  display: flex; justify-content: flex-end; border-radius: 0 0 12px 12px;
}
.lab-modal-done-btn {
  background: #15151a; color: #fff; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 700; padding: 8px 18px; cursor: pointer;
}
.lab-modal-done-btn:hover { background: #2a2a33; }

/* Generic small confirm dialog (used by the lab modal's quit-without-saving
   prompt) - deliberately self-contained rather than sharing classes with
   any other modal, so this one doesn't carry a dependency on anything
   else's styling. */
.confirm-modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 420px;
  padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.confirm-modal-title { font-size: 16px; font-weight: 800; margin-bottom: 10px; }
.confirm-modal-text { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 10px; }
.confirm-modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.confirm-modal-btn-secondary {
  background: #fff; color: #15151a; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-weight: 700; padding: 8px 16px; cursor: pointer;
}
.confirm-modal-btn-primary {
  background: #15151a; color: #fff; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 700; padding: 8px 16px; cursor: pointer;
}
.confirm-modal-btn-primary:hover { background: #2a2a33; }
.lab-live-update-score { font-size: 18px; font-weight: 800; text-align: center; padding: 10px 0; }
.lab-live-update-inputs { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 4px; font-size: 13px; font-weight: 600; }
.lab-live-update-inputs .lab-score-input { width: 52px; text-align: center; font-size: 18px; font-weight: 800; }

.lab-modal-columns { display: flex; flex-wrap: wrap; gap: 18px; }
.lab-modal-columns > .lab-group-block { flex: 1 1 360px; min-width: min(360px, 100%); margin-bottom: 0; }
@media (max-width: 600px) {
  .lab-modal-columns > .lab-group-block { flex-basis: 100%; }
}

/* Odds badge - the only "betting content" visible pre-age-confirmation;
   deliberately plain text, no figures, no bookmaker branding. */
.odds-badge {
  background: #eef2ff; color: #3b4a8a; border: 1px solid #dbe3fb; border-radius: 6px;
  font-size: 10px; font-weight: 700; padding: 2px 7px; cursor: pointer; flex-shrink: 0;
}
.odds-badge:hover { background: #dbe3fb; }

/* Age gate - reuses .lab-modal-backdrop's overlay, its own narrower card. */
.age-gate-modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 420px;
  padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.age-gate-title { font-size: 16px; font-weight: 800; margin-bottom: 10px; }
.age-gate-text { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 10px; }
.age-gate-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.age-gate-cancel-btn {
  background: #fff; color: #15151a; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-weight: 700; padding: 8px 16px; cursor: pointer;
}
.age-gate-confirm-btn {
  background: #15151a; color: #fff; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 700; padding: 8px 16px; cursor: pointer;
}
.age-gate-confirm-btn:hover { background: #2a2a33; }

/* Odds modal */
.odds-modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 480px;
  max-height: 85vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.odds-modal-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.odds-modal-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 12px 0; }
.bookie-row { border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.bookie-row-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.bookie-name { font-size: 14px; font-weight: 800; }
.bookie-link {
  background: #15151a; color: #fff; border-radius: 6px; font-size: 11px; font-weight: 700;
  padding: 6px 12px; flex-shrink: 0;
}
.bookie-link:hover { background: #2a2a33; }
.bookie-odds-cells { display: flex; gap: 8px; }
.bookie-odds-cell {
  flex: 1; background: var(--surface); border-radius: 6px; padding: 6px 4px;
  text-align: center;
}
.bookie-odds-label { display: block; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.bookie-odds-value { display: block; font-size: 15px; font-weight: 800; margin-top: 2px; }
.odds-modal-disclosure {
  font-size: 10px; color: var(--muted); line-height: 1.5; padding: 10px 16px;
  border-top: 1px solid var(--border);
}
.odds-modal-disclosure a { color: var(--muted); text-decoration: underline; }

/* ── Matchup info modal (predicted-bracket click) ─────────────────────────── */
.highlights-modal {
  background: #111; border-radius: 12px; width: 100%; max-width: 540px;
  overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}
.highlights-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
}
.highlights-modal-header span { font-size: 13px; font-weight: 600; color: #ccc; }
.highlights-modal-header .lab-modal-close { color: #ccc; }
.highlights-thumb-link { display: block; position: relative; }
.highlights-thumb { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }
.highlights-play-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 52px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.8);
  background: rgba(0,0,0,0.15); transition: background 0.15s;
}
.highlights-thumb-link:hover .highlights-play-overlay { background: rgba(0,0,0,0.35); }
.highlights-watch-btn {
  display: block; text-align: center; padding: 12px;
  background: #ff0000; color: #fff; font-size: 13px; font-weight: 700;
  text-decoration: none; letter-spacing: 0.3px;
}
.highlights-watch-btn:hover { background: #cc0000; }
.today-highlights-btn {
  display: flex; align-items: center; gap: 4px; margin-top: 8px;
  background: #111; color: #fff; border: none; border-radius: 6px;
  font-size: 11px; font-weight: 700; padding: 5px 10px; cursor: pointer;
  width: 100%; justify-content: center; letter-spacing: 0.3px;
}
.today-highlights-btn:hover { background: #222; }
.today-preview-btn { background: #1a2740; }
.today-preview-btn:hover { background: #243452; }

.matchup-info-modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 420px;
  max-height: 85vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.matchup-info-title { font-size: 13px; font-weight: 600; color: var(--muted); }
.matchup-info-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
/* Team header — flag above name above win% */
.mim-teams { display: flex; align-items: flex-start; gap: 10px; width: 100%; justify-content: center; }
.mim-team { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; max-width: 120px; }
.mim-flag { width: 56px; height: 42px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,0.12); display: block; }
.mim-team-name { font-size: 13px; font-weight: 700; text-align: center; }
.mim-vs-col { color: #9aa0ad; font-size: 12px; font-weight: 700; align-self: center; flex-shrink: 0; padding-bottom: 20px; }
/* Score / live state display */
.mim-score-display { background: var(--surface); border-radius: 10px; padding: 10px 16px; text-align: center; width: 100%; }
.mim-score-nums { font-size: 28px; font-weight: 800; letter-spacing: 4px; }
.mim-score-meta { font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 3px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.mim-live-dot { display: inline-block; width: 7px; height: 7px; background: #ef4444; border-radius: 50%; flex-shrink: 0; }
.mim-odds-toggle { display: flex; align-items: center; justify-content: center; gap: 6px; }
.mim-toggle-btn { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 6px; border: 1.5px solid var(--border); background: none; color: var(--muted); cursor: pointer; transition: background 0.1s; }
.mim-toggle-btn.active { background: #15151a; color: #fff; border-color: #15151a; }
.mim-odds-row { display: flex; gap: 8px; width: 100%; }
.mim-odds-cell { flex: 1; background: var(--surface); border-radius: 8px; padding: 14px 6px; text-align: center; }
.mim-odds-value { display: block; font-size: 20px; font-weight: 800; }
.mim-source { font-size: 12px; color: var(--muted); line-height: 1.5; display: flex; gap: 6px; background: var(--surface); border-radius: 8px; padding: 10px; width: 100%; }
.mim-source-icon { flex-shrink: 0; }
.mim-elo-section { display: flex; flex-direction: column; gap: 8px; }
.mim-elo-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.mim-elo-team { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: var(--surface); border-radius: 8px; }
.mim-elo-name { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.mim-elo-value { font-size: 15px; font-weight: 800; }
.mim-elo-probs { display: flex; gap: 8px; }
.mim-elo-prob-item { flex: 1; background: var(--surface); border-radius: 8px; padding: 8px 4px; text-align: center; }
.mim-elo-prob-item .mim-prob-label { display: block; font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mim-elo-prob-item .mim-prob-value { display: block; font-size: 16px; font-weight: 800; }
/* Cards in the predicted bracket are clickable */
#predicted-bracket-grid [data-match-num] { cursor: pointer; transition: box-shadow 0.1s; }
#predicted-bracket-grid [data-match-num]:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.14); }

.lab-group-block { margin-bottom: 18px; }
.lab-group-block .group-card { margin-bottom: 8px; }

.lab-fixture-row { padding: 8px 0; border-top: 1px solid #ececef; font-size: 12px; }
.lab-fixture-row:first-child { border-top: none; }
.lab-fixture-top { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; margin-bottom: 4px; }
.lab-fixture-top .lab-live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--red); }
.lab-fixture-team { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.lab-fixture-team .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lab-fixture-row.completed { opacity: 0.55; }
.lab-fixture-row.completed .lab-fixture-team .name { font-weight: 500; }
.lab-fixture-row.edited { background: #fffbea; border-radius: 8px; padding: 8px; margin: 0 -8px; }
.lab-fixture-row.predicted .lab-score-input { color: #b4b8c2; }
.lab-score-input {
  width: 50px; text-align: center; font-weight: 700; font-size: 15px;
  border: 1.5px solid var(--border); border-radius: 6px; padding: 4px 0;
}
.lab-score-input:focus {
  outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.18);
}

.lab-matchup-pick { margin: 0; padding: 0; border: none; }
.lab-matchup-pick-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 8px; }
.lab-pick-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.lab-pick-row .name {
  flex: 0 1 200px; font-weight: 700; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lab-tie-note { font-size: 12px; color: var(--muted); margin-top: 6px; }
.lab-tie-btn {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  font-size: 11px; font-weight: 700; padding: 4px 10px; cursor: pointer; margin-right: 6px; margin-top: 4px;
}
.lab-tie-btn:hover { background: #f4f4f6; }

@keyframes flip-fade {
  0% { background: #fff7e0; }
  100% { background: transparent; }
}
.standings-row.lab-moved { animation: flip-fade 1.2s ease-out; position: relative; z-index: 1; }

/* Standings */
.groups-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .groups-grid { grid-template-columns: 1fr; } }

/* Predicted standings cards have no stat columns (name + position only),
   so they're narrow enough to lay out 4 groups per row (3 rows for the
   12 groups) instead of the actual table's 2 per row. */
#predicted-standings-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { #predicted-standings-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { #predicted-standings-grid { grid-template-columns: 1fr; } }

.group-card { background: #fff; color: #15151a; border: 1px solid #e3e3e6; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.group-head { display: flex; align-items: center; gap: 8px; background: #14141a; color: #fff; padding: 8px 10px; font-size: 11px; font-weight: 700; }
.group-head .gh-name { flex: 1; }
.gh-col { width: 30px; text-align: center; color: #9aa0ad; font-weight: 600; flex-shrink: 0; }
.gh-col.prob { width: 42px; }
.standings-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-top: 1px solid #ececef; }
.pos-badge { width: 18px; height: 18px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; }
.pos-badge.p1, .pos-badge.p2 { background: #1a7a40; }
.pos-badge.p3, .pos-badge.qualify { background: #c2750f; }
.pos-badge.p4, .pos-badge.eliminated { background: transparent; color: #52525b; }
.standings-team { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.standings-team .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.move-arrow { font-size: 10px; font-weight: 700; flex-shrink: 0; }
.move-arrow.up { color: #16a34a; }
.move-arrow.down { color: #dc2626; }
.standings-live { width: 54px; flex-shrink: 0; display: flex; justify-content: center; }
.result-pill { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 8px; flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; }
.result-pill.live.winning { background: var(--green); color: #fff; }
.result-pill.live.losing { background: var(--red); color: #fff; }
.result-pill.live.tied { background: #ca8a04; color: #fff; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse-red 1.2s infinite; }
.standings-col { width: 30px; text-align: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.prob-pill { width: 42px; display: flex; align-items: center; justify-content: center; gap: 2px; white-space: nowrap; font-size: 11px; font-weight: 700; padding: 3px 0; border-radius: 8px; flex-shrink: 0; }
.prob-pill.tier-green  { background: #c1eec6; color: #4aa250; }
.prob-pill.tier-yellow { background: #e2eec1; color: #84a24a; }
.prob-pill.tier-orange { background: #ffd9b8; color: #cd7221; }
.prob-pill.tier-red    { background: #f8dbd0; color: #a32828; }
.prob-pill.tier-grey   { background: #e5e7eb; color: #4b5563; }


.max-w { max-width: 1100px; margin: 0 auto; }
.spinner { text-align: center; padding: 40px; color: var(--muted); font-size: 14px; }

.coffee-card {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: #fff; color: var(--text); border: 1px solid #e3e3e6; border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); transition: box-shadow 0.3s;
  padding: 16px; text-decoration: none; font-size: 13px; font-weight: 600;
}
.coffee-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.coffee-card-img { height: 44px; width: auto; }

/* Cookie consent — dismissal is remembered in localStorage (not a cookie
   itself), same as most lightweight banners; display toggled in JS rather
   than a CSS class so a hard refresh after accepting just never shows it. */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  flex-wrap: wrap; background: #fff; border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.08); padding: 14px 16px;
}
.cookie-text { font-size: 13px; color: var(--text); max-width: 640px; }
.cookie-accept-btn {
  background: #15151a; color: #fff; border: none; border-radius: 6px;
  font-size: 13px; font-weight: 700; padding: 8px 18px; cursor: pointer; flex-shrink: 0;
}
.cookie-accept-btn:hover { background: #2a2a32; }
