:root {
  --bg: #0f0f12;
  --surface: #1a1a1f;
  --surface2: #131317;
  --border: #252530;
  --text: #e8e8ec;
  --muted: #6b6b7a;
  --muted2: #888896;
  --accent: #6c5ce7;
  --accent-hover: #7d6ef7;
  --accent-dim: rgba(108, 92, 231, 0.14);
  --live: #22c55e;
  --live-red: #ef4444;
  --card-radius: 10px;
  --sidebar-width: 220px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── App layout ─────────────────────────────────────── */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--surface2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-top {
  padding: 1.1rem 1rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.brand-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.brand-text h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand-text .subtitle {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.date-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.date-row label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.date-row input[type="date"] {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.38rem 0.5rem;
  border-radius: 6px;
  font-size: 0.82rem;
  width: 100%;
  transition: border-color 0.15s;
}

.date-row input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
}

#refresh {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.42rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  width: 100%;
  transition: background 0.15s;
}

#refresh:hover {
  background: var(--accent-hover);
}

/* ── League sidebar nav ──────────────────────────────── */

.league-sidebar {
  padding: 0.5rem 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.league-section-label {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  padding: 0.7rem 0.5rem 0.3rem;
  opacity: 0.7;
}

.league-tab {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.6rem;
  font-size: 0.84rem;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--muted2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  margin-bottom: 1px;
}

.league-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.league-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 600;
}

.tab-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Match count badge */
.tab-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 1.2rem;
  text-align: right;
  flex-shrink: 0;
}

.league-tab.active .tab-count {
  color: var(--muted2);
}

/* ── Tab icons ───────────────────────────────────────── */

.tab-icon-wrap {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  flex-shrink: 0;
  color: #fff;
  letter-spacing: -0.02em;
}

/* Live icon – pulsing red dot */
.tab-icon--live {
  background: rgba(239, 68, 68, 0.15);
  border-radius: 8px;
  position: relative;
}

.live-dot {
  width: 9px;
  height: 9px;
  background: var(--live-red);
  border-radius: 50%;
  animation: livePulse 1.6s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.35); opacity: 0.65; }
}

.league-tab--live-btn {
  color: var(--live-red);
  font-weight: 600;
}

.league-tab--live-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  color: var(--live-red);
}

.league-tab--live-btn.active {
  background: rgba(239, 68, 68, 0.12);
  color: var(--live-red);
}

.league-tab--live-btn .tab-count {
  color: var(--live-red);
  opacity: 0.85;
}

/* All icon */
.tab-icon--all {
  background: rgba(108, 92, 231, 0.2);
  color: var(--accent);
  border-radius: 8px;
}

/* League colored icons */
.tab-icon--worldcup   { background: linear-gradient(135deg, #f9a825, #e65100); font-size: 0.58rem; }
.tab-icon--epl        { background: #3d004e; }
.tab-icon--laliga     { background: #c0392b; }
.tab-icon--bundesliga { background: #c0392b; }
.tab-icon--seriea     { background: #1a237e; }
.tab-icon--ligue1     { background: #1565c0; }
.tab-icon--eredivisie { background: #ff6b00; font-size: 0.52rem; }
.tab-icon--ligapt     { background: #8b1538; font-size: 0.52rem; }
.tab-icon--knvb      { background: #ff6b00; font-size: 0.5rem; }
.tab-icon--tacapt    { background: #8b1538; font-size: 0.48rem; }
.tab-icon--mls        { background: #004d99; font-size: 0.52rem; }
.tab-icon--ucl        { background: #01256e; }
.tab-icon--uel        { background: #c84b00; }

/* Active league tab – slightly brighter icon */
.league-tab.active .tab-icon--epl        { background: #6a0092; }
.league-tab.active .tab-icon--laliga     { background: #e74c3c; }
.league-tab.active .tab-icon--bundesliga { background: #e74c3c; }
.league-tab.active .tab-icon--seriea     { background: #283593; }
.league-tab.active .tab-icon--ligue1     { background: #1976d2; }
.league-tab.active .tab-icon--eredivisie { background: #ff8533; }
.league-tab.active .tab-icon--ligapt     { background: #b91c48; }
.league-tab.active .tab-icon--ksa       { background: #006c35; }
.league-tab.active .tab-icon--knvb      { background: #ff8533; }
.league-tab.active .tab-icon--facup     { background: #00247d; }
.league-tab.active .tab-icon--tacapt    { background: #b91c48; }
.league-tab.active .tab-icon--copaes    { background: #c0392b; }
.league-tab.active .tab-icon--cdf      { background: #1e3a8a; }
.league-tab.active .tab-icon--dfbpokal { background: #1a1a1a; }
.league-tab.active .tab-icon--mls        { background: #0066cc; }
.league-tab.active .tab-icon--ucl        { background: #0d3899; }
.league-tab.active .tab-icon--uel        { background: #e05a00; }

/* ── Content area ────────────────────────────────────── */

.content-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 1.25rem 1.75rem 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.9rem;
  margin-bottom: 1.25rem;
}

.content-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.content-date-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.content-area main {
  padding: 0 1.75rem 1.75rem;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

/* Matches: list 60% | reserved rail 40% (Game View fills the rail when open). */
.matches-layout {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 1rem;
}
.matches-layout-main {
  flex: 0 0 60%;
  max-width: 60%;
  min-width: 0;
}
.matches-layout-rail {
  flex: 0 0 40%;
  max-width: 40%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
}
.matches-layout-rail:has(> .gameview-sidebar:not([hidden])) {
  border: none;
  background: transparent;
}
.gameview-sidebar {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  position: sticky;
  top: 0.75rem;
  max-height: calc(100vh - 5rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.gameview-sidebar[hidden] {
  display: none !important;
}
.gameview-placeholder {
  margin: 0.75rem 0.35rem 1rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}
.gameview-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.gameview-sidebar-head h3 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.gameview-sidebar-close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.gameview-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.12);
}
.gameview-sidebar-body {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.45rem 0.55rem 0.75rem;
  flex: 1;
  min-height: 0;
}
#gameview-details.match-details-section {
  margin: 0;
}
@media (max-width: 900px) {
  .matches-layout {
    flex-direction: column;
  }
  .matches-layout-main {
    flex: 1 1 auto;
    max-width: 100%;
    width: 100%;
  }
  .matches-layout-rail {
    flex: 1 1 auto;
    max-width: 100%;
    width: 100%;
    min-height: 0;
    border-style: solid;
    border-color: var(--border);
  }
  /* Hide empty rail on small screens so the list stays full width until Game View opens. */
  .matches-layout-rail:has(> .gameview-sidebar[hidden]) {
    display: none;
  }
  .gameview-sidebar:not([hidden]) {
    position: static;
    max-height: min(70vh, 520px);
  }
}

/* ── Match list (week view) ──────────────────────────── */

.date-group-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 2rem 0 0.4rem 0;
}

.date-group-heading:first-child { margin-top: 0; }

.error {
  color: #f87171;
  padding: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--card-radius);
  margin-bottom: 1rem;
}

.empty {
  color: var(--muted);
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

/* Column headers row */
.match-col-headers {
  display: grid;
  grid-template-columns: 1fr 230px 100px 100px;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.mch-moneyline { text-align: center; }
.mch-lineup { text-align: center; }
.mch-analyse { text-align: center; }

/* Match list container */
.match-list {
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
  margin-bottom: 0.5rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.3rem;
}

/* Individual match row */
.match-row {
  display: flex;
  flex-direction: column;
  padding: 0.45rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: background 0.12s;
}

.match-row:last-child { border-bottom: 1px solid var(--border); }

.match-row:hover { background: rgba(255,255,255,0.03); }

.match-row--live { background: rgba(34, 197, 94, 0.04); }
.match-row--final { opacity: 0.75; }

/* Meta row: time / league / score / game-view */
.mr-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
}

.mr-time {
  font-weight: 700;
  color: var(--text);
  min-width: 4.5rem;
  flex-shrink: 0;
}

.mr-time--live {
  color: var(--live);
}

.mr-time--final { color: var(--muted); }

.mr-league-block {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.mr-league-name {
  font-size: 0.73rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.mr-match-state {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.mr-match-state--closed {
  color: #ef4444;
}

.mr-match-state--scheduled {
  color: #22c55e;
}

.mr-score {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text);
  padding: 0.1rem 0.5rem;
  background: rgba(255,255,255,0.07);
  border-radius: 5px;
  cursor: pointer;
  flex-shrink: 0;
}

.mr-score:hover { color: var(--accent); }

.mr-gameview {
  margin-left: auto;
  flex-shrink: 0;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted2);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.mr-gameview:hover {
  background: var(--accent-dim);
  color: var(--text);
  border-color: var(--accent);
}

/* Body: teams | moneyline | details | analyse */
.mr-body {
  display: grid;
  grid-template-columns: 1fr 230px 100px 100px;
  align-items: center;
  gap: 0.5rem;
}

/* Teams column */
.mr-teams {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.mr-team-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.mr-team-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 3px;
}

.mr-team-logo-ph {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

img.mr-team-logo.mr-team-standings-logo,
span.mr-team-logo-ph.mr-team-standings-logo {
  cursor: pointer;
}

img.mr-team-logo.mr-team-standings-logo:hover,
span.mr-team-logo-ph.mr-team-standings-logo:hover {
  opacity: 0.9;
}

img.mr-team-logo.mr-team-standings-logo:focus-visible,
span.mr-team-logo-ph.mr-team-standings-logo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mr-team-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  flex-shrink: 1;
  line-height: 1.7;
}

button.mr-team-name.mr-team-standings-btn {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  max-width: 100%;
}

button.mr-team-name.mr-team-standings-btn:hover {
  color: var(--accent);
}

.mr-draw-spacer {
  height: 0.2rem;
}

/* Moneyline column */
.mr-moneyline {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.mr-moneyline[data-pending] .ml-pct,
.mr-moneyline[data-pending] .ml-draw-pct {
  opacity: 0.4;
}

.ml-cell {
  display: flex;
  align-items: center;
}

.ml-cell--draw { justify-content: center; }

.ml-btn {
  width: 100%;
  max-width: 200px;
  padding: 0.18rem 0.6rem;
  border: none;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.01em;
  transition: filter 0.12s;
}

/* Probability fill bar – only on team win buttons */
.ml-btn--home,
.ml-btn--away {
  position: relative;
  overflow: hidden;
}

.ml-btn--home::before,
.ml-btn--away::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: var(--ml-w, 50%);
  background: rgba(255,255,255,0.14);
  border-radius: 6px 0 0 6px;
  pointer-events: none;
}

.ml-btn--home:hover,
.ml-btn--away:hover { filter: brightness(1.18); }

/* Default team button colors – overridden per-row by canvas extraction */
.ml-btn--home { background: #b91c1c; color: #fff; }
.ml-btn--away { background: #92400e; color: #fde68a; }

.ml-pct { float: right; font-weight: 800; }

/* Draw button – dark neutral (matches reference image) */
.ml-btn--draw {
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  cursor: default;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  max-width: 200px;
}

.ml-btn--draw:hover { filter: none; background: rgba(255,255,255,0.09); }

.ml-draw-pct { font-weight: 800; color: var(--text); margin-left: 0.15rem; }


/* Lineup column */
.mr-lineup {
  display: flex;
  align-items: center;
  justify-content: center;
}
.mr-lineup-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--muted2);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.7rem;
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}
.mr-lineup-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(99, 179, 237, 0.07);
}

/* Home / Away badge on team rows */
.mr-ha-badge {
  flex-shrink: 0;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-left: 0.4rem;
  line-height: 1.4;
}
.mr-ha-badge--home {
  background: rgba(99, 179, 237, 0.15);
  color: var(--accent);
  border: 1px solid rgba(99, 179, 237, 0.3);
}
.mr-ha-badge--away {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted2);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Analyse column */
.mr-analyse {
  display: flex;
  align-items: center;
  justify-content: center;
}
.mr-analyse-btn {
  background: transparent;
  border: 1px solid rgba(99, 179, 237, 0.3);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.7rem;
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}
.mr-analyse-btn:hover {
  background: rgba(99, 179, 237, 0.15);
  border-color: var(--accent);
}

/* ── Team tabs ─────────────────────────────────────────────────────── */
.lu-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0;
  flex-shrink: 0;
}
.lu-tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted2);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lu-tab-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.lu-tab-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}
.lu-tab-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lu-tab--active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.lu-tab--active .lu-tab-logo {
  background: rgba(0, 0, 0, 0.12);
}
/* Slightly larger crest beside team name on pitch / squad headers */
.pb-header > .lu-tab-logo,
.sq-header > .lu-tab-logo {
  width: 26px;
  height: 26px;
}
.lu-tab:hover:not(.lu-tab--active) { border-color: var(--accent); color: var(--accent); }

/* ── Squad card board ──────────────────────────────────────────────── */
.sq-board {
  background: #122a1a;
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,0.08);
}
.sq-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sq-team-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}
.sq-ha-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.12);
}

/* Section */
.sq-section { margin-bottom: 0.6rem; }
.sq-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  padding-left: 0.2rem;
}
.sq-section-label--gk  { color: #f59e0b; }
.sq-section-label--def { color: #4ade80; }
.sq-section-label--mid { color: #60a5fa; }
.sq-section-label--fwd { color: #f87171; }
.sq-section-label--sub { color: rgba(255,255,255,0.35); }

/* Player cards grid */
.sq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 0.35rem;
}
.sq-card {
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: 5px;
  overflow: hidden;
  cursor: default;
}
.sq-card--gk  { background: rgba(180, 83, 9, 0.35);  border: 1px solid rgba(245,158,11,0.3); }
.sq-card--def { background: rgba(20, 83, 45, 0.6);   border: 1px solid rgba(74,222,128,0.2); }
.sq-card--mid { background: rgba(30, 58, 138, 0.5);  border: 1px solid rgba(96,165,250,0.2); }
.sq-card--fwd { background: rgba(127, 29, 29, 0.5);  border: 1px solid rgba(248,113,113,0.2); }

.sq-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  align-self: stretch;
  font-size: 0.8rem;
  font-weight: 800;
  color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.25);
}
.sq-card--gk  .sq-num { color: #fbbf24; }
.sq-card--def .sq-num { color: #86efac; }
.sq-card--mid .sq-num { color: #93c5fd; }
.sq-card--fwd .sq-num { color: #fca5a5; }

.sq-info {
  display: flex;
  flex-direction: column;
  padding: 0.3rem 0.4rem;
  min-width: 0;
}
.sq-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sq-pos {
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  margin-top: 0.05rem;
}

.sq-card-subon {
  display: block;
  font-size: 0.58rem;
  font-weight: 600;
  color: rgba(253, 224, 71, 0.9);
  margin-top: 0.12rem;
  letter-spacing: 0.02em;
}

/* Substitute pills */
.sq-subs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.sq-sub-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.06rem;
  padding: 0.18rem 0.5rem 0.18rem 0.35rem;
  border-radius: 20px;
  font-size: 0.72rem;
}
.sq-sub-pill-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.sq-sub-num {
  font-weight: 800;
  color: rgba(255,255,255,0.7);
  font-size: 0.68rem;
}
.sq-sub-name {
  font-weight: 500;
  color: rgba(255,255,255,0.85);
}
.sq-sub-pos {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
}
.sq-sub-note {
  font-size: 0.55rem;
  font-weight: 600;
  color: rgba(253, 224, 71, 0.85);
  letter-spacing: 0.02em;
  padding-left: 0.05rem;
  line-height: 1.2;
}

/* Footer bar */
.sq-footer {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sq-footer-item { display: flex; flex-direction: column; gap: 0.1rem; }
.sq-footer-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}
.sq-footer-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

/* Squad fallback source note (shown when using football-data.org squad) */
.sq-source-note {
  display: inline-block;
  margin: 0.35rem 0 0.5rem 0.1rem;
  padding: 0.18rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--muted2);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
}

/* ── Pitch board ─────────────────────────────────────────────────────────── */

.pb-root {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-height: 0;
}

.pb-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.pb-team-name {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.pb-ha-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.45);
  border: 1px solid rgba(255,255,255,0.12);
}

/* Pitch container */
.pitch-wrap {
  position: relative;
  flex: 1;
  min-height: 340px;
  border-radius: 10px;
  overflow: hidden;
  background:
    repeating-linear-gradient(180deg,
      rgba(0,0,0,0.04) 0px, rgba(0,0,0,0.04) 32px,
      transparent       32px, transparent    64px
    ),
    linear-gradient(175deg, #166534 0%, #15803d 40%, #166534 70%, #14532d 100%);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.3), 0 4px 20px rgba(0,0,0,0.4);
}

/* Player token */
.pp {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  z-index: 2;
  cursor: default;
}

.pp-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  max-width: 112px;
}

.pp-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.pp-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 900;
  color: #fff;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.1);
  transition: transform 0.15s, box-shadow 0.15s;
  line-height: 1;
}
.pp:hover .pp-num {
  transform: scale(1.2);
  box-shadow: 0 4px 14px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.3);
}
.pp--gk  .pp-num { background: linear-gradient(135deg,#92400e,#b45309); border-color: #fbbf24; }
.pp--def .pp-num { background: linear-gradient(135deg,#14532d,#15803d); border-color: #4ade80; }
.pp--mid .pp-num { background: linear-gradient(135deg,#1e3a8a,#1d4ed8); border-color: #60a5fa; }
.pp--fwd .pp-num { background: linear-gradient(135deg,#7f1d1d,#b91c1c); border-color: #f87171; }

.pp-name {
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 5px rgba(0,0,0,1), 0 0 10px rgba(0,0,0,0.8);
  white-space: nowrap;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.pp-left .pp-name { max-width: 68px; }

.pp-meta {
  font-size: clamp(9px, 0.58rem, 11px);
  font-weight: 600;
  color: rgba(255, 248, 220, 0.95);
  text-align: center;
  line-height: 1.15;
  max-width: 76px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  margin-top: -1px;
}
.pp-meta-min {
  font-weight: 800;
  color: #fde047;
}
.pp-meta-for {
  color: rgba(255, 255, 255, 0.92);
}

/* Bottom scrollable block (subs + non-squad + footer) */
.pb-bottom {
  flex-shrink: 0;
  max-height: 36%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

/* Substitutes / not-called-up section */
.pb-subs { }
.pb-subs--other { opacity: 0.75; }

.pb-subs-label {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  margin-bottom: 0.3rem;
  text-align: center;
}

/* 2-column grid of player rows */
.pb-subs-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.12rem 1.2rem;
}

.pb-sub-cell {
  min-width: 0;
}

/* Single player row: [POS badge] [Name] [#] */
.pb-sub-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pb-sub-note {
  font-size: 0.55rem;
  font-weight: 600;
  color: rgba(253, 224, 71, 0.85);
  line-height: 1.2;
  padding: 0.08rem 0 0 2.75rem;
  letter-spacing: 0.01em;
}

.pb-sub-pos {
  flex-shrink: 0;
  width: 2.4rem;
  font-size: 0.58rem;
  font-weight: 700;
  text-align: center;
  padding: 0.1rem 0.15rem;
  border-radius: 3px;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.02em;
}
.pb-sub-pos--gk  { background: rgba(180,83,9,0.25);  color: #fbbf24; }
.pb-sub-pos--def { background: rgba(21,128,61,0.25);  color: #4ade80; }
.pb-sub-pos--mid { background: rgba(29,78,216,0.25);  color: #60a5fa; }
.pb-sub-pos--fwd { background: rgba(185,28,28,0.25);  color: #f87171; }

.pb-sub-name {
  flex: 1;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pb-sub-num {
  flex-shrink: 0;
  font-size: 0.66rem;
  font-weight: 800;
  color: rgba(255,255,255,0.45);
}

/* Footer stats bar */
.pb-footer {
  display: flex;
  gap: 1.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  justify-content: center;
}

.pb-fi { display: flex; flex-direction: column; gap: 0.1rem; }

.pb-fl {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
}

.pb-fv {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
}

/* Kept for substitute pill reference */
.lu-player {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.22rem 0.3rem;
  border-radius: 4px;
  transition: background 0.1s;
}
.lu-player:hover { background: rgba(255,255,255,0.04); }
/* pos tag — left of name */
.lu-pos {
  flex-shrink: 0;
  min-width: 32px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: rgba(99,179,237,0.1);
  border: 1px solid rgba(99,179,237,0.2);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  text-align: center;
}
.lu-player--sub .lu-pos {
  color: var(--muted2);
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}
.lu-pos--empty { min-width: 32px; flex-shrink: 0; }

/* player name — middle */
.lu-name {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}
.lu-player--sub .lu-name { color: var(--muted2); }

/* jersey number — right of name */
.lu-jersey {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.lu-player--sub .lu-jersey { color: var(--muted); opacity: 0.6; }

/* Analyse events modal */
.analyse-details { padding: 0.25rem 0; }

.analyse-score-banner {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
}
.analyse-score-banner__nums {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.analyse-match-summary {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.analyse-poss { margin-bottom: 1rem; }
.analyse-poss-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.analyse-poss-home-lab strong { color: #60a5fa; }
.analyse-poss-away-lab strong { color: #f87171; }

.analyse-poss-bar {
  display: flex;
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
}
.analyse-poss-seg--home {
  background: linear-gradient(90deg, #1d4ed8, #3b82f6);
}
.analyse-poss-seg--away {
  background: linear-gradient(90deg, #b91c1c, #ef4444);
}

.analyse-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.analyse-stats-table th,
.analyse-stats-table td {
  padding: 0.35rem 0.5rem;
  text-align: right;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.analyse-stats-table th:first-child,
.analyse-stats-table td.analyse-stat-label {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
}
.analyse-stat-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.analyse-stat-ic {
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  color: var(--muted2);
  opacity: 1;
}
/* Icon tint follows the stat name / meaning */
.analyse-stat-ic--possession { color: #818cf8; }
.analyse-stat-ic--shotsOn { color: #22c55e; }
.analyse-stat-ic--shotsTotal { color: #94a3b8; }
.analyse-stat-ic--shotPct { color: #2dd4bf; }
.analyse-stat-ic--corners { color: #f97316; }
.analyse-stat-ic--fouls { color: #fb923c; }
.analyse-stat-ic--offside { color: #38bdf8; }
.analyse-stat-ic--saves { color: #06b6d4; }
.analyse-stat-ic--yellow { color: #eab308; }
.analyse-stat-ic--red { color: #ef4444; }
.analyse-stat-ic--penalty { color: #f97316; }
.analyse-stat-ic--passAcc { color: #34d399; }
.analyse-stat-ic--passTot { color: #7dd3fc; }
.analyse-stat-ic--passPct { color: #5eead4; }
.analyse-stat-ic--crossAcc { color: #a78bfa; }
.analyse-stat-ic--crossTot { color: #c084fc; }
.analyse-stat-ic--crossPct { color: #e879f9; }
.analyse-stat-ic--longBallTot { color: #d97706; }
.analyse-stat-ic--longBallAcc { color: #84cc16; }
.analyse-stat-ic--longBallPct { color: #a3e635; }
.analyse-stat-ic--blocked { color: #71717a; }
.analyse-stat-ic--tackleEff { color: #f59e0b; }
.analyse-stat-ic--tackleTot { color: #ea580c; }
.analyse-stat-ic--tacklePct { color: #fb7185; }
.analyse-stat-ic--intercept { color: #22d3ee; }
.analyse-stat-ic--clearance { color: #4ade80; }
.analyse-stat-ic--default { color: var(--accent); }
.analyse-stat-ic svg {
  width: 100%;
  height: 100%;
  display: block;
}
.analyse-stat-txt {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}
.analyse-stats-table thead th {
  color: var(--text);
  font-size: 0.78rem;
}

.analyse-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.analyse-tl-item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.86rem;
}
.analyse-tl-time {
  flex-shrink: 0;
  min-width: 2.6rem;
  font-weight: 700;
  color: var(--accent);
}
.analyse-tl-body { flex: 1; min-width: 0; line-height: 1.4; }
.analyse-tl-ev-ic {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  margin-right: 0.33rem;
  vertical-align: -0.1em;
}
.analyse-tl-ev-ic svg { width: 100%; height: 100%; }
.analyse-tl-ev-ic--corner { color: #f87171; }
.analyse-tl-ev-ic--whistle { color: #e2e8f0; }
/* Goal row uses a self-colored ball SVG (no currentColor); keep subtle edge on dark bg */
.analyse-tl-ev-ic--goal {
  color: #4ade80;
  width: 1.24rem;
  height: 1.24rem;
  margin-right: 0.38rem;
  vertical-align: -0.16em;
}
.analyse-tl-ev-ic--goal svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 0.35px rgba(15, 23, 42, 0.55));
}
.analyse-tl-other--corner .analyse-tl-time { color: #fda4af; }
.analyse-tl-other--goal .analyse-tl-time { color: #86efac; }
.analyse-tl-other--phase .analyse-tl-time { color: #c4b5fd; }
.analyse-tl-goal .analyse-tl-time { color: #86efac; }
.analyse-tl-goal-detail {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9em;
  line-height: 1.4;
  max-width: 52rem;
}
.analyse-tl-muted { color: var(--muted); font-size: 0.85em; }
.analyse-tl-penalty-ctx {
  margin-top: 0.4rem;
  padding: 0.35rem 0.5rem 0.35rem 0.55rem;
  border-left: 2px solid rgba(148, 163, 184, 0.45);
  color: var(--muted);
  font-size: 0.85em;
  line-height: 1.35;
}
.analyse-tl-tag {
  display: inline-block;
  margin-right: 0.25rem;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  vertical-align: middle;
}
.analyse-tl-tag--goal { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.analyse-tl-tag--yellow { background: rgba(234, 179, 8, 0.2); color: #facc15; }
.analyse-tl-tag--red { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.analyse-tl-other .analyse-tl-tag { background: rgba(148, 163, 184, 0.14); color: #a8b3c4; }
.analyse-tl-other--corner .analyse-tl-tag { background: rgba(59, 130, 246, 0.16); color: #93c5fd; }
.analyse-tl-other--offside .analyse-tl-tag { background: rgba(120, 113, 108, 0.2); color: #c4bbb4; }
.analyse-tl-other--var .analyse-tl-tag { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; }
.analyse-tl-other--foul .analyse-tl-tag { background: rgba(251, 146, 60, 0.16); color: #fdba74; }
.analyse-tl-other--shot .analyse-tl-tag { background: rgba(56, 189, 248, 0.14); color: #7dd3fc; }
.analyse-tl-other--save .analyse-tl-tag { background: rgba(34, 211, 238, 0.14); color: #67e8f9; }
.analyse-tl-other--phase .analyse-tl-tag { background: rgba(100, 116, 139, 0.2); color: #cbd5e1; }
.analyse-tl-other--throw .analyse-tl-tag { background: rgba(99, 102, 241, 0.14); color: #a5b4fc; }
.analyse-tl-other--gk .analyse-tl-tag { background: rgba(71, 85, 105, 0.22); color: #94a3b8; }

.analyse-badge {
  display: inline-block;
  margin: 0 0.15rem;
  padding: 0.06rem 0.3rem;
  border-radius: 3px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  vertical-align: middle;
}
.analyse-badge--pen { background: rgba(249, 115, 22, 0.25); color: #fb923c; }
.analyse-badge--og { background: rgba(148, 163, 184, 0.25); color: #94a3b8; }

.analyse-sub-block { width: 100%; }
.analyse-sub-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}
.analyse-sub-out {
  color: #f87171;
  font-weight: 600;
}
.analyse-sub-in {
  color: #4ade80;
  font-weight: 600;
}
.analyse-arr {
  display: inline-block;
  margin-right: 0.15rem;
  font-weight: 900;
  font-size: 1rem;
  line-height: 1;
}
.analyse-arr-out { color: #ef4444; }
.analyse-arr-in { color: #22c55e; }
.analyse-sub-mid {
  color: var(--muted2);
  font-size: 0.85rem;
  user-select: none;
}
.analyse-sub-team { margin-top: 0.2rem; font-size: 0.8rem; }

.analyse-tl-card--yellow .analyse-tl-body strong { color: #facc15; }
.analyse-tl-card--red .analyse-tl-body strong { color: #f87171; }

/* Score clickable */
.score-clickable { cursor: pointer; }
.score-clickable:hover { color: var(--accent); }

/* ── Dialog ──────────────────────────────────────────── */

#lineups-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  color: var(--text);
  padding: 0;
  width: min(780px, 96vw);
  height: 92vh;
  max-width: 96vw;
  max-height: 92vh;
}

#lineups-dialog[open] {
  display: flex;
  flex-direction: column;
}

#lineups-dialog.lineup-dialog-wide {
  width: min(900px, 96vw);
}

#lineups-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

/* Player profile (from lineup — ESPN athlete id) */
#player-profile-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  color: var(--text);
  padding: 0;
  width: min(520px, 94vw);
  max-width: 94vw;
  max-height: 85vh;
}
#player-profile-dialog[open] {
  display: flex;
  flex-direction: column;
}
#player-profile-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}
.player-profile-dialog-header {
  padding-right: 1rem;
  justify-content: flex-start;
}
.player-profile-body {
  padding: 0.65rem 1rem 1rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.lu-profile-hit {
  cursor: pointer;
}
.lu-coach-hit {
  text-decoration: underline;
  text-decoration-color: rgba(96, 165, 250, 0.45);
  text-underline-offset: 2px;
}
.lu-coach-hit:hover {
  color: var(--accent, #60a5fa);
}
.pp-bio--coach {
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.pp-coach-photo {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.pp-coach-note {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted, #94a3b8);
  background: rgba(148, 163, 184, 0.08);
  border-radius: 6px;
  border-left: 3px solid var(--accent, #60a5fa);
}
.pp-stats-table--coach .pp-career-team {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pb-sub-cell.lu-profile-hit {
  position: relative;
  z-index: 2;
}
.lu-profile-hit:focus-visible {
  outline: 2px solid var(--accent, #60a5fa);
  outline-offset: 2px;
}
.lu-lineup-li.lu-profile-hit {
  border-radius: 6px;
  padding: 0.12rem 0.25rem;
  margin-left: -0.25rem;
}
.pp-bio {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.pp-bio-text {
  flex: 1;
  min-width: 0;
}
.pp-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.88rem;
  color: var(--muted, #94a3b8);
}
.pp-meta-row strong {
  color: var(--text);
  margin-right: 0.25rem;
}
.pp-season-totals {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--muted, #94a3b8);
}
.pp-flag {
  border-radius: 4px;
  flex-shrink: 0;
}
.pp-table-wrap {
  overflow-x: auto;
}
.pp-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.pp-stats-table th,
.pp-stats-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.45rem;
  text-align: left;
}
.pp-stats-table th:nth-child(n + 2),
.pp-stats-table td:nth-child(n + 2) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pp-stats-table th {
  color: var(--muted, #94a3b8);
  font-weight: 600;
}
.pp-empty {
  color: var(--muted);
  font-style: italic;
}
.pp-section {
  margin-top: 0.85rem;
}
.pp-section-title {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.95);
}
.pp-club-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pp-club-li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.pp-club-logo {
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.06);
}
.pp-club-logo-ph {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}
.pp-club-meta {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}
.pp-club-name {
  font-weight: 700;
  font-size: 0.88rem;
}
.pp-club-seasons {
  font-size: 0.78rem;
  color: var(--muted, #94a3b8);
}
.pp-stats-table--career th:first-child,
.pp-stats-table--career td:first-child {
  min-width: 7.5rem;
}

/* League standings (from match card team name) */
#standings-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  color: var(--text);
  padding: 0;
  width: min(920px, 98vw);
  max-width: 98vw;
  max-height: 90vh;
}

#standings-dialog[open] {
  display: flex;
  flex-direction: column;
}

#standings-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

#standings-body-wrap {
  padding: 0.75rem 1rem 1rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

#standings-body {
  min-width: 0;
}

/* Standings: one competition at a time; arrows beside league name (no horizontal slider) */
.standings-carousel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.standings-carousel-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem 0.65rem;
  padding: 0.15rem 0;
}

.standings-carousel-top--solo {
  display: block;
  text-align: center;
}

.standings-carousel-top--solo .standings-carousel-heading {
  display: inline-block;
  max-width: 100%;
  text-align: center;
}

.standings-carousel-top--solo .standings-nav-inline {
  display: none !important;
}

.standings-carousel-heading {
  min-width: 0;
  text-align: center;
}

.standings-carousel-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 0;
}

.standings-carousel-league-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
}

.standings-carousel-league-logo[hidden] {
  display: none !important;
}

.standings-carousel-league-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.standings-carousel-league-meta {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  color: var(--muted2);
  font-family: ui-monospace, monospace;
}

.standings-carousel-panels {
  min-width: 0;
}

.standings-carousel-panel[hidden] {
  display: none !important;
}

button.standings-nav-inline {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

button.standings-nav-inline:hover:not(:disabled):not(.standings-nav--disabled) {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.06);
}

.standings-nav-inline.standings-nav--disabled,
.standings-nav-inline:disabled {
  opacity: 0.32;
  cursor: default;
  transform: none;
}

.standings-nav-inline[hidden] {
  display: none !important;
}

.standings-loading,
.standings-unavailable {
  margin: 0.5rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.standings-group + .standings-group {
  margin-top: 1.25rem;
}

.standings-carousel-switch-hint {
  margin: 0 0 0.35rem;
  font-size: 0.74rem;
  color: var(--muted2);
  text-align: center;
  line-height: 1.35;
}

.standings-knockout-wrap {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.standings-knockout-wrap--top {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.standings-knockout-section-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.standings-knockout-intro {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: var(--muted2);
  line-height: 1.35;
}

.standings-league-phase-divider {
  margin: 0.75rem 0 0.5rem;
  text-align: center;
}

.standings-league-phase-label {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted2);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.standings-knockout-round {
  margin-bottom: 1rem;
}

.standings-knockout-round:last-child {
  margin-bottom: 0;
}

.standings-knockout-round-title {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.standings-knockout-list {
  margin: 0;
  padding: 0 0 0 1.1rem;
  list-style: disc;
  color: var(--muted);
  font-size: 0.82rem;
}

.standings-knockout-li {
  margin: 0.25rem 0;
  line-height: 1.35;
}

.standings-knockout-li-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}

.standings-knockout-meta {
  font-size: 0.72rem;
  color: var(--muted2);
  font-weight: 400;
  line-height: 1.35;
  max-width: 100%;
}

.standings-knockout-note {
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.35;
  max-width: 100%;
}

.standings-knockout-match {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.35rem;
  color: var(--text);
  font-weight: 500;
}

.standings-knockout-side {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.standings-knockout-score {
  font-weight: 600;
  white-space: nowrap;
}

.standings-knockout-team-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.standings-knockout-leg {
  color: var(--muted2);
  font-size: 0.76rem;
  white-space: nowrap;
}

.standings-competition-block {
  margin-bottom: 1.5rem;
}

.standings-competition-block:last-child {
  margin-bottom: 0;
}

.standings-competition-title {
  margin: 0 0 0.15rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.standings-competition-meta {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  color: var(--muted2);
  font-family: ui-monospace, monospace;
}

.standings-group-title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.standings-season {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  color: var(--muted2);
}

.standings-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

table.standings-table th,
table.standings-table td {
  padding: 0.35rem 0.45rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.standings-table th:first-child,
table.standings-table td:first-child,
table.standings-table th:nth-child(2),
table.standings-table td:nth-child(2) {
  text-align: left;
}

table.standings-table td.standings-team-cell {
  white-space: normal;
  max-width: 11rem;
}

.standings-team-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  vertical-align: middle;
}

.standings-team-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 3px;
}

.standings-team-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  font-weight: 600;
}

button.standings-team-jump {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
}

button.standings-team-jump:hover {
  background: rgba(255, 255, 255, 0.06);
}

button.standings-team-jump:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button.standings-knockout-team-jump {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 4px;
  max-width: 100%;
  min-width: 0;
}

button.standings-knockout-team-jump:hover {
  background: rgba(255, 255, 255, 0.06);
}

button.standings-knockout-team-jump:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

table.standings-table thead th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted2);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

table.standings-table tbody tr:last-child td {
  border-bottom: none;
}

table.standings-table tbody tr.standings-row-highlight {
  background: rgba(59, 130, 246, 0.12);
}

table.standings-table tbody tr.standings-row-highlight td {
  font-weight: 600;
}

#close-standings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

#close-standings:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.dialog-header h3 {
  margin: 0;
  font-size: 1.05rem;
  flex: 1;
  min-width: 120px;
}

#standings-title.standings-dialog-title--with-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.standings-dialog-title-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.standings-dialog-title-text {
  min-width: 0;
}

.dialog-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.view-toggle button {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  background: var(--surface);
  border: none;
  color: var(--muted2);
  cursor: pointer;
}

.view-toggle button:hover { color: var(--text); }
.view-toggle button.active { background: var(--accent); color: white; }

#download-lineup-image.hide-lineup-download { display: none !important; }

#close-lineups {
  display: none;
}

#lineups-content-wrap {
  padding: 0.85rem 1rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#lineups-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.match-details-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.no-goal-data-msg {
  margin: 0.5rem 0 0;
  padding: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
}

.show-lineups-btn {
  display: block;
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.show-lineups-btn:hover { background: var(--accent-hover); }

.lineup-team-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.lineup-team-tabs button {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.lineup-team-tabs button:hover { color: var(--text); border-color: var(--accent); }
.lineup-team-tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.match-details-heading {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0.5rem 0;
}

.match-details-heading + .match-details-list { margin-top: 0; }

.match-details-list {
  list-style: none;
  margin: 0 0 1rem 0;
  padding: 0;
  font-size: 0.87rem;
}

.match-details-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.match-details-list li:last-child { border-bottom: none; }

/* Game View — bet365-style live tracker (not video) */
/* Game View: finished match — score only (no live board). */
.gv-final-summary {
  padding: 1.25rem 1rem 1.5rem;
  text-align: center;
}

.gv-final-teams {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.gv-final-vs {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.82rem;
}

.gv-final-scoreline {
  margin-top: 0.85rem;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #f1f5f9;
}

.gv-final-dash {
  font-weight: 600;
  opacity: 0.85;
}

.gv-final-score-missing {
  color: var(--muted);
  font-size: 1.35rem;
  font-weight: 600;
}

.gv-final-tag {
  margin-top: 0.75rem;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* Game View: scheduled match — recent form (last N per team). */
.gv-prematch {
  padding: 0.75rem 0.5rem 1rem;
  font-size: 0.82rem;
  color: var(--text);
}
.gv-prematch-intro {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}
.gv-prematch-intro strong {
  color: var(--text);
}
.gv-prematch-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 720px) {
  .gv-prematch-cols {
    grid-template-columns: 1fr;
  }
}
.gv-prematch-team-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.65rem;
}
.gv-prematch-team-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.gv-prematch-team-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1.2;
}
.gv-prematch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
  table-layout: fixed;
}
.gv-prematch-table th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  padding: 0.4rem 0.2rem 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.gv-prematch-th-date { width: 30%; }
.gv-prematch-th-venue { width: 11%; text-align: center; }
.gv-prematch-th-opp { width: 36%; }
.gv-prematch-th-score { width: 15%; text-align: right; }
.gv-prematch-th-res { width: 8%; }
.gv-prematch-table td {
  padding: 0.42rem 0.2rem 0.42rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  vertical-align: middle;
}
.gv-prematch-table tbody tr:last-child td {
  border-bottom: none;
}
.gv-prematch-col-date {
  white-space: nowrap;
  color: var(--muted);
}
.gv-h2h-comp {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
  white-space: normal;
  max-width: 7.5rem;
}
.gv-prematch-col-venue {
  text-align: center;
  width: 11%;
}
.gv-prematch-venue-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0.1rem 0.28rem;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.gv-prematch-col-opp {
  font-weight: 600;
  min-width: 0;
}
.gv-prematch-opp-cell {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.gv-prematch-opp-cell--nologo {
  gap: 0;
}
.gv-prematch-opp-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
}
.gv-prematch-opp-logo--ph {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.12);
}
.gv-prematch-opp-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}
.gv-prematch-col-score {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding-right: 0.35rem;
  font-weight: 700;
}
button.gv-prematch-scorelink {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: inherit;
  cursor: pointer;
  text-align: right;
  white-space: nowrap;
}
button.gv-prematch-scorelink:hover {
  text-decoration: underline;
  color: #93c5fd;
}
.gv-prematch-score-sep {
  margin: 0 0.12em;
  font-weight: 600;
  opacity: 0.65;
}
.gv-prematch-col-res {
  width: 1%;
  text-align: right;
}
.gv-prematch-res {
  display: inline-block;
  min-width: 1.35rem;
  text-align: center;
  font-weight: 800;
  font-size: 0.72rem;
  border-radius: 4px;
  padding: 0.12rem 0.28rem;
}
.gv-prematch-res--win {
  background: rgba(34, 197, 94, 0.22);
  color: #86efac;
}
.gv-prematch-res--loss {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}
.gv-prematch-res--draw {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}
.gv-prematch-empty {
  color: var(--muted);
  font-style: italic;
  padding: 0.5rem 0 !important;
}

.gv-prematch-h2h {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.gv-prematch-h2h-title {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}
.gv-prematch-h2h-intro {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}
.gv-prematch-h2h-intro strong {
  color: var(--text);
}
.gv-prematch-table--h2h {
  width: 100%;
}
.gv-prematch-table--h2h tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.gv-prematch-table--h2h tbody tr:last-child {
  border-bottom: none;
}
.gv-prematch-table--h2h td {
  border-bottom: none;
}
.gv-h2h-th-match {
  width: auto;
}
.gv-h2h-match {
  vertical-align: middle;
}
.gv-h2h-match-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}
.gv-h2h-side {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 42%;
}
.gv-h2h-side--home {
  justify-content: flex-end;
  text-align: right;
}
.gv-h2h-side--away {
  justify-content: flex-start;
  text-align: left;
}
.gv-h2h-team-name {
  font-weight: 600;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gv-h2h-vs {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  opacity: 0.85;
}
.gv-h2h-score {
  text-align: center;
  padding-right: 0;
}
.gv-h2h-th-res {
  text-align: center;
  vertical-align: bottom;
  line-height: 1.15;
  width: 3.25rem;
}
.gv-h2h-th-res-abbr {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
}
.gv-h2h-th-res-hint {
  display: block;
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.02em;
}

.gv-root {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #161616, #0d0d0f);
}
.gv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.gv-names {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
}
.gv-home, .gv-away {
  font-size: 0.78rem;
  font-weight: 700;
  color: #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 38%;
}
.gv-score {
  font-size: 1.05rem;
  font-weight: 800;
  color: #facc15;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.gv-clock-badge {
  position: absolute;
  top: 0.42rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
}
.gv-clock-badge-inner {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #4ade80;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(74, 222, 128, 0.45);
  border-radius: 6px;
  padding: 0.22rem 0.5rem;
  text-shadow: 0 0 12px rgba(74, 222, 128, 0.35);
}
.gv-goalscorers {
  position: absolute;
  top: 0.38rem;
  left: 0.38rem;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.62rem;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.2rem 0.45rem 0.2rem 0.38rem;
  cursor: pointer;
  max-width: 42%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gv-goalscorers:hover {
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.gv-poss-strip {
  position: relative;
  margin: 0 0.65rem 0.45rem;
  padding: 0.38rem 0.55rem 0.38rem 0.65rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  min-height: 2.05rem;
  display: flex;
  align-items: center;
}
.gv-poss-strip-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 7px 0 0 7px;
  opacity: 0.38;
  pointer-events: none;
  transition: width 0.35s ease;
}
.gv-poss-strip-fill--home {
  background: linear-gradient(90deg, #2563eb, #38bdf8);
}
.gv-poss-strip-fill--away {
  background: linear-gradient(90deg, #dc2626, #f87171);
}
.gv-poss-strip-fill--even {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.5), rgba(148, 163, 184, 0.2));
  width: 100% !important;
  opacity: 0.15;
}
.gv-poss-strip-text {
  position: relative;
  z-index: 1;
  font-size: 0.74rem;
  font-weight: 700;
  color: #f1f5f9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  white-space: normal;
  line-height: 1.25;
}
.gv-clock-pill {
  font-size: 0.8rem;
  font-weight: 800;
  color: #5eead4;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(94,234,212,0.35);
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  flex-shrink: 0;
}
.gv-board {
  height: 1px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: transparent;
}
.gv-pitch-outer {
  padding: 0.55rem 0.65rem 0.35rem;
  perspective: 420px;
}
.gv-pitch {
  position: relative;
  height: 168px;
  border-radius: 10px;
  overflow: hidden;
  transform: rotateX(18deg);
  transform-origin: 50% 80%;
  box-shadow: 0 12px 40px rgba(0,0,0,0.55);
}
.gv-grass {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.35) 0%, transparent 28%),
    repeating-linear-gradient(90deg, #15803d 0 18px, #166534 18px 36px);
}
.gv-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.gv-spotlight {
  position: absolute;
  width: 52%;
  height: 42%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(74,222,128,0.45) 0%, transparent 68%);
  pointer-events: none;
  transform-origin: center center;
}
.gv-ball {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f8fafc;
  border: 2px solid rgba(15,23,42,0.85);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.12);
  pointer-events: none;
  animation: gv-ball-bob 2.1s ease-in-out infinite;
}
.gv-spotlight { animation: gv-spot-breathe 2.8s ease-in-out infinite; }
@keyframes gv-ball-bob {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-2px); }
}
@keyframes gv-spot-breathe {
  0%, 100% { opacity: 0.92; }
  50% { opacity: 0.68; }
}
.gv-repl-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.gv-repl-card {
  min-width: min(82%, 340px);
  padding: 1rem 1.1rem 0.9rem;
  border-radius: 12px;
  text-align: center;
  background: linear-gradient(180deg, rgba(15, 65, 32, 0.97), rgba(12, 52, 28, 0.96));
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-bottom: 3px solid #dc2626;
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.6),
    0 10px 22px rgba(220, 38, 38, 0.35);
}
.gv-repl-title {
  font-size: clamp(1.35rem, 3.4vw, 2.35rem);
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #f8fafc;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}
.gv-repl-team {
  margin-top: 0.28rem;
  font-size: clamp(0.92rem, 2.2vw, 1.28rem);
  font-weight: 800;
  color: #86efac;
  letter-spacing: 0.02em;
}
.gv-playbar {
  position: absolute;
  left: 0.45rem;
  right: 0.45rem;
  bottom: 0.35rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background: rgba(0,0,0,0.62);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}
.gv-play-team { font-size: 0.72rem; font-weight: 700; color: #93c5fd; }
.gv-play-title { font-size: 0.78rem; font-weight: 800; color: #f8fafc; }
.gv-play-sub { font-size: 0.76rem; color: #cbd5e1; line-height: 1.25; }
.gv-tabs {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.08);
  gap: 0;
}
.gv-tab {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.2rem;
  font-size: 0.64rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.gv-tab.active {
  color: #f8fafc;
  border-bottom-color: #f8fafc;
}
.gv-panels { padding: 0.55rem 0.65rem 0.75rem; max-height: min(52vh, 480px); overflow-y: auto; }
.gv-panel[hidden] { display: none !important; }
.gv-muted { color: var(--muted); font-size: 0.85rem; margin: 0.25rem 0; }
.gv-stats { font-size: 0.82rem; }

/* Game View — statistics tab (bookmaker-style donuts + bars) */
.gv-stats--bet {
  padding: 0.15rem 0 0.35rem;
}
.gv-donuts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.28rem 0.2rem;
  margin-bottom: 0.48rem;
}
.gv-donut-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  gap: 0.12rem;
}
.gv-donut-lab {
  order: 0;
  font-size: 0.56rem;
  font-weight: 700;
  color: #94a3b8;
  line-height: 1.15;
  text-align: center;
  padding: 0 0.05rem;
}
.gv-donut-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  min-width: 0;
}
.gv-donut {
  position: relative;
  width: 2.55rem;
  height: 2.55rem;
  flex-shrink: 0;
}
.gv-donut-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  /* Conic starts at top and runs CW; mirror so home (blue) reads left, away (red) right like the flanking numbers. */
  transform: scaleX(-1);
}
.gv-donut-hole {
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  background: #0a0f18;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  z-index: 1;
}
.gv-donut-mid {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 0.82rem;
  height: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
}
.gv-donut-mid--pct {
  font-size: 0.64rem;
}
.gv-donut-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.gv-dv-h {
  font-size: 0.66rem;
  font-weight: 800;
  color: #60a5fa;
  text-align: right;
  min-width: 1.65rem;
  flex: 0 0 auto;
  line-height: 1;
}
.gv-dv-a {
  font-size: 0.66rem;
  font-weight: 800;
  color: #f87171;
  text-align: left;
  min-width: 1.65rem;
  flex: 0 0 auto;
  line-height: 1;
}

/* Incidents strip: corners + cards + dual shots (Bet365-style) */
.gv-incidents {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.52rem;
  padding: 0.32rem 0.4rem;
  background: rgba(0, 0, 0, 0.42);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.gv-inc-side {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.42rem;
  flex-shrink: 0;
}
.gv-inc-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.14rem;
  min-width: 1.25rem;
}
.gv-flag {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  height: 13px;
}
.gv-flag-pole {
  width: 2px;
  height: 13px;
  flex-shrink: 0;
  border-radius: 1px;
  background: linear-gradient(180deg, #a16207, #713f12);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.gv-flag--home .gv-flag-cloth {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 9px;
  border-color: transparent transparent transparent #d92626;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}
.gv-flag--away .gv-flag-cloth {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 9px 5px 0;
  border-color: transparent #d92626 transparent transparent;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}
.gv-inc-cards {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 0.38rem;
}
.gv-inc-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.12rem;
  min-width: 0.62rem;
}
.gv-card-ico {
  display: block;
  width: 0.52rem;
  height: 0.68rem;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.gv-card-ico--yellow {
  background: linear-gradient(180deg, #fde047, #eab308);
}
.gv-card-ico--red {
  background: linear-gradient(180deg, #f87171, #b91c1c);
}
.gv-inc-val {
  font-size: 0.68rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.gv-inc-shots {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.1rem;
  padding: 0 0.15rem;
}
.gv-shots-cap {
  font-size: 0.56rem;
  font-weight: 700;
  color: #cbd5e1;
  text-align: center;
  letter-spacing: 0.02em;
}
.gv-shots-mid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
}
.gv-shots-num {
  font-size: 0.66rem;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.gv-shots-num--home {
  text-align: right;
}
.gv-shots-num--away {
  text-align: left;
}
.gv-shots-bar-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.gv-shots-bar {
  display: flex;
  width: 100%;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(30, 41, 59, 0.95);
}
.gv-shots-bar--total {
  height: 5px;
}
.gv-shots-bar--sot {
  height: 3px;
  opacity: 0.95;
}
.gv-shots-seg {
  display: block;
  height: 100%;
  min-width: 0;
}
.gv-shots-home {
  background: linear-gradient(90deg, #1d4ed8, #3b82f6);
}
.gv-shots-away {
  background: linear-gradient(90deg, #b91c1c, #ef4444);
}
.gv-shots-seg--sot.gv-shots-home {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}
.gv-shots-seg--sot.gv-shots-away {
  background: linear-gradient(90deg, #dc2626, #fb7185);
}

.gv-zones-cap {
  font-size: 0.58rem;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
  margin: 0.12rem 0 0.06rem;
}
.gv-zones-subcap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  font-size: 0.48rem;
  font-weight: 600;
  color: #64748b;
  text-align: center;
  margin-bottom: 0.18rem;
  letter-spacing: 0.02em;
}
.gv-zones-subcap span {
  min-width: 0;
}
/* Bet365-style: equal pitch thirds, grass + line overlay, dual home/away strip per column */
.gv-zones-pitch {
  position: relative;
  width: 100%;
  height: 3.05rem;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.48rem;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.4);
}
.gv-z-grass {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    #134e2a 0,
    #166534 5px,
    #14532d 10px,
    #166534 15px
  );
  opacity: 0.92;
}
.gv-z-mark {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 2;
}
.gv-z-cols {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  z-index: 1;
  pointer-events: none;
}
.gv-z-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid rgba(0,0,0,0.12);
}
.gv-z-col:last-child {
  border-right: none;
}
.gv-z-split {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column-reverse;
  transition: opacity 0.35s ease;
}
.gv-z-split-home {
  min-height: 0;
  background: linear-gradient(180deg, rgba(37,99,235,0.55), rgba(37,99,235,0.28));
  transition: flex 0.45s ease;
}
.gv-z-split-away {
  min-height: 0;
  background: linear-gradient(180deg, rgba(220,38,38,0.32), rgba(220,38,38,0.52));
  transition: flex 0.45s ease;
}
.gv-z-lab {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.04rem;
  padding: 0.08rem 0.06rem 0.1rem;
  background: linear-gradient(180deg, transparent, rgba(10,15,24,0.88));
}
.gv-z-pct {
  font-size: 0.64rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.05;
  text-shadow: 0 1px 4px rgba(0,0,0,0.85);
}
.gv-z-duel {
  font-size: 0.48rem;
  font-weight: 700;
  color: rgba(226,232,240,0.88);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.gv-cmp {
  margin-bottom: 0.36rem;
}
.gv-cmp-lab {
  font-size: 0.58rem;
  font-weight: 700;
  color: #cbd5e1;
  text-align: center;
  width: 100%;
  margin-bottom: 0.12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gv-cmp-mid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.32rem;
  min-width: 0;
}
.gv-cmp-bar-wrap {
  min-width: 0;
}
.gv-cmp-nh {
  font-size: 0.68rem;
  font-weight: 800;
  color: #60a5fa;
  text-align: right;
  white-space: nowrap;
}
.gv-cmp-na {
  font-size: 0.68rem;
  font-weight: 800;
  color: #f87171;
  text-align: left;
  white-space: nowrap;
}
.gv-cmp-bar {
  display: flex;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(30, 41, 59, 0.9);
}
.gv-cmp-seg {
  display: block;
  height: 100%;
  min-width: 0;
}
.gv-cmp-home {
  background: linear-gradient(90deg, #1d4ed8, #3b82f6);
}
.gv-cmp-away {
  background: linear-gradient(90deg, #b91c1c, #ef4444);
}

.gv-panel[data-gv-panel="stats"] {
  max-height: min(55vh, 520px);
}

.gv-stat-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.35rem;
}
.gv-stat-lab { color: var(--muted); font-weight: 600; }
.gv-stat-home { text-align: right; font-weight: 700; }
.gv-stat-away { text-align: right; font-weight: 700; color: #e2e8f0; }
.gv-poss-bar {
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  margin: 0.15rem 0 0.5rem;
}
.gv-poss-home {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #f97316);
  border-radius: 4px 0 0 4px;
}
.gv-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
.gv-mini {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0.35rem 0.4rem;
}
.gv-mini-lab { display: block; font-size: 0.65rem; color: var(--muted); margin-bottom: 0.12rem; }
.gv-tl-list { list-style: none; margin: 0; padding: 0; }
.gv-tl-item {
  display: flex;
  gap: 0.45rem;
  padding: 0.28rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.8rem;
}
.gv-tl-min { flex-shrink: 0; min-width: 2.4rem; font-weight: 800; color: #34d399; }
.gv-tl-txt { color: #e5e7eb; line-height: 1.3; }

/* Game View timeline — Bet365-style (progress strip + home | clock | away) */
.gv-tl-b365 {
  margin: 0 0.35rem 0.5rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}
.gv-tl-b365-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
}
.gv-tl-b365-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #15803d, #4ade80);
  border-radius: 0 3px 3px 0;
  transition: width 0.4s ease;
}
.gv-tl-b365-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0.25rem 0.45rem;
  position: relative;
}
/* Continuous vertical spine (Bet365-style) */
.gv-tl-b365-list::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0.35rem;
  bottom: 0.45rem;
  width: 2px;
  margin-left: -1px;
  background: rgba(148, 163, 184, 0.42);
  border-radius: 1px;
  pointer-events: none;
  z-index: 0;
}
.gv-tl-b365-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(2.35rem, auto) minmax(0, 1fr);
  align-items: stretch;
  gap: 0 0.15rem;
  padding: 0.42rem 0.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.76rem;
}
.gv-tl-b365-row:last-child {
  border-bottom: none;
}
.gv-tl-b365-lane--home {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 0.35rem;
  text-align: right;
  min-width: 0;
  padding-right: 0.2rem;
}
.gv-tl-b365-lane--away {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0.35rem;
  text-align: left;
  min-width: 0;
  padding-left: 0.2rem;
}
.gv-tl-b365-lane--empty {
  min-height: 0.35rem;
}
.gv-tl-b365-minwrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 0.1rem;
  font-weight: 700;
  font-size: 0.78rem;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  flex-shrink: 0;
}
.gv-tl-b365-minwrap--home {
  align-items: flex-end;
  text-align: right;
  padding-right: 0.35rem;
}
.gv-tl-b365-minwrap--away {
  align-items: flex-start;
  text-align: left;
  padding-left: 0.35rem;
}
.gv-tl-b365-minwrap--neutral {
  padding-top: 0.15rem;
  text-align: center;
}
.gv-tl-b365-row--neutral {
  display: block;
  padding: 0.38rem 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 2;
  background: rgba(15, 23, 42, 0.55);
}
.gv-tl-b365-neutral-span {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 0.55rem 0.85rem;
}
.gv-tl-b365-neutral-span .gv-tl-b365-cardwrap {
  flex: 1 1 10rem;
  min-width: 0;
  max-width: 100%;
  text-align: center;
}
.gv-tl-b365-cardwrap {
  min-width: 0;
  max-width: 100%;
}
.gv-tl-b365-edge {
  width: 3px;
  align-self: stretch;
  min-height: 2rem;
  border-radius: 2px;
  flex-shrink: 0;
}
.gv-tl-b365-edge--home {
  background: linear-gradient(180deg, #22c55e, #15803d);
}
.gv-tl-b365-edge--away {
  background: linear-gradient(180deg, #fb923c, #ea580c);
}
.gv-tl-b365-card {
  display: inline-block;
  text-align: inherit;
  max-width: 100%;
}
.gv-tl-b365-card--goal {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.35rem;
  max-width: 100%;
}
.gv-tl-b365-goal-text {
  min-width: 0;
  text-align: inherit;
}
.gv-tl-b365-card--corner,
.gv-tl-b365-card--offside {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
}
.gv-tl-b365-row--htsep {
  display: block;
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 2;
  background: rgba(0, 0, 0, 0.35);
}
.gv-tl-b365-htsep-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
}
.gv-tl-b365-htsep-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.22);
}
.gv-tl-b365-htsep-text {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.72rem;
  color: #f8fafc;
  letter-spacing: 0.02em;
  text-align: center;
}
.gv-tl-ball-svg,
.gv-tl-corner-flag-svg,
.gv-tl-offside-flag-svg {
  display: block;
  flex-shrink: 0;
}
.gv-tl-corner-flag-svg {
  filter: drop-shadow(0 0.5px 0 rgba(0, 0, 0, 0.55));
}
.gv-tl-b365-ico--ball {
  margin-right: 0;
  line-height: 0;
}
.gv-tl-b365-ico--corner-flag,
.gv-tl-b365-ico--offside {
  margin-right: 0;
  line-height: 0;
}
.gv-tl-b365-subrow {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.gv-tl-arr-h {
  display: inline-block;
  width: 0;
  height: 0;
  flex-shrink: 0;
}
.gv-tl-arr-h--in {
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-right: 7px solid #22c55e;
}
.gv-tl-arr-h--out {
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 7px solid #ef4444;
}
.gv-tl-b365-e-title {
  display: block;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.25;
}
.gv-tl-b365-e-sub {
  margin-top: 0.12rem;
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.3;
  max-width: 14rem;
}
.gv-tl-b365-e-sub--assist {
  margin-top: 0.08rem;
}
.gv-tl-b365-ico {
  display: inline-block;
  margin-right: 0.25rem;
  vertical-align: -0.1em;
  font-size: 0.95rem;
  line-height: 1;
}
.gv-tl-b365-ico--flag {
  width: 0.55rem;
  height: 0.75rem;
  margin-right: 0.35rem;
  background: linear-gradient(180deg, #ef4444 0%, #ef4444 55%, #f8fafc 55%, #f8fafc 100%);
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.gv-tl-b365-ico--card-yellow,
.gv-tl-b365-ico--card-red {
  width: 0.55rem;
  height: 0.75rem;
  border-radius: 2px;
  margin-right: 0.35rem;
}
.gv-tl-b365-ico--card-yellow {
  background: #eab308;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.gv-tl-b365-ico--card-red {
  background: #dc2626;
}
.gv-tl-b365-card--card {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}
.gv-tl-b365-card--card .gv-tl-b365-e-title {
  display: block;
}
.gv-tl-b365-card--card .gv-tl-b365-e-sub {
  display: block;
  margin-top: 0.06rem;
  color: #cbd5e1;
}
.gv-tl-b365-subrows {
  margin-top: 0.2rem;
  text-align: inherit;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.35;
}
.gv-tl-b365-arr {
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.gv-tl-b365-arr--in {
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 7px solid #22c55e;
}
.gv-tl-b365-arr--out {
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid #ef4444;
}

.goal-time, .card-time, .event-time {
  display: inline-block;
  min-width: 2.5rem;
  font-weight: 600;
  color: var(--accent);
}

.goal-scorer { font-weight: 600; }
.goal-assist { color: var(--muted); font-size: 0.85em; }
.goal-team, .card-team { color: var(--muted); font-size: 0.85em; }

.card-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.73rem;
  font-weight: 600;
}

.card-yellow .card-badge { background: #fbc02d; color: #000; }
.card-red .card-badge    { background: #d32f2f; color: #fff; }

#lineups-content { min-height: 120px; }

.lineup-view-list .lineup-team { margin-bottom: 1.5rem; }
.lineup-view-list .lineup-team h4 { margin: 0 0 0.5rem 0; font-size: 0.95rem; color: var(--muted); }
.lineup-view-list .lineup-team ul { margin: 0; padding-left: 1.25rem; font-size: 0.9rem; }
.lineup-view-list .lineup-team ul li { margin-bottom: 0.2rem; }

.lineup-view-formation { display: flex; flex-direction: column; gap: 2rem; }

.formation-pitch {
  background: linear-gradient(180deg, rgba(34,139,34,0.15) 0%, rgba(34,139,34,0.08) 100%);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  position: relative;
}

.formation-pitch::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  pointer-events: none;
}

.formation-team-name { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.75rem; color: var(--text); }
.formation-rows { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.formation-row  { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }

.formation-player {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  min-width: 4.5rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.formation-player .jersey { font-weight: 700; color: var(--accent); }
.formation-player .name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 6rem; margin: 0 auto; }
.formation-player .formation-subon {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(180, 130, 0, 0.95);
  margin-top: 0.15rem;
  line-height: 1.25;
}

.lu-sub-meta {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(180, 130, 0, 0.95);
  margin-left: 0.2rem;
  white-space: normal;
}

.lu-ev-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-left: 0.25rem;
  vertical-align: middle;
}

.lu-ev {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  border-radius: 999px;
  padding: 0.05rem 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
}

.lu-ev-min { display: inline-block; }

.lu-ev-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.7rem;
  height: 0.7rem;
  flex: 0 0 auto;
}

.lu-ev-ic svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  display: block;
}

.lu-ev-ic--card {
  width: 0.62rem;
  height: 0.82rem;
}

.lu-ev-ic--yellow { color: #facc15; }
.lu-ev-ic--red { color: #ef4444; }

.lu-ev--goal { background: rgba(34,197,94,0.2); color: #4ade80; border-color: rgba(34,197,94,0.35); }
.lu-ev--yellow { background: rgba(234,179,8,0.2); color: #facc15; border-color: rgba(234,179,8,0.35); }
.lu-ev--red { background: rgba(239,68,68,0.2); color: #f87171; border-color: rgba(239,68,68,0.35); }
.lu-ev--more { background: rgba(148,163,184,0.2); color: #cbd5e1; border-color: rgba(148,163,184,0.35); }

.lu-ev-wrap--pitch {
  margin-left: 0.12rem;
  margin-top: 0;
  justify-content: flex-start;
  align-items: center;
  flex-shrink: 0;
}

.lu-ev-wrap--pitch .lu-ev {
  padding: 0.1rem 0.36rem;
  font-size: 0.7rem;
}

.lu-ev-wrap--pitch .lu-ev-ic {
  width: 0.78rem;
  height: 0.78rem;
}

.lu-ev-wrap--pitch .lu-ev-ic--card {
  width: 0.66rem;
  height: 0.92rem;
}

.lu-ev-wrap--formation {
  display: flex;
  justify-content: center;
  margin: 0.18rem 0 0;
}

.lu-ev-wrap--formation .lu-ev {
  font-size: 0.56rem;
  padding: 0.02rem 0.24rem;
}

.lu-ev-wrap--card {
  display: flex;
  justify-content: center;
  margin: 0.2rem 0 0.1rem;
}

.lu-ev-wrap--sub {
  margin-left: 0.3rem;
}

/* Sub on (↑ green) / sub off (↓ red) beside lineup names */
.lu-sub-flow {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  margin-left: 0.12rem;
  flex-shrink: 0;
}
.lu-sub-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.lu-sub-ic svg {
  width: 100%;
  height: 100%;
  display: block;
}
.lu-sub-ic--in {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.lu-sub-ic--out {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.lu-ev-wrap--inline {
  margin-left: 0.35rem;
}

.lineup-view-cards { display: flex; flex-direction: column; gap: 1.5rem; }

.player-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.player-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  text-align: center;
}

.player-card .jersey { font-size: 1.5rem; font-weight: 800; color: var(--accent); line-height: 1.2; }
.player-card .name   { font-size: 0.85rem; font-weight: 600; margin-top: 0.25rem; word-break: break-word; }
.player-card .pos    { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; }
.lineup-cards-section h4 { font-size: 0.9rem; color: var(--muted); margin: 0 0 0.5rem 0; }

.lineups-empty-state { text-align: center; padding: 2rem 1rem; color: var(--muted); }

.lineups-empty-state .pitch-placeholder {
  width: 100%;
  max-width: 280px;
  height: 180px;
  margin: 0 auto 1rem;
  background: linear-gradient(180deg, rgba(34,139,34,0.2) 0%, rgba(34,139,34,0.08) 100%);
  border: 2px dashed var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.lineups-empty-state p { margin: 0 0 0.5rem 0; font-size: 0.95rem; }
.lineups-empty-state .hint { font-size: 0.8rem; opacity: 0.8; }
.lineups-loading, .lineups-unavailable { color: var(--muted); font-size: 0.9rem; }

/* Match kickoff alert toast (top-right) */
#match-alert-toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2500;
  max-width: min(420px, calc(100vw - 2rem));
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.22);
  background: linear-gradient(135deg, #15803d, #16a34a);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#match-alert-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  cursor: pointer;
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 700px) {
  .app-layout { flex-direction: column; }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .league-sidebar {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0.4rem 0.5rem;
    gap: 0.25rem;
    scrollbar-width: none;
  }

  .league-sidebar::-webkit-scrollbar { display: none; }
  .league-section-label { display: none; }

  .league-tab {
    flex-shrink: 0;
    width: auto;
    padding: 0.4rem 0.65rem;
    gap: 0.4rem;
  }

  .tab-icon-wrap { width: 22px; height: 22px; }
  .tab-count { display: none; }

  .content-header { padding: 0.9rem 1rem 0.7rem; }
  .content-area main { padding: 0 1rem 1rem; }
}
