/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --green-dark:   #0a2e1a;
  --green:        #00a651;
  --green-mid:    #006b35;
  --green-light:  #e8f5ee;
  --gold:         #f59e0b;
  --gold-light:   #fef3c7;

  --live:         #e8312c;
  --live-bg:      #fff0ef;
  --finished:     #2d7a2d;
  --finished-bg:  #edf7ed;
  --scheduled:    #4a6fa5;
  --scheduled-bg: #eef2f9;
  --postponed:    #7a6f5a;

  --bg:           #f0f3f7;
  --card:         #ffffff;
  --border:       #e2e8f0;
  --ink:          #1a2634;
  --muted:        #6b7c8d;
  --muted-light:  #94a3b8;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow:       0 4px 16px rgba(0,0,0,0.10);
  --radius:       10px;
  --radius-sm:    6px;

  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; }
img { display: block; max-width: 100%; }

/* ── Site header ────────────────────────────────────────────── */
.site-header {
  background: var(--green-dark);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-logo-icon {
  width: 30px;
  height: 30px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.site-logo span { color: var(--green); }

.site-nav {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}
.nav-link {
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.nav-link.active {
  background: var(--green);
  color: #fff;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--live);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  margin-left: 0.3rem;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

/* ── Page wrapper ───────────────────────────────────────────── */
.page-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* ── Hero (homepage only) ───────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 60%, #0d5c2e 100%);
  border-radius: var(--radius);
  padding: 2rem 2rem 1.75rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  color: #fff;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 1;
}
.hero-content { position: relative; }
.hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  background: rgba(0, 166, 81, 0.15);
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  margin-bottom: 0.65rem;
}
.hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.hero p {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  max-width: 480px;
}

/* ── Section header ─────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}
.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--green);
  border-radius: 20px;
  padding: 0.28rem 0.8rem;
  transition: background 0.15s, color 0.15s;
}
.view-all-link:hover { background: var(--green); color: #fff; }

/* ── Date navigation ────────────────────────────────────────── */
.date-bar {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
}
.date-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.15s;
  white-space: nowrap;
}
.date-btn:hover { border-color: var(--green); color: var(--green); }
.date-btn.today-btn {
  background: var(--green-light);
  color: var(--green);
  border-color: var(--green);
}
.date-label {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
}
.date-input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.28rem 0.5rem;
  font: inherit;
  font-size: 0.82rem;
  color: var(--ink);
  background: var(--bg);
}

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs-bar {
  display: flex;
  gap: 0.2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.42rem 1rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.tab-btn:hover { background: var(--bg); color: var(--ink); }
.tab-btn.active {
  background: var(--green-dark);
  color: #fff;
}
.tab-btn.live-tab.active { background: var(--live); }
.tab-count {
  background: rgba(255,255,255,0.25);
  color: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.05rem 0.4rem;
  border-radius: 20px;
  min-width: 1.4rem;
  text-align: center;
}
.tab-btn:not(.active) .tab-count {
  background: var(--bg);
  color: var(--muted);
}

/* ── Search bar ─────────────────────────────────────────────── */
.search-bar {
  position: relative;
  margin-bottom: 0.75rem;
}
.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.95rem;
  pointer-events: none;
}
.search-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 2.5rem 0.6rem 2.3rem;
  font: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.15);
}
.search-clear {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  padding: 0.2rem;
  line-height: 1;
  border-radius: 50%;
}
.search-clear:hover { color: var(--ink); background: var(--bg); }

/* ── Fixture table ──────────────────────────────────────────── */
.fixtures-list { display: flex; flex-direction: column; gap: 0.5rem; }

.league-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.league-group.is-featured {
  border-left: 3px solid var(--gold);
}

.league-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}
.league-header:hover { background: var(--green-light); }
.is-featured .league-header { background: var(--gold-light); }
.is-featured .league-header:hover { background: #fde68a; }

.league-logo { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.league-country-flag { width: 18px; height: 14px; object-fit: cover; flex-shrink: 0; border-radius: 2px; }

.league-name-btn {
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--ink);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  transition: color 0.12s;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.league-name-btn:hover { color: var(--green); }

.league-meta {
  color: var(--muted);
  font-size: 0.76rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.league-country-name { color: var(--muted); font-size: 0.76rem; }
.league-spacer { flex: 1; }

.featured-star {
  color: var(--gold);
  font-size: 0.85rem;
  flex-shrink: 0;
}
.collapse-arrow {
  color: var(--muted);
  font-size: 0.7rem;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.collapse-arrow.open { transform: rotate(180deg); }

/* Fixture rows */
.fixture-row {
  display: grid;
  grid-template-columns: 52px 1fr 90px 1fr 60px;
  align-items: center;
  gap: 0.35rem;
  padding: 0.48rem 0.75rem;
  border-top: 1px solid #f0f3f7;
  cursor: pointer;
  transition: background 0.1s;
}
.fixture-row:first-child { border-top: none; }
.fixture-row:hover { background: #f8fafc; }

.fix-time {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}
.fix-time.is-live { color: var(--live); }
.fix-time.is-finished { color: var(--finished); }

.fix-team {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.fix-team.away { flex-direction: row-reverse; text-align: right; }
.team-logo-xs { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.team-name {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}
.team-name.winner { font-weight: 700; }

.fix-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
}
.score-num {
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  min-width: 24px;
  text-align: center;
  line-height: 1.4;
}
.score-num.live { background: var(--live); }
.score-dash { color: var(--muted); font-size: 0.75rem; }
.score-vs { color: var(--muted-light); font-size: 0.8rem; font-weight: 600; }

.fix-badge {
  text-align: center;
  flex-shrink: 0;
}
.status-pill {
  display: inline-block;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.12rem 0.45rem;
  border-radius: 20px;
  white-space: nowrap;
}
.pill-live     { background: var(--live-bg);      color: var(--live); }
.pill-ft       { background: var(--finished-bg);   color: var(--finished); }
.pill-ns       { background: var(--scheduled-bg);  color: var(--scheduled); }
.pill-other    { background: #f3f4f6;              color: var(--muted); }

/* ── Live dot ────────────────────────────────────────────────── */
.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--live);
  border-radius: 50%;
  animation: live-pulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes live-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.4); opacity: 0.6; }
}

/* ── Empty / loading ────────────────────────────────────────── */
.state-msg {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.spinner {
  display: inline-block;
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: 0.75rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 18, 0.65);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(3px);
}
.modal-box {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: #fafbfc;
}
.modal-head h2 { font-size: 0.95rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
}
.modal-close:hover { background: var(--bg); color: var(--ink); }
.modal-back {
  background: none;
  border: none;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem 0.2rem 0.1rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.modal-back:hover { background: var(--green-light); }
.modal-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 1.1rem; }

/* Modal sub-tabs */
.modal-tabs {
  display: flex;
  gap: 0.2rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.modal-tab {
  background: none;
  border: none;
  padding: 0.45rem 0.85rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}
.modal-tab:hover { color: var(--ink); }
.modal-tab.active { color: var(--green); border-bottom-color: var(--green); }

/* Match hero */
.match-hero {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  text-align: center;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}
.match-team { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.match-team-logo { width: 56px; height: 56px; object-fit: contain; }
.match-team-name {
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.12s;
}
.match-team-name:hover { color: var(--green); }

.match-score-block { text-align: center; }
.match-score-nums {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  justify-content: center;
}
.match-score-sep { color: var(--muted); font-size: 1.6rem; font-weight: 300; }
.match-status-pill {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
}
.match-meta-info {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 1rem;
  line-height: 1.8;
}
.match-meta-info a { color: var(--green); cursor: pointer; }
.match-meta-info a:hover { text-decoration: underline; }

/* Events — two-column half layout */
.events-half-header {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: #f4f6f8;
  padding: 0.35rem;
  margin: 0.5rem -1.1rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.event-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 34px;
  border-bottom: 1px solid #f2f4f7;
}
.event-row:last-child { border-bottom: none; }
.event-side {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.3rem 0.2rem;
  font-size: 0.8rem;
}
.event-side.away {
  flex-direction: row-reverse;
  border-left: 1px solid #f2f4f7;
}
.ev-min { font-size: 0.7rem; color: var(--muted); font-weight: 700; white-space: nowrap; min-width: 26px; }
.ev-ico { font-size: 0.88rem; flex-shrink: 0; }
.ev-text { display: flex; flex-direction: column; }
.event-side.away .ev-text { align-items: flex-end; }
.ev-player { font-weight: 600; line-height: 1.2; }
.ev-assist { color: var(--muted); font-size: 0.71rem; }

/* Stats */
.stat-rows { display: flex; flex-direction: column; gap: 0.5rem; }
.stat-row {
  display: grid;
  grid-template-columns: 40px 1fr 130px 1fr 40px;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
}
.stat-val { font-weight: 700; }
.stat-val:first-child { text-align: right; }
.stat-label { text-align: center; color: var(--muted); font-size: 0.7rem; line-height: 1.3; }
.stat-bar-wrap { height: 6px; background: #eef0f3; border-radius: 3px; overflow: hidden; display: flex; }
.stat-bar-wrap.home { justify-content: flex-end; }
.stat-bar-wrap.away { justify-content: flex-start; }
.stat-bar-wrap.home .stat-bar-fill { background: var(--green); height: 100%; border-radius: 3px; }
.stat-bar-wrap.away .stat-bar-fill { background: var(--live); height: 100%; border-radius: 3px; }

/* Lineups — pitch (matches API-Football widget) */
.pitch-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  border: 8px solid #77c671;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  box-sizing: border-box;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.pitch-field {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    #6ab04c 5%,#77c671 5%,#77c671 10%,#6ab04c 10%,#6ab04c 15%,#77c671 15%,
    #77c671 20%,#6ab04c 20%,#6ab04c 25%,#77c671 25%,#77c671 30%,#6ab04c 30%,
    #6ab04c 35%,#77c671 35%,#77c671 40%,#6ab04c 40%,#6ab04c 45%,#77c671 45%,
    #77c671 50%,#6ab04c 50%,#6ab04c 55%,#77c671 55%,#77c671 60%,#6ab04c 60%,
    #6ab04c 65%,#77c671 65%,#77c671 70%,#6ab04c 70%,#6ab04c 75%,#77c671 75%,
    #77c671 80%,#6ab04c 80%,#6ab04c 85%,#77c671 85%,#77c671 90%,#6ab04c 90%,
    #6ab04c 95%,#77c671 95%,#77c671);
  border: 2px solid white;
  overflow: hidden;
}
.pitch-overlay { position: absolute; inset: 0; }
.pitch-half-line {
  position: absolute;
  width: 2px; height: 100%;
  background: #fff;
  left: 50%; transform: translateX(-50%);
}
.pitch-center-circle {
  position: absolute;
  width: 12%; height: 24%;
  border: 2px solid white;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.pitch-penalty-box {
  position: absolute;
  width: 16.5%; height: 55%;
  border: 2px solid white;
  top: 0; bottom: 0; margin: auto;
}
.pitch-penalty-box.home { left: -2px; }
.pitch-penalty-box.away { right: -2px; }
.pitch-goal-box {
  position: absolute;
  width: 5.5%; height: 16%;
  border: 2px solid white;
  top: 0; bottom: 0; margin: auto;
}
.pitch-goal-box.home { left: -2px; }
.pitch-goal-box.away { right: -2px; }
.pitch-corner {
  position: absolute;
  width: 20px; height: 20px;
  border: 2px solid white;
  border-radius: 50%;
  background: transparent;
}
.pitch-corner.top-left    { top: -10px; left: -10px; border-top: none; border-left: none; }
.pitch-corner.top-right   { top: -10px; right: -10px; border-top: none; border-right: none; }
.pitch-corner.bottom-left { bottom: -10px; left: -10px; border-bottom: none; border-left: none; }
.pitch-corner.bottom-right{ bottom: -10px; right: -10px; border-bottom: none; border-right: none; }
.pitch-penalty-spot {
  position: absolute;
  width: 4px; height: 4px;
  background: #fff;
  border-radius: 50%;
  top: 50%; transform: translateY(-50%);
}
.pitch-penalty-spot.home { left: 11%; }
.pitch-penalty-spot.away { right: 11%; }
.player-dot {
  position: absolute;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  z-index: 2;
  pointer-events: none;
}
.player-home { background: #1a6b38; }
.player-away { background: #c0392b; }

/* Lineups — sections */
.lu-section { margin-bottom: 0.75rem; }
.lu-section-title {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--muted);
  background: #f4f6f8;
  padding: 0.3rem;
  margin: 0 -1.1rem 0.4rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.lu-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-size: 0.82rem;
  padding: 0.1rem 0;
}
.text-right { text-align: right; }
.lu-players { display: grid; grid-template-columns: 1fr 1fr; }
.lu-pl {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.15rem;
  font-size: 0.76rem;
  border-bottom: 1px solid #f2f4f7;
  min-height: 28px;
}
.lu-pl.away {
  flex-direction: row-reverse;
  border-left: 1px solid #f2f4f7;
}
.lu-num { color: var(--muted); min-width: 18px; font-size: 0.7rem; }
.lu-pl.away .lu-num { text-align: right; }
.lu-name { flex: 1; font-size: 0.75rem; }
.lu-pl.away .lu-name { text-align: right; }
.lu-pos { color: var(--green); font-size: 0.68rem; font-weight: 600; }

/* Players tab */
.players-team-block { margin-bottom: 1.25rem; }
.players-team-header {
  font-weight: 700;
  font-size: 0.82rem;
  background: var(--green);
  color: #fff;
  padding: 0.4rem 0.75rem;
  border-radius: 4px 4px 0 0;
  margin-bottom: 0;
}
.players-table-wrap { overflow-x: auto; }
.players-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  min-width: 520px;
}
.players-tbl th {
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.67rem;
  padding: 0.25rem 0.3rem;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.players-tbl th:nth-child(2) { text-align: left; }
.players-tbl td {
  text-align: center;
  padding: 0.25rem 0.3rem;
  border-bottom: 1px solid #f0f3f7;
}
.players-tbl tr:last-child td { border-bottom: none; }
.players-tbl tr:hover td { background: #f8fafc; }
.pl-name-cell { text-align: left; font-weight: 600; white-space: nowrap; }
.rtg-good { color: var(--green); font-weight: 700; }
.rtg-bad  { color: var(--live); }

/* Standings */
.standings-group-title { font-weight: 700; font-size: 0.82rem; margin: 0.75rem 0 0.35rem; }
.standings-group-title:first-child { margin-top: 0; }
.standings-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.standings-tbl th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.7rem;
  padding: 0.25rem 0.35rem;
  border-bottom: 2px solid var(--border);
}
.standings-tbl td { padding: 0.3rem 0.35rem; border-bottom: 1px solid #f0f3f7; }
.standings-tbl tr:last-child td { border-bottom: none; }
.standings-tbl tr:hover td { background: #f8fafc; }
.team-link-cell {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}
.team-link-cell:hover .tl-name { color: var(--green); text-decoration: underline; }
.logo-xxs { width: 15px; height: 15px; object-fit: contain; }
.form-cells { display: flex; gap: 2px; }
.form-cell {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fc-w { background: var(--finished); }
.fc-d { background: var(--gold); }
.fc-l { background: var(--live); }

/* Team modal */
.team-hero { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.team-hero-logo { width: 60px; height: 60px; object-fit: contain; }
.team-hero-info h2 { font-size: 1.1rem; font-weight: 700; }
.team-hero-info p { color: var(--muted); font-size: 0.8rem; margin-top: 0.2rem; }

.results-list { display: flex; flex-direction: column; gap: 0.25rem; }
.result-row {
  display: grid;
  grid-template-columns: 1fr 60px 1fr 58px;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
}
.result-row:hover { background: var(--bg); }
.result-team {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}
.result-team.home { justify-content: flex-end; }
.result-team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-logo { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; }
.result-score {
  font-weight: 700;
  background: var(--ink);
  color: #fff;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.78rem;
  text-align: center;
  white-space: nowrap;
}
.result-date { color: var(--muted); font-size: 0.74rem; text-align: right; }

.squad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.squad-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.squad-card:hover { border-color: var(--green); box-shadow: 0 2px 8px rgba(0,166,81,0.15); }
.squad-photo { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.squad-num { font-size: 0.66rem; color: var(--muted); }
.squad-name { font-size: 0.76rem; font-weight: 600; }
.squad-pos { font-size: 0.66rem; color: var(--green); font-weight: 600; }

/* Player detail popup */
.player-popup-backdrop {
  position: absolute;
  inset: -1.1rem;
  background: rgba(10,25,18,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 1rem;
}
.player-popup {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 360px;
  position: relative;
}
.player-popup-close {
  position: absolute;
  top: 0.45rem; right: 0.45rem;
  background: none; border: none;
  font-size: 1.1rem; color: var(--muted);
  cursor: pointer; line-height: 1;
  padding: 0.15rem 0.3rem; border-radius: 4px;
}
.player-popup-close:hover { background: var(--bg); color: var(--ink); }
.player-popup-inner {
  display: flex;
  gap: 0.85rem;
  padding: 1rem;
  align-items: flex-start;
}
.player-popup-photo {
  width: 76px; height: 76px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--bg);
}
.player-popup-details { flex: 1; min-width: 0; padding-right: 1.5rem; }
.player-popup-name { font-weight: 700; font-size: 0.92rem; line-height: 1.2; margin-bottom: 0.1rem; }
.player-popup-team { color: var(--muted); font-size: 0.76rem; margin-bottom: 0.6rem; }
.player-popup-stats { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pps-item {
  display: flex; flex-direction: column;
  background: var(--bg);
  padding: 0.28rem 0.45rem;
  border-radius: var(--radius-sm);
  min-width: 52px;
}
.pps-label { font-size: 0.6rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.pps-val { font-size: 0.8rem; font-weight: 700; margin-top: 0.1rem; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--green-dark);
  color: rgba(255,255,255,0.55);
  font-size: 0.8rem;
  text-align: center;
  padding: 1.5rem 1rem;
  margin-top: 3rem;
}
.site-footer a { color: var(--green); }
.site-footer strong { color: rgba(255,255,255,0.85); }

/* ── Utilities ──────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--muted); }
.text-green { color: var(--green); }
.text-live  { color: var(--live); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 860px) {
  .fixture-row { grid-template-columns: 46px 1fr 80px 1fr 52px; gap: 0.25rem; }
  .team-name { font-size: 0.76rem; }
  .match-score-nums { font-size: 1.9rem; }
}
@media (max-width: 600px) {
  /* ── Header ── */
  .header-inner { gap: 0.4rem; padding: 0 0.75rem; height: 48px; }
  .site-logo { font-size: 1rem; gap: 0.35rem; }
  .site-logo-icon { width: 26px; height: 26px; font-size: 0.9rem; }
  .nav-link { padding: 0.25rem 0.55rem; font-size: 0.8rem; }
  .header-inner > a.nav-link { display: none; }

  /* ── Page ── */
  .page-wrap { padding: 0.75rem 0.6rem 2rem; }
  .hero { padding: 1.25rem; }
  .hero h1 { font-size: 1.4rem; }

  /* ── Tabs bar — fit all 4 tabs ── */
  .tabs-bar { padding: 0.25rem; gap: 0.15rem; }
  .tab-btn { padding: 0.35rem 0.55rem; font-size: 0.76rem; gap: 0.25rem; }
  .tab-count { font-size: 0.63rem; padding: 0.03rem 0.3rem; min-width: 1.1rem; }

  /* ── Fixture rows — 4-col grid, drop hidden badge column ── */
  .fixture-row {
    grid-template-columns: 38px 1fr 66px 1fr;
    padding: 0.4rem 0.6rem;
    gap: 0.25rem;
  }
  .fix-badge { display: none; }
  .team-name { font-size: 0.75rem; }

  /* ── League header — prevent name wrapping ── */
  .league-name-btn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .league-meta { font-size: 0.7rem; }
  .league-header { padding: 0.45rem 0.6rem; gap: 0.35rem; }

  /* ── Modal — stay at top ── */
  .modal-backdrop { align-items: flex-start; padding: 0.75rem 0.5rem 0.5rem; }
  .modal-box { max-height: 92vh; border-radius: var(--radius); width: 100%; }
  .modal-body { overflow-x: hidden; }

  /* ── Stats / pitch ── */
  .squad-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .stat-row { grid-template-columns: 32px 1fr 90px 1fr 32px; }
  /* Pitch: smaller dots on narrow screens */
  .player-dot { width: 20px; height: 20px; font-size: 8px; }
}
