/* =====================================================================
   LKGP — Lebanon Karting Grand Prix
   Global stylesheet. Racing identity built around the Lebanese flag:
   red + white, with cedar green accents, on a carbon-dark base.
   ===================================================================== */

:root {
  color-scheme: dark; /* native controls (date picker, etc.) render dark */
  --red: #e30613;
  --red-dim: #b1040f;
  --cedar: #00a651;
  --blue: #1e90ff;

  --bg: #0a0b0d;
  --bg-2: #111317;
  --bg-3: #181b21;
  --line: #24272e;
  --text: #f3f4f6;
  --muted: #9aa0ab;

  --radius: 14px;
  --maxw: 1180px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);

  --font-head: "Rajdhani", "Oswald", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Carbon-fibre / track texture behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(227, 6, 19, 0.16), transparent 60%),
    radial-gradient(700px 500px at -10% 10%, rgba(0, 166, 81, 0.08), transparent 55%),
    repeating-linear-gradient(45deg, #0c0d10 0 2px, #0a0b0d 2px 4px);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.container { width: min(var(--maxw), 92%); margin: 0 auto; }

.section { padding: 84px 0; }
.section-head { margin-bottom: 38px; }
.section-head .eyebrow {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--red);
  font-weight: 700;
  font-size: 0.85rem;
}
.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.9rem);
  text-transform: uppercase;
  margin-top: 6px;
}
.section-head p { color: var(--muted); max-width: 620px; margin-top: 10px; }

/* ---- Buttons ------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-head);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.92rem;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--red-dim));
  color: #fff;
  box-shadow: 0 10px 28px rgba(227, 6, 19, 0.35);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--red); }

/* ---- Header / nav -------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 11, 13, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--red), #7a0309);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  box-shadow: 0 6px 18px rgba(227, 6, 19, 0.4);
}
.brand .brand-text strong {
  font-family: var(--font-head);
  font-size: 1.25rem;
  letter-spacing: 1px;
  display: block;
  line-height: 1;
}
.brand .brand-text span {
  font-size: 0.66rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  font-family: var(--font-head);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.92rem;
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-3); }
.nav-links a.active { color: #fff; }
.nav-links a.active::after {
  content: ""; display: block; height: 2px; margin-top: 4px;
  background: var(--red); border-radius: 2px;
}
.nav-cta { margin-left: 8px; }
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line);
  color: var(--text);
  width: 44px; height: 44px; border-radius: 10px;
  cursor: pointer; font-size: 1.3rem;
}

/* ---- Brand / logos ------------------------------------------------- */
.brand-logo { height: 40px; width: auto; display: block; }
.footer-logo { height: 52px; width: auto; margin-bottom: 16px; }
.hero-logo { width: min(470px, 94%); height: auto; margin: 28px 0 18px; }
/* Every partner logo sits in the same box and is contained inside it, so
   wide logos (DRS, RPM) read at the same scale as the compact BLTZ one. */
.org-logo {
  display: block;
  width: 108px; height: 60px;
  object-fit: contain; object-position: center;
  margin: 0 auto 16px;
}
/* Nudge the RPM mark so it reads as optically centred */
.org-logo[alt="RPM"] { transform: translateX(-4px); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
@media (max-width: 560px) {
  .brand-logo { height: 32px; }
  .hero-logo { width: 88%; }
}

/* ---- Hero ---------------------------------------------------------- */
.hero {
  position: relative;
  padding: 90px 0 70px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}
.hero .badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-head);
  text-transform: uppercase; letter-spacing: 2px;
  font-size: 0.78rem; font-weight: 600;
  color: var(--text);
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 999px;
}
.hero .badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cedar); box-shadow: 0 0 10px var(--cedar);
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 5rem);
  text-transform: uppercase;
  margin: 20px 0 8px;
}
.hero h1 .accent {
  background: linear-gradient(120deg, var(--red), #ff5a5f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede { color: var(--muted); font-size: 1.12rem; max-width: 520px; }
.hero .org { margin-top: 18px; color: var(--muted); font-size: 0.95rem; }
.hero .org b { color: var(--text); }
.hero-actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }

/* Countdown card */
.countdown-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.countdown-card .next-label {
  font-family: var(--font-head); text-transform: uppercase;
  letter-spacing: 2px; color: var(--red); font-size: 0.8rem; font-weight: 700;
}
.countdown-card h3 { font-size: 1.5rem; margin: 6px 0 2px; text-transform: uppercase; }
.countdown-card .meta { color: var(--muted); font-size: 0.92rem; margin-bottom: 20px; }
.countdown {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.cd-unit {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 6px; text-align: center;
}
.cd-unit .num {
  font-family: var(--font-head); font-size: 2rem; font-weight: 700;
  line-height: 1; color: #fff;
}
.cd-unit .lbl {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--muted); margin-top: 6px;
}
.checkered {
  height: 14px; margin-top: 22px; border-radius: 6px;
  background:
    repeating-conic-gradient(#fff 0% 25%, #0a0b0d 0% 50%) 0 0 / 16px 16px;
  opacity: 0.85;
}

/* ---- Stat strip ---------------------------------------------------- */
.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat {
  background: var(--bg-2); padding: 26px 20px; text-align: center;
}
.stat .n {
  font-family: var(--font-head); font-size: 2.4rem; font-weight: 700;
  color: var(--red);
}
.stat .l { color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; font-size: 0.78rem; }
.stat-strip.stat-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) { .stat-strip.stat-3 { grid-template-columns: 1fr; } }

/* ---- Cards / generic ---------------------------------------------- */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-4px); border-color: #34373f; }

.grid { display: grid; gap: 20px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---- Standings table ---------------------------------------------- */
.table-wrap {
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; overflow-x: auto;
}
table.standings { width: 100%; border-collapse: collapse; min-width: 640px; }
table.standings th, table.standings td { padding: 14px 18px; text-align: left; }
table.standings thead th {
  background: var(--bg-3);
  font-family: var(--font-head); text-transform: uppercase;
  letter-spacing: 1.5px; font-size: 0.8rem; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
table.standings tbody tr { border-bottom: 1px solid var(--line); transition: background .15s; }
table.standings tbody tr:hover { background: var(--bg-3); }
table.standings tbody tr:last-child { border-bottom: none; }
.pos-badge {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px;
  font-family: var(--font-head); font-weight: 700;
  background: var(--bg-3); border: 1px solid var(--line);
}
.pos-1 .pos-badge { background: linear-gradient(135deg,#ffd34d,#c79100); color:#1a1500; border:none; }
.pos-2 .pos-badge { background: linear-gradient(135deg,#dfe4ea,#9aa3ad); color:#15171a; border:none; }
.pos-3 .pos-badge { background: linear-gradient(135deg,#e6915a,#a85a26); color:#1a0f06; border:none; }

/* Driver / Constructors view switch */
.standings-switch { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.standings-switch label { color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; font-size: .72rem; font-family: var(--font-head); }
.standings-switch select {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 16px; font-family: var(--font-head);
  font-size: .98rem; font-weight: 600; cursor: pointer; min-width: 220px;
}
.standings-switch select:focus { outline: none; border-color: var(--red); }

/* Constructors standings — team-coloured shaded row + line */
table.standings.constructors tbody tr.constructor-row td:first-child { border-left: 4px solid var(--team, var(--line)); }
table.standings.constructors tbody tr.constructor-row:hover td { background: color-mix(in srgb, var(--team) 30%, transparent); }
.team-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.team-cell { display: inline-flex; align-items: center; gap: 14px; white-space: nowrap; }
/* Fixed box → every logo occupies the same footprint (so DRS reads at the same
   scale as the compact BLTZ mark) and is centred inside it; every team name then
   starts at the same x, so the names line up regardless of logo shape. */
.team-logo-box { width: 72px; height: 38px; flex: none; display: inline-flex; align-items: center; justify-content: flex-start; }
.team-logo { max-width: 72px; max-height: 38px; width: auto; height: auto; object-fit: contain; }

/* Not currently qualified for the pre-finals — faded red row. */
table.standings tbody tr.not-qualified { background: rgba(230,30,45,.09); }
table.standings tbody tr.not-qualified:hover { background: rgba(230,30,45,.15); }
table.standings tbody tr.not-qualified td { color: rgba(255,255,255,.42); }
table.standings tbody tr.not-qualified a { color: rgba(255,255,255,.52) !important; }
.quali-legend {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  color: var(--muted); font-size: .82rem;
}
.quali-legend .ql-swatch {
  width: 26px; height: 14px; border-radius: 4px; flex: none;
  background: rgba(230,30,45,.18); border: 1px solid rgba(230,30,45,.4);
}

/* Final race result — podium rows: one flat colored strip (gold / silver / bronze). */
table.final-result tr.pos-1 { background: rgba(255,211,77,.15); }
table.final-result tr.pos-2 { background: rgba(223,228,234,.13); }
table.final-result tr.pos-3 { background: rgba(230,145,90,.14); }
table.final-result tr.pos-1:hover { background: rgba(255,211,77,.22); }
table.final-result tr.pos-2:hover { background: rgba(223,228,234,.19); }
table.final-result tr.pos-3:hover { background: rgba(230,145,90,.20); }
table.final-result tr.pos-1 td:last-child { color: #ffd34d; }
table.final-result tr.pos-2 td:last-child { color: #dfe4ea; }
table.final-result tr.row-dsq-final { background: rgba(230,30,45,.07); }
table.final-result tr.row-dsq-final td { color: rgba(255,255,255,.5); }

/* ---- Practice day ------------------------------------------------- */
.practice-perk {
  display: flex; align-items: center; gap: 10px; margin-bottom: 22px;
  padding: 12px 16px; border-radius: var(--radius);
  background: rgba(46,204,113,.10); border: 1px solid rgba(46,204,113,.28);
  color: var(--text); font-size: .95rem;
}
.practice-perk b { color: #6ee7a0; }
.practice-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.practice-slots { align-items: stretch; }
.practice-slot { display: flex; flex-direction: column; gap: 12px; }
.practice-slot .ps-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.practice-slot .ps-when { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.practice-slot .ps-time { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }
.practice-slot .ps-cap { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.practice-slot .ps-cap b { color: var(--text); font-family: var(--font-head); font-size: 1rem; }
.practice-slot .ps-actions { margin-top: auto; }
.practice-slot .ps-actions .btn { width: 100%; justify-content: center; }
.practice-slot .ps-badge {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: .5px;
  font-size: .78rem; color: #6ee7a0; background: rgba(46,204,113,.12);
  border: 1px solid rgba(46,204,113,.3); border-radius: 8px; padding: 6px 10px;
}
.practice-slot.mine { border-color: rgba(46,204,113,.4); }
.practice-slot.full { opacity: .6; }
table.final-result tr.pos-3 td:last-child { color: #e6915a; }
.driver-cell { display: flex; align-items: center; gap: 12px; }
.num-chip {
  font-family: var(--font-head); font-weight: 700; font-size: 0.95rem;
  min-width: 34px; text-align: center; padding: 3px 6px; border-radius: 6px;
  background: var(--bg-3); border: 1px solid var(--line);
}
.team-tag {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px;
  padding: 3px 9px; border-radius: 999px; font-weight: 600;
  border: 1px solid currentColor;
}
.pts { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }

/* ---- Driver cards -------------------------------------------------- */
.driver-card {
  position: relative; overflow: hidden; cursor: pointer;
  padding: 0;
}
.driver-card .dc-top {
  position: relative; padding: 22px 22px 16px;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border-bottom: 1px solid var(--line);
}
.driver-card .dc-num {
  position: absolute; top: 8px; right: 14px;
  font-family: var(--font-head); font-weight: 700;
  font-size: 3.4rem; line-height: 1; color: rgba(255,255,255,0.07);
}
.driver-card .dc-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 1.5rem;
  color: #fff; margin-bottom: 12px;
}
.driver-card h3 { font-size: 1.3rem; text-transform: uppercase; }
.driver-card .dc-team { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.driver-card .dc-stats {
  display: grid; grid-template-columns: repeat(3,1fr);
  padding: 16px 0; text-align: center;
}
.driver-card .dc-stats div { padding: 0 6px; }
.driver-card .dc-stats .v { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; }
.driver-card .dc-stats .k { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.driver-card .dc-foot { padding: 0 22px 20px; }

/* ---- Modal --------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); max-width: 560px; width: 100%;
  box-shadow: var(--shadow); overflow: hidden; animation: pop .2s ease;
}
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal .m-head {
  padding: 26px; display: flex; gap: 18px; align-items: center;
  border-bottom: 1px solid var(--line); position: relative;
}
.modal .m-close {
  position: absolute; top: 16px; right: 18px;
  background: none; border: none; color: var(--muted);
  font-size: 1.6rem; cursor: pointer; line-height: 1;
}
.modal .m-close:hover { color: #fff; }
.modal .m-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 1.7rem; color: #fff;
}
.modal .m-body { padding: 24px 26px; }
.modal .m-body p { color: var(--muted); }
.m-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin: 20px 0; }
.m-stats .ms {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 8px; text-align: center;
}
.m-stats .ms .v { font-family: var(--font-head); font-weight: 700; font-size: 1.4rem; }
.m-stats .ms .k { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.results-line { display: flex; gap: 8px; flex-wrap: wrap; }
.results-line .rd {
  flex: 1; min-width: 60px; text-align: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 4px;
}
.results-line .rd .rr { font-family: var(--font-head); font-weight: 700; }
.results-line .rd .rl { font-size: 0.62rem; color: var(--muted); text-transform: uppercase; }

/* ---- Schedule ------------------------------------------------------ */
.round-row {
  display: grid; grid-template-columns: 80px 1fr auto; gap: 20px; align-items: center;
  padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); margin-bottom: 14px; transition: border-color .15s;
}
.round-row:hover { border-color: #34373f; }
.round-row .rnum {
  font-family: var(--font-head); font-weight: 700; font-size: 2.2rem;
  text-align: center; color: var(--red);
}
.round-row .rinfo h3 { font-size: 1.25rem; text-transform: uppercase; }
.round-row .rinfo .rmeta { color: var(--muted); font-size: 0.92rem; margin-top: 4px; }
.round-row .rstatus { text-align: right; }
.pill {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: 1px;
  font-size: 0.74rem; font-weight: 600; padding: 6px 13px; border-radius: 999px;
}
.pill.done { background: rgba(0,166,81,0.14); color: var(--cedar); border: 1px solid rgba(0,166,81,0.4); }
.pill.next { background: rgba(227,6,19,0.14); color: #ff6b6f; border: 1px solid rgba(227,6,19,0.4); }
.pill.live {
  background: rgba(245,166,35,0.16); color: #f5a623; border: 1px solid rgba(245,166,35,0.5);
  display: inline-flex; align-items: center; gap: 7px;
}
.pill.live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #f5a623; box-shadow: 0 0 8px #f5a623; animation: pulse 1.3s infinite;
}
.pill.cancelled { background: var(--bg-3); color: var(--muted); border: 1px solid var(--line); text-decoration: line-through; }
.round-row .rdate { font-family: var(--font-head); font-weight: 600; margin-top: 6px; }

/* ---- News ---------------------------------------------------------- */
.news-card { display: flex; flex-direction: column; }
.news-card .ntag {
  align-self: flex-start; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1.5px;
  font-family: var(--font-head); font-weight: 700; color: var(--red);
  border: 1px solid rgba(227,6,19,0.4); border-radius: 999px; padding: 4px 11px; margin-bottom: 14px;
}
.news-card .ndate { color: var(--muted); font-size: 0.82rem; }
.news-card h3 { font-size: 1.25rem; margin: 6px 0 10px; }
.news-card p { color: var(--muted); font-size: 0.95rem; }

/* ---- Forms --------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: 1px;
  font-size: 0.78rem; color: var(--muted); font-weight: 600;
}
.field input, .field select, .field textarea {
  background: var(--bg); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 13px 14px; font-family: var(--font-body); font-size: 0.96rem;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(227,6,19,0.15);
}
.field .err { color: #ff6b6f; font-size: 0.78rem; min-height: 1em; }
.form-note { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120%);
  background: var(--cedar); color: #042b14; font-weight: 600;
  padding: 14px 24px; border-radius: 999px; box-shadow: var(--shadow);
  z-index: 300; transition: transform .35s cubic-bezier(.2,.9,.3,1.3);
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: 1px;
}
.toast.show { transform: translateX(-50%) translateY(0); }

.success-box {
  background: linear-gradient(180deg, rgba(0,166,81,0.12), var(--bg-2));
  border: 1px solid rgba(0,166,81,0.4);
  border-radius: var(--radius); padding: 34px; text-align: center;
}
.success-box .big { font-size: 3rem; }
.success-box h3 { font-size: 1.6rem; text-transform: uppercase; margin: 10px 0; }
.success-box p { color: var(--muted); }

/* ---- Regulations --------------------------------------------------- */
.reg-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.reg-list li { color: var(--muted); padding-left: 20px; position: relative; font-size: 0.95rem; }
.reg-list li::before {
  content: "›"; position: absolute; left: 0; top: -1px;
  color: var(--red); font-family: var(--font-head); font-weight: 700; font-size: 1.1rem;
}
.reg-list li b { color: var(--text); }
.reg-doc {
  display: flex; flex-direction: column; gap: 16px;
}
.reg-doc-frame {
  width: 100%; height: 540px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--bg-2);
}
.reg-doc-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Compact points table — narrow, points sit next to the position */
.points-table-wrap { max-width: 440px; }
.points-table { min-width: 0 !important; }
.points-table th { padding: 8px 16px; }
.points-table td { padding: 3px 16px; }
.points-table .pos-badge { width: 22px; height: 22px; border-radius: 6px; font-size: 0.82rem; }
.points-table .pts { font-size: 1rem; }

/* Flag indicators */
.flag-head { display: flex; align-items: center; gap: 11px; margin-bottom: 8px; }
.flag-dot {
  width: 18px; height: 18px; border-radius: 5px; flex: none;
  animation: flagflash 1.1s infinite;
}
@keyframes flagflash {
  0%, 100% { opacity: 1; box-shadow: 0 0 9px currentColor; }
  50% { opacity: 0.3; box-shadow: none; }
}
.flag-yellow { background: #f5d300; color: #f5d300; }
.flag-blue { background: #1e90ff; color: #1e90ff; }
.flag-red { background: #e30613; color: #e30613; }
.flag-white { background: #ffffff; color: #ffffff; }
.flag-chequered {
  background-image: repeating-conic-gradient(#fff 0% 25%, #111 0% 50%);
  background-size: 9px 9px; color: #fff;
}
/* A standing (held) flag is steady — no flash, just a constant glow. */
.flag-dot.flag-static { animation: none; opacity: 1; box-shadow: 0 0 9px currentColor; }

/* ---- Live Draw ----------------------------------------------------- */
.draw-wait { text-align: center; padding: 20px 0 10px; }
.draw-wait .badge { display: inline-flex; align-items: center; gap: 8px; }
.draw-wait h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); text-transform: uppercase; margin: 16px 0 8px; }
.draw-wait .lede { color: var(--muted); max-width: 560px; margin: 0 auto; }
.karts-preview { margin-top: 40px; }
.kp-label { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 2px; color: var(--muted); font-size: 0.78rem; margin-bottom: 14px; }
.kp-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.kart-chip {
  font-family: var(--font-head); font-weight: 700; letter-spacing: 1px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 8px 12px; min-width: 58px;
}

.draw-phase-title { margin: 34px 0 18px; }
.draw-phase-title h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); text-transform: uppercase; margin-top: 4px; }

.draw-heat {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 18px;
}
.dh-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.dh-title { font-family: var(--font-head); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: 1.3rem; }
.dh-start {
  font-family: var(--font-head); font-weight: 600; letter-spacing: 1px; font-size: 0.82rem;
  color: var(--text); background: var(--bg); border: 1px solid var(--line);
  padding: 3px 10px; border-radius: 999px;
}
.dh-time { margin-left: auto; font-family: var(--font-head); color: var(--muted); font-size: 0.8rem; letter-spacing: 1px; }
.dg-name .dh-start { font-size: 0.72rem; padding: 2px 8px; }
.draw-groups { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.draw-group {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
}
.dg-name {
  font-family: var(--font-head); font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  font-size: 0.92rem; color: var(--red); margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.draw-entry {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 6px; border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .35s ease;
}
.draw-entry.shown { opacity: 1; transform: none; }
.draw-entry:last-child { border-bottom: none; }
.de-driver { flex: 1; font-weight: 600; font-size: 0.92rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.de-arrow { color: var(--muted); }
.de-pts { margin-left: auto; font-family: var(--font-head); font-weight: 700; font-size: 1rem; color: var(--text); min-width: 56px; text-align: right; }
.de-pos { font-family: var(--font-head); font-weight: 700; color: var(--muted); min-width: 34px; }
.de-grid {
  font-family: var(--font-head); font-weight: 700; font-size: 0.82rem;
  min-width: 32px; text-align: center; padding: 3px 7px; border-radius: 6px;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--red); flex: none;
}
.draw-entry.podium { border-radius: 8px; }
.draw-entry.podium-1 { background: linear-gradient(90deg, rgba(255,211,77,0.16), transparent); }
.draw-entry.podium-2 { background: linear-gradient(90deg, rgba(223,228,234,0.14), transparent); }
.draw-entry.podium-3 { background: linear-gradient(90deg, rgba(230,145,90,0.14), transparent); }
.draw-entry.podium-1 .de-grid { color: #ffd34d; border-color: rgba(255,211,77,0.5); }
.draw-entry.podium-2 .de-grid { color: #dfe4ea; border-color: rgba(223,228,234,0.5); }
.draw-entry.podium-3 .de-grid { color: #e6915a; border-color: rgba(230,145,90,0.5); }
.kart-num {
  font-family: var(--font-head); font-weight: 700; font-size: 1.05rem;
  min-width: 52px; text-align: center; padding: 4px 8px; border-radius: 7px;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--muted);
  transition: color .2s, border-color .2s, background .2s;
}
.kart-num.settled {
  color: #fff; border-color: var(--red);
  background: linear-gradient(135deg, rgba(227,6,19,0.25), var(--bg-3));
  animation: kartPop .3s ease;
}
@keyframes kartPop { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }
.final-grid { max-width: 520px; }
@media (max-width: 900px) { .draw-groups { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .draw-groups { grid-template-columns: 1fr; } }

/* ---- Empty state --------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  background: var(--bg-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty-state .es-flag { font-size: 2.6rem; opacity: 0.9; }
.empty-state h3 { font-size: 1.5rem; text-transform: uppercase; margin: 12px 0 8px; }
.empty-state p { color: var(--muted); max-width: 460px; margin: 0 auto; }

/* ---- Page hero (inner pages) -------------------------------------- */
.page-hero { padding: 64px 0 10px; }
.page-hero .eyebrow {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: 3px;
  color: var(--red); font-weight: 700; font-size: 0.85rem;
}
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); text-transform: uppercase; margin-top: 8px; }
.page-hero p { color: var(--muted); max-width: 640px; margin-top: 10px; }

/* ---- Footer -------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 50px 0 30px; margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
.site-footer p { color: var(--muted); font-size: 0.92rem; }
.site-footer h4 {
  text-transform: uppercase; letter-spacing: 1.5px; font-size: 0.92rem; margin-bottom: 14px;
}
.site-footer ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.site-footer ul a { color: var(--muted); font-size: 0.92rem; }
.site-footer ul a:hover { color: var(--text); }
.footer-partners {
  display: flex; align-items: center; justify-content: center;
  gap: 30px; flex-wrap: wrap;
  margin-top: 34px; padding-top: 28px; border-top: 1px solid var(--line);
}
.footer-partners span {
  color: var(--muted); font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 2px; font-family: var(--font-head); font-weight: 600;
}
.footer-partners img {
  width: 58px; height: 32px;
  object-fit: contain; object-position: center;
  opacity: 0.85; transition: opacity .15s;
}
.footer-partners img:hover { opacity: 1; }
.footer-bottom {
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  color: var(--muted); font-size: 0.84rem;
}

/* ---- Layout chips & banners --------------------------------------- */
.layout-chip {
  display: inline-block; font-family: var(--font-head); font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px; font-size: 0.68rem;
  padding: 3px 10px; border-radius: 999px; border: 1px solid currentColor;
  vertical-align: middle; margin-left: 6px;
}
.banner {
  display: flex; gap: 14px; align-items: flex-start;
  background: linear-gradient(180deg, rgba(227,6,19,0.10), var(--bg-2));
  border: 1px solid rgba(227,6,19,0.35);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 24px;
}
.banner b { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 1px; }
.banner span { color: var(--muted); font-size: 0.9rem; }
.banner-dot {
  width: 11px; height: 11px; border-radius: 50%; margin-top: 5px; flex: none;
  background: var(--red); box-shadow: 0 0 12px var(--red); animation: pulse 1.6s infinite;
}

/* ---- Home: running-order snapshot --------------------------------- */
.ro-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-2); margin-bottom: 10px;
}
.ro-time {
  font-family: var(--font-head); font-weight: 700; font-size: 1.1rem;
  color: var(--red); min-width: 52px;
}
.ro-main { flex: 1; }
.ro-label { font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.ro-field { color: var(--muted); font-size: 0.85rem; }

/* ---- Format: layout cards ----------------------------------------- */
.kv { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.kv span {
  font-family: var(--font-head); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); background: var(--bg); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px;
}
.track-line {
  height: 6px; margin-top: 20px; border-radius: 4px;
  background: linear-gradient(90deg, transparent, var(--c, var(--red)), transparent);
  opacity: 0.7;
}

/* ---- Format: day timetable ---------------------------------------- */
.timetable { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tt-row { display: flex; gap: 18px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.tt-row:last-child { border-bottom: none; }
.tt-row:nth-child(even) { background: var(--bg-2); }
.tt-time { font-family: var(--font-head); font-weight: 700; color: var(--red); min-width: 56px; }
.tt-body { display: flex; flex-direction: column; }
.tt-body b { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.5px; }
.tt-body span { color: var(--muted); font-size: 0.86rem; }

/* ---- Timetable table ---------------------------------------------- */
.tt-table { min-width: 560px; }
.tt-table td.tt-time {
  font-family: var(--font-head); font-weight: 700; color: var(--red);
  white-space: nowrap;
}
.tt-table td.tt-session { font-weight: 600; }
.tt-table td.tt-notes { color: var(--muted); }
.tt-table tr.tt-break td {
  background: rgba(245, 166, 35, 0.12);
}
.tt-table tr.tt-break td.tt-time,
.tt-table tr.tt-break td.tt-session { color: #f5a623; font-family: var(--font-head); }
.tt-table tr.tt-break td.tt-notes { color: #f5a623; }
.tt-table tr.tt-watch td {
  background: rgba(0, 166, 81, 0.12);
}
.tt-table tr.tt-watch td.tt-time,
.tt-table tr.tt-watch td.tt-session { color: var(--cedar); font-family: var(--font-head); }
.tt-table tr.tt-watch td.tt-notes { color: var(--cedar); }
.tt-table tr.tt-break:hover td,
.tt-table tr.tt-watch:hover td { filter: brightness(1.15); }

/* ---- Finals bracket ----------------------------------------------- */
.bracket { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }
.bk-col { display: flex; flex-direction: column; gap: 18px; }
.bk-card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.bk-final { border-color: rgba(255,211,77,0.4); background: linear-gradient(180deg, rgba(255,211,77,0.08), var(--bg-2)); }
.bk-head {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: 1px;
  font-weight: 700; margin-bottom: 14px; display: flex; align-items: center;
}
.bk-slot {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px; margin-bottom: 7px; font-size: 0.9rem;
  display: flex; align-items: center; gap: 8px;
}
.bk-slot .tbd { color: var(--muted); font-family: var(--font-head); letter-spacing: 2px; font-size: 0.8rem; }
.bk-pos { font-family: var(--font-head); font-weight: 700; color: var(--red); font-size: 0.8rem; min-width: 26px; }
.bk-kart { margin-left: auto; font-family: var(--font-head); font-weight: 700; color: var(--muted); }
.bk-more { color: var(--muted); font-size: 0.78rem; margin-top: 8px; }

/* ---- Filter chips -------------------------------------------------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip {
  font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
  font-size: 0.82rem; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--muted);
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: #34373f; }
.chip.active { background: var(--red); border-color: var(--red); color: #fff; }

.m-subhead {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); font-size: 0.78rem; margin-bottom: 8px;
}

/* ---- Responsive ---------------------------------------------------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .nav-links {
    position: fixed; inset: 72px 0 auto 0;
    flex-direction: column; align-items: stretch;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
    padding: 14px; gap: 4px;
    transform: translateY(-120%); transition: transform .25s ease;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 14px; }
  .nav-cta { margin: 8px 0 0; }
  .nav-toggle { display: grid; place-items: center; }
  .round-row { grid-template-columns: 66px 1fr; padding: 16px; gap: 12px; }
  .round-row .rnum { font-size: 1.4rem; }
  .round-row .rstatus { grid-column: 2; text-align: left; margin-top: 2px; }
  .bracket { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid.cols-3, .grid.cols-4, .grid.cols-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .m-stats { grid-template-columns: repeat(2,1fr); }
  .countdown { gap: 7px; }
  .cd-unit .num { font-size: 1.5rem; }
}
