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

:root {
  --bg: #050508;
  --panel: #0c0d13;
  --panel-2: #11131d;
  --text: #f6f7fb;
  --muted: #9ea4b4;
  --line: rgba(255,255,255,.12);
  --red: #ff154f;
  --red-2: #ff3b30;
  --blue: #00d4ff;
  --purple: #8f36ff;
  --green: #23e58b;
  --yellow: #ffd84d;
  --radius: 24px;
  --shadow: 0 25px 80px rgba(0,0,0,.42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 92px; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 80% 10%, rgba(143,54,255,.13), transparent 30%),
    radial-gradient(circle at 10% 30%, rgba(0,212,255,.09), transparent 28%),
    var(--bg);
  font-family: Inter, system-ui, sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  z-index: -2;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .045;
  z-index: 50;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

.speed-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: .18;
  background: repeating-linear-gradient(112deg, transparent 0 86px, rgba(0,212,255,.09) 87px 88px, transparent 89px 180px);
  animation: drift 18s linear infinite;
}

@keyframes drift { to { transform: translateX(-240px); } }

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 0 4vw;
  background: rgba(5,5,8,.74);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  font-family: Rajdhani, sans-serif;
  font-size: 28px;
  font-weight: 800;
  transform: skewX(-10deg);
  background: linear-gradient(135deg, var(--red), var(--purple));
  border-radius: 10px 3px 10px 3px;
  box-shadow: 0 0 30px rgba(255,21,79,.35);
}

.brand strong,
.brand small { display: block; }
.brand strong {
  font-family: Rajdhani, sans-serif;
  letter-spacing: .12em;
  font-size: 20px;
}
.brand small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .22em;
}

.nav {
  display: flex;
  gap: 24px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.nav a { color: #d7dae3; }
.nav a:hover { color: var(--red); }

.sound-toggle,
.menu-toggle {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
}
.sound-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.sound-icon {
  color: var(--red);
  text-shadow: 0 0 12px var(--red);
}
.menu-toggle { display: none; font-size: 20px; }

.hero {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  align-items: center;
  gap: 30px;
  padding: 72px 5vw 70px;
  overflow: hidden;
}

.hero-copy { max-width: 760px; position: relative; z-index: 3; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font-family: Rajdhani, sans-serif;
  line-height: .86;
  letter-spacing: -.045em;
}
.hero h1 span {
  display: block;
  font-size: clamp(48px, 7vw, 98px);
  font-weight: 600;
  color: #d8dbe5;
}
.hero h1 strong {
  display: block;
  font-size: clamp(64px, 10vw, 144px);
  color: transparent;
  -webkit-text-stroke: 2px #fff;
  text-shadow:
    4px 4px 0 var(--red),
    9px 9px 0 rgba(143,54,255,.45);
}
.hero-copy > p {
  max-width: 650px;
  margin: 28px 0 0;
  color: #b9becb;
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px 3px 12px 3px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .04em;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary {
  color: white;
  background: linear-gradient(135deg, var(--red), #ba005f);
  box-shadow: 0 12px 34px rgba(255,21,79,.28);
}
.button-ghost {
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.04);
}
.button-game {
  gap: 9px;
  color: #03141a;
  background: linear-gradient(135deg, var(--blue), #7cf7ff);
  box-shadow: 0 12px 34px rgba(0,212,255,.24);
}
.button-game span {
  font-size: 18px;
  line-height: 1;
  transition: transform .2s ease;
}
.button-game:hover span { transform: translate(2px, -2px); }

.nav-game-link {
  color: #041319 !important;
  padding: 9px 14px;
  border-radius: 9px 3px 9px 3px;
  background: linear-gradient(135deg, var(--blue), #7cf7ff);
  box-shadow: 0 0 22px rgba(0,212,255,.18);
  font-weight: 800;
}
.button-accelerate {
  background: linear-gradient(135deg, var(--green), #00a76c);
  color: #02140d;
  transition: background .2s ease, box-shadow .2s ease, color .2s ease, opacity .2s ease;
}
.button-accelerate.waiting {
  background: linear-gradient(135deg, #3a2c10, #6d4d0a);
  color: #ffd46a;
  box-shadow: inset 0 0 0 1px rgba(255,212,106,.22);
}
.button-accelerate.ready {
  background: linear-gradient(135deg, #20ef91, #00a76c);
  color: #02140d;
  box-shadow: 0 0 26px rgba(35,229,139,.45);
  animation: gasPulse .72s ease-in-out infinite alternate;
}
@keyframes gasPulse {
  from { transform: scale(1); box-shadow: 0 0 18px rgba(35,229,139,.34); }
  to { transform: scale(1.018); box-shadow: 0 0 34px rgba(35,229,139,.62); }
}
.button:disabled { opacity: .35; cursor: not-allowed; transform: none; }

.hero-stats {
  display: flex;
  gap: 34px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.hero-stats div { display: grid; gap: 4px; }
.hero-stats strong {
  font-family: Rajdhani, sans-serif;
  font-size: 32px;
  color: #fff;
}
.hero-stats span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }

.hero-visual {
  position: relative;
  min-height: 600px;
}
.track-stage {
  position: absolute;
  inset: 60px -100px 0 -20px;
  display: grid;
  place-items: center;
  perspective: 800px;
}
.track-stage::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 36% 0 2%;
  background: linear-gradient(110deg, transparent 0 20%, rgba(255,21,79,.12) 42%, rgba(0,212,255,.1) 70%, transparent);
  filter: blur(28px);
  transform: rotate(-8deg);
}
.track-ring {
  position: absolute;
  pointer-events: none;
  width: 780px;
  height: 320px;
  border: 2px solid rgba(255,255,255,.08);
  border-radius: 50%;
  transform: rotateX(67deg) rotateZ(-9deg);
}
.track-ring-one { box-shadow: inset 0 0 0 12px rgba(0,212,255,.06), 0 0 55px rgba(0,212,255,.18); }
.track-ring-two { width: 630px; height: 250px; border-color: rgba(255,21,79,.42); box-shadow: 0 0 45px rgba(255,21,79,.26); }
.track-ring-three { width: 500px; height: 185px; border-style: dashed; border-color: rgba(143,54,255,.6); animation: spin 13s linear infinite; }
@keyframes spin { to { transform: rotateX(67deg) rotateZ(351deg); } }


.hero-car-shell {
  position: relative;
  z-index: 2;
  width: min(850px, 98%);
  display: grid;
  place-items: center;
  transform: rotate(-2deg);
  animation: hoverCar 3.2s ease-in-out infinite;
  filter: drop-shadow(0 34px 52px rgba(0,0,0,.82));
}
.hero-car-shell::before {
  content: "";
  position: absolute;
  inset: 22% 8% 14%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,255,.18), rgba(255,21,79,.12) 48%, transparent 72%);
  filter: blur(28px);
}
.hero-car-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 390px;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  transition: opacity .2s ease, transform .45s cubic-bezier(.2,.8,.2,1), filter .3s ease;
  filter: saturate(1.12) contrast(1.06) drop-shadow(0 0 24px rgba(0,212,255,.18));
}
.hero-car-image.switching { opacity: .15; transform: translateX(20px) scale(.985); }
.car-selector {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: -54px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 8px;
  background: rgba(7,8,14,.78);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px 4px 14px 4px;
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 35px rgba(0,0,0,.42);
}
.car-swatch {
  min-width: 66px;
  padding: 8px 10px;
  color: #8e94a5;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px 2px 8px 2px;
  cursor: pointer;
  font: 700 10px/1 Rajdhani, sans-serif;
  letter-spacing: .12em;
  transition: transform .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.car-swatch::before {
  content: "";
  display: block;
  width: 100%;
  height: 3px;
  margin-bottom: 7px;
  border-radius: 99px;
  background: linear-gradient(90deg, #00d4ff, #ff154f);
  box-shadow: 0 0 10px rgba(0,212,255,.45);
}
.car-swatch[data-car="red-blue"]::before { background: linear-gradient(90deg, #ff284f, #dceeff, #00baff); }
.car-swatch[data-car="gold"]::before { background: linear-gradient(90deg, #fff06b, #ff9a16); }
.car-swatch[data-car="green-cyan"]::before { background: linear-gradient(90deg, #2dff9b, #00dcff); }
.car-swatch:hover { color: #fff; transform: translateY(-2px); }
.car-swatch.active {
  color: #fff;
  border-color: rgba(0,212,255,.45);
  box-shadow: inset 0 0 16px rgba(0,212,255,.08), 0 0 18px rgba(0,212,255,.12);
}
@keyframes hoverCar { 50% { transform: rotate(-2deg) translateY(-12px); } }

.speed-hud {
  position: absolute;
  right: 8%;
  bottom: 14%;
  z-index: 3;
  display: grid;
  justify-items: end;
  padding: 14px 18px;
  background: rgba(6,7,12,.72);
  border: 1px solid rgba(0,212,255,.45);
  border-radius: 16px 3px 16px 3px;
  backdrop-filter: blur(10px);
}
.speed-hud span { color: var(--green); font-size: 11px; letter-spacing: .22em; }
.speed-hud strong { font-family: Rajdhani; font-size: 54px; line-height: .9; }
.speed-hud small { color: var(--muted); }

.starting-lights {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: #0b0c11;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.starting-lights i {
  display: block;
  border-radius: 50%;
  background: #241117;
  border: 2px solid #4d222d;
  box-shadow: inset 0 0 12px rgba(0,0,0,.9);
}
.starting-lights i.on {
  background: var(--red-2);
  border-color: #ff8d86;
  box-shadow: 0 0 18px rgba(255,59,48,.95), inset 0 0 10px #fff4;
}
.starting-lights.go i {
  background: #23e58b;
  border-color: #baffdc;
  box-shadow: 0 0 28px rgba(35,229,139,1), inset 0 0 12px rgba(255,255,255,.55);
  animation: greenLightPulse .45s ease-in-out infinite alternate;
}
.starting-lights.false-start i {
  background: #5d1017;
  border-color: #ff4d5a;
  box-shadow: 0 0 18px rgba(255,38,57,.58);
}
@keyframes greenLightPulse {
  from { filter: brightness(.92); }
  to { filter: brightness(1.28); }
}
.starting-lights.compact {
  position: absolute;
  top: 2px;
  right: 10%;
  z-index: 4;
}
.starting-lights.compact i { width: 23px; height: 23px; }
.starting-lights.large { justify-content: center; }
.starting-lights.large i { width: 56px; height: 56px; }

.ticker {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--red);
  color: white;
  transform: rotate(-1deg) scale(1.02);
}
.ticker-track {
  display: flex;
  align-items: center;
  gap: 26px;
  width: max-content;
  padding: 14px 0;
  font-family: Rajdhani;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .18em;
  animation: ticker 22s linear infinite;
}
@keyframes ticker { to { transform: translateX(-50%); } }

.section {
  width: min(1440px, 92vw);
  margin: 0 auto;
  padding: 110px 0;
}
.section-heading {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 510px);
  gap: 70px;
  align-items: end;
  margin-bottom: 40px;
}
.section-heading h2,
.challenge-copy h2,
.final-cta h2 {
  margin: 0;
  font-family: Rajdhani, sans-serif;
  font-size: clamp(40px, 5vw, 70px);
  line-height: .95;
}
.section-heading > p,
.challenge-copy > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}
.section-number {
  display: inline-block;
  margin-bottom: 14px;
  color: rgba(255,255,255,.16);
  font-family: Rajdhani;
  font-size: 72px;
  font-weight: 700;
  line-height: .8;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(480px, 100%);
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
}
.search-box input {
  width: 100%;
  height: 48px;
  color: white;
  border: 0;
  outline: 0;
  background: transparent;
}
.legend { display: flex; gap: 18px; color: var(--muted); font-size: 12px; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-f1 { background: var(--blue); }
.legend-new { background: var(--yellow); box-shadow: 0 0 12px var(--yellow); }

.teams-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.team-card {
  --team: #fff;
  position: relative;
  min-height: 250px;
  padding: 22px;
  overflow: hidden;
  background:
    linear-gradient(140deg, color-mix(in srgb, var(--team) 18%, transparent), transparent 48%),
    var(--panel);
  border: 1px solid color-mix(in srgb, var(--team) 42%, #252731);
  border-radius: 20px 4px 20px 4px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.team-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 20px 50px color-mix(in srgb, var(--team) 20%, transparent);
}
.team-card::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 220px;
  height: 220px;
  border: 28px solid color-mix(in srgb, var(--team) 13%, transparent);
  border-radius: 50%;
}
.team-top { display: flex; align-items: start; justify-content: space-between; gap: 15px; }
.team-logo-wrap {
  width: 94px;
  height: 72px;
  display: grid;
  place-items: center;
  padding: 9px;
  background: rgba(255,255,255,.92);
  border-radius: 14px 3px 14px 3px;
}
.team-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.team-logo-fallback {
  display: block;
  color: #090a0e;
  font-family: Rajdhani;
  font-size: 28px;
  font-weight: 900;
}
.team-logo-fallback[hidden] { display: none; }
.team-tag {
  padding: 6px 9px;
  border: 1px solid color-mix(in srgb, var(--team) 60%, transparent);
  border-radius: 999px;
  color: var(--team);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.team-card h3 { margin: 28px 0 4px; font-family: Rajdhani; font-size: 28px; }
.team-base { color: var(--muted); font-size: 12px; }
.team-drivers {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.team-drivers span {
  padding: 7px 9px;
  background: rgba(255,255,255,.06);
  border-radius: 8px;
  font-size: 11px;
}

.driver-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.chip {
  border: 1px solid var(--line);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  cursor: pointer;
}
.chip.active {
  color: white;
  border-color: var(--red);
  background: rgba(255,21,79,.15);
}

.drivers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.driver-card {
  --accent: var(--red);
  position: relative;
  min-height: 470px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, #242631);
  border-radius: 24px 5px 24px 5px;
  background: var(--panel);
  transition: transform .25s ease, box-shadow .25s ease;
}
.driver-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 24px 60px color-mix(in srgb, var(--accent) 18%, transparent);
}
.driver-image {
  height: 330px;
  display: grid;
  place-items: end center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 40%),
    linear-gradient(150deg, #181a24, #07080d);
}
.driver-image.image-failed::after {
  content: "Снимката не е достъпна";
  align-self: center;
  padding: 10px 14px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
}
.driver-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 24px 30px rgba(0,0,0,.45));
  transition: transform .35s ease;
}
.driver-card:hover img { transform: scale(1.045); }
.driver-info {
  position: relative;
  padding: 20px;
  border-top: 2px solid var(--accent);
}
.driver-info small { color: var(--accent); font-weight: 800; letter-spacing: .13em; }
.driver-info h3 { margin: 7px 0 5px; font-family: Rajdhani; font-size: 29px; }
.driver-info p { margin: 0; color: var(--muted); font-size: 12px; }
.driver-number {
  position: absolute;
  right: 14px;
  bottom: 6px;
  color: rgba(255,255,255,.07);
  font-family: Rajdhani;
  font-size: 76px;
  font-weight: 900;
  line-height: 1;
}

.challenge-section {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 70px;
  align-items: center;
}
.reaction-scale {
  display: grid;
  gap: 9px;
  margin-top: 30px;
  color: var(--muted);
  font-size: 13px;
}
.reaction-scale span { display: flex; justify-content: space-between; max-width: 410px; border-bottom: 1px dashed var(--line); padding-bottom: 7px; }
.reaction-scale b { color: white; }

.reaction-console {
  padding: 36px;
  background:
    radial-gradient(circle at 50% 0, rgba(255,21,79,.17), transparent 42%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px 6px 28px 6px;
  box-shadow: var(--shadow);
}
.reaction-display {
  display: grid;
  justify-items: center;
  margin: 30px 0;
}
.reaction-display small { color: var(--muted); letter-spacing: .17em; }
.reaction-display strong {
  font-family: Rajdhani;
  font-size: clamp(70px, 10vw, 126px);
  line-height: .85;
  color: white;
  text-shadow: 0 0 40px rgba(0,212,255,.25);
}
.reaction-display span { color: var(--blue); }
.reaction-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.console-message { color: var(--muted); text-align: center; font-size: 13px; margin: 16px 0 0; }

.pitstop-game {
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px 6px 28px 6px;
}
.pitstop-hud {
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: flex-end;
}
.pitstop-hud div { display: grid; }
.pitstop-hud div:first-child { margin-right: auto; }
.pitstop-hud small { color: var(--muted); font-size: 10px; letter-spacing: .14em; }
.pitstop-hud strong { font-family: Rajdhani; font-size: 34px; }
.pit-car-wrap {
  position: relative;
  min-height: 430px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-top: 10px;
  background:
    linear-gradient(90deg, transparent 48%, rgba(255,255,255,.08) 49% 51%, transparent 52%),
    linear-gradient(#11131b, #08090d);
  border-radius: 20px;
}
.pit-lane-lines {
  position: absolute;
  pointer-events: none;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 120px, rgba(255,216,77,.28) 121px 129px);
  opacity: .25;
}

.pit-car {
  position: relative;
  z-index: 2;
  width: min(900px, 92%);
  aspect-ratio: 3.75 / 1;
  display: grid;
  place-items: center;
}
.pit-car::before {
  content: "";
  position: absolute;
  inset: 32% 4% 12%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,170,34,.22), transparent 70%);
  filter: blur(24px);
}
.pit-car-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: saturate(1.08) contrast(1.04) drop-shadow(0 22px 26px rgba(0,0,0,.75));
  user-select: none;
  pointer-events: none;
}
.pit-car-status {
  position: absolute;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 12px;
  color: #ffd84d;
  background: rgba(8,9,14,.78);
  border: 1px solid rgba(255,216,77,.35);
  border-radius: 10px 2px 10px 2px;
  font: 800 11px/1 Rajdhani, sans-serif;
  letter-spacing: .18em;
  box-shadow: 0 0 22px rgba(255,174,0,.14);
}
.tyre {
  position: absolute;
  z-index: 3;
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(255,224,120,.72);
  color: #fff6c8;
  background: radial-gradient(circle, rgba(8,9,13,.18) 0 42%, rgba(255,174,0,.16) 44% 57%, rgba(8,9,13,.62) 59% 100%);
  box-shadow: inset 0 0 0 6px rgba(5,6,10,.62), 0 0 22px rgba(255,174,0,.28);
  cursor: pointer;
  transition: transform .14s ease, box-shadow .2s ease, opacity .2s ease, border-color .2s ease;
  backdrop-filter: blur(2px);
}
.tyre span {
  display: grid;
  place-items: center;
  width: 27px;
  height: 20px;
  border-radius: 5px 1px 5px 1px;
  background: rgba(5,6,10,.8);
  font: 800 10px/1 Rajdhani, sans-serif;
  letter-spacing: .08em;
}
.tyre:hover:not(:disabled) {
  transform: scale(1.12);
  border-color: #fff;
  box-shadow: inset 0 0 0 6px rgba(5,6,10,.5), 0 0 30px rgba(255,184,45,.65);
}
.tyre.changed {
  border-color: var(--green);
  color: var(--green);
  box-shadow: inset 0 0 0 6px rgba(5,6,10,.45), 0 0 34px rgba(35,229,139,.7);
  opacity: .58;
  transform: scale(.82) rotate(22deg);
}
.tyre:disabled { cursor: not-allowed; }
.tyre-fl { left: 12.5%; top: 32%; }
.tyre-fr { left: 19%; top: 12%; }
.tyre-rl { right: 12%; top: 31%; }
.tyre-rr { right: 18.5%; top: 11%; }

.rules-layout {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 20px;
}
.steward-panel,
.decision-card {
  padding: 30px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px 5px 24px 5px;
}
.steward-panel label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.steward-panel select {
  width: 100%;
  min-height: 54px;
  padding: 0 14px;
  color: white;
  background: #11131b;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.severity { margin: 28px 0; }
.severity span { display: block; margin-bottom: 10px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.severity input { width: 100%; accent-color: var(--red); }
.severity div { display: flex; justify-content: space-between; color: var(--muted); }
.decision-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0, rgba(255,21,79,.18), transparent 35%),
    var(--panel);
}
.decision-card small { color: var(--red); letter-spacing: .18em; }
.decision-card h3 { margin: 14px 0; font-family: Rajdhani; font-size: clamp(54px, 7vw, 92px); line-height: 1; }
.decision-card p { max-width: 650px; color: #bdc2cf; line-height: 1.8; }
.decision-flag {
  position: absolute;
  right: 26px;
  top: 18px;
  color: rgba(255,255,255,.08);
  font-size: 100px;
}
@keyframes decisionPulse {
  0% { transform: scale(.992); box-shadow: 0 0 0 rgba(255,21,79,0); }
  45% { transform: scale(1.006); box-shadow: 0 0 42px rgba(255,21,79,.18); }
  100% { transform: scale(1); box-shadow: none; }
}
.decision-card.decision-updated { animation: decisionPulse .48s ease; }
.decision-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.decision-meta span { padding: 8px 10px; background: rgba(255,255,255,.05); border-radius: 8px; font-size: 11px; }

.timeline { padding: 32px; background: var(--panel); border: 1px solid var(--line); border-radius: 24px 5px 24px 5px; }
.timeline-track {
  position: relative;
  height: 6px;
  margin: 42px 20px 28px;
  background: linear-gradient(90deg, var(--blue), var(--purple), var(--red));
  border-radius: 999px;
  box-shadow: 0 0 20px rgba(143,54,255,.35);
}

.timeline-car {
  position: absolute;
  top: 50%;
  left: 0;
  width: 92px;
  height: 42px;
  transform: translate(-50%, -50%);
  background: url("assets/cars/green-cyan.png") center / contain no-repeat;
  filter: drop-shadow(0 0 12px rgba(0,212,255,.72));
  transition: left .6s cubic-bezier(.2,.8,.2,1);
}
.timeline-buttons {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.timeline-buttons button {
  border: 1px solid var(--line);
  padding: 10px 6px;
  border-radius: 8px;
  background: rgba(255,255,255,.03);
  cursor: pointer;
}
.timeline-buttons button.active { border-color: var(--red); background: rgba(255,21,79,.13); }
.timeline-content {
  margin-top: 26px;
  padding: 24px;
  background: rgba(255,255,255,.035);
  border-radius: 14px;
}
.timeline-content h3 { margin: 0 0 10px; font-family: Rajdhani; font-size: 32px; }
.timeline-content p { margin: 0; color: var(--muted); line-height: 1.7; }

.quiz-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 34px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px 6px 28px 6px;
}
.quiz-progress { height: 6px; background: rgba(255,255,255,.07); border-radius: 999px; overflow: hidden; }
.quiz-progress div { width: 20%; height: 100%; background: linear-gradient(90deg, var(--blue), var(--red)); transition: width .3s ease; }
.quiz-meta { display: flex; justify-content: space-between; margin: 16px 0 34px; color: var(--muted); font-size: 12px; }
.quiz-shell h3 { font-family: Rajdhani; font-size: clamp(30px, 4vw, 48px); }
.quiz-answers { display: grid; gap: 10px; margin-bottom: 22px; }
.quiz-answer {
  width: 100%;
  padding: 16px 18px;
  text-align: left;
  color: white;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.quiz-answer:hover:not(:disabled) { border-color: var(--blue); }
.quiz-answer:disabled { cursor: default; }
.quiz-answer.correct { border-color: var(--green); background: rgba(35,229,139,.12); }
.quiz-answer.wrong { border-color: var(--red); background: rgba(255,21,79,.12); }
.quiz-feedback { min-height: 26px; color: var(--muted); }

.final-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 70px;
  margin-bottom: 90px;
  background:
    linear-gradient(135deg, rgba(255,21,79,.19), rgba(143,54,255,.14) 45%, rgba(0,212,255,.11)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 30px 7px 30px 7px;
}

.driver-modal {
  width: min(980px, 92vw);
  color: white;
  padding: 0;
  background: #0b0c12;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 28px 6px 28px 6px;
  box-shadow: 0 35px 120px rgba(0,0,0,.85);
}
.driver-modal::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(7px); }
.driver-modal.fallback-open {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  display: block;
  max-height: 92vh;
  overflow: auto;
}
body.modal-open { overflow: hidden; }
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  cursor: pointer;
  font-size: 28px;
}
.modal-driver-layout { display: grid; grid-template-columns: .9fr 1.1fr; min-height: 590px; }
.modal-image-wrap {
  display: grid;
  place-items: end center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, rgba(255,21,79,.22), transparent 44%), #10121a;
}
.modal-image-wrap img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.modal-copy { padding: 60px 46px; }
.modal-copy h2 { margin: 0; font-family: Rajdhani; font-size: 58px; line-height: .95; }
.modal-team { color: var(--red); font-weight: 800; }
.modal-copy > p:last-of-type { color: #b9becb; line-height: 1.75; }
.modal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 28px 0; }
.modal-stat { padding: 12px; background: rgba(255,255,255,.045); border-radius: 10px; }
.modal-stat strong, .modal-stat span { display: block; }
.modal-stat strong { font-family: Rajdhani; font-size: 30px; }
.modal-stat span { color: var(--muted); font-size: 10px; text-transform: uppercase; }

footer {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  padding: 54px 5vw;
  border-top: 1px solid var(--line);
  background: #030305;
}
footer p { color: var(--muted); line-height: 1.6; }
.footer-links { display: grid; gap: 8px; align-content: start; }
.footer-links a { color: #dfe3ee; }
.footer-links a:hover { color: var(--red); }
.legal-note { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid var(--line); font-size: 11px; }

@media (max-width: 1120px) {
  .teams-grid, .drivers-grid { grid-template-columns: repeat(3, 1fr); }
  .hero { grid-template-columns: 1fr; padding-top: 80px; }
  .hero-visual { min-height: 500px; }
  .track-stage { inset: 20px -80px -20px; }
  .challenge-section { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .nav {
    position: absolute;
    top: 74px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    padding: 22px 5vw;
    background: rgba(5,5,8,.97);
    border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
  .menu-toggle { display: block; }
  .sound-toggle .sound-label { display: none; }
  .section-heading { grid-template-columns: 1fr; gap: 20px; }
  .teams-grid, .drivers-grid { grid-template-columns: repeat(2, 1fr); }
  .rules-layout { grid-template-columns: 1fr; }
  .timeline-buttons { grid-template-columns: repeat(4, 1fr); }
  .final-cta { flex-direction: column; align-items: flex-start; padding: 42px 28px; }
  .modal-driver-layout { grid-template-columns: 1fr; }
  .modal-image-wrap { min-height: 420px; }
  .modal-copy { padding: 36px 28px; }
  footer { grid-template-columns: 1fr; }
  .legal-note { grid-column: auto; }
}

@media (max-width: 560px) {
  .topbar { padding: 0 16px; }
  .brand small { display: none; }
  .hero { padding: 54px 18px 40px; }
  .hero h1 strong { -webkit-text-stroke-width: 1px; text-shadow: 3px 3px 0 var(--red), 6px 6px 0 rgba(143,54,255,.35); }
  .hero-stats { gap: 16px; }
  .hero-stats strong { font-size: 24px; }
  .hero-visual { min-height: 390px; }
  .track-stage { inset: 20px -150px -25px -120px; }
  .starting-lights.compact { right: 0; }
  .section { width: min(94vw, 1440px); padding: 78px 0; }
  .controls-row { align-items: stretch; flex-direction: column; }
  .legend { flex-wrap: wrap; }
  .teams-grid, .drivers-grid { grid-template-columns: 1fr; }
  .driver-card { min-height: 440px; }
  .reaction-console { padding: 22px 14px; }
  .starting-lights.large i { width: 40px; height: 40px; }
  .reaction-buttons { grid-template-columns: 1fr; }
  .pitstop-hud { flex-wrap: wrap; }
  .pit-car-wrap { min-height: 380px; }
  .pit-car { transform: scale(.68); }
  .timeline { padding: 20px 12px; }
  .timeline-buttons { grid-template-columns: repeat(2, 1fr); }
  .quiz-shell { padding: 24px 18px; }
  .modal-stats { grid-template-columns: repeat(2, 1fr); }
}


@media (max-width: 900px) {
  .hero-car-shell { width: min(760px, 112%); }
  .car-selector { bottom: -48px; }
  .pit-car { width: min(780px, 112%); }
}

@media (max-width: 560px) {
  .hero-car-shell { width: 125%; }
  .car-selector { bottom: -46px; gap: 5px; padding: 6px; }
  .car-swatch { min-width: 51px; padding: 7px 6px; font-size: 8px; }
  .pit-car { width: 100%; }
  .tyre { width: 54px; height: 54px; }
  .tyre-fl { left: 13%; top: 31%; }
  .tyre-fr { left: 21%; top: 9%; }
  .tyre-rl { right: 12%; top: 30%; }
  .tyre-rr { right: 20%; top: 8%; }
  .timeline-car { width: 72px; height: 34px; }
}

@media (max-width: 560px) {
  .pit-car-wrap { min-height: 330px; }
  .pit-car { width: 100%; transform: none; }
  .tyre { width: 50px; height: 50px; }
  .tyre-fl { left: 10%; top: 35%; }
  .tyre-fr { left: 22%; top: 8%; }
  .tyre-rl { right: 10%; top: 34%; }
  .tyre-rr { right: 22%; top: 7%; }
}
