/* ============================================================
   PRIMETIME GAMING LEAGUE — Global Styles
   ============================================================ */
:root {
  --bg: #08090d;
  --surface: #10121a;
  --surface2: #181b26;
  --border: rgba(255,255,255,0.07);
  --gold: #f5c842;
  --gold-dim: rgba(245,200,66,0.12);
  --red: #e03a3a;
  --red-dim: rgba(224,58,58,0.12);
  --green: #4cdb7a;
  --blue: #3a8fe8;
  --text: #e6e8f0;
  --text-muted: #6b7090;
  --text-dim: #3a3f58;
  --radius: 8px;
  --nav-h: 58px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

/* ── NAV ── */
nav {
  height: var(--nav-h);
  background: rgba(8,9,13,0.97);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 32px;
  flex-shrink: 0;
  text-decoration: none;
}
.logo-icon {
  width: 30px;
  height: 30px;
  background: var(--gold);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-icon svg { width: 14px; height: 14px; }
.logo-text .top { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--gold); text-transform: uppercase; display: block; }
.logo-text .bot { font-size: 9px; font-weight: 600; letter-spacing: 1.5px; color: var(--text-muted); text-transform: uppercase; display: block; }

.nav-links { display: flex; gap: 2px; flex: 1; }
.nav-link {
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  letter-spacing: 0.2px;
}
.nav-link:hover { color: var(--text); background: var(--surface2); }
.nav-link.active { color: var(--gold); background: var(--gold-dim); }

.nav-right { display: flex; align-items: center; gap: 10px; }

.game-switcher { display: flex; gap: 6px; }
.game-pill {
  padding: 5px 13px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}
.game-pill:hover { border-color: var(--gold); color: var(--gold); }
.game-pill.active { background: var(--gold); color: #08090d; border-color: var(--gold); }

.nav-auth-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-block;
}
.btn-login { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-login:hover { border-color: rgba(255,255,255,0.18); }
.btn-register { background: var(--gold); color: #08090d; }
.btn-register:hover { background: #f8d45a; }
.btn-signout { background: transparent; color: var(--text-muted); border: 1px solid var(--border); font-size: 12px; padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.btn-signout:hover { color: var(--red); border-color: var(--red); }

/* ── PAGE WRAPPER ── */
.page-wrap {
  max-width: 1020px;
  margin: 0 auto;
  padding: 32px 28px;
  width: 100%;
}

/* ── BUTTONS ── */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  letter-spacing: 0.2px;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}
.btn-gold { background: var(--gold); color: #08090d; }
.btn-gold:hover { background: #f8d45a; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: rgba(255,255,255,0.18); background: var(--surface2); }
.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(224,58,58,0.25); }
.btn-danger:hover { background: rgba(224,58,58,0.2); }
.btn-sm { padding: 6px 12px; font-size: 11px; }
.btn-full { width: 100%; }

/* ── CARDS / SURFACES ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-lg { border-radius: 12px; padding: 24px; }

/* ── SECTION HEADER ── */
.sh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sh h2 { font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); }
.sh a { font-size: 11px; color: var(--gold); cursor: pointer; text-decoration: none; }

.page-title { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 22px; }
.page-title span { color: var(--gold); }

/* ── MATCH ROWS ── */
.match-list { display: flex; flex-direction: column; gap: 7px; }
.match-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 12px;
  transition: border-color 0.15s;
}
.match-row:hover { border-color: rgba(245,200,66,0.2); }
.match-team { display: flex; align-items: center; gap: 10px; }
.match-team.right { flex-direction: row-reverse; text-align: right; }
.team-badge {
  width: 34px; height: 34px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 900;
  flex-shrink: 0; letter-spacing: 0.5px;
}
.team-name { font-size: 13px; font-weight: 700; }
.team-record { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.score-box { text-align: center; min-width: 80px; }
.score { font-size: 22px; font-weight: 900; letter-spacing: 3px; }
.score-sub { font-size: 9px; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.match-meta { text-align: right; min-width: 72px; }
.match-badge {
  display: inline-block;
  font-size: 9px; font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase; letter-spacing: 1px;
}
.badge-live { background: rgba(76,219,122,0.12); color: var(--green); border: 1px solid rgba(76,219,122,0.25); }
.badge-final { background: rgba(107,112,144,0.1); color: var(--text-muted); }
.badge-soon { background: rgba(58,143,232,0.1); color: var(--blue); border: 1px solid rgba(58,143,232,0.25); }
.badge-pending { background: rgba(245,200,66,0.1); color: var(--gold); border: 1px solid rgba(245,200,66,0.25); }

/* ── STANDINGS TABLE ── */
.division-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.division-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 800;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
}
.division-header::before {
  content: '';
  width: 3px; height: 12px;
  background: var(--gold);
  border-radius: 2px;
}
.standings-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.standings-table th {
  text-align: left; padding: 8px 16px;
  font-size: 10px; color: var(--text-dim);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
}
.standings-table td { padding: 10px 16px; border-top: 1px solid rgba(255,255,255,0.03); }
.standings-table tr:hover td { background: var(--surface2); }
.standings-table .rank { color: var(--text-dim); font-weight: 800; font-size: 11px; }
.standings-table .tn { font-weight: 700; display: flex; align-items: center; gap: 9px; }
.standings-table .pct { color: var(--gold); font-weight: 800; }
.standings-table tr.playoff td:first-child { border-left: 2px solid var(--gold); }
.standings-table tr.bubble td:first-child { border-left: 2px solid var(--blue); }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 7px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: rgba(245,200,66,0.4);
}
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.form-select option { background: var(--surface2); }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 11px; color: var(--red); margin-top: 5px; display: none; }
.form-error.visible { display: block; }

/* ── ALERTS ── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 18px;
  display: none;
}
.alert.visible { display: block; }
.alert-success { background: rgba(76,219,122,0.1); color: var(--green); border: 1px solid rgba(76,219,122,0.25); }
.alert-error { background: var(--red-dim); color: var(--red); border: 1px solid rgba(224,58,58,0.25); }
.alert-info { background: rgba(58,143,232,0.1); color: var(--blue); border: 1px solid rgba(58,143,232,0.25); }

/* ── LOADING SPINNER ── */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px;
  color: var(--text-muted);
  font-size: 13px;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 13px;
}
.empty-state .empty-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.4; }

/* ── STAT STRIP ── */
.stat-strip { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-card .val { font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.stat-card .lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.stat-card .chg { font-size: 10px; color: var(--green); margin-top: 5px; }

/* ── PLAYER CARDS ── */
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px,1fr)); gap: 10px; }
.player-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.15s;
}
.player-card:hover { border-color: rgba(245,200,66,0.3); }
.player-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900;
  margin-bottom: 10px;
}
.pos-badge {
  display: inline-block;
  font-size: 9px; font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 7px;
  letter-spacing: 0.5px;
}
.player-name-text { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.player-ovr { font-size: 10px; color: var(--text-muted); margin-bottom: 9px; }
.player-stats { display: flex; gap: 14px; }
.pstat .v { font-size: 14px; font-weight: 800; }
.pstat .l { font-size: 9px; color: var(--text-dim); margin-top: 2px; }

/* ── TEAM CARDS ── */
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px,1fr)); gap: 12px; }
.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  transition: all 0.15s;
}
.team-card:hover { border-color: rgba(245,200,66,0.3); transform: translateY(-1px); }
.team-card-top { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.team-logo {
  width: 46px; height: 46px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; letter-spacing: 0.5px;
}
.team-card-name { font-size: 15px; font-weight: 800; letter-spacing: -0.3px; }
.team-card-owner { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.team-card-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; border-top: 1px solid var(--border); padding-top: 13px; }
.tcs .v { font-size: 16px; font-weight: 800; }
.tcs .l { font-size: 9px; color: var(--text-dim); margin-top: 2px; }

/* ── LEADERS ── */
.stats-leaders { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.leader-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.leader-block h3 {
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 13px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.leader-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.leader-rank { font-size: 11px; color: var(--text-dim); width: 16px; font-weight: 800; }
.leader-name { flex: 1; font-size: 12.5px; font-weight: 700; }
.leader-team-tag { font-size: 10px; color: var(--text-muted); font-weight: 500; }
.leader-val { font-size: 14px; font-weight: 900; color: var(--gold); min-width: 44px; text-align: right; }
.bar-bg { width: 50px; height: 3px; background: var(--surface2); border-radius: 2px; }
.bar-fill { height: 3px; border-radius: 2px; background: var(--gold); }

/* ── HERO ── */
.hero {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 52px 44px;
  margin-bottom: 24px;
}
.hero-stripe {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--red) 50%, transparent 100%);
}
.hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 85% 50%, rgba(245,200,66,0.05) 0%, transparent 60%);
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 800; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--gold); margin-bottom: 16px;
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
.hero h1 { font-size: 40px; font-weight: 900; letter-spacing: -1.5px; line-height: 1.1; margin-bottom: 14px; }
.hero h1 .pt { color: var(--gold); }
.hero p { color: var(--text-muted); font-size: 14px; line-height: 1.65; max-width: 440px; margin-bottom: 26px; }
.btn-row { display: flex; gap: 10px; }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .stat-strip { grid-template-columns: repeat(2,1fr); }
  .stats-leaders { grid-template-columns: 1fr; }
  .hero { padding: 32px 24px; }
  .hero h1 { font-size: 28px; }
  .page-wrap { padding: 20px 16px; }
}

/* ── MOBILE NAV ── */
@media (max-width: 768px) {
  nav {
    height: auto;
    flex-direction: column;
    padding: 10px 16px;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .logo { margin-right: 0; width: 100%; justify-content: center; padding: 4px 0; }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    width: 100%;
  }

  .nav-link {
    text-align: center;
    padding: 8px 6px;
    font-size: 11px;
    border-radius: 8px;
    background: var(--surface2);
  }

  .nav-right {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
    align-items: center;
  }

  .game-switcher {
    display: flex;
    width: 100%;
    gap: 6px;
  }

  .game-pill {
    flex: 1;
    text-align: center;
    padding: 7px 10px;
  }

  .nav-auth-btn {
    width: 100%;
    text-align: center;
    padding: 8px 14px;
  }

  .btn-login, .btn-register, .btn-signout {
    width: 100%;
    text-align: center;
  }
}
