@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #101216;
  --bg-elevated: #16191f;
  --bg-card: #1b1f26;
  --border: #262b34;
  --text: #eceef1;
  --text-dim: #9aa1ad;
  --accent: #e7b64c;
  --accent-strong: #f4c85c;
  --accent-ink: #211a05;
  --light: #4f9d8f;
  --club: #4f8ded;
  --pro: #c9556f;
  --danger: #d9564a;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1200px 500px at 15% -10%, rgba(231,182,76,0.08), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(79,141,237,0.06), transparent 55%);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, .display {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
}

a { color: inherit; text-decoration: none; }
p { color: var(--text-dim); max-width: 62ch; }

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Nav --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(16,18,22,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1120px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), #b9852b);
  position: relative;
  flex-shrink: 0;
}
.brand-mark::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, transparent 0 4px, rgba(16,18,22,0.35) 4px 5px);
  border-radius: 7px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.93rem;
  font-weight: 500;
  transition: color .15s ease, background .15s ease;
}
.nav-links a:hover { color: var(--text); background: var(--bg-elevated); }
.nav-links a.active { color: var(--text); background: var(--bg-elevated); }
.nav-user {
  display: flex; align-items: center; gap: 10px;
}
.nav-avatar { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.btn:hover { border-color: #3a4150; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-danger { border-color: rgba(217,86,74,0.4); color: #f0a89f; background: rgba(217,86,74,0.08); }
.btn-danger:hover { border-color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-steam, .btn-discord {
  gap: 10px;
}
.btn-steam { background: #101f2e; border-color: #1b3350; }
.btn-steam:hover { border-color: #2b5486; }
.btn-discord { background: #1c1f3a; border-color: #333a6b; }
.btn-discord:hover { border-color: #5865f2; }

/* --- Hero --- */
.hero {
  padding: 96px 0 72px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -20%; right: -10%;
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(231,182,76,0.12), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}
.hero-eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 14px;
  opacity: 0;
  animation: rise .6s ease forwards;
}
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  max-width: 16ch;
  opacity: 0;
  animation: rise .7s ease forwards .08s;
}
.hero p.lead {
  font-size: 1.1rem;
  max-width: 52ch;
  margin-top: 18px;
  opacity: 0;
  animation: rise .7s ease forwards .16s;
}
.hero-actions {
  display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap;
  opacity: 0;
  animation: rise .7s ease forwards .24s;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-row {
  display: flex; gap: 40px; margin-top: 56px; flex-wrap: wrap;
  opacity: 0;
  animation: rise .7s ease forwards .3s;
}
.stat-num { font-family: 'Space Grotesk', sans-serif; font-size: 2rem; font-weight: 700; }
.stat-label { color: var(--text-dim); font-size: 0.86rem; }

/* --- Section --- */
.section { padding: 64px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.6rem; }

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color .18s ease, transform .18s ease;
}
.card:hover { border-color: #333a45; }

.member-card { display: flex; flex-direction: column; gap: 14px; }
.member-top { display: flex; align-items: center; gap: 12px; }
.member-avatar { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border); object-fit: cover; }
.member-avatar-fallback {
  width: 52px; height: 52px; border-radius: 50%; background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--text-dim);
}
.member-name { font-weight: 600; }
.member-handle { color: var(--text-dim); font-size: 0.85rem; }
.member-meta { font-size: 0.85rem; color: var(--text-dim); display: flex; flex-direction: column; gap: 4px; }
.member-bio { font-size: 0.9rem; color: var(--text-dim); }

/* --- Badges --- */
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-top4-light { color: var(--light); background: rgba(79,157,143,0.12); border-color: rgba(79,157,143,0.3); }
.badge-top4-club { color: var(--club); background: rgba(79,141,237,0.12); border-color: rgba(79,141,237,0.3); }
.badge-top4-pro { color: var(--pro); background: rgba(201,85,111,0.12); border-color: rgba(201,85,111,0.3); }
.badge-champion-light { color: var(--light); background: rgba(79,157,143,0.18); border-color: rgba(79,157,143,0.5); }
.badge-champion-club { color: var(--club); background: rgba(79,141,237,0.18); border-color: rgba(79,141,237,0.5); }
.badge-champion-pro { color: var(--pro); background: rgba(201,85,111,0.18); border-color: rgba(201,85,111,0.5); }
.badge-serie-light { color: var(--light); background: rgba(79,157,143,0.14); }
.badge-serie-club { color: var(--club); background: rgba(79,141,237,0.14); }
.badge-serie-pro { color: var(--pro); background: rgba(201,85,111,0.14); }

/* --- Forms --- */
.form-group { margin-bottom: 18px; }
label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-dim); margin-bottom: 6px; }
input[type=text], input[type=number], input[type=datetime-local], textarea, select {
  width: 100%;
  padding: 11px 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color .15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 90px; }
.hint { font-size: 0.8rem; color: var(--text-dim); margin-top: 6px; }
.field-error { color: #f0a89f; font-size: 0.85rem; margin-top: 6px; }

.auth-card {
  max-width: 440px;
  margin: 80px auto;
  padding: 36px;
}
.auth-card .btn { margin-bottom: 12px; }
.auth-note {
  background: rgba(231,182,76,0.08);
  border: 1px solid rgba(231,182,76,0.25);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.87rem;
  color: var(--accent-strong);
  margin: 18px 0;
}

.divider { display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: 0.8rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* --- Car picker --- */
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.car-option { cursor: pointer; }
.car-option input { position: absolute; opacity: 0; pointer-events: none; }
.car-option .card { padding: 0; overflow: hidden; }
.car-option img { width: 100%; height: 100px; object-fit: cover; background: var(--bg-elevated); }
.car-option .car-name { padding: 10px 12px; font-size: 0.88rem; font-weight: 500; }
.car-option input:checked + .card { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* --- Tables --- */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 500; font-size: 0.8rem; text-transform: none; }
tr:hover td { background: var(--bg-elevated); }

/* --- Misc --- */
.tag-serie {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
}
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

.alert { padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 0.9rem; }
.alert-error { background: rgba(217,86,74,0.1); border: 1px solid rgba(217,86,74,0.3); color: #f0a89f; }
.alert-success { background: rgba(79,157,143,0.1); border: 1px solid rgba(79,157,143,0.3); color: #9fdccf; }

.error-page { text-align: center; padding: 120px 20px; }
.error-page h1 { font-size: 2.2rem; }

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding: 64px 0 48px; }
  .auth-card { margin: 40px auto; padding: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
