:root {
  --bg: #0b0f14;
  --card: #111826;
  --text: #e6edf3;
  --muted: #95a4b6;
  --accent: #4cc2ff;
  --good: #4ade80;
  --bad: #fb7185;
  --border: rgba(255,255,255,.08);
  --shadow: 0 12px 30px rgba(0,0,0,.35);
}

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

body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1000px 600px at 20% 0%, #12243a, var(--bg));
  color: var(--text);
  min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  height: 58px;
  border-bottom: 1px solid rgba(76,194,255,.15);
  background: linear-gradient(90deg, rgba(5,15,30,.95), rgba(8,12,22,.95));
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 rgba(76,194,255,.08), 0 4px 20px rgba(0,0,0,.4);
}
.topbar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(76,194,255,.4), rgba(76,194,255,.2), transparent);
}
.topbar-scan {
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(76,194,255,.15), transparent);
  animation: topbar-scan 4s ease-in-out infinite;
}
@keyframes topbar-scan {
  0%, 100% { opacity: .3; transform: scaleX(.3); }
  50%       { opacity: 1;  transform: scaleX(1); }
}
.brand {
  font-family: 'Russo One', ui-sans-serif;
  font-weight: 400;
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.brand-icon svg { width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; }
.brand-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  letter-spacing: .25em;
  color: var(--accent);
  opacity: .7;
  margin-top: 1px;
  text-transform: uppercase;
}
.topbar-nav {
  display: flex;
  gap: 2px;
  align-items: center;
}
.nav-link {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 4px;
  transition: color .2s, background .2s, border-color .2s;
  position: relative;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  font-family: 'Share Tech Mono', monospace;
}
.nav-link::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform .2s;
  border-radius: 0 2px 2px 0;
}
.nav-link:hover {
  color: var(--accent);
  background: rgba(76,194,255,.06);
  border-color: rgba(76,194,255,.12);
}
.nav-link:hover::before { transform: scaleY(1); }
.nav-link.active {
  color: var(--accent);
  background: rgba(76,194,255,.08);
  border-color: rgba(76,194,255,.18);
}
.nav-link.active::before { transform: scaleY(1); }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  padding: 5px 10px 5px 6px;
  border-radius: 4px;
  border: 1px solid rgba(76,194,255,.2);
  background: rgba(76,194,255,.06);
  transition: border-color .2s, background .2s, color .2s;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: .06em;
}
.user-btn:hover {
  border-color: rgba(76,194,255,.45);
  background: rgba(76,194,255,.12);
  color: var(--accent);
}
.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  background: rgba(76,194,255,.15);
  border: 1px solid rgba(76,194,255,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
  font-family: 'Share Tech Mono', monospace;
}
.topbar-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,.08);
}
.logout-btn {
  color: var(--muted);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.06);
  background: none;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-family: 'Share Tech Mono', monospace;
}
.logout-btn:hover {
  color: var(--bad);
  border-color: rgba(251,113,133,.3);
  background: rgba(251,113,133,.06);
}

/* ── Page wrapper ── */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 16px;
}

/* ── Card ── */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
}

/* ── Buttons ── */
button, .btn {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
  display: inline-block;
  transition: border-color .14s;
}
button:hover, .btn:hover { border-color: rgba(255,255,255,.2); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary, .btn.primary {
  background: rgba(76,194,255,.18);
  border-color: rgba(76,194,255,.35);
  color: var(--accent);
}

/* ── Forms ── */
input {
  width: 100%;
  background: rgba(0,0,0,.25);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  font-size: 14px;
}
input:focus { border-color: rgba(76,194,255,.4); }

/* ── Auth ── */
.auth-form {
  max-width: 360px;
  margin: 80px auto;
}
.auth-form h1 { margin-bottom: 24px; }
.auth-form p { margin: 14px 0; }

/* ── Typography ── */
h1 { font-size: 22px; font-weight: 400; font-family: 'Russo One', ui-sans-serif; font-style: normal; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; }
a { color: var(--accent); }
  
/* ── Profile hero ── */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}
.avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(76,194,255,.18);
  border: 1px solid rgba(76,194,255,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
}
.profile-meta { flex: 1; }
.profile-meta h1 { margin-bottom: 4px; }
.profile-meta p { color: var(--muted); font-size: 13px; }
.profile-actions { margin-left: auto; }

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
@media (max-width: 640px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
.stat-card {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}
.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.stat-value.good { color: var(--good); }
.stat-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 6px;
}

/* ── Section header ── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
}

/* ── History table ── */
.history-table {
  width: 100%;
  border-collapse: collapse;
}
.history-table th {
  text-align: left;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.history-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: 13px;
}
.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover td { background: rgba(255,255,255,.02); }

/* ── Table elements ── */
.faction-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
}
.faction-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.result-win {
  color: var(--good);
  font-weight: 700;
  font-size: 12px;
}
.result-loss {
  color: var(--muted);
  font-size: 12px;
}
.score-badge {
  background: rgba(76,194,255,.12);
  border: 1px solid rgba(76,194,255,.25);
  color: var(--accent);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}
.score-badge.high {
  background: rgba(74,222,128,.12);
  border-color: rgba(74,222,128,.25);
  color: var(--good);
}
.td-muted { color: var(--muted); }

.winner-card {
  border-color: rgba(74,222,128,.3);
  background: linear-gradient(180deg, rgba(74,222,128,.06), rgba(255,255,255,.02));
}

.tech-pill {
  font-size: 11px;
  background: rgba(76,194,255,.08);
  border: 1px solid rgba(76,194,255,.18);
  color: var(--accent);
  border-radius: 6px;
  padding: 3px 8px;
}

.badge.accent {
  background: rgba(76,194,255,.12);
  border-color: rgba(76,194,255,.25);
  color: var(--accent);
}
/* - Login - */
.login-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  padding: 5px 10px 5px 6px;
  border-radius: 4px;
  border: 1px solid rgba(76,194,255,.2);
  background: rgba(76,194,255,.06);
  transition: border-color .2s, background .2s, color .2s;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: .06em;
}
.login-btn:hover {
  border-color: rgba(76,194,255,.45);
  background: rgba(76,194,255,.12);
  color: var(--accent);
}