/* ========== NAV ========== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.nav-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gradient-blue);
  color: #fff;
  padding: 10px 24px;
  border-radius: 14px;
  font-family: var(--font);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 0 var(--blue-dark), 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.1s, filter 0.2s;
}

.nav-cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 6px 0 var(--blue-dark), 0 8px 20px rgba(37, 99, 235, 0.25);
}

.nav-cta:active {
  transform: translateY(3px);
  box-shadow: 0 0px 0 var(--blue-dark), 0 2px 6px rgba(37, 99, 235, 0.2);
}

/* ========== HERO ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 120px 0 80px;
  text-align: center;
}

/* Floating math symbols */
.floats {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.float {
  position: absolute;
  left: var(--x);
  bottom: -60px;
  font-size: var(--sz, 2rem);
  font-weight: 900;
  color: rgba(148, 163, 184, 0.10);
  animation: floatUp 22s linear infinite;
  animation-delay: var(--d);
  user-select: none;
  will-change: transform;
}

/* Gradient blobs */
.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: -15%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.07) 0%, transparent 70%);
  animation: float-slow 20s ease-in-out infinite;
}

.hero-bg::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(234, 88, 12, 0.06) 0%, transparent 70%);
  animation: float-slow 15s ease-in-out infinite reverse;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 720px;
  margin: 0 auto;
}

.hero-logo {
  display: block;
  margin: 0 auto 24px auto;
  width: 120px;
  height: 120px;
  border-radius: 24px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 32px;
  letter-spacing: 0.03em;
}

.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue-light);
  animation: pulse-dot 2s ease-in-out infinite;
}

.hero h1 {
  font-size: clamp(36px, 5.5vw, 60px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 20px;
}

.hero h1 strong {
  font-weight: 900;
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-light);
  max-width: 540px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

/* Trust strip */
.trust-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.trust-icon {
  font-size: 16px;
}

.trust-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border);
}

/* ========== STEPS ========== */
.steps {
  padding: 100px 0;
  background: var(--bg);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
}

.step-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--dark);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
}

.step-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.step-text {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.6;
}

/* ========== GAME MODES ========== */
.modes {
  padding: 100px 0;
  background: var(--bg-alt);
}

.modes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.mode-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 40px;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
}

.mode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.06);
}

.mode-icon {
  font-size: 40px;
  margin-bottom: 20px;
  display: block;
}

.mode-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}

.mode-desc {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 24px;
}

.mode-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.mode-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mode-card--math .mode-list li::before {
  background: var(--blue);
}

.mode-card--quiz .mode-list li::before {
  background: var(--orange-light);
}

/* ========== STATS BAR ========== */
.stats {
  padding: 72px 0;
  background: var(--gradient-dark);
  color: #fff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}

.stat-item strong {
  display: block;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff, var(--text-muted-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-item span {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted-dark);
}

/* ========== MULTIPLAYER ========== */
.multiplayer {
  padding: 100px 0;
  background: var(--bg);
}

.multi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.multi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 28px;
  text-align: center;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
}

.multi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
}

.multi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(37, 99, 235, 0.08);
  font-size: 24px;
  margin-bottom: 20px;
}

.multi-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.multi-text {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
}

/* ========== FINAL CTA ========== */
.cta-section {
  padding: 100px 0;
  background: var(--bg-alt);
  text-align: center;
}

.cta-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.cta-sub {
  font-size: 17px;
  color: var(--text-light);
  margin-bottom: 40px;
}

.cta-link {
  display: block;
  margin-top: 32px;
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
}

.cta-link:hover {
  color: var(--blue);
}

/* ========== FOOTER ========== */
.footer {
  padding: 48px 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

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

.footer-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.footer-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.footer-tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 12px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-right a {
  transition: color 0.2s;
}

.footer-right a:hover {
  color: var(--blue);
}

/* ========== TUG-OF-WAR ANIMATION ========== */
.hero-scene {
  margin-top: 48px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

/* Floating question popups */
.hero-questions-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.hero-question {
  position: absolute;
  background: white;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 8px 16px -4px rgba(15, 23, 42, 0.1), 0 4px 8px -2px rgba(15, 23, 42, 0.05);
  animation: heroQuestionFloat 4s ease-in-out infinite;
  opacity: 0.95;
  border: 2px solid;
  max-width: max-content;
}

.hero-question--math {
  top: -10px;
  left: 5%;
  color: #3B82F6;
  border-color: #BFDBFE;
  background: #EFF6FF;
  --rot: -6deg;
  animation-delay: 0s;
}

.hero-question--culture {
  top: 15%;
  right: -5%;
  color: #8B5CF6;
  border-color: #DDD6FE;
  background: #F5F3FF;
  --rot: 5deg;
  animation-delay: -1.5s;
}

.hero-question--anglais {
  bottom: 12%;
  left: 15%;
  color: #F59E0B;
  border-color: #FDE68A;
  background: #FFFBEB;
  --rot: -4deg;
  animation-delay: -3s;
}

@keyframes heroQuestionFloat {

  0%,
  100% {
    transform: translateY(0) rotate(var(--rot));
  }

  50% {
    transform: translateY(-8px) rotate(var(--rot));
  }
}

.tug-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Rope vibration */
.tug-rope-lines {
  animation: tugRopeVibrate 0.2s ease-in-out infinite alternate;
}

@keyframes tugRopeVibrate {
  0% {
    transform: translateY(-1.2px);
  }

  100% {
    transform: translateY(1.2px);
  }
}

/* Character pulling animation */
.tug-char-pull {
  animation: tugCharPull 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

/* Stagger delays per character */
.tug-team>g:nth-child(2)>.tug-char-pull {
  animation-delay: 0.22s;
}

.tug-team>g:nth-child(3)>.tug-char-pull {
  animation-delay: 0.44s;
}

@keyframes tugCharPull {

  0%,
  100% {
    transform: translateX(0) translateY(0) rotate(0deg) scaleX(1) scaleY(1);
  }

  18% {
    transform: translateX(3px) translateY(-1.5px) rotate(2deg) scaleX(0.98) scaleY(1.02);
  }

  42% {
    transform: translateX(-8px) translateY(3.5px) rotate(-6deg) scaleX(1.03) scaleY(0.97);
  }

  56% {
    transform: translateX(-5px) translateY(2px) rotate(-3.5deg) scaleX(1.01) scaleY(0.99);
  }

  76% {
    transform: translateX(2px) translateY(-0.5px) rotate(1deg) scaleX(0.99) scaleY(1.01);
  }

  90% {
    transform: translateX(0) translateY(0) rotate(0deg) scaleX(1) scaleY(1);
  }
}

/* Dust puffs at feet */
.tug-dust {
  animation: tugDustPuff 1.4s ease-out infinite;
}

.tug-team>g:nth-child(2)>.tug-dust {
  animation-delay: 0.22s;
}

.tug-team>g:nth-child(3)>.tug-dust {
  animation-delay: 0.44s;
}

@keyframes tugDustPuff {

  0%,
  30% {
    opacity: 0;
    transform: translateY(0);
  }

  40% {
    opacity: 0.7;
    transform: translateY(-6px);
  }

  60% {
    opacity: 0;
    transform: translateY(-22px);
  }

  100% {
    opacity: 0;
    transform: translateY(-22px);
  }
}

/* Sweat drops */
.tug-sweat {
  animation: tugSweatFly 1.4s ease-out infinite;
}

.tug-team>g:nth-child(2)>.tug-sweat {
  animation-delay: 0.22s;
}

.tug-team>g:nth-child(3)>.tug-sweat {
  animation-delay: 0.44s;
}

@keyframes tugSweatFly {

  0%,
  34% {
    opacity: 0;
    transform: translate(0, 0);
  }

  42% {
    opacity: 0.85;
    transform: translate(0, 0);
  }

  64% {
    opacity: 0;
    transform: translate(12px, -18px);
  }

  100% {
    opacity: 0;
    transform: translate(12px, -18px);
  }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {

  .steps-grid,
  .multi-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }

  .modes-grid {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin: 0 auto;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 16px;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 100px 0 60px;
    min-height: auto;
  }

  .hero-logo {
    width: 88px;
    height: 88px;
  }

  .steps,
  .modes,
  .multiplayer,
  .cta-section {
    padding: 64px 0;
  }

  .mode-card {
    padding: 36px 28px;
  }

  .trust-strip {
    gap: 12px;
  }

  .trust-dot {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 30px;
  }

  .hero-sub {
    font-size: 16px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-badge {
    font-size: 12px;
    padding: 6px 14px;
  }

  .hero-question {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 10px;
    border-width: 1.5px;
  }

  .hero-question--math {
    top: 5%;
    left: 5%;
  }

  .hero-question--culture {
    top: 15%;
    right: 2%;
  }

  .hero-question--anglais {
    bottom: 5%;
    left: 10%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer .container {
    flex-direction: column;
    text-align: center;
  }

  .footer-tagline {
    margin-left: 0;
    display: block;
    margin-top: 4px;
  }
}

/* BOAT RACE */


.race-stage {
  width: 100%;
  height: 280px;
  display: block;
  overflow: visible;
}

.race-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ═══ WAVE ANIMATION ═══ */
.wave-layer {
  animation: waveSlide 4s linear infinite;
}

.wave--1 {
  animation-duration: 3.5s;
}

.wave--2 {
  animation-duration: 5s;
  animation-direction: reverse;
}

@keyframes waveSlide {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(120px);
  }
}

/* ═══ PIROGUE GROUP ═══ */
.pirogue-group {
  transition: transform 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.pirogue-group.game-over {
  transition: transform 1.5s ease-in-out;
}

/* ═══ BOAT BOBBING ═══ */
.boat-bob {
  animation: boatBob 2.2s ease-in-out infinite;
  transform-origin: center;
}

.boat-bob--delay {
  animation-delay: 0.6s;
}

.game-over .boat-bob {
  animation: boatBobSlow 3.5s ease-in-out infinite;
}

@keyframes boatBob {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-2.5px) rotate(-0.8deg);
  }

  50% {
    transform: translateY(0.5px) rotate(0.5deg);
  }

  75% {
    transform: translateY(-1.5px) rotate(-0.3deg);
  }
}

@keyframes boatBobSlow {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-2px) rotate(-0.5deg);
  }
}

/* ═══ BOAT SHADOW ═══ */
.boat-shadow {
  animation: shadowPulse 2.2s ease-in-out infinite;
}

@keyframes shadowPulse {

  0%,
  100% {
    rx: 60;
    opacity: 1;
  }

  50% {
    rx: 56;
    opacity: 0.7;
  }
}

/* ═══ BOAT WAKE ═══ */
.boat-wake-container {
  transition: opacity 0.5s ease-out;
}

.boat-wake-container--hidden {
  opacity: 0;
}

.boat-wake {
  mix-blend-mode: overlay;
  animation: wakeExpand ease-out infinite;
  transform-origin: center;
}

.wake-1 {
  animation-duration: 0.8s;
  opacity: 0.6;
}

.wake-2 {
  animation-duration: 1.1s;
  animation-delay: 0.2s;
  opacity: 0.4;
}

.wake-3 {
  animation-duration: 0.9s;
  animation-delay: 0.4s;
  opacity: 0.3;
}

@keyframes wakeExpand {
  0% {
    transform: scaleX(0) scaleY(0.5);
    opacity: 0;
  }

  20% {
    opacity: 0.7;
  }

  100% {
    transform: scaleX(1.8) scaleY(1.4);
    opacity: 0;
  }
}

/* ═══ BODY LEAN (rocking with paddle stroke) ═══ */
.lean-body {
  animation: leanRock 1.2s ease-in-out infinite;
  transform-origin: 0px -5px;
}

.lean-body--delay {
  animation-delay: 0.3s;
}

@keyframes leanRock {
  0% {
    transform: rotate(-4deg);
  }

  45% {
    transform: rotate(8deg);
  }

  100% {
    transform: rotate(-4deg);
  }
}

/* ═══ PADDLE STROKE ═══ */
.paddle-stroke {
  animation: paddleStroke 1.2s ease-in-out infinite;
  transform-origin: 4px -25px;
}

.paddle-stroke--delay {
  animation-delay: 0.3s;
}

@keyframes paddleStroke {
  0% {
    transform: rotate(-18deg) translateX(-4px);
  }

  35% {
    transform: rotate(6deg) translateX(3px);
  }

  55% {
    transform: rotate(14deg) translateX(5px);
  }

  75% {
    transform: rotate(5deg) translateX(2px);
  }

  100% {
    transform: rotate(-18deg) translateX(-4px);
  }
}

/* ═══ WATER SPLASHES ═══ */
.splash-group {
  animation: splashCycle 1.2s ease-out infinite;
}

.splash-group--delay {
  animation-delay: 0.3s;
}

@keyframes splashCycle {

  0%,
  30% {
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }

  40% {
    opacity: 0.9;
    transform: translateY(-6px) scale(1);
  }

  55% {
    opacity: 0.6;
    transform: translateY(-14px) scale(1.2);
  }

  70% {
    opacity: 0;
    transform: translateY(-22px) scale(0.8);
  }

  100% {
    opacity: 0;
    transform: translateY(-22px) scale(0.8);
  }
}

/* ═══ SWEAT DROP ═══ */
.sweat {
  animation: sweatDrop 1.8s ease-out infinite;
}

.sweat--delay {
  animation-delay: 0.5s;
}

@keyframes sweatDrop {

  0%,
  40% {
    opacity: 0;
    transform: translate(0, 0);
  }

  50% {
    opacity: 0.8;
    transform: translate(0, 0);
  }

  80% {
    opacity: 0;
    transform: translate(8px, -12px);
  }

  100% {
    opacity: 0;
    transform: translate(8px, -12px);
  }
}

/* ═══ GAME OVER STATES ═══ */
.game-over .lean-body,
.game-over .lean-body--delay {
  animation: none;
  transform: rotate(0deg);
}

.game-over .paddle-stroke,
.game-over .paddle-stroke--delay {
  animation: none;
  transform: rotate(0deg) translateX(0);
}

.game-over .splash-group,
.game-over .splash-group--delay {
  animation: none;
  opacity: 0;
}

.game-over .sweat,
.game-over .sweat--delay {
  animation: none;
  opacity: 0;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
  .race-stage {
    flex: 1;
    height: auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .race-svg {
    width: 100%;
    height: 100%;
    max-height: none;
  }
}

/* TRACK RACE */


.race-stage {
  width: 100%;
  height: 300px;
  display: block;
  overflow: visible;
}

.race-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ═══ RUNNER GROUP (slides with progress) ═══ */
.runner-group {
  transition: transform 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.runner-group.game-over {
  transition: transform 1.5s ease-in-out;
}

/* ═══ BODY BOUNCE ═══
   Two foot-strikes per cycle. Each peak = flight phase.
   Subtle rotation adds natural body sway rhythm.
*/
.runner-bounce {
  transform-origin: bottom center;
  animation: runBounce 0.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.runner-bounce--delay {
  animation-delay: 0.25s;
}

@keyframes runBounce {

  0%,
  100% {
    transform: translateY(0px) rotate(0.4deg);
  }

  12% {
    transform: translateY(-7px) rotate(0deg);
  }

  25% {
    transform: translateY(-1px) rotate(-0.4deg);
  }

  50% {
    transform: translateY(0px) rotate(-0.4deg);
  }

  62% {
    transform: translateY(-7px) rotate(0deg);
  }

  75% {
    transform: translateY(-1px) rotate(0.4deg);
  }
}

/* ═══ RUNNER SHADOW ═══ */
.runner-shadow {
  animation: shadowRun 0.5s ease-in-out infinite;
}

.runner-shadow--delay {
  animation-delay: 0.25s;
}

@keyframes shadowRun {

  0%,
  50%,
  100% {
    rx: 14;
    ry: 3;
    opacity: 0.15;
  }

  25%,
  75% {
    rx: 8;
    ry: 1.8;
    opacity: 0.04;
  }
}

/* ═══ LEG STRIDE ═══
   Asymmetric timing models real sprint mechanics:
   - Recovery (swing forward): 60% of cycle — slower, leg in the air
   - Power stroke (pull back): 40% of cycle — fast, explosive ground contact
   Wider ±44deg stride for dramatic sprinting motion.
*/
.leg-back {
  animation: legStrideBack 0.5s cubic-bezier(0.25, 0, 0.75, 1) infinite;
}

.leg-back--delay {
  animation-delay: 0.25s;
}

.leg-front {
  animation: legStrideFront 0.5s cubic-bezier(0.25, 0, 0.75, 1) infinite;
}

.leg-front--delay {
  animation-delay: 0.25s;
}

/* Back leg: starts behind (+44), recovers forward slowly (60%), snaps back quickly (40%) */
@keyframes legStrideBack {
  0% {
    transform: translate(0px, -42px) rotate(44deg) translate(0px, 42px);
  }

  60% {
    transform: translate(0px, -42px) rotate(-44deg) translate(0px, 42px);
  }

  100% {
    transform: translate(0px, -42px) rotate(44deg) translate(0px, 42px);
  }
}

/* Front leg: starts forward (-44), pulls back quickly (40%), recovers forward slowly (60%) */
@keyframes legStrideFront {
  0% {
    transform: translate(3px, -42px) rotate(-44deg) translate(-3px, 42px);
  }

  40% {
    transform: translate(3px, -42px) rotate(44deg) translate(-3px, 42px);
  }

  100% {
    transform: translate(3px, -42px) rotate(-44deg) translate(-3px, 42px);
  }
}

/* ═══ ARM PUMP ═══
   Arms swing opposite to legs with matching asymmetric timing.
   ±44deg for aggressive sprint pumping.
*/
.arm-back {
  animation: armPumpBack 0.5s cubic-bezier(0.25, 0, 0.75, 1) infinite;
}

.arm-back--delay {
  animation-delay: 0.25s;
}

.arm-front {
  animation: armPumpFront 0.5s cubic-bezier(0.25, 0, 0.75, 1) infinite;
}

.arm-front--delay {
  animation-delay: 0.25s;
}

/* Back arm: swings forward slowly (60%), snaps back quickly (40%) */
@keyframes armPumpBack {
  0% {
    transform: translate(-6px, -68px) rotate(-44deg) translate(6px, 68px);
  }

  60% {
    transform: translate(-6px, -68px) rotate(44deg) translate(6px, 68px);
  }

  100% {
    transform: translate(-6px, -68px) rotate(-44deg) translate(6px, 68px);
  }
}

/* Front arm: snaps forward quickly (40%), swings back slowly (60%) */
@keyframes armPumpFront {
  0% {
    transform: translate(8px, -66px) rotate(44deg) translate(-8px, 66px);
  }

  40% {
    transform: translate(8px, -66px) rotate(-44deg) translate(-8px, 66px);
  }

  100% {
    transform: translate(8px, -66px) rotate(44deg) translate(-8px, 66px);
  }
}

/* ═══ DUST PUFFS ═══ */
.dust-puff {
  animation: dustBurst 0.5s ease-out infinite;
}

.dust-puff--delay {
  animation-delay: 0.25s;
}

@keyframes dustBurst {

  0%,
  8% {
    opacity: 0;
    transform: translateX(0) translateY(0) scale(0.4);
  }

  25% {
    opacity: 0.8;
    transform: translateX(-4px) translateY(-4px) scale(1.1);
  }

  55% {
    opacity: 0.3;
    transform: translateX(-10px) translateY(-9px) scale(1.2);
  }

  85%,
  100% {
    opacity: 0;
    transform: translateX(-18px) translateY(-14px) scale(0.5);
  }
}

/* ═══ SWEAT DROPS ═══ */
.sweat-drop {
  animation: sweatFly 0.8s ease-out infinite;
}

.sweat-drop--2 {
  animation-delay: 0.25s;
}

.sweat-drop--3 {
  animation-delay: 0.12s;
}

.sweat-drop--4 {
  animation-delay: 0.4s;
}

@keyframes sweatFly {

  0%,
  25% {
    opacity: 0;
    transform: translate(0, 0) scale(1);
  }

  35% {
    opacity: 0.9;
    transform: translate(2px, -2px) scale(1.2);
  }

  75% {
    opacity: 0;
    transform: translate(14px, -16px) scale(0.6);
  }

  100% {
    opacity: 0;
    transform: translate(14px, -16px) scale(0.6);
  }
}

/* ═══ GAME OVER STATES ═══ */
.game-over .runner-bounce,
.game-over .runner-bounce--delay {
  animation: none;
  transform: translateY(0);
}

.game-over .leg-back,
.game-over .leg-back--delay,
.game-over .leg-front,
.game-over .leg-front--delay {
  animation: none;
  transform: none;
}

.game-over .arm-back,
.game-over .arm-back--delay,
.game-over .arm-front,
.game-over .arm-front--delay {
  animation: none;
  transform: none;
}

.game-over .dust-puff,
.game-over .dust-puff--delay {
  animation: none;
  opacity: 0;
}

.game-over .sweat-drop {
  animation: none;
  opacity: 0;
}

.game-over .runner-shadow,
.game-over .runner-shadow--delay {
  animation: none;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
  .race-stage {
    flex: 1;
    height: auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
  }

  .race-svg {
    width: 100%;
    height: 100%;
    max-height: none;
  }
}

/* ═══ SPEED LINES ═══ */
.speed-lines {
  opacity: 0.35;
  transition: opacity 0.5s ease-out;
}

.speed-lines--hidden {
  opacity: 0;
}

.speed-line {
  stroke-linecap: round;
  animation: speedFly linear infinite;
}

.sl-1 {
  animation-duration: 0.4s;
}

.sl-2 {
  animation-duration: 0.6s;
  animation-delay: 0.15s;
}

.sl-3 {
  animation-duration: 0.35s;
  animation-delay: 0.05s;
}

.sl-4 {
  animation-duration: 0.5s;
  animation-delay: 0.25s;
}

@keyframes speedFly {
  0% {
    transform: translateX(200px);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    transform: translateX(-900px);
    opacity: 0;
  }
}

/* ═══ SLIDER CONTROLS ═══ */
.slider-dots {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}

.slider-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  transition: color 0.2s, transform 0.2s;
  margin-right: 0.5rem;
}

.slider-toggle-btn:hover {
  color: #3B82F6;
  transform: scale(1.1);
}

.slider-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background: #CBD5E1;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.slider-dot:hover {
  background: #94A3B8;
  transform: scale(1.1);
}

.slider-dot--active {
  background: #3B82F6;
  transform: scale(1.2);
}