.game {
  min-width: 0;
  color: #fff;
  background: #0a0e14;
}

.scene,
.scene > * {
  pointer-events: none;
}

.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0a0e14;
}

.nightSky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 72% 10%, rgba(212, 175, 55, .14), transparent 32%),
    linear-gradient(180deg, #0a0e14 0%, #101a2a 52%, #1a2a3c 100%);
}

.nightSky::before,
.nightSky::after {
  content: "";
  position: absolute;
  width: 3px;
  height: 3px;
  background: #f0e6cd;
  box-shadow: 180px 35px 0 #dbe4ee, 420px -16px 0 #f0e6cd, 680px 54px 0 #dbe4ee, 900px 20px 0 #f0e6cd;
}

.nightSky::before { top: 62px; left: 9%; }
.nightSky::after { top: 118px; left: 27%; transform: scale(.65); }

.moon {
  position: absolute;
  top: 9%;
  right: 12%;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 36%, #fff7dc, #e5c65c 62%, #a8851f);
  box-shadow: 0 0 40px rgba(229, 198, 92, .35);
}

.farCity {
  position: absolute;
  right: 0;
  bottom: calc(var(--deck-h, 160px) + 120px);
  left: 0;
  height: 145px;
  opacity: .8;
  background:
    linear-gradient(90deg,
      #141c28 0 8%, transparent 8% 10%,
      #1a2436 10% 19%, transparent 19% 21%,
      #121a26 21% 34%, transparent 34% 37%,
      #1a2436 37% 51%, transparent 51% 54%,
      #121a26 54% 67%, transparent 67% 70%,
      #1a2436 70% 82%, transparent 82% 85%,
      #141c28 85% 100%);
  clip-path: polygon(0 28%, 8% 28%, 8% 4%, 19% 4%, 19% 38%, 33% 38%, 33% 14%, 49% 14%, 49% 34%, 65% 34%, 65% 0, 80% 0, 80% 29%, 100% 29%, 100% 100%, 0 100%);
}

.farCityRight {
  opacity: .35;
  transform: scaleX(-1) translateY(24px);
}

.horizonGlow {
  position: absolute;
  right: 0;
  bottom: calc(var(--deck-h, 160px) + 90px);
  left: 0;
  height: 90px;
  background: linear-gradient(180deg, transparent, rgba(212, 175, 55, .1));
}

.road {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: calc(var(--deck-h, 160px) + 120px);
  background:
    repeating-linear-gradient(90deg, transparent 0 90px, rgba(240, 230, 205, .16) 90px 150px, transparent 150px 240px) center 72% / auto 6px no-repeat,
    linear-gradient(180deg, #1c2733, #0d141d);
}

.trackGate {
  display: none;
}

.streetWrap,
.streetWrap .street {
  pointer-events: none;
}

.streetWrap .street > .bld {
  pointer-events: auto;
}

.streetWrap {
  position: absolute;
  z-index: 4;
  top: 64px;
  right: 0;
  left: 0;
  bottom: calc(var(--deck-h, 160px) + 26px);
  overflow: hidden;
}

.streetWrap::before {
  content: "";
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  height: 82px;
  border-top: 4px solid #3a4a58;
  background: repeating-linear-gradient(90deg, #1b2530 0 58px, #222e3a 58px 116px);
  box-shadow: inset 0 6px 0 #141c28;
}

.street {
  position: absolute;
  z-index: 2;
  inset: 46px 16px 84px;
  display: grid;
  grid-template-columns: repeat(var(--targets, 5), minmax(0, 1fr));
  align-items: end;
  gap: 12px;
}

.bld {
  position: relative;
  width: 100%;
  height: 88%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  transition: transform .16s steps(2, end), opacity .16s ease;
}

.bld.slot-1 { --slot: 0; height: 91%; }
.bld.slot-2 { --slot: 1; height: 82%; }
.bld.slot-3 { --slot: 2; height: 96%; }
.bld.slot-4 { --slot: 3; height: 86%; }
.bld.slot-5 { --slot: 4; height: 93%; }
.bld.slot-6 { --slot: 5; height: 88%; }

.facade-0 { --front: #cf5261; --side: #8f2d42; --top: #ea8290; }
.facade-1 { --front: #348c79; --side: #16604f; --top: #62b8a3; }
.facade-2 { --front: #dfa544; --side: #9b692d; --top: #f2ca73; }
.facade-3 { --front: #6379aa; --side: #3b4e7e; --top: #91a5d0; }
.facade-4 { --front: #b76d52; --side: #7d4436; --top: #d99a7c; }

.buildingBody {
  position: absolute;
  inset: 14px 10px 0 0;
  border: 2px solid rgba(255, 255, 255, .42);
  border-radius: 5px 5px 0 0;
  background:
    linear-gradient(var(--gold-light) 0 0) 16% 25% / 26% 18% no-repeat,
    linear-gradient(var(--gold-light) 0 0) 72% 25% / 26% 18% no-repeat,
    linear-gradient(#244052 0 0) 50% 100% / 38% 29% no-repeat,
    var(--front);
  box-shadow: 0 8px 0 rgba(2, 6, 10, .3), 0 18px 24px rgba(2, 6, 10, .22);
}

.buildingBody::before {
  content: "";
  position: absolute;
  inset: -14px -10px auto 0;
  height: 14px;
  background: var(--top);
  clip-path: polygon(0 100%, 9% 0, 100% 0, 92% 100%);
}

.buildingBody::after {
  content: "";
  position: absolute;
  inset: -7px -10px 0 auto;
  width: 10px;
  background: var(--side);
  clip-path: polygon(0 7px, 100% 0, 100% 100%, 0 100%);
}

.game.routeBlocked .streetWrap::after {
  content: "";
  position: absolute;
  z-index: 5;
  inset: 0;
  opacity: 0;
  background: repeating-linear-gradient(135deg, rgba(198, 42, 58, .24) 0 18px, rgba(198, 42, 58, 0) 18px 36px);
  animation: routeBlockedIn .3s ease-out forwards;
  pointer-events: none;
}

@keyframes routeBlockedIn {
  to { opacity: 1; }
}

@media (max-width: 760px) {
  .streetWrap { top: 58px; }
  .street { inset: 24px 8px 42px; gap: 6px; }
  .streetWrap::before { height: 46px; }
  .moon { top: 12%; width: 48px; height: 48px; }
  .buildingBody { inset: 10px 5px 0 0; }
  .buildingBody::before { inset: -10px -5px auto 0; height: 10px; }
  .buildingBody::after { inset: -4px -5px 0 auto; width: 5px; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .streetWrap { top: 56px; }
  .street { inset: 6px 8px 18px; }
  .streetWrap::before { height: 16px; }
  .farCity { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .game.routeBlocked .streetWrap::after {
    opacity: 1;
    animation: none;
    transition: opacity .16s ease;
  }
}
