/* ============================================================
   Arsenal Predictor — Styles
   Theme: Arsenal Red (#EF0107), White, Gold (#9C824A)
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ──────────────────────────────────────────────────────────────
   THEMING
   Colours are driven by CSS variables so the whole site can switch
   between light and dark. The default (:root) is the LIGHT theme;
   [data-theme="dark"] on <html> overrides it with dark values.
   A toggle button in the header flips the attribute (see app.js),
   and the choice is remembered in localStorage.

   --white always means "text/icons on a coloured surface" (the red
   header, buttons, chips) and stays white in both themes. Card and
   panel surfaces use --surface; the page uses --bg.
   ────────────────────────────────────────────────────────────── */
:root {
  --red:        #EF0107;
  --red-dark:   #B80004;
  --red-light:  #FF4B4F;
  --gold:       #9C824A;
  --gold-light: #C4A35A;
  --white:      #FFFFFF;   /* text/icons on coloured surfaces */

  --bg:         #F5F5F5;   /* page background */
  --surface:    #FFFFFF;   /* cards, panels, inputs */
  --surface-2:  #ECEEF1;   /* raised / alt fills */
  --dark:       #1A1A1A;   /* PRIMARY TEXT (name kept for compat) */
  --gray-900:   #1F1F1F;
  --gray-800:   #2D2D2D;
  --gray-700:   #3D3D3D;   /* secondary text */
  --gray-100:   #F5F5F5;   /* subtle fills / hovers / inputs */
  --gray-200:   #E8E8E8;   /* borders / dividers */
  --gray-400:   #A0A0A0;   /* muted text */

  --err-bg:     #FEF2F2;
  --err-border: #FECACA;
  --err-text:   #991B1B;
  --me-row:     #FEF7F7;
  --skel-a:     #eeeeee;
  --skel-b:     #f5f5f5;
  --toast-info-bg:   #1A1A1A;
  --toast-info-text: #FFFFFF;
  --seg-loss:   #1a2a5e;

  --green:      #22c55e;
  --amber:      #f59e0b;
  --radius:     10px;
  --shadow:     0 4px 24px rgba(0,0,0,0.12);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.18);
  --font:       'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.2s ease;
}

:root[data-theme="dark"] {
  --gold:       #C4A35A;
  --gold-light: #D9BC74;

  --bg:         #0F1319;
  --surface:    #191E26;
  --surface-2:  #212833;
  --dark:       #E8EAED;
  --gray-900:   #E8EAED;
  --gray-800:   #D4D8DE;
  --gray-700:   #B7BDC7;
  --gray-100:   #212833;
  --gray-200:   #2E353F;
  --gray-400:   #8B93A0;

  --err-bg:     #33181A;
  --err-border: #5E2A2E;
  --err-text:   #F7B4B4;
  --me-row:     rgba(239,1,7,0.10);
  --skel-a:     #1c222b;
  --skel-b:     #252d38;
  --toast-info-bg:   #212833;
  --toast-info-text: #E8EAED;
  --seg-loss:   #4E6FA8;

  --shadow:     0 4px 24px rgba(0,0,0,0.45);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.6);
}

html { background: var(--bg); }
body { transition: background var(--transition), color var(--transition); }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--dark);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Header ────────────────────────────────────────────────── */
#app-header {
  background: var(--red);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-cannon { font-size: 1.4rem; }
.logo-crest { width: 30px; height: 30px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3)); }
.logo strong { color: var(--gold-light); }

nav { display: flex; align-items: center; gap: 4px; }

.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.nav-btn {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.nav-btn:hover, .nav-btn.active {
  background: rgba(255,255,255,0.18);
  color: var(--white);
}
.nav-btn.nav-admin { color: var(--gold-light); }
.nav-btn.nav-admin:hover { background: rgba(156,130,74,0.25); color: var(--gold-light); }
.nav-btn.nav-logout { color: rgba(255,255,255,0.6); }
.nav-btn.nav-logout:hover { background: rgba(0,0,0,0.2); color: var(--white); }
.nav-btn.nav-theme {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid rgba(255,255,255,0.35);
  color: var(--white);
}
.nav-btn.nav-theme:hover { background: rgba(255,255,255,0.2); }
/* Floating "Buy me a coffee" button — pinned just below the header, top-right. */
#coffee-float {
  position: fixed; top: 84px; z-index: 90;
  /* Align to the right edge of the centred 1100px content column,
     not the far edge of the browser window. */
  right: max(20px, calc(50% - 530px));
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gold); color: #1A1A1A;
  font-family: var(--font); font-weight: 800; font-size: 0.8rem;
  text-decoration: none; white-space: nowrap;
  padding: 8px 15px; border-radius: 22px; box-shadow: var(--shadow);
  transition: background var(--transition), transform var(--transition);
}
#coffee-float:hover { background: var(--gold-light); transform: translateY(-1px); }
@media (max-width: 600px) {
  #coffee-float { top: 66px; right: 12px; font-size: 0.72rem; padding: 6px 11px; gap: 4px; }
}

/* ── Pages ─────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

.page-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* ── Auth Page ─────────────────────────────────────────────── */
#page-auth {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 50%, #0B0D11 100%);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#page-auth.active {
  display: flex;
}

.auth-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.auth-hero {
  background: var(--red);
  padding: 32px 28px 24px;
  text-align: center;
  color: var(--white);
}

.auth-hero { position: relative; overflow: hidden; }
.auth-hero::after {
  content: '';
  position: absolute;
  right: -30px; bottom: -40px;
  width: 160px; height: 160px;
  background: url('https://a.espncdn.com/i/teamlogos/soccer/500/359.png') no-repeat center/contain;
  opacity: 0.08;
  pointer-events: none;
}
.auth-hero .cannon { font-size: 3rem; display: block; margin-bottom: 8px; }
.auth-crest { width: 72px; height: 72px; object-fit: contain; margin-bottom: 8px; position: relative; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25)); }
.auth-hero h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; position: relative; }
.auth-hero p  { font-size: 0.875rem; opacity: 0.9; margin-top: 4px; position: relative; }

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
}
.auth-tab {
  flex: 1;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-400);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font);
}
.auth-tab.active { color: var(--red); border-bottom-color: var(--red); }

.auth-body { padding: 28px; }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  background: var(--surface);
}
.form-group input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239,1,7,0.1);
}

/* Typed text in all inputs follows the theme (light on dark, dark on light). */
input, textarea, select { color: var(--dark); }
input::placeholder, textarea::placeholder { color: var(--gray-400); opacity: 1; }
/* Autofill can force a light background + dark text — keep it themed. */
input:-webkit-autofill { -webkit-text-fill-color: var(--dark); transition: background-color 9999s ease-in-out 0s; }

.pin-hint {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 5px;
}

.btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--red);
  color: var(--white);
}
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(239,1,7,0.4); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--gray-100);
  color: var(--dark);
  border: 2px solid var(--gray-200);
}
.btn-secondary:hover { background: var(--gray-200); }

.btn-gold {
  background: var(--gold);
  color: var(--white);
}
.btn-gold:hover { background: var(--gold-light); transform: translateY(-1px); }

.btn-sm {
  width: auto;
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }

.auth-error {
  background: var(--err-bg);
  border: 1px solid var(--err-border);
  color: var(--err-text);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.875rem;
  margin-bottom: 16px;
  display: none;
}

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
  margin-bottom: 28px;
}
.page-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.03em;
}
.page-header .subtitle {
  color: var(--gray-400);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* ── Season Badge ───────────────────────────────────────────── */
.season-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--red);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  margin-left: 10px;
  letter-spacing: 0.05em;
}

/* ── Fixtures ────────────────────────────────────────────────── */
.fixtures-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 2px solid var(--gray-200);
  background: var(--surface);
  color: var(--gray-700);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
}
.filter-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

.fixture-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  border-left: 4px solid transparent;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.fixture-card:hover { box-shadow: var(--shadow); }
.fixture-card.completed { border-left-color: var(--green); }
.fixture-card.locked    { border-left-color: var(--gray-400); opacity: 0.8; }
.fixture-card.predicted { border-left-color: var(--gold); }

.fixture-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.fixture-gw {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.fixture-date {
  font-size: 0.78rem;
  color: var(--gray-400);
}

.fixture-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.team {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.team.home { justify-content: flex-end; }
.team.away { justify-content: flex-start; }

.team-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
}
.team-name.arsenal { color: var(--red); }

.score-block {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 100px;
  justify-content: center;
}

.score-display {
  display: flex;
  align-items: center;
  gap: 6px;
}
.score-num {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  border-radius: 6px;
  background: var(--gray-100);
  color: var(--dark);
}
.score-sep { font-weight: 700; color: var(--gray-400); }

/* Prediction inputs */
.prediction-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}
.score-input {
  width: 40px;
  height: 40px;
  text-align: center;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition);
  background: var(--surface);
}
.score-input:focus { border-color: var(--red); }

.predict-btn {
  margin-left: 8px;
  padding: 8px 14px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: background var(--transition);
}
.predict-btn:hover { background: var(--red-dark); }
.predict-btn:disabled { background: var(--gray-400); cursor: not-allowed; }

.fixture-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--gray-200);
  font-size: 0.78rem;
}

.points-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.75rem;
}
.points-badge.pts-3 { background: #dcfce7; color: #166534; }
.points-badge.pts-1 { background: #fef9c3; color: #854d0e; }
.points-badge.pts-0 { background: #fee2e2; color: #991b1b; }
.points-badge.pts-pending { background: var(--gray-100); color: var(--gray-400); }

.prediction-label { color: var(--gray-400); }
.prediction-saved { color: var(--gold); font-weight: 600; }
.status-pill {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-completed { background: #dcfce7; color: #166534; }
.status-locked    { background: var(--gray-100); color: var(--gray-400); }
.status-open      { background: #dbeafe; color: #1e40af; }

.venue-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  vertical-align: middle;
}
.home-badge { background: #dcfce7; color: #166534; }
.away-badge { background: #dbeafe; color: #1e40af; }
.stadium-name { font-size: 0.72rem; color: var(--gray-400); font-weight: 500; }

/* ── Leaderboard ─────────────────────────────────────────────── */
.leaderboard-table {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.lb-header {
  display: grid;
  grid-template-columns: 42px minmax(90px, 1fr) 64px 58px 48px 66px 66px;
  padding: 12px 20px;
  background: var(--red);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  align-items: center;
}
.lb-row {
  display: grid;
  grid-template-columns: 42px minmax(90px, 1fr) 64px 58px 48px 66px 66px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-200);
  align-items: center;
  transition: background var(--transition);
}
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: var(--gray-100); }
.lb-row.me { background: var(--me-row); }

.lb-rank {
  font-weight: 800;
  font-size: 1rem;
  color: var(--gray-400);
}
.lb-rank.rank-1 { color: #F5B700; }
.lb-rank.rank-2 { color: #A8A9AD; }
.lb-rank.rank-3 { color: #CD7F32; }

.lb-name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.me-tag {
  font-size: 0.68rem;
  background: var(--red);
  color: white;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.lb-pts { font-weight: 800; font-size: 1rem; color: var(--red); }
.lb-exact, .lb-correct { color: var(--gray-400); font-size: 0.85rem; }

/* ── Admin Panel ─────────────────────────────────────────────── */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}
@media (max-width: 700px) { .admin-grid { grid-template-columns: 1fr; } }

.admin-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.admin-card h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  margin-bottom: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat-box {
  background: var(--gray-100);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}
.stat-num { font-size: 1.8rem; font-weight: 800; color: var(--red); }
.stat-label { font-size: 0.72rem; color: var(--gray-400); font-weight: 600; text-transform: uppercase; }

.admin-btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

.result-fixture {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-200);
  gap: 12px;
}
.result-fixture:last-child { border-bottom: none; }

.result-teams { flex: 1; font-size: 0.85rem; font-weight: 600; }
.result-date  { font-size: 0.75rem; color: var(--gray-400); }

.result-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── About Page ──────────────────────────────────────────────── */
.about-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  max-width: 700px;
}
.about-hero {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  padding: 40px 32px;
  text-align: center;
  color: var(--white);
}
.about-hero .cannon { font-size: 4rem; }
.about-hero h2 { font-size: 1.8rem; font-weight: 800; margin-top: 8px; }
.about-hero p  { opacity: 0.85; margin-top: 6px; }

.about-body { padding: 32px; }
.about-body p { color: var(--gray-700); line-height: 1.7; margin-bottom: 16px; }
.about-body p:last-child { margin-bottom: 0; }
.about-body h3 { color: var(--red); font-size: 1.15rem; font-weight: 800; margin-bottom: 12px; }
.about-signoff { color: var(--red); font-weight: 800; font-size: 1.1rem; margin-top: 4px; }

.prize-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--gold);
  border-left: 5px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.prize-icon { font-size: 2rem; line-height: 1; }
.prize-title { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gold); }
.prize-text { font-size: 0.95rem; color: var(--dark); font-weight: 600; }
.prize-text strong { color: var(--red); }

/* ── Avatars ──────────────────────────────────────────────── */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #fff; font-weight: 800; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.7), 0 1px 3px rgba(0,0,0,0.2);
  line-height: 1;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-block; font-size: 0.62rem; font-weight: 700;
  background: var(--gray-100); color: var(--gray-700);
  border: 1px solid var(--gray-200); border-radius: 20px;
  padding: 1px 7px; white-space: nowrap;
}

/* ── Leaderboard name cell with avatar + badges ───────────── */
.lb-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lb-name-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lb-uname { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.lb-acc { font-weight: 700; color: var(--gray-700); }

/* ── Podium ───────────────────────────────────────────────── */
.podium {
  display: grid; grid-template-columns: repeat(3, 1fr);
  align-items: end; gap: 12px; max-width: 560px; margin: 8px auto 26px;
}
.podium-col {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--gray-200); border-radius: 14px 14px 0 0;
  padding: 14px 8px 0; position: relative;
}
.podium-col.place-1 { padding-top: 20px; border-color: var(--gold); box-shadow: 0 -4px 20px rgba(156,130,74,0.18); }
.podium-col.me { outline: 2px solid var(--red); }
.podium-col.empty { background: transparent; border: none; }
.podium-medal { font-size: 1.5rem; }
.podium-name { font-size: 0.82rem; font-weight: 700; text-align: center; display: flex; align-items: center; gap: 4px; }
.podium-pts { font-size: 0.78rem; font-weight: 800; color: var(--red); }
.podium-stand {
  width: 100%; margin-top: 6px; text-align: center; font-weight: 800; color: #fff;
  background: var(--gray-400); border-radius: 8px 8px 0 0;
}
.podium-col.place-1 .podium-stand { background: var(--gold); height: 64px; line-height: 64px; font-size: 1.4rem; }
.podium-col.place-2 .podium-stand { background: #B4B2A9; height: 46px; line-height: 46px; font-size: 1.2rem; }
.podium-col.place-3 .podium-stand { background: #C08457; height: 34px; line-height: 34px; font-size: 1.1rem; }

/* ── Confetti ─────────────────────────────────────────────── */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 9998; overflow: hidden; }
.confetti i {
  position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 1px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(600deg); opacity: 0.9; }
}

/* ── Skeleton loaders ─────────────────────────────────────── */
.skel-card, .skel-row {
  background: var(--surface); border-radius: 12px; box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 14px;
}
.skel-row { display: flex; align-items: center; gap: 12px; }
.skel-teams { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0; }
.skel-bar { height: 12px; border-radius: 6px; background: linear-gradient(90deg,var(--skel-a),var(--skel-b),var(--skel-a)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skel-circle { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(90deg,var(--skel-a),var(--skel-b),var(--skel-a)); background-size: 200% 100%; animation: shimmer 1.3s infinite; flex-shrink: 0; }
.skel-circle.sm { width: 30px; height: 30px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── My Picks page ────────────────────────────────────────── */
.mp-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.mp-name { font-size: 1.3rem; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.mp-sub { display: flex; gap: 5px; margin-top: 4px; color: var(--gray-400); font-size: 0.8rem; }
.mp-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 20px; }
.mp-stat { background: var(--surface); border: 1px solid var(--gray-200); border-radius: 12px; padding: 14px 8px; text-align: center; box-shadow: var(--shadow); }
.mp-num { font-size: 1.5rem; font-weight: 800; color: var(--red); }
.mp-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--gray-400); margin-top: 2px; }
.mp-list { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.mp-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--gray-200); font-size: 0.85rem; }
.mp-row:last-child { border-bottom: none; }
.mp-gw { display: inline-block; background: var(--red); color: #fff; font-size: 0.66rem; font-weight: 800; padding: 1px 6px; border-radius: 5px; margin-right: 4px; }
.mp-pred { display: flex; align-items: center; gap: 8px; color: var(--gray-700); white-space: nowrap; }
@media (max-width: 700px) {
  .mp-stats { grid-template-columns: repeat(3, 1fr); }
  .mp-row { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ── Predict button press feedback ────────────────────────── */
.predict-btn { transition: transform 0.1s ease, background 0.2s ease; }
.predict-btn:active { transform: scale(0.94); }
.fixture-card.v2 { transition: box-shadow var(--transition), transform var(--transition); }

.contact-block { padding: 14px 0; border-bottom: 1px solid var(--gray-200); }
.contact-block:last-child { border-bottom: none; }
.contact-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-400); margin-bottom: 4px; }
.contact-value { font-size: 1.05rem; font-weight: 700; color: var(--dark); }
.contact-value a { color: var(--red); text-decoration: none; }
.contact-value a:hover { text-decoration: underline; }
.about-placeholder {
  background: var(--gray-100);
  border-radius: 8px;
  padding: 20px;
  border-left: 4px solid var(--gold);
  color: var(--gray-400);
  font-style: italic;
}

/* ── Toast ───────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
  max-width: 320px;
}
.toast-success { background: #166534; color: white; }
.toast-error   { background: #991b1b; color: white; }
.toast-info    { background: var(--toast-info-bg); color: var(--toast-info-text); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}

/* ── Modal ───────────────────────────────────────────────────── */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
#modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--gray-400);
  padding: 4px;
}
.modal-body { padding: 20px; }

/* ── Loading Spinner ─────────────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  text-align: center;
  padding: 40px;
  color: var(--gray-400);
}

/* ── Empty / Error states ────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--gray-400);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: 10px; }
.empty-state p { font-size: 0.9rem; }

.error-banner {
  background: var(--err-bg);
  border: 1px solid var(--err-border);
  color: var(--err-text);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 0.875rem;
}

/* ── Fixture Card v2 (Classic Red Header) ────────────────────── */
.fixture-card.v2 {
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.fixture-card.v2:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.fixture-card.v2.completed { opacity: 0.92; }
/* Greyed out once predictions are locked (30 min before kick-off). */
.fixture-card.v2.locked { opacity: 0.55; filter: grayscale(0.4); }
.fixture-card.v2.locked:hover { transform: none; box-shadow: var(--shadow); }

.fc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--red);
  color: var(--white);
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 700;
}
.fc-header-left { display: flex; gap: 8px; align-items: center; }
.fc-gw { background: rgba(255,255,255,0.2); padding: 2px 9px; border-radius: 20px; }
.fc-venue { font-weight: 700; }
.fc-date { font-weight: 500; opacity: 0.95; }

.fc-timer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--gray-700);
  background: var(--gray-100);
  padding: 5px 12px;
  border-bottom: 1px solid var(--gray-200);
}
.fc-timer b { color: var(--red); font-weight: 800; }

.req-mark { color: var(--red); font-weight: 800; }

.fc-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  gap: 8px;
}
.fc-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 120px;
}
.fc-crest-wrap { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; }
.fc-crest { width: 46px; height: 46px; object-fit: contain; }
.fc-crest-fallback {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--gray-200); color: var(--gray-700);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.8rem;
}
.fc-name { font-size: 0.82rem; font-weight: 700; text-align: center; line-height: 1.2; }
.fc-name.arsenal { color: var(--red); }
.fc-nick { display: block; font-size: 0.68rem; font-weight: 600; color: var(--gray-400); margin-top: 1px; }
.fc-captain { font-size: 0.68rem; font-weight: 600; color: var(--gray-700); text-align: center; display: inline-flex; align-items: center; gap: 3px; }
.cap-icon { vertical-align: middle; }
.lb-flag { margin-right: 5px; font-size: 1.05em; }
.flag-img { width: 22px; height: 16px; object-fit: cover; border-radius: 2px; vertical-align: middle; box-shadow: 0 0 0 1px rgba(0,0,0,0.10); }
.fc-closes { width: 100%; text-align: right; font-size: 0.7rem; color: var(--gray-400); margin-top: 2px; }

.fc-mid { min-width: 62px; text-align: center; font-weight: 800; color: var(--gray-400); font-size: 1.1rem; }
.fc-score { font-size: 1.6rem; font-weight: 800; color: var(--dark); }
.fc-score-sep { font-size: 1.2rem; font-weight: 800; color: var(--gray-400); margin: 0 6px; }
.fc-ball { font-size: 1.3rem; }

.fc-stadium {
  display: flex; align-items: center; gap: 6px;
  padding: 0 20px 12px;
  font-size: 0.76rem; color: var(--gray-700);
}
.fc-map { color: var(--red); text-decoration: none; font-weight: 700; margin-left: 4px; }
.fc-map:hover { text-decoration: underline; }

/* Prediction breakdown */
.fc-votes { padding: 4px 20px 12px; }
.fc-votes-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--gray-700); margin-bottom: 6px;
}
.fc-votes-total { color: var(--gray-400); font-weight: 600; text-transform: none; letter-spacing: 0; }
.fc-votes-bar {
  display: flex; height: 8px; border-radius: 6px; overflow: hidden;
  background: var(--gray-200); margin-bottom: 7px;
}
.fc-votes-bar .seg.win  { background: var(--red); }
.fc-votes-bar .seg.draw { background: var(--gray-400); }
.fc-votes-bar .seg.loss { background: var(--seg-loss); }
.fc-votes-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.72rem; color: var(--gray-700); }
.fc-votes-legend b { font-weight: 800; }
.fc-votes-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.fc-votes-legend .dot.win  { background: var(--red); }
.fc-votes-legend .dot.draw { background: var(--gray-400); }
.fc-votes-legend .dot.loss { background: var(--seg-loss); }

.fc-footer {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 20px;
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
}
.fc-footer .predict-btn { margin-left: auto; }
/* Prediction footer: centre the score inputs + Predict button as a group. */
.fc-footer-predict { justify-content: center; }
.fc-footer-predict .predict-btn { margin-left: 0; }
.fc-footer-predict .fc-closes { text-align: center; }
.fc-footer .prediction-label { font-size: 0.82rem; font-weight: 600; color: var(--gray-700); }
.fc-footer .points-badge, .fc-footer .status-pill { margin-left: auto; }

/* ── Utilities ───────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-2 { margin-top: 8px; }
.divider { height: 1px; background: var(--gray-200); margin: 20px 0; }

/* ── Responsive ──────────────────────────────────────────────── */
/* Prevent horizontal scroll on small screens */
html, body { overflow-x: hidden; }
* { -webkit-text-size-adjust: 100%; }

/* ── Hamburger nav for phones & smaller tablets ─────────────── */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  header nav {
    position: absolute;
    top: 60px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--red-dark);
    padding: 8px;
    display: none;
    box-shadow: 0 10px 24px rgba(0,0,0,0.28);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }
  header nav.open { display: flex; }
  header .nav-btn { width: 100%; text-align: left; padding: 13px 16px; font-size: 0.95rem; border-radius: 8px; }
  header .nav-btn.active { background: rgba(255,255,255,0.18); }
  .nav-logout { margin-top: 4px; }
}

/* ── Tablet: give the leaderboard a touch more room ─────────── */
@media (max-width: 820px) {
  .podium { max-width: 480px; }
}

/* ── Phone tweaks ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .header-inner { padding: 0 14px; }
  .logo-text { display: none; }
  .page-content { padding: 20px 14px 60px; }

  /* Fixture cards */
  .fc-teams { padding: 16px 12px; }
  .fc-team { width: 92px; gap: 5px; }
  .fc-crest-wrap, .fc-crest, .fc-crest-fallback { width: 40px; height: 40px; }
  .fc-name { font-size: 0.76rem; }
  .fc-mid { min-width: 48px; }
  .fc-score { font-size: 1.35rem; }
  .fc-header, .fc-stadium, .fc-votes, .fc-footer { padding-left: 14px; padding-right: 14px; }
  .fc-votes-legend { gap: 10px; font-size: 0.68rem; }

  /* Leaderboard */
  .lb-header, .lb-row { grid-template-columns: 34px 1fr 40px 50px 50px 50px 50px; padding: 10px 12px; font-size: 0.8rem; }
  .lb-acc, .lb-exact, .lb-correct { display: none; }
  .lb-header { display: none; }
  .avatar { box-shadow: 0 0 0 1px rgba(255,255,255,0.7); }

  /* Podium a bit tighter */
  .podium { gap: 6px; }
  .podium-name { font-size: 0.72rem; }

  /* My Picks stats */
  .mp-stats { grid-template-columns: repeat(3, 1fr); }

  /* Prize banner wraps nicely */
  .prize-banner { padding: 12px 14px; }
}

/* ── Small phones ───────────────────────────────────────────── */
@media (max-width: 380px) {
  .fc-team { width: 80px; }
  .fc-name { font-size: 0.72rem; }
  .mp-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ── Global footer ──────────────────────────────────────────── */
#site-footer {
  margin-top: 40px;
  padding: 24px 20px 34px;
  border-top: 1px solid var(--gray-200);
  background: var(--surface);
  text-align: center;
  color: var(--gray-400);
}
.footer-disclaimer { max-width: 720px; margin: 0 auto 12px; font-size: 0.75rem; line-height: 1.55; }
.footer-links {
  display: flex; gap: 8px 18px; justify-content: center; align-items: center;
  flex-wrap: wrap; margin-bottom: 10px;
}
.footer-links a { color: var(--gray-700); text-decoration: none; font-size: 0.82rem; font-weight: 600; }
.footer-links a:hover { color: var(--red); }
.footer-coffee {
  background: var(--gold); color: #1A1A1A !important;
  padding: 6px 15px; border-radius: 20px; font-weight: 800 !important;
  transition: background var(--transition);
}
.footer-coffee:hover { background: var(--gold-light); color: #1A1A1A !important; }
.footer-copy { font-size: 0.72rem; }

/* ── Consent banner ─────────────────────────────────────────── */
#cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 9997;
  max-width: 640px; margin: 0 auto;
  background: var(--surface-2); color: var(--dark);
  border: 1px solid var(--gray-200); border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 14px 16px; font-size: 0.82rem; line-height: 1.5;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between;
}
#cookie-banner a { color: var(--red); font-weight: 600; }
#cookie-banner .btn { width: auto; padding: 9px 20px; flex-shrink: 0; }
#cookie-banner.hidden { display: none; }
