:root {
  --ink: #07131a;
  --ink-2: #0f1923;
  --surface: #14141c;
  --surface-2: #1a1a22;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,0,107,0.5);
  --pink: #FF006B;
  --pink-glow: rgba(255,0,107,0.35);
  --burgundy: #8C1A2E;
  --gold: #D4B885;
  --text: #ffffff;
  --text-muted: rgba(255,255,255,0.65);
  --text-faint: rgba(255,255,255,0.4);
  --green: #22C55E;
  --amber: #F59E0B;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--text);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.display { font-family: 'Anton', Impact, 'Inter', sans-serif; font-weight: 400; letter-spacing: 0.5px; }
a { color: var(--pink); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--gold); }
button { font-family: inherit; }

/* ─── Topbar ───────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(7,19,26,0.75);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .ball { font-size: 24px; filter: drop-shadow(0 0 8px rgba(255,0,107,0.4)); }
.brand .wordmark {
  background: linear-gradient(90deg, var(--gold), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1.5px;
}
.topnav { display: flex; gap: 22px; align-items: center; }
.topnav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  position: relative;
}
.topnav a:hover { color: var(--text); }
.topnav a:not(.admin-link)::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--pink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s;
}
.topnav a:not(.admin-link):hover::after,
.topnav a.active:not(.admin-link)::after { transform: scaleX(1); }
.topnav a.active:not(.admin-link) { color: var(--text); }
.topnav .admin-link.active { background: var(--pink); color: white; border-color: var(--pink); }
.nav-toggle {
  display: none;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
}
.topnav .admin-link {
  padding: 6px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 18px;
}
.topnav .admin-link:hover {
  background: rgba(255,0,107,0.15);
  border-color: var(--pink);
}

/* ─── Hero ──────────────────────────────────────────────────── */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  max-height: 820px;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 30%, rgba(255,0,107,0.25), transparent 50%),
    linear-gradient(180deg, rgba(7,19,26,0.65) 0%, rgba(7,19,26,0.35) 45%, rgba(7,19,26,0.95) 100%);
  z-index: 2;
}
.hero-content {
  position: relative;
  z-index: 3;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 28px;
  text-align: center;
  transform: translateY(-30px);
}
.hero-tag {
  display: inline-block;
  padding: 6px 14px;
  background: var(--pink);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  border-radius: 24px;
  margin-bottom: 18px;
  box-shadow: 0 0 24px var(--pink-glow);
  animation: glow-pulse 2.4s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 24px var(--pink-glow); }
  50% { box-shadow: 0 0 48px var(--pink-glow); }
}
.hero h1.display {
  font-size: clamp(38px, 7vw, 72px);
  line-height: 0.95;
  margin: 0 0 16px;
  text-shadow: 0 2px 24px rgba(0,0,0,0.85);
  text-transform: uppercase;
}
.hero-sub {
  font-size: clamp(15px, 2vw, 19px);
  color: var(--text);
  text-shadow: 0 1px 12px rgba(0,0,0,0.85);
  margin: 0 0 28px;
}
.hero-sub strong { color: var(--gold); }
.hero-cta { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

.hero-stats {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 28px;
  padding: 14px 28px;
  background: rgba(7,19,26,0.65);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.hero-stats > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}
.hero-stats .num {
  font-family: 'Anton', Impact, sans-serif;
  font-size: 30px;
  line-height: 1;
  color: var(--gold);
}
.hero-stats .lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-top: 4px;
}

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  letter-spacing: 0.3px;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--pink);
  color: white;
  box-shadow: 0 8px 24px var(--pink-glow);
}
.btn-primary:hover { box-shadow: 0 12px 32px var(--pink-glow); }
.btn-secondary {
  background: rgba(255,255,255,0.12);
  color: var(--text);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.2);
  border-color: var(--text-muted);
}
.btn-link { background: none; color: var(--text-muted); border: none; cursor: pointer; font-size: 13px; padding: 0; }

/* ─── Layout ──────────────────────────────────────────────── */
.container { max-width: 1180px; margin: 0 auto; padding: 36px 24px; }

.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 22px;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
}
.card h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.card .muted { color: var(--text-muted); font-size: 13px; }
.loading { color: var(--text-muted); padding: 14px 0; font-size: 13px; }
.error { color: #FF8A8A; font-size: 13px; }
.muted { color: var(--text-muted); }

/* ─── Reels ────────────────────────────────────────────────── */
.reels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.reel {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--ink-2);
  border: 1px solid var(--border);
  transition: transform 0.2s, border-color 0.2s;
}
.reel:hover { transform: translateY(-3px); border-color: var(--border-hover); }
.reel video {
  width: 100%;
  display: block;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: #000;
}
.reel-label {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.reel-status {
  font-size: 10px;
  background: var(--gold);
  color: var(--ink);
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.reel-coming-soon video { opacity: 0.3; }
.reel-coming-soon::after {
  content: "Generating…";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}

/* ─── Standings ─────────────────────────────────────────────── */
table.standings {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.standings th, table.standings td {
  padding: 12px 8px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
table.standings th {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 1.4px;
  font-weight: 700;
  text-transform: uppercase;
}
table.standings td.team-name {
  text-align: left;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
table.standings td.team-name img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
}
table.standings tr.in-playoff td:first-child {
  color: var(--pink);
  font-weight: 700;
  position: relative;
}
table.standings tr.in-playoff td:first-child::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--pink);
  border-radius: 2px;
}
.pts { color: var(--pink); font-weight: 700; }
.pos-1 { color: var(--gold); }

/* ─── Fixtures ────────────────────────────────────────────── */
.fixture-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  transition: border-color 0.15s, transform 0.15s;
}
.fixture-row:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}
.fixture-row .teams { flex: 1; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.fixture-row .vs { color: var(--text-muted); font-weight: 400; margin: 0 6px; font-size: 12px; }
.fixture-row .crest {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  object-fit: contain;
}
.fixture-row .meta { color: var(--text-muted); font-size: 12px; }
.fixture-row .status {
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-left: 12px;
  text-transform: uppercase;
}
.status.scheduled { background: rgba(255,0,107,0.18); color: var(--pink); }
.status.live { background: rgba(34,197,94,0.18); color: var(--green); }
.status.confirmed { background: rgba(255,255,255,0.1); color: var(--text-muted); }
.status.forfeit { background: rgba(245,158,11,0.18); color: var(--amber); }

/* ─── Teams ───────────────────────────────────────────────── */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.team-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.team-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 32px rgba(255,0,107,0.15);
}
.team-card .crest {
  width: 96px;
  height: 96px;
  margin-bottom: 12px;
  object-fit: contain;
}
.team-card .crest-fallback {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 30px;
  margin-bottom: 12px;
}
.team-card h3 { margin: 0; font-size: 16px; font-weight: 700; }
.team-card .slogan {
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  margin-top: 4px;
}

/* ─── Transfers ────────────────────────────────────────────── */
.transfer-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
}
.transfer-row .icon { color: var(--pink); margin-right: 12px; font-size: 16px; }
.transfer-row .arrow { color: var(--gold); margin: 0 8px; }
.transfer-row .fee { color: var(--pink); font-weight: 700; margin-left: auto; }

/* ─── CTA grid (footer cards) ─────────────────────────────── */
.cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 36px 0;
}
.cta-card {
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  border: 1px solid var(--border);
}
.cta-card.cta-player {
  background: linear-gradient(135deg, rgba(255,0,107,0.18), rgba(140,26,46,0.18));
  border-color: rgba(255,0,107,0.3);
}
.cta-card.cta-coach {
  background: linear-gradient(135deg, rgba(212,184,133,0.15), rgba(140,26,46,0.12));
  border-color: rgba(212,184,133,0.3);
}
.cta-card.cta-sponsor {
  background: linear-gradient(135deg, rgba(34,197,94,0.12), rgba(15,128,93,0.12));
  border-color: rgba(34,197,94,0.3);
}
.cta-card .cta-icon { font-size: 38px; margin-bottom: 10px; }
.cta-card h2 { font-size: 22px; margin: 0 0 8px; }
.cta-card p { color: var(--text-muted); margin: 0 0 18px; font-size: 14px; }
.cta-card p strong { color: var(--gold); }

/* ─── Admin ───────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 4px; }
.tab {
  background: transparent;
  border: none;
  padding: 10px 16px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.tab.active { color: var(--pink); border-bottom-color: var(--pink); }
.tab:hover { color: var(--text); }

.admin-section .app-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
}
.admin-section .app-card h4 { margin: 0; font-size: 15px; }
.admin-section .app-card .meta { color: var(--text-muted); font-size: 12px; margin-bottom: 10px; }
.admin-section .app-card .body {
  background: var(--ink);
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 12px;
}
.admin-section .actions { display: flex; gap: 8px; }

input[type="email"], input[type="password"], input[type="text"], input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 12px;
  font-family: inherit;
  transition: border-color 0.15s;
}
input:focus { outline: none; border-color: var(--pink); }
.login-card { max-width: 400px; margin: 0 auto; }
.login-card input { margin-top: 8px; }

footer {
  margin-top: 60px;
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--text-faint);
  font-size: 13px;
}
.footer-row { display: flex; justify-content: space-between; align-items: center; }

@media (max-width: 720px) {
  .hero { height: 80vh; min-height: 520px; }
  .hero-stats { gap: 16px; padding: 12px 18px; }
  .hero-stats .num { font-size: 22px; }
  .nav-toggle { display: block; }
  .topnav {
    position: absolute;
    top: 60px;
    right: 16px;
    background: rgba(7,19,26,0.97);
    border: 1px solid var(--border);
    border-radius: 14px;
    flex-direction: column;
    gap: 6px;
    padding: 14px 20px;
    display: none;
    box-shadow: 0 10px 32px rgba(0,0,0,0.5);
  }
  body.nav-open .topnav { display: flex; }
  .topnav a { font-size: 15px; padding: 6px 0; }
  .topnav a:not(.admin-link)::after { display: none; }
  .topbar { padding: 12px 16px; }
  .container { padding: 28px 16px; }
  .card { padding: 20px 16px; }
  .card h2 { font-size: 20px; }
  .teams-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .team-card { padding: 16px 12px; }
  .team-card .crest { width: 80px; height: 80px; }
  .reels-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header h1.display { font-size: clamp(32px, 9vw, 50px); }
}

/* ─── Multi-page additions ───────────────────────────────── */
.page-header {
  background:
    radial-gradient(circle at 70% 30%, rgba(255,0,107,0.18), transparent 50%),
    linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
  padding: 56px 0 36px;
  border-bottom: 1px solid var(--border);
}
.page-header .eyebrow {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(255,0,107,0.18);
  color: var(--pink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  border-radius: 16px;
  margin-bottom: 12px;
}
.page-header h1.display {
  font-size: clamp(38px, 6vw, 64px);
  margin: 0 0 8px;
  text-transform: uppercase;
}
.page-header p {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0;
  max-width: 640px;
}

.card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}
@media (max-width: 720px) {
  .card-row { grid-template-columns: 1fr; }
}
.card-row .next-card {
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, border-color 0.15s;
  display: block;
}
.card-row .next-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
}
.card-row .next-card h3 {
  margin: 6px 0 4px;
  font-size: 20px;
}

.gw-heading {
  font-size: 11px;
  letter-spacing: 1.4px;
  color: var(--gold);
  margin: 18px 0 8px;
  font-weight: 800;
}
.gw-heading:first-child { margin-top: 0; }

.reels-preview .reel:nth-child(n+4) { display: none; }
@media (min-width: 900px) {
  .reels-preview { grid-template-columns: repeat(3, 1fr); }
}

/* Scroll fade-in for cards */
@media (prefers-reduced-motion: no-preference) {
  .card {
    animation: fade-up 0.5s ease-out backwards;
  }
  .card:nth-child(1) { animation-delay: 0.05s; }
  .card:nth-child(2) { animation-delay: 0.1s; }
  .card:nth-child(3) { animation-delay: 0.15s; }
  .card:nth-child(4) { animation-delay: 0.2s; }
  @keyframes fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ─── Players ──────────────────────────────────────────────── */
.leaderboard-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.lb-tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.lb-tab.active { color: white; background: var(--pink); border-color: var(--pink); }
.lb-tab:hover:not(.active) { color: var(--text); border-color: var(--text-muted); }

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 6px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, border-color 0.15s;
}
.leaderboard-row:hover { transform: translateY(-1px); border-color: var(--border-hover); }
.leaderboard-row .rank {
  width: 24px;
  text-align: center;
  font-weight: 700;
  color: var(--text-muted);
}
.leaderboard-row:nth-child(1) .rank { color: var(--gold); }
.leaderboard-row:nth-child(2) .rank { color: var(--text); }
.leaderboard-row:nth-child(3) .rank { color: #CD7F32; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.avatar-placeholder {
  background: linear-gradient(135deg, var(--burgundy), var(--pink));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
}
.lb-name { flex: 1; font-weight: 600; }
.lb-value {
  color: var(--pink);
  font-weight: 800;
  font-size: 22px;
  font-family: 'Anton', sans-serif;
}

/* ─── Player profile page ─────────────────────────────────── */
.back-link {
  display: inline-block;
  color: var(--text-muted);
  font-size: 13px;
  margin: 24px 0 18px;
}
.back-link:hover { color: var(--text); }
.player-profile { padding-top: 0; }

.player-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 20px;
  margin-bottom: 16px;
  background:
    radial-gradient(circle at 80% 20%, rgba(255,0,107,0.18), transparent 50%),
    linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}
.player-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--pink);
}
.player-avatar.avatar-placeholder {
  font-size: 36px;
  border: 3px solid var(--gold);
}
.player-meta { flex: 1; min-width: 0; }
.player-meta .eyebrow { font-size: 10px; }
.player-meta h1.display {
  font-size: clamp(28px, 5vw, 44px);
  margin: 6px 0;
  text-transform: uppercase;
}
.player-meta .muted {
  font-size: 12px;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 14px;
  text-align: center;
}
.stat-num {
  display: block;
  font-family: 'Anton', sans-serif;
  font-size: 38px;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.event-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.event-row:last-child { border-bottom: none; }
.event-icon { font-size: 18px; }
