:root {
  --bg: #09111f;
  --panel: rgba(16, 27, 49, 0.94);
  --panel-2: rgba(20, 33, 61, 0.94);
  --border: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --red: #e31b23;
  --green: #22c55e;
  --flash-info: #0ea5e9;
  --flash-success: #22c55e;
  --flash-error: #ef4444;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, rgba(227,27,35,0.12), transparent 30%), linear-gradient(180deg, #0a1020 0%, #09111f 100%);
}
a { color: inherit; text-decoration: none; }
.container { max-width: 1240px; margin: 0 auto; padding: 24px; }
.auth-page-shell { min-height: 100vh; }
.topbar {
  max-width: 1240px; margin: 24px auto 0; padding: 16px 20px;
  display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center;
  background: var(--panel); border: 1px solid var(--border); border-bottom: 3px solid var(--red); border-radius: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; background: var(--red); border-radius: 10px; font-weight: 900; }
.brand-title { font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.brand-sub, .muted, small { color: var(--muted); }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a, .tab { padding: 10px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.nav a.active, .tab.active { background: rgba(227,27,35,0.18); color: var(--text); }
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 24px; padding: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.22);
}
.auth-grid, .grid.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid.two-up.unequal { grid-template-columns: 1.3fr .9fr; }
.hero h1, .hero-banner h1, .panel h1 { margin: 8px 0; font-size: clamp(2rem, 4vw, 3rem); }
.hero-stats, .stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.hero-stats div, .stat-grid div { background: var(--panel-2); border: 1px solid var(--border); border-radius: 18px; padding: 18px; }
.hero-stats strong, .hero-stats span, .stat-grid strong, .stat-grid span { display: block; }
.eyebrow, .section-kicker { text-transform: uppercase; letter-spacing: .16em; font-size: .75rem; font-weight: 800; color: var(--muted); }
.eyebrow.red, .win { color: var(--green); }
.loss { color: #f87171; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px;
  border-radius: 14px; border: 0; cursor: pointer; font-weight: 700;
}
.button.primary { background: linear-gradient(135deg, #e31b23, #b3131b); color: white; }
.button.secondary { background: rgba(148,163,184,0.1); color: white; border: 1px solid var(--border); }
.stack { display: flex; flex-direction: column; gap: 16px; }
label { display: flex; flex-direction: column; gap: 8px; font-weight: 600; }
input, select, textarea {
  width: 100%; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--border);
  background: rgba(9,17,31,0.8); color: white; font: inherit;
}
.tab-row { display: inline-flex; gap: 8px; padding: 6px; border-radius: 18px; background: rgba(148,163,184,0.08); margin-bottom: 18px; }
.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.flash { padding: 12px 14px; border-radius: 14px; font-weight: 600; }
.flash.info { background: rgba(14,165,233,.15); color: #7dd3fc; }
.flash.success { background: rgba(34,197,94,.15); color: #86efac; }
.flash.error { background: rgba(239,68,68,.15); color: #fca5a5; }
.hero-banner, .section-header, .player-card, .list-row, .match-card > div, .inline-search { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.player-card { align-items: flex-end; }
.rank-chip { display: inline-flex; background: rgba(227,27,35,.18); padding: 6px 10px; border-radius: 999px; font-weight: 700; }
.elo-box { text-align: right; }
.elo-box span, .elo-box strong, .elo-box small { display: block; }
.elo-box strong { font-size: 4rem; line-height: 1; }
.list-stack { display: flex; flex-direction: column; gap: 12px; }
.list-row, .match-card, .leaderboard-row {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 18px; padding: 16px;
}
.match-card { display: flex; flex-direction: column; gap: 10px; }
.match-card.large small { color: var(--muted); }
.table-wrap { display: flex; flex-direction: column; gap: 10px; }
.table-head, .leaderboard-row { display: grid; grid-template-columns: 90px 2fr 1fr 1fr 1fr 1fr; gap: 12px; align-items: center; }
.table-head { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; background: transparent; border: 0; padding: 0 12px; }
.leaderboard-row.highlight { border-color: rgba(227,27,35,.45); }
.mono { font-family: 'JetBrains Mono', monospace; }
.top-gap { margin-top: 16px; }
.section-header.compact h3 { margin: 0; }

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-shell-minimal {
  background:
    radial-gradient(circle at top, rgba(227,27,35,0.10), transparent 30%),
    linear-gradient(180deg, #0a1020 0%, #09111f 100%);
}

.auth-kicker {
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f87171;
  font-weight: 800;
}

.auth-kicker-panel {
  color: var(--red);
}

.auth-panel-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.auth-panel-wrap-minimal {
  max-width: 460px;
  padding: 0;
}

.auth-panel {
  width: min(100%, 460px);
  padding: 34px;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.20);
}

.auth-panel-header {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
}

.auth-panel-header-minimal {
  margin-bottom: 20px;
}

.auth-panel h2 {
  margin: 8px 0 0;
  color: #0f172a;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.auth-tabs {
  align-self: flex-start;
  margin-bottom: 0;
  background: rgba(15, 23, 42, 0.06);
}

.auth-form-grid {
  gap: 14px;
}

.auth-form-grid label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  color: #0f172a;
}

.auth-form-grid input {
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.auth-form-grid input:focus {
  outline: none;
  border-color: rgba(227, 27, 35, 0.7);
  box-shadow: 0 0 0 4px rgba(227, 27, 35, 0.12);
}

.auth-submit {
  margin-top: 8px;
  width: 100%;
  justify-content: center;
  padding: 14px 18px;
}

@media (max-width: 1100px) {
  .auth-shell {
    padding: 32px 20px;
  }
}

@media (max-width: 960px) {
  .auth-grid, .grid.two-up, .grid.two-up.unequal, .topbar { grid-template-columns: 1fr; }
  .hero-stats, .stat-grid { grid-template-columns: 1fr 1fr; }
  .table-head, .leaderboard-row { grid-template-columns: 80px 1.5fr 1fr 1fr; }
  .table-head span:nth-child(n+5), .leaderboard-row span:nth-child(n+5) { display: none; }
}
@media (max-width: 640px) {
  .container, .panel { padding: 18px; }
  .hero-stats, .stat-grid { grid-template-columns: 1fr; }
  .topbar, .hero-banner, .section-header, .player-card, .list-row, .match-card > div, .inline-search { display: flex; flex-direction: column; align-items: stretch; }
  .auth-title {
    font-size: clamp(2.4rem, 12vw, 3.4rem);
  }

  .auth-panel-wrap,
  .auth-hero-inner {
    padding: 20px;
  }

  .auth-panel {
    padding: 24px;
  }
}
