/* Fuel Run: two-lane side-scrolling strip with a fuel pump sign on top. */
.fr-root {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 190px;
  max-height: 340px;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.fr-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 4px 8px;
  flex: 0 0 auto;
}
.fr-pump {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 2px 18px 2px 12px;
  border-radius: 16px;
  background: var(--plate);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow-press);
  font-family: var(--display);
  color: var(--ink);
  line-height: 1.05;
}
.fr-pump-icon { width: clamp(22px, 5vh, 32px); height: clamp(22px, 5vh, 32px); flex: none; }
.fr-sound { font-size: clamp(32px, 8vh, 56px); letter-spacing: .04em; }
.fr-tank { display: flex; gap: 10px; }
.fr-slot {
  display: grid;
  place-items: center;
  min-width: 64px;
  height: 40px;
  padding: 0 10px;
  box-sizing: border-box;
  border-radius: 10px;
  border: 3px dashed var(--ink-soft);
  background: rgba(255, 250, 240, .6);
  font-family: var(--read);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.fr-slot.fr-full { border: 3px solid var(--go-dark); background: var(--go); color: #fff; animation: fr-slot .35s ease-out; }
@keyframes fr-slot { 0% { transform: scale(.6); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }

.fr-road {
  position: relative;
  flex: 1 1 auto;
  min-height: 100px;
  margin-inline: clamp(56px, 9vw, 96px);
  overflow: hidden;
  border-radius: 16px;
  background: var(--asphalt);
  border: 4px solid var(--asphalt-edge);
  box-shadow: var(--shadow);
  cursor: pointer;
}
/* One dashed line between the two lanes; it runs backwards past the car. */
.fr-lines {
  position: absolute;
  inset: 0 -72px 0 0;
  background: repeating-linear-gradient(90deg, var(--lane) 0 36px, transparent 36px 72px) 0 calc(var(--fr-lane, 50px) - 2px) / 100% 4px no-repeat;
  background-size: 100% 4px;
  will-change: transform;
  animation: fr-scroll 1.4s linear infinite;
  pointer-events: none;
}
@keyframes fr-scroll { to { transform: translateX(-72px); } } /* transform, so the Fire never repaints the road */

.fr-car {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
  pointer-events: none;
  z-index: 2;
}
.fr-car-body, .fr-car svg { display: block; width: 100%; height: 100%; }
.fr-wobble { animation: fr-wobble .5s ease-in-out; }
@keyframes fr-wobble {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-7deg) translateY(2px); }
  45% { transform: rotate(5deg); }
  70% { transform: rotate(-3deg); }
}

.fr-cans { position: absolute; inset: 0; pointer-events: none; }
.fr-can {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 8px 8px 4px;
  border-radius: 10px;
  background: linear-gradient(#e0392c, var(--red));
  border: 3px solid #7d1810;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18), 0 3px 4px rgba(0, 0, 0, .35);
  will-change: transform;
}
.fr-handle { position: absolute; left: 8px; top: -9px; width: 30px; height: 11px; }
.fr-label {
  display: block;
  max-width: 100%;
  padding: 0 .3em;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--read);
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}
.fr-pop { animation: fr-pop .4s ease-out forwards; }
@keyframes fr-pop { 0% { opacity: 1; scale: 1; } 40% { scale: 1.35; } 100% { opacity: 0; scale: 1.7; } }
/* A wrong can is knocked up and away, gently. */
.fr-bump { animation: fr-bump .6s ease-out forwards; }
@keyframes fr-bump { 0% { opacity: 1; } 100% { opacity: 0; translate: 50px -50px; rotate: 35deg; scale: .7; } }
.fr-gone { opacity: 0; }

.fr-note {
  position: absolute;
  left: 50%;
  top: 6px;
  z-index: 3;
  margin: 0;
  padding: 2px 14px;
  max-width: 92%;
  box-sizing: border-box;
  transform: translateX(-50%);
  border-radius: 14px;
  background: var(--paper);
  border: 3px solid var(--ink);
  color: var(--ink);
  font-family: var(--read);
  font-weight: 700;
  font-size: clamp(16px, 3.6vh, 22px);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.fr-note.fr-show { opacity: 1; }
.fr-hint {
  position: absolute; left: 50%; top: 50%; z-index: 3; width: 34px; height: 68px; margin: -34px 0 0 -17px;
  pointer-events: none; animation: pulse 1.4s ease-in-out 3;
}
.fr-hint svg { width: 100%; height: 100%; display: block; }
@keyframes pulse { 50% { transform: scale(1.18); } }

/* Short screens: the pump sign and the slots share one row. */
@media (max-height: 480px) {
  .fr-root { min-height: 160px; }
  .fr-head { flex-direction: row; justify-content: center; gap: 14px; padding-bottom: 6px; }
  .fr-sound { font-size: clamp(28px, 9vh, 40px); }
  .fr-slot { height: 40px; min-width: 56px; font-size: 16px; }
}
@media (max-width: 420px) {
  .fr-tank { gap: 6px; }
  .fr-slot { min-width: 54px; padding: 0 6px; font-size: 16px; }
}
/* Calm mode (grown-ups' screen) */
body.calm .fr-lines { animation-duration: 2.8s; }


/* His car gets a glowing yellow ring underneath, so it's clear which one he steers. */
.fr-car::before {
  content: ""; position: absolute; left: 4%; right: 4%; bottom: -10%; height: 34%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 212, 38, .95), rgba(255, 212, 38, .45) 60%, transparent);
  z-index: -1; animation: frYou 1.2s ease-in-out infinite;
}
@keyframes frYou { 50% { transform: scale(1.12); opacity: .75; } }
.fr-hint.fr-hint-stay { animation: pulse 1.4s ease-in-out infinite; }
body.calm .fr-car::before, body.calm .fr-hint.fr-hint-stay { animation: none; }
