:root {
  --bg-sky-top: #8fd8ff;
  --bg-sky-bottom: #eaf9ff;
  --grass-a: #98df73;
  --grass-b: #78cb5d;
  --road: #636a74;
  --road-dark: #4c525b;
  --lane: #ffffff;
  --truck-red: #ff684d;
  --truck-yellow: #ffdc54;
  --truck-line: #d24a35;
  --wheel: #222831;
  --wheel-hub: #c5ced7;
  --outline: #2d5166;
  --ui: #1f4258;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: "Trebuchet MS", "Verdana", sans-serif;
  background: linear-gradient(to bottom, var(--bg-sky-top), var(--bg-sky-bottom));
}

body {
  overflow: hidden;
}

.game {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
  outline: none;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background: linear-gradient(to bottom, #a6e3ff 0%, #dff7ff 58%, var(--grass-a) 58%, var(--grass-b) 100%);
}

.sky {
  position: absolute;
  inset: 0 0 42% 0;
}

.hills {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 34%;
  height: 20%;
  pointer-events: none;
}

.hill {
  position: absolute;
  bottom: 0;
  border-radius: 999px 999px 0 0;
  border: 4px solid #6cb654;
  border-bottom: 0;
  background: linear-gradient(to bottom, #a6e978, #85d062);
}

.hill-a {
  left: -4%;
  width: 35%;
  height: 84%;
}

.hill-b {
  left: 24%;
  width: 42%;
  height: 100%;
}

.hill-c {
  right: -7%;
  width: 38%;
  height: 92%;
}

.sun {
  position: absolute;
  right: 6%;
  top: 5%;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff9aa, #ffd95d 65%, #ffcb31);
  box-shadow: 0 0 24px #ffd85b99;
}

.cloud {
  position: absolute;
  width: 132px;
  height: 52px;
  border-radius: 999px;
  border: 3px solid #c5dce8;
  background: #f6fdff;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: #f6fdff;
  border: 3px solid #c5dce8;
  border-bottom: 0;
}

.cloud::before {
  width: 52px;
  height: 42px;
  left: 16px;
  top: -22px;
}

.cloud::after {
  width: 64px;
  height: 52px;
  right: 14px;
  top: -30px;
}

.cloud-a {
  left: 10%;
  top: 8%;
}

.cloud-b {
  left: 37%;
  top: 13%;
  transform: scale(0.9);
}

.sky-traffic {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 42%;
  pointer-events: none;
  z-index: 2;
}

.sky-icon {
  position: absolute;
  line-height: 1;
  user-select: none;
  filter: drop-shadow(0 3px 3px rgba(20, 34, 48, 0.25));
}

.sky-icon.plane {
  font-size: clamp(34px, 4.4vw, 50px);
}

.sky-icon.helicopter {
  font-size: clamp(30px, 3.9vw, 44px);
}

.route-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 13%;
  height: 260px;
  overflow: hidden;
}

.scroll-layer {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}

.scroll-back {
  top: 18px;
  height: 86px;
  z-index: 2;
}

.scroll-front {
  top: 42px;
  height: 80px;
  z-index: 3;
}

.road {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  height: 86px;
  border-radius: 0;
  background: var(--road);
  box-shadow: inset 0 -7px 0 var(--road-dark), inset 0 8px 0 #747b84, 0 -6px 32px rgba(20, 24, 32, 0.35);
  z-index: 4;
}

.traffic-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.traffic-icon {
  position: absolute;
  font-size: 56px;
  line-height: 1;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.35));
  transform: none;
  opacity: 0.95;
}

.road::before {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  top: 38px;
  height: 8px;
  border-radius: 99px;
  background-image: repeating-linear-gradient(to right, var(--lane) 0 48px, transparent 48px 92px);
  background-position: var(--road-shift, 0px) 0;
}

.truck {
  position: absolute;
  bottom: 42px;
  width: 160px;
  height: 104px;
  display: grid;
  place-items: end center;
  z-index: 6;
}

.truck-icon {
  display: inline-block;
  font-size: 92px;
  line-height: 1;
  transform: scaleX(-1);
  filter: drop-shadow(0 4px 0 rgba(25, 34, 42, 0.2));
}

.truck.bump {
  animation: truck-bump 170ms ease-out;
}

@keyframes truck-bump {
  0% { transform: translate(var(--tx), 0); }
  45% { transform: translate(var(--tx), -8px); }
  100% { transform: translate(var(--tx), 0); }
}

.bg-item {
  position: absolute;
  transform: translateX(-50%);
}

.bg-item.icon-item {
  width: auto;
  height: auto;
  border: 0;
  background: none;
  line-height: 1;
  user-select: none;
  filter: drop-shadow(0 2px 0 rgba(32, 58, 74, 0.22));
}

.scroll-back .bg-item.icon-item {
  opacity: 0.9;
  filter: saturate(0.9) drop-shadow(0 2px 0 rgba(32, 58, 74, 0.15));
}

.scroll-front .bg-item.icon-item {
  opacity: 1;
}

.bg-item.tree {
  width: 22px;
  height: 58px;
  border-radius: 8px;
  border: 3px solid #6f4425;
  background: #96633d;
}

.bg-item.tree::before,
.bg-item.tree::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 3px solid #2d9347;
  background: #48c364;
}

.bg-item.tree::before {
  left: -24px;
  top: -26px;
  width: 66px;
  height: 42px;
}

.bg-item.tree::after {
  left: -14px;
  top: -39px;
  width: 48px;
  height: 34px;
}

.bg-item.house {
  width: 64px;
  height: 52px;
  border-radius: 8px;
  border: 3px solid #c08f5e;
  background: #ffe6c3;
}

.bg-item.house::before {
  content: "";
  position: absolute;
  top: -24px;
  left: -8px;
  width: 0;
  height: 0;
  border-left: 40px solid transparent;
  border-right: 40px solid transparent;
  border-bottom: 28px solid #eb7458;
}

.bg-item.house::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 11px;
  width: 18px;
  height: 14px;
  border-radius: 4px;
  border: 2px solid #8fc2d7;
  background: #c6ebff;
}

.bg-item.animal {
  width: 50px;
  height: 27px;
  border-radius: 16px;
  border: 3px solid #caa961;
  background: #f5d58a;
}

.bg-item.animal::before {
  content: "";
  position: absolute;
  right: -8px;
  top: -7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid #caa961;
  background: #f5d58a;
}

.bg-item.animal::after {
  content: "";
  position: absolute;
  right: -14px;
  top: -1px;
  width: 0;
  height: 0;
  border-left: 10px solid #f59040;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.bg-item.bridge {
  width: 62px;
  height: 34px;
  border-radius: 52px 52px 0 0;
  border: 4px solid #7ca6c5;
  border-bottom: 0;
}

.bg-item.bridge::before,
.bg-item.bridge::after {
  content: "";
  position: absolute;
  bottom: -16px;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  background: #7ca6c5;
}

.bg-item.bridge::before {
  left: 9px;
}

.bg-item.bridge::after {
  right: 9px;
}

.effect-layer,
.celebration {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.puff {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #f8d889;
  background: #fffdf0;
  animation: puff-pop 380ms ease-out forwards;
}

@keyframes puff-pop {
  0% { opacity: 0.95; transform: scale(0.6); }
  100% { opacity: 0; transform: scale(2.1); }
}

.celebration.active::before,
.celebration.active::after {
  content: "";
  position: absolute;
  top: 14%;
  width: 28%;
  height: 28%;
  background: radial-gradient(circle, #ffe881 0 20%, #ffb25e 20% 42%, transparent 42%);
  animation: cheer 600ms ease-out 2;
}

.celebration.active::before {
  left: 14%;
}

.celebration.active::after {
  right: 14%;
}

@keyframes cheer {
  0% { opacity: 0.95; transform: scale(0.5) rotate(0deg); }
  100% { opacity: 0; transform: scale(1.35) rotate(35deg); }
}

.hint {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  padding: 7px 16px;
  border-radius: 999px;
  border: 2px solid #ffffffd9;
  background: #ffffffc2;
  color: var(--ui);
  font-size: clamp(15px, 2.2vw, 20px);
  font-weight: 700;
  letter-spacing: 0.2px;
}

@media (max-width: 700px) {
  .truck {
    width: 130px;
    height: 82px;
    bottom: 50px;
  }

  .truck-icon {
    font-size: 72px;
  }
}
