.bumper-game {
  position: relative;
  border: 3px solid #20372f;
  background: #f7f3e8;
  box-shadow: 7px 7px 0 #20372f;
  overflow: hidden;
}
.bumper-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  font-size: 0.85rem;
  background: #20372f;
  color: #fff;
  min-height: 55px;
}
.bumper-stage {
  width: 100%;
  aspect-ratio: 900/600;
  background: linear-gradient(#bfe9e8, #ecf4d7);
  overflow: hidden;
  position: relative;
}
.bumper-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 900px;
  height: 600px;
  transform-origin: top left;
}
.bumper-platform {
  position: absolute;
  left: 450px;
  top: 310px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #597e6d;
  box-shadow: 0 24px 0 #345547, 0 30px 0 #20372f, 0 48px 34px #35524755;
  transition: width 0.15s linear, height 0.15s linear;
}
.bumper-floor {
  position: absolute;
  inset: 0;
  border: 9px solid #fff2a1;
  border-radius: 50%;
  background: repeating-radial-gradient(
      ellipse at center,
      transparent 0 58px,
      #ffffff23 59px 61px
    ),
    #82b5a0;
  box-shadow: inset 0 0 0 3px #20372f;
  display: grid;
  place-items: center;
}
.bumper-floor-mark {
  text-align: center;
  font: 64px Georgia, serif;
  color: #254d4055;
  line-height: 0.65;
  transform: scaleY(0.75);
}
.bumper-floor-mark small {
  font: 13px Arial, sans-serif;
  letter-spacing: 7px;
}
.bumper-cloud {
  position: absolute;
  width: 180px;
  height: 50px;
  border-radius: 50%;
  background: #ffffff80;
  filter: blur(4px);
}
.cloud-one {
  left: 30px;
  top: 100px;
}
.cloud-two {
  right: 20px;
  bottom: 45px;
}
.bumper-car {
  position: absolute;
  width: 78px;
  height: 90px;
  margin-left: -39px;
  margin-top: -77px;
  transform-origin: 50% 90%;
  transition: opacity 0.7s, filter 0.2s, transform 0.7s;
  pointer-events: none;
}
.bumper-car-body {
  position: absolute;
  bottom: 0;
  left: 1px;
  width: 76px;
  height: 43px;
  background: var(--car-color);
  border: 5px solid #22352d;
  border-radius: 45%;
  box-shadow: inset 0 -8px #0002, 0 6px 0 #22352d;
  z-index: 3;
}
.bumper-car-seat {
  position: absolute;
  inset: 2px 14px 18px;
  border-radius: 50%;
  background: #20372f;
}
.bumper-car-nose {
  position: absolute;
  left: 25px;
  top: 8px;
  color: #20372f;
  font-size: 23px;
  line-height: 1;
}
.bumper-car-shadow {
  position: absolute;
  width: 86px;
  height: 24px;
  background: #18362944;
  filter: blur(2px);
  border-radius: 50%;
  bottom: -12px;
  left: -4px;
}
.bumper-driver {
  position: absolute;
  left: 2px;
  top: -5px;
  z-index: 4;
  height: 69px;
  overflow: hidden;
}
.bumper-driver .character-leg {
  display: none;
}
.bumper-driver .character-arm {
  top: 47px;
  height: 22px;
}
.bumper-driver .character-body {
  height: 27px;
}
.bumper-driver .character-arm-left {
  transform: rotate(-35deg);
}
.bumper-driver .character-arm-right {
  transform: rotate(35deg);
}
.bumper-car-name {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  background: #fffdf0;
  border: 2px solid #20372f;
  border-radius: 5px;
  padding: 3px 7px;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 800;
}
.bumper-car.is-you .bumper-car-name {
  background: #dfff70;
}
.bumper-car.is-you .bumper-car-shadow {
  outline: 3px solid #fff4a8;
}
.bumper-car.is-fallen {
  transform: translateY(85px) scale(0.2) rotate(40deg);
  opacity: 0;
}
.bumper-car.is-dashing .bumper-car-body {
  box-shadow: 0 0 0 6px #fff7ab, 0 0 30px #fff7ab;
}
.bumper-countdown {
  position: absolute;
  inset: 190px 0 auto;
  text-align: center;
  font: bold 120px Georgia, serif;
  color: #fff;
  text-shadow: 4px 5px #20372f;
  z-index: 1000;
  pointer-events: none;
}
.bumper-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 20px;
  border-top: 2px solid #20372f;
}
.bumper-footer p {
  font-size: 0.8rem;
  line-height: 1.6;
  text-align: center;
  margin: 0;
}
.bumper-stick {
  position: relative;
  width: 100px;
  height: 100px;
  border: 2px solid #20372f;
  border-radius: 50%;
  background: #dbe5db;
  touch-action: none;
  user-select: none;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.bumper-knob {
  width: 42px;
  height: 42px;
  border: 2px solid #20372f;
  border-radius: 50%;
  background: #fffef1;
  box-shadow: 0 3px #20372f;
}
.bumper-stick small {
  position: absolute;
  bottom: 7px;
  font-size: 8px;
  letter-spacing: 2px;
  pointer-events: none;
}
.bumper-dash {
  width: 85px;
  height: 85px;
  border-radius: 50%;
  border: 3px solid #20372f;
  background: #e5ff70;
  box-shadow: 0 4px #20372f;
  font-weight: 900;
  cursor: pointer;
  touch-action: none;
  flex-shrink: 0;
}
.bumper-dash small {
  display: block;
  font-size: 9px;
  margin-top: 4px;
}
.bumper-dash:disabled {
  background: #d9ddcd;
  color: #737b70;
  box-shadow: none;
}
.bumper-hint {
  font-size: 0.75rem;
  line-height: 1.5;
  color: #586355;
  padding: 0 20px 14px;
  margin: 0;
}
.bumper-results {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 22%;
  z-index: 1100;
  background: #fffdf1;
  border: 3px solid #20372f;
  box-shadow: 7px 7px #20372f;
  padding: 28px;
  text-align: center;
}
.bumper-results[hidden] {
  display: none;
}
.bumper-results h2 {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  margin: 0 0 12px;
}
.bumper-results p {
  font-size: 0.85rem;
}
.is-windy .bumper-stage {
  background: linear-gradient(125deg, #a9dfe0, #d7eabc);
}
.bumper-practice {
  margin-top: 10px;
  width: 100%;
}
@media (max-width: 600px) {
  .bumper-hud {
    padding: 10px;
    font-size: 0.65rem;
    gap: 6px;
  }
  .bumper-footer {
    padding: 12px 10px;
  }
  .bumper-stick {
    width: 80px;
    height: 180px;
  }
  .bumper-dash {
    width: 70px;
    height: 70px;
    font-size: 0.8rem;
  }
  .bumper-footer p {
    font-size: 0.62rem;
  }
  .bumper-results {
    padding: 16px;
    top: 15%;
  }
  .bumper-hint {
    font-size: 0.65rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bumper-car {
    transition: opacity 0.2s;
  }
  .bumper-platform {
    transition: none;
  }
}
/* Keep the arena and controls together while a round is on screen. */
body:has(.bumper-game) .masthead {
  display: none;
}
body:has(.bumper-game) .game-nav {
  margin-bottom: 12px;
}
@media (min-width: 700px) {
  .bumper-game {
    width: min(100%, max(540px, calc((100dvh - 260px) * 1.5)));
    margin: 0 auto;
  }
  .bumper-footer {
    padding-block: 8px;
  }
  .bumper-stick {
    width: 80px;
    height: 80px;
  }
  .bumper-dash {
    width: 72px;
    height: 72px;
  }
}
.bumper-hud {
  flex-wrap: wrap;
}
.bumper-sound {
  border: 1px solid #ffffff80;
  background: transparent;
  color: white;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
}
.bumper-scoreboard {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 2px solid #20372f;
  font-size: 0.7rem;
}
.bumper-scoreboard > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bumper-scoreboard .player-badge {
  font-size: 0.7rem;
  padding: 3px 7px;
  background: #e5ecd9;
  border-radius: 4px;
}
.bumper-scoreboard .player-avatar {
  width: 22px;
  height: 22px;
  font-size: 0.6rem;
}
.bumper-car.is-hit .bumper-car-body {
  box-shadow: 0 0 0 6px #ffed8f, 0 0 25px #fff;
  filter: brightness(1.4);
}
.bumper-winner-stage .player-character {
  scale: 1.35;
  transform-origin: center center;
}
.bumper-winner-stage {
  min-height: 220px;
}
.bumper-wind-alert {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 9px 22px;
  background: #ffe296;
  color: #20372f;
  border: 3px solid #20372f;
  box-shadow: 4px 4px #20372f55;
  white-space: nowrap;
  font-size: 21px;
  font-weight: 900;
  pointer-events: none;
}
.bumper-wind-alert[hidden] {
  display: none;
}
.bumper-wind-arrow {
  font-size: 38px;
  display: inline-block;
  transform: rotate(var(--wind-angle));
  line-height: 1;
}
.is-windy .bumper-wind-alert {
  background: #d8f5f0;
}
.is-wind-warning .bumper-wind-alert {
  animation: wind-warning 0.6s ease-in-out infinite alternate;
}
.bumper-wind-lines {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 850px;
  height: 340px;
  margin: -170px 0 0 -425px;
  transform: rotate(var(--wind-angle));
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
}
.is-windy .bumper-wind-lines {
  opacity: 0.7;
}
.bumper-wind-lines i {
  position: absolute;
  left: 0;
  width: 125px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  animation: wind-streak 0.8s linear infinite;
  animation-play-state: paused;
}
.is-windy .bumper-wind-lines i {
  animation-play-state: running;
}
.bumper-wind-lines i:nth-child(1) {
  top: 15%;
  animation-delay: -0.2s;
}
.bumper-wind-lines i:nth-child(2) {
  top: 40%;
  animation-delay: -0.6s;
}
.bumper-wind-lines i:nth-child(3) {
  top: 65%;
  animation-delay: -0.4s;
}
.bumper-wind-lines i:nth-child(4) {
  top: 90%;
  animation-delay: -0.1s;
}
@keyframes wind-streak {
  from {
    transform: translateX(-100px);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  to {
    transform: translateX(800px);
    opacity: 0;
  }
}
@keyframes wind-warning {
  to {
    box-shadow: 0 0 0 5px #ffe29655;
  }
}
@media (prefers-reduced-motion: reduce) {
  .is-wind-warning .bumper-wind-alert,
  .bumper-wind-lines i {
    animation: none;
  }
  .bumper-wind-lines {
    display: none;
  }
}
