/* ═══════════════════════════════════════════════════════════
   AUTOMOBILISTA 2 — Grid Formation Portal
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Rajdhani:wght@300;400;500;600;700&display=swap');

:root {
  --bg-deep: #0a0a0f;
  --bg-card: rgba(12, 12, 18, 0.75);
  --red: #e20613;
  --red-glow: #ff1a2e;
  --red-dark: #a00410;
  --silver: #c8cdd4;
  --chrome: linear-gradient(135deg, #f0f4f8 0%, #8a95a5 40%, #e8ecf0 60%, #6b7785 100%);
  --carbon: repeating-linear-gradient(
    45deg,
    #111 0px, #111 2px,
    #1a1a1a 2px, #1a1a1a 4px
  );
  --glass: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--red) var(--bg-deep);
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--silver);
  overflow-x: hidden;
  line-height: 1.5;
}

/* ── Carbon overlay texture ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--carbon);
  opacity: 0.03;
  pointer-events: none;
  z-index: 9999;
}

/* ── Speed lines background ── */
.speed-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.speed-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(226, 6, 19, 0.15), transparent);
  animation: speedLine 4s linear infinite;
}

@keyframes speedLine {
  0% { transform: translateX(-100%) scaleX(0.5); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateX(200vw) scaleX(1.5); opacity: 0; }
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.4s var(--ease-out), padding 0.4s var(--ease-out);
}

.nav.scrolled {
  background: rgba(10, 10, 15, 0.92);
  padding: 0.6rem 2rem;
}

.nav-logo {
  height: 36px;
  display: block;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 12px rgba(226, 6, 19, 0.3));
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--silver);
  text-decoration: none;
  position: relative;
  transition: color 0.3s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--red);
  transition: width 0.3s var(--ease-out);
}

.nav-links a:hover { color: #fff; }
.nav-links a:hover::after { width: 100%; }

.nav-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url('https://cdn.cloudflare.steamstatic.com/steam/apps/1648061/ss_fc5cf129b53591c105246100e01751c29e0d7d70.1920x1080.jpg?t=1634735031') center/cover no-repeat;
  transform: scale(1.05);
  animation: heroZoom 20s ease-in-out infinite alternate;
}

@keyframes heroZoom {
  0% { transform: scale(1.05); }
  100% { transform: scale(1.12); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10,10,15,0.4) 0%, rgba(10,10,15,0.85) 60%, var(--bg-deep) 100%),
    linear-gradient(90deg, rgba(10,10,15,0.6) 0%, transparent 50%, rgba(10,10,15,0.6) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
  max-width: 900px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.2rem;
  background: rgba(226, 6, 19, 0.15);
  border: 1px solid rgba(226, 6, 19, 0.4);
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red-glow);
  margin-bottom: 2rem;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  animation: fadeUp 0.8s var(--ease-out) both;
}

.hero-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0 auto 2rem;
  animation: fadeUp 0.8s 0.1s var(--ease-out) both;
}

.hero-logo {
  display: block;
  max-width: min(480px, 88vw);
  width: 100%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: drop-shadow(0 6px 28px rgba(226, 6, 19, 0.2));
}

.hero-logo-sm {
  max-width: min(400px, 85vw) !important;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--chrome);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  animation: fadeUp 0.8s 0.2s var(--ease-out) both;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 300;
  color: rgba(200, 205, 212, 0.8);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  animation: fadeUp 0.8s 0.3s var(--ease-out) both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 2.5rem;
  animation: fadeUp 0.8s 0.4s var(--ease-out) both;
}

.stat {
  text-align: center;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.stat-value span { color: var(--red); }

.stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(200, 205, 212, 0.5);
  margin-top: 0.3rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeUp 0.8s 0.5s var(--ease-out) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 2rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}

.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 24px rgba(226, 6, 19, 0.4);
}

.btn-primary:hover {
  background: var(--red-glow);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(226, 6, 19, 0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--silver);
  border: 1px solid var(--glass-border);
}

.btn-ghost:hover {
  border-color: var(--red);
  color: #fff;
  background: rgba(226, 6, 19, 0.1);
}

.btn-danger {
  background: transparent;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.4rem 0.8rem;
  font-size: 0.6rem;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

.btn-sm {
  padding: 0.5rem 1.2rem;
  font-size: 0.65rem;
}

/* ── Sections ── */
section {
  position: relative;
  z-index: 1;
  padding: 6rem 2rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-tag {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.8rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
}

.section-desc {
  margin-top: 0.8rem;
  color: rgba(200, 205, 212, 0.6);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Registration ── */
#inscricoes {
  background: linear-gradient(180deg, var(--bg-deep) 0%, #0d0d14 50%, var(--bg-deep) 100%);
}

.registration-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .registration-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red), transparent);
}

.card-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-title svg { color: var(--red); }

/* ── Form ── */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(200, 205, 212, 0.7);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 2px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(226, 6, 19, 0.15);
}

.form-group select option {
  background: #1a1a22;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 500px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-submit {
  width: 100%;
  margin-top: 0.5rem;
}

/* ── Driver list ── */
.driver-list {
  list-style: none;
  max-height: 520px;
  overflow-y: auto;
}

.driver-list::-webkit-scrollbar { width: 4px; }
.driver-list::-webkit-scrollbar-thumb { background: var(--red); border-radius: 2px; }

.driver-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.3s;
  animation: slideIn 0.4s var(--ease-out) both;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.driver-item:hover { background: rgba(255, 255, 255, 0.02); }

.driver-number {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--red);
  min-width: 48px;
  text-align: center;
}

.driver-info { flex: 1; min-width: 0; }

.driver-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-meta {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.driver-tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  color: rgba(200, 205, 212, 0.7);
}

.driver-tag.class-tag {
  background: rgba(226, 6, 19, 0.15);
  color: var(--red-glow);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: rgba(200, 205, 212, 0.4);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.driver-count {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--red);
}

/* ── Starting Grid ── */
#grid {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(226, 6, 19, 0.08) 0%, transparent 60%),
    var(--bg-deep);
}

.grid-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.grid-track {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 0;
}

.grid-track::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 5%;
  right: 5%;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255,255,255,0.15) 0px, rgba(255,255,255,0.15) 20px,
    transparent 20px, transparent 40px
  );
  transform: translateY(-50%);
}

.grid-lanes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.grid-row {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  align-items: center;
  gap: 0;
}

.grid-pos {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.2);
  text-align: center;
}

.grid-slot {
  min-height: 64px;
  display: flex;
  align-items: center;
  padding: 0.5rem 0.8rem;
  background: var(--bg-card);
  border: 1px dashed var(--glass-border);
  border-radius: 3px;
  transition: all 0.3s var(--ease-out);
  cursor: grab;
  position: relative;
}

.grid-slot.left {
  border-right: 3px solid transparent;
  justify-content: flex-end;
  text-align: right;
}

.grid-slot.right {
  border-left: 3px solid transparent;
  justify-content: flex-start;
}

.grid-slot.occupied {
  border-style: solid;
  border-color: var(--glass-border);
  background: rgba(20, 20, 28, 0.9);
}

.grid-slot.occupied.left { border-right-color: var(--red); }
.grid-slot.occupied.right { border-left-color: var(--red); }

.grid-slot.dragging {
  opacity: 0.4;
  transform: scale(0.95);
}

.grid-slot.drag-over {
  border-color: var(--red);
  background: rgba(226, 6, 19, 0.1);
  box-shadow: 0 0 20px rgba(226, 6, 19, 0.2);
}

.grid-slot.empty-slot {
  cursor: default;
  justify-content: center;
  color: rgba(200, 205, 212, 0.2);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.grid-driver {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.grid-slot.left .grid-driver { flex-direction: row-reverse; }

.grid-driver-num {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--red);
}

.grid-driver-info { min-width: 0; }

.grid-driver-name {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid-driver-class {
  font-size: 0.65rem;
  color: rgba(200, 205, 212, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pole-marker {
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #fbbf24;
  text-transform: uppercase;
}

/* ── Classes showcase ── */
#classes {
  background: #0d0d14;
}

.classes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.class-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  text-align: center;
  transition: all 0.3s var(--ease-out);
  cursor: default;
}

.class-card:hover {
  border-color: rgba(226, 6, 19, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.class-icon {
  font-size: 2rem;
  margin-bottom: 0.8rem;
}

.class-name {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}

.class-desc {
  font-size: 0.8rem;
  color: rgba(200, 205, 212, 0.5);
  margin-top: 0.3rem;
}

/* ── Footer ── */
footer {
  position: relative;
  z-index: 1;
  padding: 3rem 2rem;
  text-align: center;
  border-top: 1px solid var(--glass-border);
  background: var(--bg-deep);
}

.footer-logo {
  height: 28px;
  opacity: 0.5;
  margin-bottom: 1rem;
  mix-blend-mode: screen;
}

.footer-text {
  font-size: 0.8rem;
  color: rgba(200, 205, 212, 0.4);
}

.footer-text a {
  color: var(--red);
  text-decoration: none;
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 1rem 1.5rem;
  background: rgba(20, 20, 28, 0.95);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--red);
  border-radius: 4px;
  font-size: 0.9rem;
  color: #fff;
  animation: toastIn 0.4s var(--ease-out) both;
  backdrop-filter: blur(12px);
}

.toast.success { border-left-color: #22c55e; }
.toast.error { border-left-color: #ef4444; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Modal export ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #12121a;
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s var(--ease-out);
}

.modal-overlay.active .modal { transform: translateY(0); }

.modal h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: #fff;
  margin-bottom: 1rem;
}

.modal pre {
  background: rgba(0, 0, 0, 0.4);
  padding: 1rem;
  border-radius: 4px;
  font-family: 'Consolas', monospace;
  font-size: 0.8rem;
  color: var(--silver);
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 1rem;
  max-height: 400px;
  overflow-y: auto;
}

.modal-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
}

/* ── Responsive nav ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero-stats { gap: 1.5rem; }
  .stat-value { font-size: 1.8rem; }
  section { padding: 4rem 1rem; }
}

/* ── Reveal animations ── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── PHP App: Auth, Admin, Races ── */
.nav-user { display: flex; align-items: center; gap: 0.8rem; }
.nav-username { font-family: var(--font-display); font-size: 0.7rem; letter-spacing: 0.08em; color: rgba(200, 205, 212, 0.7); text-decoration: none; }
.nav-username:hover { color: var(--red-glow); }
.flash-banner { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 10001; padding: 0.8rem 1.5rem; border-radius: 4px; font-weight: 600; animation: fadeUp 0.4s var(--ease-out); max-width: 90%; text-align: center; }
.flash-success { background: rgba(34, 197, 94, 0.2); border: 1px solid #22c55e; color: #86efac; }
.flash-error { background: rgba(239, 68, 68, 0.2); border: 1px solid #ef4444; color: #fca5a5; }
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 6rem 1rem 2rem; position: relative; z-index: 1; }
.auth-card { max-width: 480px; width: 100%; }
.auth-title { font-family: var(--font-display); font-size: 1.4rem; color: #fff; text-transform: uppercase; letter-spacing: 0.05em; }
.auth-subtitle { color: rgba(200, 205, 212, 0.6); margin: 0.5rem 0 1.5rem; font-size: 0.95rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; color: rgba(200, 205, 212, 0.6); }
.auth-footer a { color: var(--red-glow); text-decoration: none; }
.alert { padding: 0.8rem 1rem; border-radius: 4px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.4); color: #fca5a5; }
.form-group textarea { width: 100%; padding: 0.75rem 1rem; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--glass-border); border-radius: 2px; color: #fff; font-family: var(--font-body); font-size: 1rem; resize: vertical; outline: none; }
.page-section { position: relative; z-index: 1; padding: 6rem 2rem 4rem; min-height: 60vh; }
.container-narrow { max-width: 640px; }
.hero-compact { min-height: 70vh; }

.admin-bar {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.section-header-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.back-link { display: inline-block; color: rgba(200, 205, 212, 0.6); text-decoration: none; margin-bottom: 1.5rem; font-size: 0.9rem; }
.back-link:hover { color: var(--red-glow); }
.races-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.2rem; }
.race-card { text-decoration: none; color: inherit; display: block; transition: transform 0.3s var(--ease-out), border-color 0.3s; }
.race-card:hover { transform: translateY(-4px); border-color: rgba(226, 6, 19, 0.4); }
.race-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.race-status { font-family: var(--font-display); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.25rem 0.6rem; border-radius: 2px; }
.status-open { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.status-closed { background: rgba(251, 191, 36, 0.15); color: #fcd34d; }
.status-done { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.race-class { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--red-glow); }
.race-title { font-family: var(--font-display); font-size: 1rem; color: #fff; margin-bottom: 0.5rem; }
.race-track, .race-date { font-size: 0.85rem; color: rgba(200, 205, 212, 0.6); margin-bottom: 0.3rem; }
.race-footer { display: flex; justify-content: space-between; margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--glass-border); font-size: 0.8rem; color: rgba(200, 205, 212, 0.5); }
.race-link { color: var(--red-glow); }
.race-detail-title { font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 2rem); color: #fff; margin-bottom: 1rem; }
.race-detail-meta { display: flex; flex-wrap: wrap; gap: 1.2rem; color: rgba(200, 205, 212, 0.7); margin-bottom: 1rem; }
.race-description { color: rgba(200, 205, 212, 0.8); line-height: 1.7; margin-bottom: 1.5rem; }
.race-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.badge-registered { color: #86efac; font-weight: 600; }
.badge-closed { color: #fcd34d; font-weight: 600; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
.stat-card { text-align: center; padding: 1.5rem 1rem !important; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--glass-border); }
.admin-table th { font-family: var(--font-display); font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(200, 205, 212, 0.5); }
.admin-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.form-actions-row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.driver-pool { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.pool-item { cursor: grab; border: 1px solid var(--glass-border) !important; border-radius: 3px; }
.setup-notice { max-width: 640px; margin: 0 auto; }
.setup-notice p { color: rgba(200,205,212,0.8); margin-bottom: 1rem; }
.setup-steps { margin: 1rem 0 0 1.2rem; color: rgba(200,205,212,0.7); line-height: 1.8; }
.setup-steps a { color: var(--red-glow); }
.section-desc { color: rgba(200, 205, 212, 0.6); margin-top: 0.5rem; max-width: 520px; }
.container-narrow { max-width: 640px; }
.form-hint { display: block; font-size: 0.75rem; color: rgba(200, 205, 212, 0.45); margin-top: 0.35rem; }
.ranking-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.ranking-tab { font-family: var(--font-display); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.6rem 1.2rem; border: 1px solid var(--glass-border); background: transparent; color: rgba(200, 205, 212, 0.6); border-radius: 3px; cursor: pointer; transition: all 0.2s; }
.ranking-tab:hover { color: #fff; border-color: rgba(255,255,255,0.2); }
.ranking-tab.active { background: rgba(220, 38, 38, 0.15); border-color: var(--red-glow); color: var(--red-glow); }
.ranking-table .rank-pos { font-family: var(--font-display); font-weight: 700; color: rgba(200, 205, 212, 0.5); width: 3rem; }
.ranking-table .rank-top-1 td { background: rgba(251, 191, 36, 0.06); }
.ranking-table .rank-top-2 td { background: rgba(192, 192, 192, 0.04); }
.ranking-table .rank-top-3 td { background: rgba(205, 127, 50, 0.04); }
.driver-num-badge { display: inline-block; font-family: var(--font-display); font-size: 0.65rem; font-weight: 700; color: var(--red-glow); margin-right: 0.4rem; }
.input-sm { width: 100%; min-width: 5rem; padding: 0.45rem 0.6rem; background: rgba(0,0,0,0.35); border: 1px solid var(--glass-border); border-radius: 3px; color: #fff; font-family: var(--font-mono, monospace); font-size: 0.85rem; }
.input-sm:focus { outline: none; border-color: var(--red-glow); }
.results-edit-table td { vertical-align: middle; }
.results-edit-table .result-pos { max-width: 5rem; }
.results-edit-table .result-time { min-width: 8rem; }
@media (max-width: 768px) { .nav-user .nav-username { display: none; } .page-section { padding: 5rem 1rem 3rem; } }
