:root {
  --bg: #06070a;
  --bg-card: rgba(15, 18, 25, 0.9);
  --line: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --text-muted: #8b92a5;
  --accent: #ff4d00;
  --gold: #f59e0b;
  --silver: #cbd5e1;
  --bronze: #d97706;
  --green: #10b981;
  --font-display: 'Chakra Petch', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  min-height: 100vh;
  padding: 12px;
  overflow-x: hidden;
}

.hud-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Header */
.hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 10px 16px;
  border-radius: 10px;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-tag {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
}

.hud-titles h1 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
}

.hud-titles h1 span {
  color: var(--gold);
}

.hud-domain {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
}

.hud-live-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.hud-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
}

/* Grid */
.hud-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.card-leader, .card-standings {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.card-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Leader Card */
.card-leader {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, rgba(15, 18, 25, 0.95) 100%);
}

.leader-main {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.leader-flag {
  font-size: 36px;
}

.leader-info h2 {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.leader-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.leader-score {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.score-num {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.score-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.leader-badges {
  display: flex;
  gap: 6px;
}

.chip {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.chip.gold { background: rgba(245, 158, 11, 0.2); color: var(--gold); }

/* Table */
.hud-table-wrapper {
  overflow-x: auto;
}

.hud-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.hud-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.hud-table td {
  padding: 10px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.hud-table tr:last-child td {
  border-bottom: none;
}

.th-r, .td-r {
  text-align: right;
  font-family: var(--font-mono);
}

.driver-name-text {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pos-tag {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  display: inline-block;
  width: 20px;
  text-align: center;
}

.pos-tag.p1 { color: var(--gold); }
.pos-tag.p2 { color: var(--silver); }
.pos-tag.p3 { color: var(--bronze); }

.td-pts {
  font-weight: 700;
  font-size: 15px;
  color: var(--gold);
}

/* Stats Row */
.card-stats {
  grid-column: 1 / -1;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stat-k {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.stat-v {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.stat-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* Footer */
.hud-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.full-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
  .hud-grid {
    grid-template-columns: 1fr;
  }
  .card-stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
