@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Mono:wght@300;400;500&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg: #0d1117;
  --card: #0f1923;
  --card2: #111d2b;
  --border: #1e2a38;
  --border2: #243447;
  --accent: #00C9B1;
  --accent2: #00a896;
  --accent-dim: rgba(0,201,177,0.12);
  --accent-glow: rgba(0,201,177,0.25);
  --orange: #EF9F27;
  --orange-dim: rgba(239,159,39,0.15);
  --red: #e05260;
  --red-dim: rgba(224,82,96,0.15);
  --green: #2dd4a7;
  --yellow: #f5c842;
  --text: #e8edf3;
  --text2: #8a9bb0;
  --text3: #4a5a6e;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --font-display: 'Syne', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --font-body: 'DM Sans', sans-serif;
}

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

html { font-size: 14px; scroll-behavior: smooth; }

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

/* ── NAVBAR ─────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,17,23,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 52px;
  gap: 6px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  margin-right: 16px;
  white-space: nowrap;
  text-decoration: none;
  opacity: 0.95;
  transition: opacity 0.15s;
}
.navbar-brand:hover { opacity: 1; }
.navbar-brand img { height: 28px; display: block; }
.navbar-brand span { color: var(--text2); font-weight: 400; }

.nav-link {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.15s;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.nav-link:hover { color: var(--text); background: var(--card2); }
.nav-link.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: var(--accent);
}

.nav-spacer { flex: 1; }

.nav-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text3);
  letter-spacing: 1px;
}

/* ── PAGE LAYOUT ─────────────────────────────────────── */
.page { padding: 20px; max-width: 1600px; margin: 0 auto; }
.page-header { margin-bottom: 20px; }
.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.page-title span { color: var(--accent); }
.page-subtitle { font-size: 12px; color: var(--text2); margin-top: 2px; font-family: var(--font-mono); }

/* ── CARD ────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.card-header {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text3);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 12px;
  background: var(--accent);
  border-radius: 2px;
}

/* ── CHIPS & BADGES ──────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text2);
}

.chip.accent { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.chip.orange { background: var(--orange-dim); border-color: var(--orange); color: var(--orange); }
.chip.red { background: var(--red-dim); border-color: var(--red); color: var(--red); }
.chip.green { background: rgba(45,212,167,0.12); border-color: var(--green); color: var(--green); }

/* ── SELECTS ─────────────────────────────────────────── */
select, input[type="text"], input[type="search"] {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
}

select:focus, input:focus { border-color: var(--accent); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%234a5a6e'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
  cursor: pointer;
}

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent2); }

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border2); background: var(--card2); }

/* ── TABLE ───────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
thead th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text3);
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
thead th:hover { color: var(--text2); }
thead th.sorted { color: var(--accent); }

tbody td {
  padding: 7px 10px;
  font-size: 12px;
  border-bottom: 1px solid rgba(30,42,56,0.5);
  color: var(--text2);
}
tbody tr:hover td { background: var(--card2); color: var(--text); }
tbody tr:last-child td { border-bottom: none; }

/* ── STAT ROW ────────────────────────────────────────── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.stat-chip {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  text-align: center;
}

.stat-chip .label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text3);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.stat-chip .value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.stat-chip .unit {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text3);
}

/* ── DNA BAR ─────────────────────────────────────────── */
.dna-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.dna-bar-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text2);
  width: 80px;
  flex-shrink: 0;
}

.dna-bar-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.dna-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.dna-bar-val {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text2);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* ── FIT COLORS ──────────────────────────────────────── */
.fit-elite { color: var(--accent); }
.fit-good { color: var(--green); }
.fit-moderate { color: var(--yellow); }
.fit-weak { color: var(--red); }

/* ── SCROLLBAR ───────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ── LOADING ─────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px;
  color: var(--text3);
  font-family: var(--font-mono);
  font-size: 11px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── EMPTY STATE ─────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 40px;
  color: var(--text3);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ── FOOTER ──────────────────────────────────────────── */
.site-footer {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  background: rgba(13,17,23,0.95);
  padding: 10px 24px 8px;
  font-family: var(--font-mono);
}
.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.site-footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}
.site-footer-brand img {
  height: 18px;
  margin-bottom: 4px;
  display: block;
  opacity: 0.9;
}
.site-footer-brand p {
  font-size: 9px;
  color: var(--text3);
  line-height: 1.5;
  font-family: var(--font-body);
  max-width: 220px;
}
.site-footer-col h4 {
  font-size: 8px;
  color: var(--text3);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.site-footer-col a {
  display: block;
  font-size: 10px;
  color: var(--text2);
  text-decoration: none;
  margin-bottom: 3px;
  transition: color 0.15s;
}
.site-footer-col a:hover { color: var(--accent); }
.site-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 6px;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer-bottom span {
  font-size: 9px;
  color: var(--text3);
}
.site-footer-bottom .footer-right {
  display: flex;
  gap: 16px;
}

/* ── HAMBURGER ───────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  margin-left: auto;
}
.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: all 0.2s;
}
.nav-menu-mobile {
  display: none;
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  background: rgba(13,17,23,0.98);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px 16px;
  z-index: 99;
  flex-direction: column;
  gap: 4px;
}
.nav-menu-mobile.open { display: flex; }
.nav-menu-mobile .nav-link {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 6px;
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 768px) {
  .page { padding: 12px; }
  .navbar { padding: 0 12px; }
  .navbar > .nav-link,
  .navbar > .nav-spacer,
  .navbar > .nav-badge { display: none; }
  .nav-hamburger { display: flex; }
  .site-footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 900px) {
  .page { padding: 12px; }
  .navbar { padding: 0 12px; }
}

/* ── Season Pill Button (Squad DB) ───────────────────── */
.season-pill-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card2);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
}
.season-pill-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── AUTH NAV ─────────────────────────────────────────── */
.nav-btn-login {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-btn-login:hover { background: var(--accent); color: #0d1117; }

.nav-user-wrap { position: relative; display: flex; align-items: center; }
.nav-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; cursor: pointer;
  border: 2px solid var(--accent);
}
.nav-avatar-ini {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #0d1117;
  font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.nav-user-dropdown {
  position: absolute; top: 38px; right: 0;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 10px; min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  z-index: 200; padding: 8px 0;
}
.nav-user-info { padding: 10px 14px 8px; }
.nav-user-dname { font-size: 12px; font-weight: 600; color: var(--text); }
.nav-user-email { font-size: 10px; color: var(--text3); margin-top: 2px; font-family: var(--font-mono); }
.nav-user-sep { height: 1px; background: var(--border); margin: 4px 0; }
.nav-user-item {
  display: block; width: 100%; padding: 8px 14px;
  background: none; border: none; text-align: left;
  font-size: 12px; color: var(--text2); cursor: pointer;
  transition: color 0.15s;
}
.nav-user-item:hover { color: var(--red); }

/* ── AUTH MODAL ──────────────────────────────────────── */
.auth-modal-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.auth-modal-box {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 32px 28px 24px;
  width: 100%; max-width: 380px;
  position: relative;
  box-shadow: 0 16px 48px rgba(0,0,0,0.7);
}
.auth-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; font-size: 14px;
  color: var(--text3); cursor: pointer; padding: 4px 8px;
  border-radius: 4px; transition: color 0.15s;
}
.auth-close:hover { color: var(--text); }
.auth-header { margin-bottom: 20px; }
.auth-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.auth-sub { font-size: 12px; color: var(--text3); line-height: 1.5; }

.auth-btn-google {
  width: 100%; height: 40px; border-radius: 8px;
  border: 1px solid var(--border2); background: var(--card2);
  color: var(--text); font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 16px;
}
.auth-btn-google:hover { border-color: #4285F4; background: rgba(66,133,244,0.08); }

.auth-divider {
  display: flex; align-items: center; gap: 10px;
  font-size: 10px; color: var(--text3); margin-bottom: 14px;
  font-family: var(--font-mono);
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.auth-input {
  display: block; width: 100%; height: 38px;
  background: var(--card2); border: 1px solid var(--border2);
  border-radius: 7px; color: var(--text);
  padding: 0 12px; font-size: 13px; margin-bottom: 10px;
  font-family: var(--font-body); outline: none;
  transition: border-color 0.15s;
}
.auth-input:focus { border-color: var(--accent); }

.auth-btn-primary {
  width: 100%; height: 40px; border-radius: 8px;
  background: var(--accent); border: none;
  color: #0d1117; font-size: 13px; font-weight: 700;
  cursor: pointer; margin-top: 4px; margin-bottom: 12px;
  transition: background 0.15s;
}
.auth-btn-primary:hover { background: var(--accent2); }

.auth-error {
  background: var(--red-dim); border: 1px solid rgba(224,82,96,0.3);
  border-radius: 6px; padding: 8px 12px;
  font-size: 11px; color: var(--red);
  margin-bottom: 10px; font-family: var(--font-mono);
}
.auth-switch {
  font-size: 11px; color: var(--text3); text-align: center;
}
.auth-switch a { color: var(--accent); text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
