/* ── Haywire Tractor — site stylesheet ─────────────────────────────
   Palette lifted straight from the game: Country Lane sky/grass/dirt,
   rumble-strip red, wheat-gold lane paint, plus the menu's dark
   forest greens for the heavy sections. Fredoka display font.
   ─────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/fredoka-latin.woff2') format('woff2');
}

:root {
  --font-display: 'Fredoka', 'Arial Rounded MT Bold', Arial, sans-serif;
  --font-body: 'Segoe UI', Arial, sans-serif;

  --sky: #7ec8f7;
  --sky-light: #d6f2ff;
  --grass: #5fa83c;
  --grass-dark: #55a037;
  --hill: #4d8f4d;
  --dirt: #a5773f;
  --dirt-dark: #8a5a2b;
  --rumble: #e8604c;
  --rumble-dark: #c44a30;
  --wheat: #f2d15c;
  --gold: #ffd34d;
  --cream: #f5efe0;
  --ink: #22301c;
  --forest-1: #16221a;
  --forest-2: #24382a;
  --leaf: #7ddf64;
  --leaf-dark: #3d9a3d;
  --danger: #ff7a6b;
  --card: #ffffff;

  --radius-card: 18px;
  --radius-pill: 28px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
}

img {
  max-width: 100%;
}

a {
  color: var(--rumble);
}

/* ── Navigation ─────────────────────────────────────────────────── */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px clamp(14px, 4vw, 40px);
  background: rgba(245, 239, 224, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid rgba(95, 168, 60, 0.35);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 1px;
}

.nav-brand em {
  font-style: normal;
  color: var(--rumble);
  transform: rotate(-2deg);
  display: inline-block;
}

.nav-brand img {
  transition: transform 0.25s ease;
}

.nav-brand:hover img {
  transform: rotate(-6deg) scale(1.08);
}

.nav-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
}

.nav-links a:hover {
  background: rgba(95, 168, 60, 0.16);
}

.nav-links a.active {
  background: var(--leaf-dark);
  color: #ffffff;
}

/* Hamburger — desktop hides it, mobile swaps the links for a dropdown. */
.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border: 3px solid rgba(95, 168, 60, 0.45);
  border-radius: 14px;
  background: var(--card);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 3px;
  margin: 4px auto;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-nav.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-nav.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.site-nav.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Hero ────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(var(--sky) 0%, var(--sky-light) 58%, var(--grass) 58%);
  padding: clamp(30px, 6vh, 70px) clamp(16px, 5vw, 60px) 0;
}

.hero-inner {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 6vw, 80px);
  max-width: 1150px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.hero-copy {
  max-width: 480px;
  text-align: center;
  padding-bottom: clamp(24px, 5vh, 60px);
}

.hero-logo {
  width: min(360px, 82%);
  filter: drop-shadow(0 10px 24px rgba(34, 48, 28, 0.35));
  animation: title-sway 4s ease-in-out infinite alternate;
  transform-origin: bottom center;
}

@keyframes title-sway {
  from { transform: rotate(-1.6deg); }
  to { transform: rotate(1.6deg); }
}

.hero-tagline {
  margin: 18px auto 26px;
  padding: 12px 26px;
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--ink);
  background-color: var(--card);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 0 rgba(34, 48, 28, 0.12);
}

.hero-tagline .tagline-em {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--rumble);
}

/* "Free to play" shout line. */
.free-note {
  margin: 0 auto 16px auto;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.75;
}

/* Sun + clouds */
.sun {
  position: absolute;
  top: 42px;
  right: 9%;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #f8e08e;
  box-shadow: 0 0 60px 26px rgba(248, 224, 142, 0.6);
  z-index: 1;
}

.cloud {
  position: absolute;
  background: #ffffff;
  border-radius: 999px;
  opacity: 0.9;
  z-index: 1;
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.cloud-1 {
  top: 60px;
  left: -140px;
  width: 140px;
  height: 44px;
  animation: cloud-drift 55s linear infinite;
}
.cloud-1::before { width: 60px; height: 60px; top: -28px; left: 22px; }
.cloud-1::after { width: 44px; height: 44px; top: -20px; left: 72px; }

.cloud-2 {
  top: 140px;
  left: -100px;
  width: 100px;
  height: 34px;
  animation: cloud-drift 75s linear infinite;
  animation-delay: -30s;
}
.cloud-2::before { width: 44px; height: 44px; top: -20px; left: 16px; }
.cloud-2::after { width: 34px; height: 34px; top: -15px; left: 52px; }

.cloud-3 {
  top: 26px;
  left: -180px;
  width: 180px;
  height: 50px;
  opacity: 0.65;
  animation: cloud-drift 95s linear infinite;
  animation-delay: -60s;
}
.cloud-3::before { width: 76px; height: 76px; top: -34px; left: 30px; }
.cloud-3::after { width: 54px; height: 54px; top: -24px; left: 96px; }

@keyframes cloud-drift {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 300px)); }
}

/* Parallax horizon — the game's own backdrop strips, tiled. */
.hills {
  position: absolute;
  left: 0;
  right: 0;
  background-repeat: repeat-x;
  background-size: auto 100%;
  z-index: 2;
  pointer-events: none;
}

.hills-far {
  top: calc(58% - 74px);
  height: 80px;
  background-image: url('../img/hills-far.png');
  background-size: 512px 100%;
}

.hills-near {
  top: calc(58% - 26px);
  height: 90px;
  background-image: url('../img/hills-near.png');
  background-size: 384px 100%;
  background-position-x: 130px;
}

/* ── Hero diorama: a dirt lane rushing toward the Old Banger ────── */

.hero-scene {
  position: relative;
  width: min(360px, 86vw);
  height: 460px;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: -4px;
}

/* The lane begins partway down the scene (at the horizon) and widens
   toward the viewer — the game's pseudo-3D trick in pure CSS. */
.road {
  position: absolute;
  left: 0;
  right: 0;
  top: 44%;
  bottom: 0;
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%);
  background: var(--dirt);
}

/* Red/white rumble strips — the gradient scrolls so the lane
   appears to rush toward the viewer, like the game. */
.road-edge {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    var(--rumble) 0,
    var(--rumble) 16px,
    var(--cream) 16px,
    var(--cream) 32px
  );
  animation: road-rush 0.9s linear infinite;
}

.road-edge-left {
  clip-path: polygon(46% 0, 48.5% 0, 9% 100%, 0 100%);
}

.road-edge-right {
  clip-path: polygon(51.5% 0, 54% 0, 100% 100%, 91% 100%);
}

.road-dash {
  position: absolute;
  inset: 0;
  clip-path: polygon(49.6% 0, 50.4% 0, 51.5% 100%, 48.5% 100%);
  background: repeating-linear-gradient(
    0deg,
    var(--wheat) 0,
    var(--wheat) 18px,
    transparent 18px,
    transparent 42px
  );
  animation: road-rush-dash 1.35s linear infinite;
}

/* Each strip loops its own pattern height so they flow together. */
@keyframes road-rush {
  from { background-position-y: 0; }
  to { background-position-y: 32px; }
}

@keyframes road-rush-dash {
  from { background-position-y: 0; }
  to { background-position-y: 42px; }
}

/* The Old Banger — wanders side to side, exactly as advertised. */
.hero-tractor {
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 220px;
  transform: translateX(-50%);
  animation: tractor-wander 3.4s ease-in-out infinite alternate;
}

.hero-tractor img {
  display: block;
  width: 100%;
  filter: drop-shadow(0 8px 10px rgba(34, 48, 28, 0.3));
  animation: tractor-bounce 0.55s ease-in-out infinite alternate;
}

@keyframes tractor-wander {
  0%   { transform: translateX(-58%) rotate(-2.5deg); }
  45%  { transform: translateX(-46%) rotate(0.8deg); }
  100% { transform: translateX(-42%) rotate(2.5deg); }
}

@keyframes tractor-bounce {
  from { transform: translateY(0) rotate(-0.6deg); }
  to { transform: translateY(-4px) rotate(0.6deg); }
}

/* Exhaust puffs — CSS-only smoke, timed like a tired engine. */
.smoke {
  position: absolute;
  left: 9%;
  top: 6%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 120, 120, 0.75), rgba(120, 120, 120, 0) 70%);
  opacity: 0;
  animation: puff 2.7s ease-out infinite;
}

.smoke-2 { animation-delay: 0.9s; }
.smoke-3 { animation-delay: 1.8s; }

@keyframes puff {
  0%   { transform: translate(0, 0) scale(0.5); opacity: 0; }
  15%  { opacity: 0.8; }
  100% { transform: translate(-26px, -70px) scale(2); opacity: 0; }
}

/* ── Road-sign ticker ───────────────────────────────────────────── */

.sign-ticker {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: center;
  padding: 30px 20px;
  background: var(--ink);
  overflow: hidden;
  min-height: 62px;
}

.sign {
  display: none;
  align-items: center;
  padding: 8px 22px;
  border: 3px solid var(--gold);
  border-radius: 10px;
  background: var(--dirt-dark);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(14px, 2.4vw, 18px);
  letter-spacing: 2px;
  white-space: nowrap;
  transform: rotate(-1.2deg);
}

.sign.show {
  display: inline-flex;
  animation: sign-flip 0.35s ease-out;
}

@keyframes sign-flip {
  from { transform: rotate(-1.2deg) scaleY(0); }
  to { transform: rotate(-1.2deg) scaleY(1); }
}

/* ── Store buttons — the game's own green pill style ────────────── */

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.store-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--leaf), var(--leaf-dark));
  color: #ffffff;
  text-decoration: none;
  font-family: var(--font-display);
  box-shadow:
    0 5px 0 #2a6e2a,
    0 12px 28px rgba(0, 0, 0, 0.25);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.12s ease;
}

.store-btn:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.store-btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #2a6e2a;
}

.store-btn svg {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  padding: 3px;
}

.store-btn-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}

.store-btn-top {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  opacity: 0.85;
}

.store-btn-name {
  font-size: 19px;
  font-weight: 700;
}

.store-btn-soon {
  position: absolute;
  top: -10px;
  right: -8px;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--gold);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  transform: rotate(6deg);
  box-shadow: 0 2px 0 rgba(34, 48, 28, 0.25);
}

/* ── Generic sections & cards ────────────────────────────────────── */

.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(40px, 7vh, 80px) clamp(16px, 4vw, 32px);
}

.section-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 5vw, 44px);
  letter-spacing: 2px;
  text-align: center;
  color: var(--ink);
}

.section-title .w {
  display: inline-block;
}

.section-title .w1 { transform: rotate(-1.5deg); }
.section-title .w2 { transform: rotate(1.5deg); }

.section-sub {
  margin: 0 auto 34px;
  max-width: 560px;
  text-align: center;
  font-size: 17px;
  opacity: 0.75;
}

.card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: 0 4px 0 rgba(34, 48, 28, 0.12);
}

/* ── How to drive ────────────────────────────────────────────────── */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

.step-card {
  text-align: center;
  position: relative;
  padding-top: 34px;
}

.step-num {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--rumble);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 40px;
  box-shadow: 0 3px 0 var(--rumble-dark);
}

.step-card h3 {
  margin: 6px 0 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: 1px;
}

.step-card p {
  margin: 0;
  font-size: 15px;
  opacity: 0.8;
}

.step-icon {
  font-size: 40px;
  line-height: 1;
  display: block;
  margin-bottom: 4px;
}

/* ── Meet the tractors ───────────────────────────────────────────── */

.tractors-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.tractor-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 250px;
  padding: 18px 16px;
  border: 3px solid transparent;
  border-radius: var(--radius-card);
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 4px 0 rgba(34, 48, 28, 0.12);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.tractor-card:hover {
  transform: translateY(-4px) rotate(-0.8deg);
  border-color: var(--rumble);
}

.tractor-card.specialist {
  background: linear-gradient(160deg, var(--forest-2), var(--forest-1));
  border-color: var(--gold);
  color: #eef5ea;
}

.tractor-card.specialist:hover {
  border-color: var(--rumble);
}

.tractor-card-img {
  width: 170px;
  height: 150px;
  object-fit: contain;
}

.tractor-card-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: 1px;
}

.tractor-card-blurb {
  margin: 0 auto 6px auto;
  font-size: 15px;
  line-height: 1.35;
  opacity: 0.75;
  text-align: center;
  min-height: 32px;
}

/* Hazard-stripe traits chip — same pattern as the game's garage. */
.tractor-card-traits {
  padding: 5px 16px 8px;
  border-radius: 999px;
  background: repeating-linear-gradient(
    -45deg,
    var(--gold),
    var(--gold) 8px,
    #2a2a2a 8px,
    #2a2a2a 16px
  );
}

.tractor-card-traits i {
  font-style: normal;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #1a1a1a;
  background: #ffffff;
  border-radius: 10px;
  white-space: nowrap;
}

.tractor-card-star {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--forest-1);
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1px;
  white-space: nowrap;
}

.tractor-card.specialist .tractor-card-img {
  margin-top: 18px;
}

/* Stat bars — same look as the garage screen. */
.tractor-card-stats {
  display: grid;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}

.stat-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
}

.stat-label {
  text-align: right;
  text-transform: uppercase;
  opacity: 0.65;
}

.stat-bar {
  height: 10px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.tractor-card.specialist .stat-bar {
  background: rgba(0, 0, 0, 0.45);
}

.stat-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--leaf-dark), var(--leaf));
  border-radius: 999px;
}

.tractor-card.honk-pop {
  animation: honk-pop 0.35s ease-out;
}

@keyframes honk-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.06) rotate(-2deg); }
  100% { transform: scale(1); }
}

/* ── Tracks ──────────────────────────────────────────────────────── */

.tracks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}

.track-card {
  padding: 0;
  overflow: hidden;
  text-align: center;
}

.track-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.track-card-body {
  padding: 12px 14px 16px;
}

.track-card-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 1px;
}

.track-card-blurb {
  font-size: 15px;
  opacity: 0.7;
  font-style: italic;
}

/* ── Hazards ─────────────────────────────────────────────────────── */

.hazards-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.hazard-card {
  flex: 0 1 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px;
  text-align: center;
  transition: transform 0.15s ease;
}

.hazard-card:hover {
  transform: translateY(-3px) rotate(1deg);
}

.hazard-img {
  height: 64px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.25));
}

.hazard-sub {
  margin: 30px auto 12px auto;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: center;
  opacity: 0.85;
}

.hazard-pill {
  padding: 2px 10px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #eaffe3;
  background: linear-gradient(180deg, #3f9d38, #256e22);
  border: 1px solid #57c24e;
  box-shadow: 0 2px 0 rgba(12, 40, 10, 0.8);
}

.hazard-name {
  margin: 6px auto 2px auto;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 1px;
}

.hazard-blurb {
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.7;
  font-style: italic;
}

/* ── Features strip ──────────────────────────────────────────────── */

.features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.feature-item {
  flex: 0 1 320px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: 0 4px 0 rgba(34, 48, 28, 0.12);
}

.feature-icon {
  font-size: 26px;
  line-height: 1.2;
}

.feature-item h3 {
  margin: 0 0 3px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.feature-item p {
  margin: 0;
  font-size: 13px;
  opacity: 0.75;
}

/* ── CTA band ────────────────────────────────────────────────────── */

.cta-band {
  background: radial-gradient(120% 120% at 50% -10%, var(--forest-2), var(--forest-1));
  color: var(--cream);
  text-align: center;
  padding: clamp(70px, 8vh, 100px) 40px;
}

.cta-band .section-title {
  color: var(--gold);
}

.cta-band p {
  margin: 12px auto 24px auto;
  max-width: 440px;
  opacity: 0.85;
}

.cta-band .free-note {
  color: var(--cream);
}

/* ── High scores page ────────────────────────────────────────────── */

.scores-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(var(--sky), var(--sky-light) 70%, #cfeebf);
  padding: clamp(36px, 6vh, 64px) 20px clamp(30px, 5vh, 50px);
  text-align: center;
}

.game-title {
  position: relative;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(44px, 8vw, 72px);
  line-height: 0.95;
  color: var(--ink);
  letter-spacing: 4px;
  animation: title-sway 4s ease-in-out infinite alternate;
  transform-origin: bottom center;
}

.title-word {
  display: block;
}

.title-word-1 {
  transform: rotate(-2.5deg);
}

.title-word-3 {
  transform: rotate(-1.5deg);
}

.scores-hero p {
  margin: 10px auto 0;
  max-width: 480px;
  font-size: 17px;
  opacity: 0.8;
}

.scores-note {
  margin-top: 26px;
  font-size: 13px;
  opacity: 0.65;
}

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.podium-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 200px;
  padding: 18px 14px;
  border-radius: var(--radius-card);
  background: var(--card);
  border: 3px solid transparent;
  box-shadow: 0 4px 0 rgba(34, 48, 28, 0.12);
  text-align: center;
}

.podium-card img {
  width: 96px;
  height: 84px;
  object-fit: contain;
}

.podium-first {
  border-color: var(--gold);
  transform: translateY(-14px);
  background: linear-gradient(170deg, #fff8e1, #ffffff 60%);
}

.podium-second { border-color: #b8c4cc; }
.podium-third { border-color: #d99a5b; }

.podium-medal {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  padding: 3px 12px;
  border-radius: 12px;
}

.podium-first .podium-medal { background: var(--gold); color: var(--ink); }
.podium-second .podium-medal { background: #b8c4cc; color: var(--ink); }
.podium-third .podium-medal { background: #d99a5b; color: #ffffff; }

.podium-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.5px;
}

.podium-score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--rumble);
  line-height: 1;
}

.podium-meta {
  font-size: 12px;
  opacity: 0.7;
}

.scores-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 3px 0 rgba(34, 48, 28, 0.1);
}

.score-rank {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(126, 200, 247, 0.4);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-row:nth-child(-n + 3) .score-rank {
  background: var(--gold);
  color: var(--ink);
}

.score-tractor {
  width: 56px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.score-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.score-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-meta {
  font-size: 12px;
  opacity: 0.65;
}

.score-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--rumble);
  flex-shrink: 0;
}

.score-value small {
  font-size: 14px;
  opacity: 0.7;
}

.scores-empty {
  text-align: center;
  padding: 20px 10px 40px;
}

.scores-empty img {
  width: 190px;
  opacity: 0.9;
}

.scores-empty p {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  opacity: 0.7;
}

/* ── Legal pages ─────────────────────────────────────────────────── */

.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(30px, 6vh, 60px) clamp(16px, 4vw, 32px);
}

.legal-card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: clamp(22px, 5vw, 44px);
  box-shadow: 0 4px 0 rgba(34, 48, 28, 0.12);
}

.legal-card h1 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 5vw, 40px);
  letter-spacing: 2px;
}

.legal-updated {
  margin: 0 0 24px;
  font-size: 13px;
  opacity: 0.6;
}

.legal-card h2 {
  margin: 28px 0 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--leaf-dark);
}

.legal-card p,
.legal-card li {
  font-size: 15px;
}

.legal-card ul {
  padding-left: 22px;
}

/* ── Footer ──────────────────────────────────────────────────────── */

.site-footer {
  background: var(--forest-1);
  color: #cfe3b8;
  padding: 44px 20px 30px;
  text-align: center;
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-brand {
  color: #ffffff;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
}

.footer-links a {
  color: #cfe3b8;
  text-decoration: none;
  font-size: 14px;
}

.footer-links a:hover {
  color: var(--gold);
  text-decoration: underline;
}

.footer-quip {
  margin: 0;
  font-size: 13px;
  font-style: italic;
  opacity: 0.7;
}

.footer-legal {
  margin: 0;
  font-size: 12px;
  opacity: 0.5;
}

/* ── Small screens ───────────────────────────────────────────────── */

@media (max-width: 640px) {
  .nav-brand span {
    font-size: 18px;
  }

  .nav-toggle {
    display: block;
  }

  /* Links become a floating dropdown card under the nav bar. */
  .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    left: 10px;
    right: 10px;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border-radius: var(--radius-card);
    background: var(--card);
    box-shadow: 0 8px 24px rgba(34, 48, 28, 0.28);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }

  .site-nav.nav-open .nav-links {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-links a {
    text-align: center;
    padding: 12px 16px;
  }

  .hero-scene {
    width: min(300px, 88vw);
    height: 400px;
  }

  .hero-tractor {
    width: 185px;
  }

  .hills-far {
    top: calc(58% - 54px);
    height: 60px;
  }

  .hills-near {
    top: calc(58% - 16px);
    height: 64px;
  }

  .podium-first {
    transform: none;
  }

  .score-value {
    font-size: 19px;
  }
}

/* ── Reduced motion ──────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-logo,
  .game-title,
  .hero-tractor,
  .hero-tractor img,
  .cloud,
  .smoke,
  .road-edge,
  .road-dash,
  .sign.show,
  .tractor-card.honk-pop {
    animation: none;
  }
}
