:root {
  --bg: #070a0f;
  --bg-elev: #0f141c;
  --panel: #0b1119;
  --text: #e7f7f7;
  --muted: #8aa2a7;
  --accent: #18c7c1;
  --accent-2: #57efe7;
  --ok: #66f2c4;
  --warn: #ff9f43;
  --grid: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --font-title: "Rajdhani", "Trebuchet MS", sans-serif;
  --font-body: "Space Grotesk", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
}

body {
  min-height: 100vh;
  background-image:
    linear-gradient(180deg, rgba(24, 199, 193, 0.12), rgba(0, 0, 0, 0) 40%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 120px 120px, 120px 120px;
  background-position: center, top left, top left;
}

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

a { color: inherit; text-decoration: none; }

.container {
  width: min(1400px, 94vw);
  margin: 0 auto;
}

header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(11, 14, 19, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-title);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.brand-badge {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(24, 199, 193, 0.2), rgba(24, 199, 193, 0.02));
  display: grid;
  place-items: center;
  font-weight: 700;
  box-shadow: var(--shadow);
  border: 1px solid rgba(24, 199, 193, 0.35);
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand span { font-size: 1.1rem; font-weight: 700; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-weight: 600;
  color: var(--muted);
}

.nav-links a.active,
.nav-links a:hover {
  color: var(--text);
}

.hero {
  padding: 40px 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.hero-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.hero-card h1 {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 2.6vw, 2.6rem);
  margin: 0 0 8px;
}

.hero-card p { margin: 0; color: var(--muted); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 12px;
  font-family: var(--font-title);
  letter-spacing: 0.5px;
}

#stewards-list .card h3 {
  margin-bottom: 4px;
}

.stat {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-title);
}

.grid {
  display: grid;
  gap: 20px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.section-title {
  font-family: var(--font-title);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 32px 0 16px;
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

th {
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  position: sticky;
  top: 0;
  background: var(--panel);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge.up { background: rgba(61, 220, 151, 0.12); color: var(--ok); }
.badge.down { background: rgba(255, 122, 0, 0.15); color: var(--warn); }
.badge.same { background: rgba(255, 255, 255, 0.08); color: var(--muted); }

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.countdown .slot {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  padding: 12px;
}

.countdown .value {
  font-size: 1.6rem;
  font-weight: 700;
  font-family: var(--font-title);
}

.timeline {
  display: grid;
  gap: 16px;
}

.race-card {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.race-card h4 { margin: 0 0 6px; font-family: var(--font-title); }

.track-thumb {
  width: 80px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  display: block;
}

.track-thumb.hidden {
  display: none;
}

.race-card .race-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.race-card--list {
  grid-template-columns: 120px 1fr 180px;
  align-items: start;
}

.race-card--list h4 {
  margin-bottom: 4px;
}

.race-card--list .race-meta {
  gap: 10px;
}

.race-card__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.race-card__info {
  min-width: 0;
}

.race-card__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
}

.race-card--list .badge {
  margin-bottom: 4px;
}

.race-card--list .button {
  width: 140px;
  text-align: center;
}

.decision-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.steward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.steward-round h3 {
  margin: 0;
}

.flag-thumb {
  width: 18px;
  height: 12px;
  object-fit: cover;
  border-radius: 3px;
  margin-right: 6px;
  border: 1px solid var(--border);
}

.driver-flag {
  width: 18px;
  height: 12px;
  object-fit: cover;
  border-radius: 3px;
  margin-right: 6px;
  border: 1px solid var(--border);
}

.team-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  margin-right: 8px;
}

.race-meta { color: var(--muted); font-size: 0.9rem; }

.button {
  background: var(--accent);
  color: #051112;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
}

.button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.filter-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.result-row {
  display: grid;
  grid-template-columns: 60px 1.2fr 1.2fr 70px 140px 120px 1fr 60px 90px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.result-row.header {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.85rem;
}

.result-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

select, input, textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--font-body);
}

textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
}

footer {
  margin: 40px 0 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.chart-card {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat-card {
  border-top: 3px solid var(--accent);
}

@media (max-width: 860px) {
  .nav { flex-direction: column; align-items: flex-start; }
  .nav-links { flex-wrap: wrap; }
  table { min-width: 540px; }
}

@media (max-width: 600px) {
  .countdown { grid-template-columns: repeat(2, 1fr); }
  .race-card { grid-template-columns: 1fr; align-items: flex-start; }
}
