/* =========================================================
   Car Zone — styles just for this page.
   Three "hill scenes" you scroll down through (off-road vehicles bob up
   and down over the bumps), a transition, then a race track at the
   bottom. All vehicle movement is driven by js/cars.js.
   ========================================================= */

.offroad-section {
  position: relative;
}

.hill-scene {
  position: relative;
  height: 640px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hill-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hill-scene-1 { background: linear-gradient(to bottom, #16233d, #1f3a2c); }
.hill-scene-2 { background: linear-gradient(to bottom, #1f3a2c, #2c5236); }
.hill-scene-3 { background: linear-gradient(to bottom, #2c5236, #3d6b3f); }

.offroad-vehicle {
  position: relative;
  z-index: 2;
  width: 200px;
  cursor: pointer;
  will-change: transform;
  filter: drop-shadow(0 12px 10px rgba(0, 0, 0, 0.4));
}

.offroad-vehicle .vehicle-svg {
  width: 100%;
  height: auto;
  display: block;
}

.vehicle-label {
  text-align: center;
  margin: 0.4rem 0 0;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Wheels spin continuously to suggest motion, independent of scroll. */
.wheel {
  transform-origin: center;
  transform-box: fill-box;
  animation: wheel-spin 0.8s linear infinite;
}

@keyframes wheel-spin {
  to { transform: rotate(360deg); }
}

.scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-dim);
  font-size: 0.75rem;
  z-index: 3;
  animation: bob 1.6s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.6; }
  50% { transform: translate(-50%, 8px); opacity: 1; }
}

/* ---------- Transition from hills to race track ---------- */

.terrain-transition {
  height: 220px;
  background: linear-gradient(to bottom, #3d6b3f, #4a4a4a 55%, #2b2b2b);
}

/* ---------- Race track ---------- */

.track-section {
  position: relative;
  padding: 3rem 1.5rem 4rem;
  background: #2b2b2b;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.checkered-strip {
  width: 100%;
  max-width: 900px;
  height: 22px;
  background-image:
    conic-gradient(#eaf0ff 90deg, #0b0e14 90deg 180deg, #eaf0ff 180deg 270deg, #0b0e14 270deg);
  background-size: 22px 22px;
  border-radius: 4px;
}

.track {
  width: 100%;
  max-width: 900px;
  height: 180px;
  position: relative;
  background: repeating-linear-gradient(
    to bottom,
    #3a3a3a 0px,
    #3a3a3a 60px,
    #333 60px,
    #333 120px
  );
  border-radius: 12px;
  border: 4px solid #1a1a1a;
  overflow: hidden;
}

.track::before {
  /* dashed center line down the middle of the track */
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 6px;
  transform: translateY(-50%);
  background-image: repeating-linear-gradient(to right, #ffd60a 0 30px, transparent 30px 55px);
}

.race-car {
  position: absolute;
  top: 22px;
  left: 40px;
  width: 150px;
  cursor: pointer;
  will-change: transform;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.5));
}

.race-car .vehicle-svg {
  width: 100%;
  height: auto;
  display: block;
}

.race-car-2 {
  top: 96px;
}

.race-button {
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(90deg, var(--neon-yellow), #ff9e2c);
  color: #2b1a00;
  font-family: 'Press Start 2P', sans-serif;
  font-size: 0.75rem;
  cursor: pointer;
  box-shadow: 0 8px 0 0 #a35f00, 0 12px 20px -4px rgba(255, 158, 44, 0.5);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.race-button:active,
.race-button.pressed {
  transform: translateY(6px);
  box-shadow: 0 2px 0 0 #a35f00, 0 4px 10px -2px rgba(255, 158, 44, 0.5);
}

.track-hint {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-align: center;
}

/* Little exhaust/dust puffs spawned during the race and on vehicle taps */
.puff {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(234, 240, 255, 0.55);
  pointer-events: none;
  animation: puff-fade 0.6s ease-out forwards;
  z-index: 1;
}

@keyframes puff-fade {
  0% { opacity: 0.7; transform: scale(0.6); }
  100% { opacity: 0; transform: scale(1.8) translateY(-10px); }
}
