/* =========================================================
   Football Live Scores — Dark Neon + Light theme
   CSS variables drive both themes. Edit :root for dark,
   body.light for light overrides.
   ========================================================= */

:root {
  --bg:        #17211c;
  --surface:   #101713;
  --surface-2: #141d18;
  --shell-bg:  #111a15;
  --header-bg: #111a15;
  --app-bg:    #17211c;
  --text:      #a7b4ad;
  --text-strong: #e3e8e5;
  --muted:     #a7b4ad;
  --border:    #26342d;
  --border-strong: rgba(38,52,45,0.85);
  --accent:    #2bd86b;
  --accent-2:  #16a34a;
  --danger:    #ff4757;
  --warn:      #ffc83a;
  --info:      #63b3ff;
  --icon:      #cfd6d2;
  --row-bg:    linear-gradient(180deg, #101713, #141d18);
  --tracker-tooltip-bg: #141d18;
  --tracker-tooltip-border: #26342d;
  --tracker-tooltip-title: #e3e8e5;
  --tracker-tooltip-text: #a7b4ad;
  --tracker-tooltip-accent: #2bd86b;
  --profile-card-bg: #141d18;
  --profile-card-border: #26342d;
  --profile-text: #e3e8e5;
  --profile-muted: #a7b4ad;
  --profile-secondary-button-bg: rgba(255,255,255,0.04);
  --profile-secondary-button-text: #e3e8e5;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(43,216,107,0.07), transparent 60%),
    radial-gradient(800px 500px at 50% 110%, rgba(43,216,107,0.04), transparent 60%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-y: auto;
  display: flex; justify-content: center; align-items: stretch;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img { display: block; max-width: 100%; }

/* ---------- App container (the "phone") ---------- */
.app {
  width: 100%; max-width: 430px; min-height: 100vh;
  background: linear-gradient(180deg, var(--app-bg) 0%, #121915 100%);
  position: relative; display: flex; flex-direction: column;
  padding-bottom: 92px;
}
body.light .app { background: linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%); }

/* Tablet framed look */
@media (min-width: 700px) and (max-width: 1023px) {
  body { padding: 32px 16px; align-items: flex-start; }
  .app {
    min-height: calc(100vh - 64px);
    border-radius: 36px;
    border: 1px solid rgba(57, 255, 130, 0.35);
    box-shadow: 0 0 0 1px rgba(57, 255, 130, 0.15), 0 0 30px rgba(57, 255, 130, 0.25),
                0 0 80px rgba(57, 255, 130, 0.18) inset, 0 30px 80px rgba(0,0,0,0.6);
    overflow-x: hidden;
    overflow-y: visible;
  }
}


@media (max-width: 1023px) {
  .app {
    min-height: auto;
    padding-bottom: calc(132px + env(safe-area-inset-bottom));
  }
}

/* ---------- Top header ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 6px; }
.topbar h1 { font-size: 20px; letter-spacing: 0.5px; font-weight: 800; color: var(--text-strong); }
.topbar .icon-btn { position: relative; padding: 6px; color: var(--icon); }
.topbar .icon-btn:hover { color: var(--text-strong); }
.dot-red { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 6px var(--danger); }

.topbar-back { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px 8px; font-size: 13px; color: var(--icon); letter-spacing: 1.2px; }
.topbar-back .title { flex: 1; text-align: center; font-weight: 700; }
.topbar-back .back, .topbar-back .share { padding: 6px 8px; color: var(--icon); }
.topbar-back .back:hover, .topbar-back .share:hover { color: var(--text-strong); }

/* ---------- Date strip ---------- */
.date-strip { display: flex; gap: 8px; padding: 10px 14px 4px; overflow-x: auto; scrollbar-width: none; }
.date-strip::-webkit-scrollbar { display: none; }
.date-chip {
  flex: 0 0 auto; text-align: center; padding: 8px 10px; border-radius: 12px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  color: var(--icon); min-width: 52px; transition: all 0.2s ease; cursor: pointer;
}
.date-chip small { display: block; font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.date-chip strong { display: block; font-size: 14px; font-weight: 700; }
.date-chip.live {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #06140a; border-color: transparent;
  box-shadow: 0 6px 20px rgba(43, 216, 107, 0.35);
}
.date-chip.live small { color: #06140a; opacity: 0.85; }
.date-chip:hover:not(.live) { background: rgba(255,255,255,0.06); color: var(--text-strong); }

/* ---------- Section titles ---------- */
.section-title { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.section-title h2 { font-size: 14px; letter-spacing: 1.5px; font-weight: 700; color: var(--text); text-transform: uppercase; }
.section-title .meta { font-size: 11px; color: var(--accent); letter-spacing: 1px; }
.section-title .league-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--text-strong); }
.section-title .league-badge {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, #6f42c1, var(--accent));
  display: inline-block;
}

/* ---------- Hot matches ---------- */
.hot-section { position: relative; }
.hot-row { display: flex; gap: 10px; overflow-x: auto; padding: 4px 14px 6px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.hot-row::-webkit-scrollbar { display: none; }
.hot-card {
  flex: 0 0 78%; scroll-snap-align: start;
  background: var(--row-bg); border: 1px solid var(--border); border-radius: 14px; padding: 12px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.hot-card:hover { border-color: rgba(43,216,107,0.4); transform: translateY(-2px); }
.hot-card .team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hot-card .team.right { justify-content: flex-end; }
.hot-card .team .name { font-weight: 700; font-size: 13px; color: var(--text-strong); }
.hot-card .score { font-weight: 800; font-size: 16px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text-strong); }
.hot-card .score small { font-size: 10px; color: var(--muted); font-weight: 600; }

/* Hot carousel arrow + dots */
.hot-arrow {
  position: absolute; top: 0; right: 14px;
  background: rgba(255,255,255,0.06); border-radius: 8px; padding: 4px 8px;
  color: var(--text-strong); font-size: 14px;
}
.hot-arrow:hover { background: rgba(43,216,107,0.18); color: var(--accent); }
.hot-dots { display: flex; gap: 6px; justify-content: center; padding: 6px 0 2px; }
.hot-dots .dot {
  width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.12); cursor: pointer;
  transition: background 0.15s ease, width 0.15s ease;
}
.hot-dots .dot.active { background: var(--accent); width: 18px; border-radius: 3px; }

/* ---------- Match list ---------- */
.match-list { display: flex; flex-direction: column; gap: 6px; padding: 4px 14px; }
.match-row {
  display: grid; grid-template-columns: 16px 1fr 60px 1fr 24px;
  align-items: center; gap: 8px; padding: 12px;
  background: var(--row-bg); border: 1px solid var(--border); border-radius: 12px;
  transition: transform 0.15s ease, border-color 0.2s ease;
  cursor: pointer;
}
.match-row:hover { border-color: rgba(43,216,107,0.35); transform: translateY(-1px); }
.match-row .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.match-row .live-dot.off { background: #3a3f48; box-shadow: none; }
.match-row .home, .match-row .away { display: flex; align-items: center; gap: 8px; min-width: 0; }
.match-row .away { justify-content: flex-end; }
.match-row .name { font-size: 13px; font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-row .center { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.match-row .score-pill { font-weight: 800; font-size: 14px; color: var(--text-strong); }
.match-row .minute { font-size: 10px; font-weight: 700; color: var(--accent);
  background: rgba(43,216,107,0.14); padding: 2px 6px; border-radius: 6px; }
.match-row .meta-time { color: var(--muted); font-size: 10px; }
.match-row .star { color: #5a606b; font-size: 18px; line-height: 1; padding: 4px;
  transition: color 0.15s ease, transform 0.15s ease; }
.match-row .star.active { color: var(--accent); text-shadow: 0 0 8px rgba(43,216,107,0.6); }
.match-row .star:hover { transform: scale(1.15); color: var(--accent); }
.match-row .red-card { display: inline-block; width: 7px; height: 10px; background: var(--danger);
  border-radius: 1px; margin-left: 4px; vertical-align: middle; }

/* ---------- Team logos ---------- */
.logo {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #4a4f5a, #1c2028);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; color: var(--text-strong);
  border: 1px solid rgba(255,255,255,0.1); flex-shrink: 0;
}
.logo.lg { width: 56px; height: 56px; font-size: 14px; }
.logo.t-mnc  { background: linear-gradient(135deg, #6CABDD, #1f4f8b); }
.logo.t-ars  { background: linear-gradient(135deg, #EF0107, #8b1010); }
.logo.t-rma  { background: linear-gradient(135deg, #f5f5f5, #b8b8b8); color: #1a1a1a; }
.logo.t-bar  { background: linear-gradient(135deg, #A50044, #004D98); }
.logo.t-lba  { background: linear-gradient(135deg, #fdb913, #8b6914); color: #1a1a1a; }
.logo.t-arg  { background: linear-gradient(135deg, #75AADB, #0a3d7a); }
.logo.t-usb  { background: linear-gradient(135deg, #d8232a, #6e1216); }
.logo.t-hbs  { background: linear-gradient(135deg, #ffd700, #6b5400); color: #1a1a1a; }
.logo.t-smlh { background: linear-gradient(135deg, #34a853, #1a5a2a); }
.logo.t-vsc  { background: linear-gradient(135deg, #ff8c00, #6b3700); }

/* ---------- ALL LIVE toggle ---------- */
.all-live-wrap { position: sticky; bottom: 80px; display: flex; justify-content: center; margin: 12px 0 0; pointer-events: none; }

/* Mobile: ALL LIVE must NOT float/sticky over match cards */
@media (max-width: 1023px) {
  .all-live-wrap {
    position: relative !important;
    bottom: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    margin: 20px auto 28px !important;
    z-index: 3 !important;
  }
}
.all-live { pointer-events: auto; display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #06140a; font-weight: 800; font-size: 13px; padding: 10px 16px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(43,216,107,0.45); letter-spacing: 0.5px; transition: filter 0.2s ease; }
.all-live:hover { filter: brightness(1.05); }
.all-live .switch { width: 30px; height: 16px; border-radius: 999px; background: rgba(0,0,0,0.25); position: relative; transition: background 0.2s ease; }
.all-live .switch::after { content: ""; position: absolute; top: 2px; left: 16px; width: 12px; height: 12px; background: #fff; border-radius: 50%; transition: left 0.2s ease; }
.all-live.off .switch::after { left: 2px; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  background: rgba(8,10,14,0.95); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); padding: 8px 10px 14px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; z-index: 50;
}
@media (min-width: 700px) and (max-width: 1023px) {
  .bottom-nav { border-radius: 0 0 36px 36px; width: calc(100% - 32px); max-width: 430px; bottom: 32px; }
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 10px; color: var(--muted); padding: 6px 4px; border-radius: 10px; transition: color 0.15s ease; }
.bottom-nav a .ic { font-size: 18px; line-height: 1; }
.bottom-nav a:hover { color: var(--text-strong); }
.bottom-nav a.active { color: var(--accent); }
.bottom-nav a.active .ic { filter: drop-shadow(0 0 6px rgba(43,216,107,0.7)); }

/* ---------- Match Detail ---------- */
.score-hero { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; padding: 18px 18px 8px; }
.score-hero .team-block { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.score-hero .team-block .name { font-size: 12px; letter-spacing: 1px; color: var(--text); font-weight: 700; text-align: center; }
.score-hero .big-score { font-size: 44px; font-weight: 800; letter-spacing: -1px; color: var(--text-strong); text-align: center; }

.card { background: var(--row-bg); border: 1px solid var(--border); border-radius: 16px; margin: 10px 14px; padding: 14px; }
.card .card-title { display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; letter-spacing: 1.5px; color: var(--text); font-weight: 700; margin-bottom: 10px; text-transform: uppercase; }
.card .card-title .expand { color: var(--muted); }
.card p { color: var(--text); }

/* Pitch */
.pitch {
  position: relative; height: 160px; border-radius: 10px;
  background:
    radial-gradient(80px 60px at 35% 50%, rgba(43,216,107,0.55), transparent 70%),
    radial-gradient(60px 40px at 55% 40%, rgba(43,216,107,0.45), transparent 70%),
    radial-gradient(90px 70px at 60% 60%, rgba(43,216,107,0.6),  transparent 70%),
    radial-gradient(50px 40px at 75% 50%, rgba(43,216,107,0.35), transparent 70%),
    linear-gradient(180deg, #13201a, #0f1713);
  border: 1px solid rgba(43,216,107,0.15); overflow: hidden;
}
.pitch::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: rgba(255,255,255,0.15); }
.pitch .center-circle { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,0.15); transform: translate(-50%,-50%); }
.pitch .ball { position: absolute; top: 50%; left: 35%; width: 8px; height: 8px; border-radius: 50%;
  background: #fff; transform: translate(-50%,-50%); box-shadow: 0 0 8px rgba(255,255,255,0.6); }
.pitch-zones { position: absolute; inset: 0; }
.heatmap-zone {
  position: absolute;
  background: rgba(43,216,107,0.08);
  border: 1px solid rgba(43,216,107,0.10);
  border-radius: 8px;
  color: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.heatmap-zone:hover,
.heatmap-zone.active { background: rgba(43,216,107,0.18); border-color: rgba(43,216,107,0.35); }
.heatmap-tooltip {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--tracker-tooltip-bg);
  border: 1px solid var(--tracker-tooltip-border);
  color: var(--tracker-tooltip-title);
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 12px 30px rgba(0,0,0,0.28);
}
.heatmap-tooltip strong { display: block; font-size: 12px; margin-bottom: 2px; color: var(--tracker-tooltip-accent); }
.heatmap-tooltip small { display: block; color: var(--tracker-tooltip-text); font-size: 11px; }
.timeline { display: flex; align-items: center; gap: 4px; margin-top: 10px; height: 14px; }
.timeline .tick { flex: 1; height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; }
.timeline .tick.evt { background: var(--accent); box-shadow: 0 0 6px rgba(43,216,107,0.6); }
.timeline-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 4px; }

/* Tabs */
/* Tabs — horizontally scrollable on all screens so the 9 tabs fit on mobile too */
.tabs { display: flex; gap: 0; margin: 12px 14px 0; border-bottom: 1px solid var(--border);
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; white-space: nowrap; touch-action: pan-x; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; padding: 12px 14px; text-align: center;
  font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--muted); position: relative;
  transition: color 0.15s ease; white-space: nowrap; min-width: max-content; }
.tab.active { color: var(--text-strong); }
.tab.active::after { content: ""; position: absolute; bottom: -1px; left: 20%; right: 20%; height: 2px;
  background: var(--accent); border-radius: 2px; box-shadow: 0 0 8px rgba(43,216,107,0.7); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.event-filters { display: flex; gap: 8px; padding: 0 0 10px; flex-wrap: wrap; }
.event-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.event-chip.active { color: var(--text-strong); border-color: rgba(43,216,107,0.35); background: rgba(43,216,107,0.12); }
.event-summary {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--row-bg);
  border: 1px solid var(--border);
  color: var(--text-strong);
  font-size: 12px;
  line-height: 1.5;
}
/* Inside Standings tab, highlight the two competing teams */
.table-row.active { background: rgba(43,216,107,0.07); }

/* Stats */
.stat-row { padding: 10px 0; }
.stat-row .label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text); margin-bottom: 6px; font-weight: 600; letter-spacing: 0.5px; }
.stat-row .label .name { color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: 1px; }
.stat-row .bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.06); overflow: hidden; position: relative; }
.stat-row .bar .fill-h, .stat-row .bar .fill-a {
  position: absolute; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.6s ease;
}
.stat-row .bar .fill-h { left: 0; }
.stat-row .bar .fill-a { right: 0; opacity: 0.55; }

/* ---------- Lineups ---------- */
.formations { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 14px; }
@media (max-width: 360px) { .formations { grid-template-columns: 1fr; } }
@media (max-width: 540px) { .formations { grid-template-columns: 1fr; } }
.formation-label { text-align: center; font-weight: 800; font-size: 16px; padding: 8px 0; color: var(--text-strong); }
.mini-pitch {
  position: relative; height: 240px; border-radius: 12px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.02) 0 12px, transparent 12px 24px),
    linear-gradient(180deg, #132019, #0f1713);
  border: 1px solid rgba(43,216,107,0.18); overflow: hidden;
}
.mini-pitch::before { content: ""; position: absolute; top: 50%; left: 8%; right: 8%; height: 1px; background: rgba(255,255,255,0.12); }
.mini-pitch::after { content: ""; position: absolute; top: 50%; left: 50%; width: 36px; height: 36px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,0.15); transform: translate(-50%,-50%); }
.player { position: absolute; transform: translate(-50%,-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; width: 44px; }
.player .shirt { width: 22px; height: 22px; border-radius: 4px 4px 8px 8px;
  background: linear-gradient(180deg, #6CABDD, #1f4f8b); box-shadow: 0 2px 6px rgba(0,0,0,0.5); }
.player.away .shirt { background: linear-gradient(180deg, #EF0107, #8b1010); }
.player.gk .shirt    { background: linear-gradient(180deg, #ffd400, #8b7400); }
.player .pname { font-size: 9px; color: var(--text-strong); font-weight: 600; white-space: nowrap; max-width: 60px; overflow: hidden; text-overflow: ellipsis; }
.player .prating { font-size: 8px; color: var(--accent); font-weight: 700; }

.subs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 6px 14px; }
.subs-grid .sub-list h4 { font-size: 11px; letter-spacing: 1.5px; color: var(--muted); font-weight: 700; margin-bottom: 8px; text-transform: uppercase; }
.sub-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 12px; color: var(--text); }
.sub-row .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-row .prating { color: var(--accent); font-weight: 700; font-size: 11px; }

.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
.btn { padding: 12px 14px; border-radius: 12px; font-weight: 700; letter-spacing: 1px; font-size: 13px;
  text-align: center; transition: filter 0.15s ease, transform 0.15s ease; display: inline-block; cursor: pointer; }
.btn-secondary { background: rgba(255,255,255,0.04); border: 1px solid var(--border-strong); color: var(--text); }
.btn-primary   { background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: #06140a;
  box-shadow: 0 8px 24px rgba(43,216,107,0.35); }
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 100;
  display: none; align-items: flex-end; justify-content: center; backdrop-filter: blur(4px); }
.modal-backdrop.open { display: flex; }
.modal { width: 100%; max-width: 430px;
  background: linear-gradient(180deg, #11161e, #0a0d12);
  border: 1px solid rgba(43,216,107,0.25); border-bottom: none;
  border-radius: 20px 20px 0 0; padding: 18px; animation: slideUp 0.25s ease; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.modal h3 { font-size: 16px; font-weight: 800; margin-bottom: 4px; display: flex; justify-content: space-between; align-items: center; color: var(--text-strong); }
.modal h3 .close { color: var(--muted); font-size: 22px; line-height: 1; padding: 4px; }
.modal .lead { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.modal .analysis-block { padding: 10px 12px; background: rgba(255,255,255,0.03); border-radius: 10px;
  margin-bottom: 8px; border: 1px solid var(--border); }
.modal .analysis-block h4 { font-size: 11px; letter-spacing: 1.5px; color: var(--accent); font-weight: 800; text-transform: uppercase; margin-bottom: 4px; }
.modal .analysis-block p { font-size: 13px; color: var(--text); line-height: 1.5; }

/* ---------- Standings ---------- */
.dropdown { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
  margin: 10px 14px; background: var(--row-bg); border: 1px solid var(--border); border-radius: 12px;
  font-weight: 700; font-size: 13px; cursor: pointer; color: var(--text-strong); }
.dropdown.muted { background: rgba(255,255,255,0.02); }
.dropdown small { color: var(--muted); font-size: 10px; letter-spacing: 1px; display: block; font-weight: 600; }
.dropdown .left { display: flex; align-items: center; gap: 10px; }
.dropdown.open + .dropdown-list { display: block; }
.dropdown-list { display: none; margin: -6px 14px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.dropdown-list button { display: block; width: 100%; text-align: left; padding: 12px 14px; font-size: 13px; color: var(--text); }
.dropdown-list button:hover { background: rgba(43,216,107,0.08); color: var(--text-strong); }

.table-card { padding: 4px 0; }
.table-head, .table-row {
  display: grid; grid-template-columns: 28px 1fr 28px 28px 28px 28px 36px 36px;
  align-items: center; gap: 4px; padding: 10px 14px;
}
.table-head { font-size: 10px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.table-head .team { text-align: left; }
.table-row { font-size: 12px; color: var(--text); border-left: 3px solid transparent; transition: background 0.15s ease; }
.table-row:hover { background: rgba(255,255,255,0.02); }
.table-row.top { border-left-color: var(--accent); background: rgba(43,216,107,0.04); }
.table-row .team { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.table-row .num { text-align: center; }
.table-row .pts { text-align: center; font-weight: 800; color: var(--text-strong); }

.scorers .scorer-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.scorers .scorer-row:first-of-type { border-top: none; }
.scorer-photo { width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #1f4f8b);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: var(--text-strong); flex-shrink: 0; }
.scorer-row .pname { flex: 1; font-weight: 700; font-size: 14px; color: var(--text-strong); }
.scorer-row .pmeta { font-size: 11px; color: var(--muted); display: block; font-weight: 500; }
.scorer-row .gnum  { font-weight: 800; font-size: 16px; color: var(--text-strong); }

/* Empty state */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .ic { font-size: 42px; margin-bottom: 12px; opacity: 0.7; }
.empty p { font-size: 13px; line-height: 1.6; }

/* Profile */
.profile-shell { padding-bottom: 24px; }
body[data-page="profile"] .app { padding-bottom: 132px; }
body[data-page="login"] .app,
body[data-page="register"] .app,
body[data-page="forgot-password"] .app,
body[data-page="edit-profile"] .app,
body[data-page="account-settings"] .app { padding-bottom: 132px; }
.profile-shell .profile-hero,
.profile-shell .card.profile-theme-card,
.profile-shell .profile-stats .stat,
.profile-shell .menu-item,
.profile-shell .profile-meta__item,
.profile-shell .benefit {
  background: var(--profile-card-bg);
  border-color: var(--profile-card-border);
  color: var(--profile-text);
}
.profile-shell .profile-hero {
  border: 1px solid var(--profile-card-border);
}
.profile-shell .profile-hero h2,
.profile-shell .profile-hero p,
.profile-shell .profile-theme p,
.profile-shell .profile-meta__item span,
.profile-shell .profile-benefits .benefit span,
.profile-shell .profile-stats .stat span,
.profile-shell .menu-item,
.profile-shell .menu-item .chev {
  color: var(--profile-muted);
}
.profile-shell .profile-hero h2,
.profile-shell .profile-meta__item strong,
.profile-shell .profile-benefits .benefit strong,
.profile-shell .profile-stats .stat strong {
  color: var(--profile-text);
}
.profile-shell .profile-actions .btn.btn-secondary,
.profile-shell .profile-theme__choices .btn.btn-secondary {
  background: var(--profile-secondary-button-bg);
  color: var(--profile-secondary-button-text);
  border-color: var(--profile-card-border);
}
.profile-shell .profile-actions .btn.btn-secondary:hover,
.profile-shell .profile-theme__choices .btn.btn-secondary:hover {
  border-color: rgba(43,216,107,0.3);
}
.profile-shell .profile-actions .btn.btn-primary,
.profile-shell .profile-theme__choices .theme-choice.on {
  color: #06140a;
}
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 0 14px; }
.profile-actions .btn { min-width: 120px; }
.profile-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 14px; width: 100%; max-width: 560px; }
.profile-meta__item { background: var(--row-bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; text-align: left; }
.profile-meta__item span { display: block; font-size: 10px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.profile-meta__item strong { display: block; font-size: 13px; color: var(--text-strong); word-break: break-word; }
.profile-benefits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px 14px 6px; }
.profile-benefits .benefit { background: var(--row-bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.profile-benefits .benefit strong { display: block; font-size: 14px; color: var(--text-strong); margin-bottom: 4px; }
.profile-benefits .benefit span { display: block; font-size: 12px; color: var(--muted); line-height: 1.45; }
.profile-theme-card { margin-top: 4px; }
.profile-theme {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 14px 6px;
}
.profile-theme p { font-size: 12px; color: var(--muted); line-height: 1.5; }
.profile-theme__choices { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-theme__choices .btn { min-width: 92px; }
.theme-choice.on {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #06140a;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(43,216,107,0.25);
}
.profile-avatar-row { display: flex; align-items: center; gap: 12px; padding: 0 14px 8px; }
.profile-avatar-row .avatar { width: 72px; height: 72px; font-size: 28px; flex-shrink: 0; }
.profile-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 18px 14px; }
.profile-hero .avatar { width: 88px; height: 88px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #1f4f8b);
  display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 800; color: var(--text-strong);
  box-shadow: 0 0 30px rgba(43,216,107,0.3); }
.profile-hero h2 { font-size: 20px; font-weight: 800; color: var(--profile-text); }
.profile-hero p { font-size: 13px; color: var(--profile-muted); }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 14px; }
.profile-stats--4 { grid-template-columns: repeat(2, 1fr); }
.profile-stats .stat { background: var(--profile-card-bg); border: 1px solid var(--profile-card-border); border-radius: 12px; padding: 14px 8px; text-align: center; }
.profile-stats .stat strong { display: block; font-size: 20px; color: var(--accent); font-weight: 800; }
.profile-stats .stat span { font-size: 11px; color: var(--profile-muted); letter-spacing: 0.5px; }

.menu-list { padding: 6px 14px; }
.menu-item {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: var(--profile-card-bg); border: 1px solid var(--profile-card-border); border-radius: 12px; margin-bottom: 8px;
  font-size: 14px; font-weight: 600; color: var(--profile-text); transition: border-color 0.15s ease; cursor: pointer;
}
.menu-item:hover { border-color: rgba(43,216,107,0.3); }
.menu-item .ic { font-size: 18px; width: 24px; text-align: center; color: var(--icon); }
.menu-item .chev { margin-left: auto; color: var(--profile-muted); }

/* Live refresh */
@keyframes spin { to { transform: rotate(360deg); } }
.spinning { animation: spin 0.7s linear; }
#refresh-status { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--accent); }
#refresh-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 6px var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Skeleton & badges */
.skeleton {
  background: linear-gradient(90deg, rgba(37,52,45,0.55), rgba(60,78,69,0.85), rgba(37,52,45,0.55));
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 8px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skeleton-row { pointer-events: none; }
.skeleton-dot { width: 8px; height: 8px; border-radius: 50%; }
.skeleton-logo { width: 22px; height: 22px; border-radius: 50%; display: inline-block; }
.skeleton-logo--lg { width: 26px; height: 26px; }
.skeleton-logo--xl { width: 56px; height: 56px; }
.skeleton-text { height: 10px; width: 100%; display: inline-block; }
.skeleton-text--tiny { width: 50px; height: 8px; }
.skeleton-text--short { width: 72px; }
.skeleton-text--med { width: 110px; }
.skeleton-pill { width: 52px; height: 14px; border-radius: 999px; display: inline-block; }
.skeleton-score { width: 34px; height: 18px; border-radius: 6px; display: inline-block; }
.skeleton-score--sm { width: 22px; height: 14px; }
.skeleton-score--xl { width: 84px; height: 48px; border-radius: 10px; }
.skeleton-star { width: 18px; height: 18px; border-radius: 50%; display: inline-block; }
.skeleton-menu-text { width: 180px; height: 10px; display: inline-block; }
.skeleton-chevron { width: 12px; height: 12px; display: inline-block; }
.skeleton-bar { height: 6px; width: 100%; border-radius: 3px; display: block; }
.skeleton-card, .skeleton-rail, .skeleton-menu { pointer-events: none; }
.avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-strong);
  font-weight: 900;
  font-size: 12px;
  flex-shrink: 0;
}
.avatar, .avatar-sm, .profile-hero .avatar, .profile-avatar-row .avatar {
  background: linear-gradient(135deg, var(--accent), #1f4f8b);
}
.avatar--green, .avatar-sm--green { background: linear-gradient(135deg, var(--accent), #1f4f8b); }
.avatar--blue, .avatar-sm--blue { background: linear-gradient(135deg, #63b3ff, #1f4f8b); }
.avatar--purple, .avatar-sm--purple { background: linear-gradient(135deg, #a855f7, #6d28d9); }
.avatar--orange, .avatar-sm--orange { background: linear-gradient(135deg, #ffb347, #ea580c); }
.avatar--pink, .avatar-sm--pink { background: linear-gradient(135deg, #fb7185, #db2777); }
.favs-first-wrap { display: flex; justify-content: flex-end; padding: 0 14px 4px; }
.favs-first-toggle { display: inline-flex; align-items: center; gap: 8px; }
.favs-first-toggle strong { font-size: 11px; letter-spacing: 1px; }
.favs-first-toggle small { font-size: 10px; color: inherit; opacity: 0.75; }
.favs-first-toggle.on {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #06140a;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(43,216,107,0.25);
}

.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: 1px; }
.badge.live { background: rgba(43,216,107,0.18); color: var(--accent); }
.badge.ft   { background: rgba(255,255,255,0.06); color: var(--text); }
.badge.ht   { background: rgba(255,200,0,0.18);  color: var(--warn); }
.badge.up   { background: rgba(99,179,255,0.16); color: var(--info); }

/* Search */
.search-bar { display: flex; align-items: center; gap: 10px; margin: 10px 14px; padding: 12px 16px;
  background: var(--row-bg); border: 1px solid var(--border); border-radius: 14px; }
.search-bar input { flex: 1; background: transparent; border: none; color: var(--text-strong); font-size: 14px; outline: none; }
.search-bar input::placeholder { color: var(--muted); }

/* Static doc cards */
.doc-card { margin: 14px; padding: 22px;
  background: var(--row-bg); border: 1px solid var(--border); border-radius: 18px; line-height: 1.65; }
.doc-card h2 { font-size: 22px; margin-bottom: 12px; color: var(--text-strong); }
.doc-card h3 { font-size: 15px; color: var(--accent); margin: 18px 0 6px; letter-spacing: 0.5px; }
.doc-card p  { color: var(--text); font-size: 14px; margin-bottom: 8px; }
.doc-card a  { color: var(--accent); text-decoration: underline; }

/* Form */
.form-field { margin: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 11px; letter-spacing: 1.2px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.form-field input, .form-field textarea, .form-field select {
  background: var(--row-bg); border: 1px solid var(--border-strong); color: var(--text-strong);
  padding: 12px 14px; border-radius: 12px; font-size: 14px; outline: none; font: inherit;
  transition: border-color 0.15s ease;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: rgba(43,216,107,0.5); }
.form-error { color: var(--danger); font-size: 12px; margin: 4px 14px; min-height: 16px; }
.form-hint  { color: var(--muted);  font-size: 12px; margin: 4px 14px; }

/* Auth screen layout */
.auth-hero { padding: 32px 18px 8px; text-align: center; }
.auth-hero .brand-mark { font-size: 36px; margin-bottom: 6px; }
.auth-hero h1 { font-size: 22px; color: var(--text-strong); margin-bottom: 4px; }
.auth-hero p  { color: var(--muted); font-size: 13px; }
.auth-actions { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 13px; padding: 14px; }
.auth-foot a { color: var(--accent); font-weight: 700; }
.auth-message {
  margin: 10px 14px 4px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.5;
}
.auth-message--ok { background: rgba(43,216,107,0.10); color: var(--text-strong); border-color: rgba(43,216,107,0.26); }
.auth-message--err { background: rgba(255,71,87,0.10); color: var(--text-strong); border-color: rgba(255,71,87,0.28); }

/* Match events */
.events { display: flex; flex-direction: column; gap: 8px; }
.event-row { display: grid; grid-template-columns: 40px 24px 1fr; gap: 10px; align-items: center;
  padding: 8px 0; border-bottom: 1px dashed var(--border); cursor: pointer; border-radius: 8px; }
.event-row:last-child { border-bottom: none; }
.event-row:hover,
.event-row.active { background: rgba(255,255,255,0.03); }
.event-row .time { font-weight: 800; color: var(--accent); font-size: 12px; }
.event-row .ic   { font-size: 16px; text-align: center; }
.event-row .desc { font-size: 13px; color: var(--text); }

/* Odds (placeholder, no betting) */
.odds-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.odds-info .col { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 10px; padding: 10px; text-align: center; }
.odds-info .col small { display: block; font-size: 10px; color: var(--muted); letter-spacing: 1px; margin-bottom: 4px; }
.odds-info .col strong { font-size: 16px; color: var(--text-strong); font-weight: 800; }

/* Tiny screens: standings horizontal scroll */
@media (max-width: 380px) {
  .table-card { overflow-x: auto; }
  .table-head, .table-row { min-width: 360px; }
}

/* =========================================================
   Desktop layout (>= 1024px)
   ========================================================= */
@media (min-width: 1024px) {
  /* Desktop header: logo / search / account */
  .site-header-wrap { position: sticky; top: 0; z-index: 50;
    background: linear-gradient(180deg, rgba(17,26,21,0.96), rgba(17,26,21,0.88));
    backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
  .site-header { max-width: 1480px; margin: 0 auto; padding: 14px 28px;
    display: grid; grid-template-columns: 240px minmax(0,1fr) 240px; gap: 24px; align-items: center; }
  .site-brand { display: flex; align-items: center; gap: 10px;
    font-weight: 900; letter-spacing: 1px; font-size: 16px; color: var(--text-strong); }
  .site-brand .logo-mark { width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex; align-items: center; justify-content: center; color: #06140a;
    font-weight: 900; box-shadow: 0 4px 14px rgba(43,216,107,0.45); }
  .site-search { display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--border);
    border-radius: 999px; padding: 10px 16px; transition: border-color .15s ease; }
  .site-search:focus-within { border-color: rgba(43,216,107,0.5); box-shadow: 0 0 0 3px rgba(43,216,107,0.12); }
  .site-search .search-ic { color: var(--muted); font-size: 14px; }
  .site-search input { flex: 1; background: transparent; border: 0; outline: none;
    color: var(--text-strong); font-size: 14px; }
  .site-search input::placeholder { color: var(--muted); }
  .site-account { display: flex; align-items: center; gap: 10px; justify-self: end;
    padding: 6px 14px 6px 6px; background: rgba(255,255,255,0.04); border: 1px solid var(--border);
    border-radius: 999px; color: var(--text-strong); font-weight: 700; font-size: 13px;
    transition: border-color .15s ease, background .15s ease; }
  .site-account:hover { border-color: rgba(43,216,107,0.4); background: rgba(43,216,107,0.06); }
  .site-account .avatar-sm { width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #16a34a);
    display: flex; align-items: center; justify-content: center;
    color: #06140a; font-weight: 900; font-size: 12px; }

  body { display: block; padding: 0;
    background:
      radial-gradient(1400px 700px at 80% -200px, rgba(43,216,107,0.08), transparent 60%),
      radial-gradient(1000px 600px at 0% 100%, rgba(43,216,107,0.05), transparent 60%),
      var(--bg); }

  .layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 320px;
    gap: 28px; max-width: 1480px; margin: 0 auto; padding: 24px 28px 60px; align-items: start; }
  body[data-page="match"] .layout, body[data-page="lineups"] .layout,
  body[data-page="standings"] .layout, body[data-page="profile"] .layout,
  body[data-page="settings"] .layout, body[data-page="about"] .layout,
  body[data-page="contact"] .layout, body[data-page="privacy"] .layout,
  body[data-page="terms"] .layout, body[data-page="search"] .layout,
  body[data-page="player"] .layout, body[data-page="team"] .layout,
  body[data-page="login"] .layout, body[data-page="register"] .layout,
  body[data-page="forgot"] .layout, body[data-page="edit-profile"] .layout,
  body[data-page="followed-leagues"] .layout, body[data-page="notification-settings"] .layout,
  body[data-page="account-settings"] .layout, body[data-page="league-detail"] .layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .app { max-width: none; width: 100%; min-height: auto; background: transparent; padding-bottom: 0; }
  .bottom-nav { display: none; }

  .side-nav { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto;
    background: linear-gradient(180deg, var(--shell-bg), #0e1511); border: 1px solid var(--border);
    border-radius: 20px; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; }
  .side-nav .brand { display: none; }
  .side-nav .nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
    color: var(--text); font-weight: 600; font-size: 14px; transition: background 0.15s ease, color 0.15s ease;
    width: 100%; text-align: left; cursor: pointer; }
  .side-nav .nav-item .ic { width: 20px; text-align: center; font-size: 16px; }
  .side-nav .nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text-strong); }
  .side-nav .nav-item.active { background: linear-gradient(180deg, rgba(43,216,107,0.2), rgba(43,216,107,0.06));
    color: var(--accent); box-shadow: inset 0 0 0 1px rgba(43,216,107,0.25); }
  .side-nav .nav-section { font-size: 10px; letter-spacing: 1.5px; color: var(--muted);
    padding: 14px 14px 6px; text-transform: uppercase; font-weight: 700; }
  .side-nav .theme-toggle { margin-top: auto; display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; border-radius: 12px; cursor: pointer;
    background: rgba(255,255,255,0.04); color: var(--text); font-weight: 600; font-size: 13px; }

  .side-rail { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 48px); overflow-y: auto; }
  .rail-card { background: linear-gradient(180deg, var(--shell-bg), #0e1511); border: 1px solid var(--border);
    border-radius: 18px; padding: 16px; }
  .rail-card h3 { font-size: 12px; letter-spacing: 1.5px; color: var(--text); text-transform: uppercase;
    font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
  .rail-card h3 .more { color: var(--accent); font-size: 11px; font-weight: 700; }
  .rail-list { display: flex; flex-direction: column; gap: 10px; }
  .rail-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px;
    transition: background 0.15s ease; cursor: pointer; }
  .rail-item:hover { background: rgba(255,255,255,0.04); }
  .rail-item .meta { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; color: var(--text-strong); }
  .rail-item .meta small { display: block; font-size: 10px; color: var(--muted); font-weight: 500; margin-top: 2px; }
  .rail-item .val { font-weight: 800; color: var(--accent); font-size: 13px; }

  body[data-page="home"] .match-list,
  body[data-page="live"] .match-list,
  body[data-page="favourites"] .match-list,
  body[data-page="fixtures"] .match-list,
  body[data-page="results"] .match-list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  }
  .hot-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; gap: 14px; scroll-snap-type: none; }
  .hot-card { flex: none; padding: 16px; }
  .hot-arrow, .hot-dots { display: none; }

  .topbar h1 { font-size: 24px; }
  .topbar { padding: 8px 8px 12px; }
  .all-live-wrap { position: static; bottom: auto; }

  body[data-page="match"] .detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
  .formations { gap: 24px; }
  .mini-pitch { height: 480px; }

  .table-head, .table-row { grid-template-columns: 40px 1fr 50px 50px 50px 50px 60px 60px;
    padding: 12px 18px; font-size: 13px; }

  body[data-page="profile"] .profile-hero, body[data-page="dashboard"] .profile-hero {
    flex-direction: row; justify-content: flex-start;
    background: linear-gradient(180deg, var(--shell-bg), #0e1511); border: 1px solid var(--border);
    border-radius: 18px; padding: 28px; align-items: center; gap: 22px; text-align: left; margin: 0 14px; }

  /* Auth pages: nicer centered card */
  body[data-page="login"] .app, body[data-page="register"] .app,
  body[data-page="forgot"] .app, body[data-page="forgot-password"] .app,
  body[data-page="edit-profile"] .app, body[data-page="account-settings"] .app { max-width: 460px; margin: 0 auto; }
}

@media (min-width: 1440px) {
  body[data-page="home"] .match-list,
  body[data-page="fixtures"] .match-list,
  body[data-page="results"] .match-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* =========================================================
   LIGHT THEME — high-contrast overrides via tokens
   ========================================================= */
body.light {
  --bg:        #f3f5f8;
  --surface:   #ffffff;
  --surface-2: #ffffff;
  --text:      #1a1f2b;
  --text-strong: #0a0d12;
  --muted:     #4a5060;
  --border:    rgba(15,20,30,0.10);
  --border-strong: rgba(15,20,30,0.16);
  --accent:    #16a34a;
  --accent-2:  #0d8a3d;
  --icon:      #2a2f3a;
  --row-bg:    #ffffff;
  --tracker-tooltip-bg: #eef2f0;
  --tracker-tooltip-border: #d7dfda;
  --tracker-tooltip-title: #111827;
  --tracker-tooltip-text: #4b5563;
  --tracker-tooltip-accent: #149b4f;
  --profile-card-bg: #ffffff;
  --profile-card-border: #d9e3dc;
  --profile-text: #111827;
  --profile-muted: #4b5563;
  --profile-secondary-button-bg: #f4f8f5;
  --profile-secondary-button-text: #111827;
}
body.light {
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(22,163,74,0.18), transparent 60%),
    var(--bg);
}
body.light .pitch,
body.light .mini-pitch {
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.03) 0 12px, transparent 12px 24px),
    linear-gradient(180deg, #d8efe1, #c5e6d2);
  border-color: rgba(22,163,74,0.35);
}
body.light .player .pname { color: #0a0d12; text-shadow: 0 1px 0 rgba(255,255,255,0.6); }
body.light .pitch::before { background: rgba(0,0,0,0.18); }
body.light .pitch .ball { background: #0a0d12; box-shadow: 0 0 6px rgba(0,0,0,0.4); }
body.light .all-live { color: #fff; }
body.light .bottom-nav { background: rgba(255,255,255,0.96); border-top-color: var(--border); }
body.light .stat-row .bar { background: rgba(0,0,0,0.06); }
body.light .modal { background: #ffffff; border-color: rgba(22,163,74,0.3); }
body.light .modal .analysis-block { background: #eef2f0; border-color: #d7dfda; }
body.light .skeleton {
  background: linear-gradient(90deg, rgba(210,216,223,0.75), rgba(238,242,246,1), rgba(210,216,223,0.75));
  background-size: 220% 100%;
}
body.light .side-nav, body.light .rail-card,
body.light body[data-page="profile"] .profile-hero,
body.light body[data-page="dashboard"] .profile-hero {
  background: #ffffff;
}
body.light .logo {
  background: linear-gradient(135deg, rgba(22,163,74,0.88), rgba(99,179,255,0.82));
  color: #0b1f16;
  border-color: rgba(22,163,74,0.25);
  box-shadow: 0 1px 2px rgba(15,20,30,0.08), inset 0 0 0 1px rgba(255,255,255,0.22);
}
body.light .logo.t-mnc,
body.light .logo.t-ars,
body.light .logo.t-rma,
body.light .logo.t-bar,
body.light .logo.t-lba,
body.light .logo.t-arg,
body.light .logo.t-usb,
body.light .logo.t-hbs,
body.light .logo.t-smlh,
body.light .logo.t-vsc {
  background: linear-gradient(135deg, rgba(22,163,74,0.88), rgba(99,179,255,0.82));
  color: #0b1f16;
  border-color: rgba(22,163,74,0.25);
}
body.light .section-title .league-badge {
  background: linear-gradient(135deg, rgba(22,163,74,0.92), rgba(99,179,255,0.85));
  border: 1px solid rgba(22,163,74,0.25);
  box-shadow: 0 1px 2px rgba(15,20,30,0.08), inset 0 0 0 1px rgba(255,255,255,0.2);
}
body.light body[data-page="profile"] .profile-meta__item,
body.light body[data-page="profile"] .profile-benefits .benefit,
body.light body[data-page="profile"] .profile-stats .stat,
body.light .auth-message,
body.light .form-field input,
body.light .form-field textarea,
body.light .form-field select {
  background: #ffffff;
}
body.light body[data-page="profile"] .profile-hero p,
body.light body[data-page="profile"] .profile-meta__item span,
body.light body[data-page="profile"] .profile-benefits .benefit span,
body.light body[data-page="profile"] .menu-item,
body.light .auth-foot,
body.light .auth-hero p,
body.light .form-hint,
body.light .form-error,
body.light .auth-message {
  color: var(--text);
}
body.light .auth-message--ok { background: rgba(22,163,74,0.08); border-color: rgba(22,163,74,0.20); }
body.light .auth-message--err { background: rgba(255,71,87,0.08); border-color: rgba(255,71,87,0.20); }
body.light .timeline .tick { background: rgba(0,0,0,0.08); }
body.light .table-row.top { background: rgba(22,163,74,0.08); }
body.light .heatmap-tooltip { background: var(--tracker-tooltip-bg); border-color: var(--tracker-tooltip-border); color: var(--tracker-tooltip-title); box-shadow: 0 10px 22px rgba(15,20,30,0.08); }
body.light .heatmap-tooltip strong { color: var(--tracker-tooltip-accent); }
body.light .heatmap-tooltip small { color: var(--tracker-tooltip-text); }
body.light .event-summary { background: #f7f9fc; border-color: #d7dfda; color: var(--text-strong); }
body.light .card .card-title .expand { color: #5b6474; }
body.light .stat-row .label { color: var(--text-strong); }
body.light .stat-row .label .name { color: #4b5563; }
body.light .odds-info .col { background: #f7f9fc; border-color: #d7dfda; }
body.light .search-bar { background: #ffffff; border-color: #d7dfda; }
body.light .menu-item { background: #ffffff; border-color: #d7dfda; }
body.light .rail-item { background: #ffffff; border-color: #d7dfda; }
body.light .profile-meta__item strong,
body.light .profile-benefits .benefit strong,
body.light .profile-stats .stat strong { color: var(--text-strong); }
body.light .profile-meta__item span,
body.light .profile-benefits .benefit span,
body.light .profile-stats .stat span { color: #4a5060; }
body.light .profile-shell .profile-hero,
body.light .profile-shell .card.profile-theme-card,
body.light .profile-shell .profile-stats .stat,
body.light .profile-shell .menu-item,
body.light .profile-shell .profile-meta__item,
body.light .profile-shell .profile-benefits .benefit {
  background: var(--profile-card-bg);
  border-color: var(--profile-card-border);
  color: var(--profile-text);
}
body.light .profile-shell .profile-hero h2,
body.light .profile-shell .profile-hero p,
body.light .profile-shell .profile-theme p,
body.light .profile-shell .profile-meta__item span,
body.light .profile-shell .profile-benefits .benefit span,
body.light .profile-shell .profile-stats .stat span,
body.light .profile-shell .menu-item,
body.light .profile-shell .menu-item .chev {
  color: var(--profile-muted);
}
body.light .profile-shell .profile-hero h2,
body.light .profile-shell .profile-meta__item strong,
body.light .profile-shell .profile-benefits .benefit strong,
body.light .profile-shell .profile-stats .stat strong {
  color: var(--profile-text);
}
body.light .profile-shell .profile-actions .btn.btn-secondary,
body.light .profile-shell .profile-theme__choices .btn.btn-secondary {
  background: var(--profile-secondary-button-bg);
  color: var(--profile-secondary-button-text);
  border-color: var(--profile-card-border);
}
body.light .profile-shell .profile-actions .btn.btn-secondary:hover,
body.light .profile-shell .profile-theme__choices .btn.btn-secondary:hover {
  border-color: rgba(22,163,74,0.28);
}
body.light .profile-shell .profile-actions .btn.btn-primary,
body.light .profile-shell .profile-theme__choices .theme-choice.on {
  color: #06140a;
}
body.light .topbar { box-shadow: inset 0 -1px 0 var(--border); }
body.light .site-header-wrap { background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.85)); }
body.light .site-search, body.light .site-account { background: #f3f5f9; }

@media (min-width: 700px) {
  body[data-page="profile"] .profile-stats--4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1200px) {
  body[data-page="match"] .detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
  }
  body[data-page="match"] .detail-grid > div {
    min-width: 0;
    max-width: 100%;
  }
  body[data-page="match"] .detail-grid > div:last-child {
    width: 100%;
  }
}

/* Safety: hide desktop chrome on tablet/mobile */
@media (max-width: 1023px) {
  .side-nav, .side-rail, .site-header-wrap { display: none !important; }
}

@media (max-width: 699px) {
  /* Base bottom padding for all mobile pages */
  .app {
    padding-bottom: calc(160px + env(safe-area-inset-bottom));
    min-height: auto !important;
    height: auto !important;
  }
  body[data-page="login"] .app,
  body[data-page="register"] .app,
  body[data-page="forgot"] .app,
  body[data-page="forgot-password"] .app,
  body[data-page="edit-profile"] .app,
  body[data-page="account-settings"] .app,
  body[data-page="profile"] .app,
  body[data-page="dashboard"] .app,
  body[data-page="match"] .app,
  body[data-page="home"] .app,
  body[data-page="live"] .app,
  body[data-page="favourites"] .app,
  body[data-page="leagues"] .app,
  body[data-page="search"] .app,
  body[data-page="settings"] .app {
    min-height: auto !important;
    height: auto !important;
    padding-bottom: calc(160px + env(safe-area-inset-bottom));
  }

  /* Match detail — single column, proper spacing */
  body[data-page="match"] .detail-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  body[data-page="match"] .detail-grid > div {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }
  body[data-page="match"] .detail-grid .card,
  body[data-page="match"] .detail-grid .odds-info,
  body[data-page="match"] .detail-grid .table-card,
  body[data-page="match"] .detail-grid .mini-pitch {
    max-width: 100%;
    box-sizing: border-box;
  }
  /* Score hero — visible padding, no clipping */
  body[data-page="match"] .score-hero {
    padding-top: 12px;
    padding-bottom: 16px;
    overflow: visible;
  }

  body[data-page="register"] .auth-hero,
  body[data-page="login"] .auth-hero,
  body[data-page="forgot"] .auth-hero,
  body[data-page="forgot-password"] .auth-hero,
  body[data-page="edit-profile"] .auth-hero,
  body[data-page="account-settings"] .auth-hero {
    padding-bottom: 4px;
  }

  /* html and body must scroll freely */
  html, body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    max-height: none !important;
  }
}
@media (max-width: 1024px) {
  body[data-page="home"] .topbar { padding-bottom: 8px; }
  body[data-page="home"] .date-strip {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 5;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 8px 14px 10px;
    margin-top: 0;
    margin-bottom: 4px;
  }
  body[data-page="home"] .favs-first-wrap {
    position: relative;
    z-index: 4;
    width: 100%;
    justify-content: flex-end;
    padding: 6px 14px 2px;
    margin-top: 4px;
    margin-bottom: 0;
    clear: both;
  }
  body[data-page="home"] .hot-section {
    margin-top: 6px;
  }
  body[data-page="home"] .section-title {
    padding-top: 10px;
  }
}

/* ==========================================================================
   RESPONSIVE LAYOUT FIXES — v2
   Fixes: mobile header, date strip, bottom padding, match detail overflow,
   desktop match info width, sidebar responsiveness, global overflow,
   loading skeleton spacing, and bad CSS patterns.
   DO NOT change colors, fonts, cards, icons, or API logic.
   ========================================================================== */

/* ── Global overflow prevention ─────────────────────────────────────────── */
html { overflow-x: hidden; }

/* ── 1. Mobile header fix (≤ 768px) ─────────────────────────────────────── */
@media (max-width: 768px) {
  .topbar {
    padding: 12px 12px 8px;
    flex-wrap: nowrap;
    min-height: 52px;
    width: 100%;
    box-sizing: border-box;
    gap: 8px;
  }
  .topbar h1 {
    font-size: 17px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .topbar > div {
    gap: 2px;
    flex-shrink: 0;
  }
  .topbar .icon-btn {
    padding: 5px;
  }
  #refresh-status {
    font-size: 9px;
    white-space: nowrap;
    max-width: 48px;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0;
  }
}

/* ── 2. Home page element order and date strip (mobile/tablet ≤ 1024px) ── */
@media (max-width: 1024px) {
  /* Favs-first toggle directly under header */
  #favs-first-wrap,
  .favs-first-wrap {
    display: flex !important;
    justify-content: flex-end;
    padding: 6px 14px 2px;
    margin: 0;
    position: relative;
    z-index: 5;
    width: 100%;
    box-sizing: border-box;
  }

  /* Date strip always visible below favs toggle */
  .date-strip {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 4;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px 14px 10px;
    margin: 0;
    box-sizing: border-box;
    flex-shrink: 0;
  }
  .date-strip::-webkit-scrollbar { display: none; }
}

/* ── 3. Global bottom nav safe spacing — all pages (≤ 768px) ──────────── */
@media (max-width: 768px) {
  .app {
    padding-bottom: calc(160px + env(safe-area-inset-bottom)) !important;
    min-height: auto !important;
    height: auto !important;
    overflow-x: hidden !important;
  }
  body[data-page="match"] .app,
  body[data-page="home"] .app,
  body[data-page="live"] .app,
  body[data-page="favourites"] .app,
  body[data-page="leagues"] .app,
  body[data-page="profile"] .app,
  body[data-page="login"] .app,
  body[data-page="register"] .app,
  body[data-page="dashboard"] .app,
  body[data-page="settings"] .app,
  body[data-page="edit-profile"] .app,
  body[data-page="account-settings"] .app,
  body[data-page="forgot-password"] .app,
  body[data-page="forgot"] .app,
  body[data-page="search"] .app {
    padding-bottom: calc(160px + env(safe-area-inset-bottom)) !important;
    min-height: auto !important;
    height: auto !important;
  }

  html, body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    max-height: none !important;
  }
}

/* ── 4. Match detail page — mobile scrolling and overflow ──────────────── */
@media (max-width: 768px) {
  body[data-page="match"] .app {
    height: auto !important;
    min-height: auto !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  /* detail-grid: single column flex, with spacing */
  .detail-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    overflow: visible !important;
    min-width: 0;
    width: 100%;
  }

  .detail-grid > div {
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    width: 100%;
  }

  .detail-grid .card,
  .detail-grid .odds-info,
  .detail-grid .table-card,
  .detail-grid .mini-pitch,
  .detail-grid .formations {
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
  }

  /* Score hero — MUST be fully visible, no overflow clipping */
  .score-hero {
    overflow: visible !important;
    width: 100%;
    box-sizing: border-box;
    padding-top: 12px;
    padding-bottom: 16px;
  }

  /* Tabs scroll horizontally */
  .tabs {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap !important;
  }
  .tabs::-webkit-scrollbar { display: none; }

  .tab-panel {
    overflow: visible !important;
    min-height: 0;
    width: 100%;
  }

  #panel-standings,
  #panel-fixtures,
  #panel-results {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Match Info card — always use 3 columns grid */
  #match-info,
  .odds-info {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
  }
}

/* ── 5. Desktop Match Info — responsive grid ────────────────────────────── */
@media (min-width: 1025px) and (max-width: 1199px) {
  body[data-page="match"] .detail-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px;
    width: 100%;
    min-width: 0;
  }
  body[data-page="match"] .detail-grid > div {
    min-width: 0;
    max-width: 100%;
  }
}

@media (min-width: 1200px) {
  body[data-page="match"] .detail-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 320px) !important;
    gap: 18px;
    align-items: start;
    width: 100%;
    min-width: 0;
  }
  body[data-page="match"] .detail-grid > div {
    min-width: 0;
    max-width: 100%;
  }
  body[data-page="match"] .detail-grid > div:last-child {
    max-width: 320px;
    width: 100%;
    min-width: 0;
  }
}

/* ── 6. Sidebar smooth responsive breakpoints ───────────────────────────── */
/* Tablet (769–1024px): side-nav and site-header already hidden */
/* 1025–1279px: left sidebar only, no right rail */
@media (min-width: 1025px) and (max-width: 1279px) {
  .layout {
    grid-template-columns: 220px minmax(0, 1fr) !important;
  }
  .side-rail { display: none !important; }
}

/* 1280px+: left sidebar + right rail */
@media (min-width: 1280px) {
  .layout {
    grid-template-columns: 240px minmax(0, 1fr) 300px;
  }
}
@media (min-width: 1366px) {
  .layout {
    grid-template-columns: 240px minmax(0, 1fr) 320px;
  }
}
@media (min-width: 1480px) {
  .layout {
    max-width: 1480px;
  }
}

/* Sidebars must not overflow their column */
.side-nav,
.side-rail {
  min-width: 0;
  overflow-x: hidden;
}

/* ── 7. Global content width — prevent overflow everywhere ──────────────── */
.app,
.layout,
.site-header,
.match-list,
.hot-row,
.date-strip,
.tabs {
  max-width: 100%;
  box-sizing: border-box;
}

.match-row,
.hot-card,
.card,
.rail-card,
.menu-item,
.doc-card {
  min-width: 0;
  box-sizing: border-box;
  max-width: 100%;
}

/* Tables only scroll when they need to */
.table-card {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── 8. Skeleton — no layout jump, date strip never hidden ─────────────── */
.date-strip,
#favs-first-wrap,
.favs-first-wrap {
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#leagues-list[data-skeleton="1"],
#hot-row[data-skeleton="1"] {
  min-height: 80px;
}
#leagues-list { margin-top: 0; }

/* ── 9. Fix known bad CSS pattern: height:100vh on match page ───────────── */
body[data-page="match"] .app {
  height: auto !important;
}

/* ── 10. Very small screens (≤ 380px) ──────────────────────────────────── */
@media (max-width: 380px) {
  .match-row {
    grid-template-columns: 12px 1fr 50px 1fr 18px;
    gap: 4px;
    padding: 10px 8px;
  }
  .match-row .name { font-size: 11px; }
  .hot-card { flex: 0 0 90%; }
  .formations { grid-template-columns: 1fr !important; }
  .subs-grid { grid-template-columns: 1fr !important; }
  .topbar h1 { font-size: 15px; }
}

/* ── 11. Tablet frame: allow scroll without clip ───────────────────────── */
@media (min-width: 700px) and (max-width: 1024px) {
  .app {
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }
}

/* ── 12. Desktop sticky header: never covers content ───────────────────── */
@media (min-width: 1025px) {
  .site-header-wrap {
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .layout { position: relative; z-index: 1; }
}

/* ── 13. app container: never clip vertical scroll ─────────────────────── */
.app {
  overflow-x: hidden;
  /* overflow-y intentionally not set — let body scroll */
}

