.runtime-qr {
  display: block;
  width: 240px;
  height: 240px;
  margin: 0 auto;
  image-rendering: pixelated;
}

.mock-qr {
  display: grid;
  place-items: center;
  width: 240px;
  height: 240px;
  margin: 0 auto;
  border: 0;
  background: #f8fafc;
  box-shadow: none;
}

.runtime-error {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 9999;
  transform: translateX(-50%);
  max-width: min(92vw, 560px);
  padding: 14px 18px;
  border: 3px solid #000;
  border-radius: 12px;
  background: #ef4444;
  color: #fff;
  box-shadow: 0 7px 0 #000;
  text-align: center;
  font-size: 10px;
}

.nt-sky {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  --accent: #ffa400;
  --accent-dark: #c97900;
  --building: #9fb3c7;
  --building-dark: #6f8498;
  --building-side: #7e92a6;
  --window-lit: #ffe58d;
  --window-dark: #25384d;
  background:
    linear-gradient(180deg, rgba(56, 189, 248, calc(1 - var(--altitude, 0))) 0%, rgba(125, 211, 252, calc(1 - var(--altitude, 0))) 44%, rgba(186, 230, 253, calc(1 - var(--altitude, 0))) 72%, rgba(241, 245, 249, calc(1 - var(--altitude, 0))) 100%),
    linear-gradient(180deg, #030712 0%, #10183f 45%, #1e1b4b 72%, #312e81 100%);
}

.runtime-world-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.runtime-space-full {
  position: absolute;
  inset: 0;
  opacity: var(--altitude, 0);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, .88) 0 1px, transparent 2px),
    radial-gradient(circle at 28% 54%, rgba(255, 255, 255, .64) 0 1px, transparent 2px),
    radial-gradient(circle at 49% 26%, rgba(255, 255, 255, .74) 0 1px, transparent 2px),
    radial-gradient(circle at 74% 38%, rgba(255, 255, 255, .7) 0 1px, transparent 2px),
    radial-gradient(circle at 87% 17%, rgba(255, 255, 255, .86) 0 1px, transparent 2px),
    radial-gradient(circle at 60% 68%, rgba(255, 255, 255, .58) 0 1px, transparent 2px),
    radial-gradient(circle at 52% 42%, rgba(96, 165, 250, .18), transparent 220px),
    linear-gradient(180deg, #020617 0%, #0f172a 48%, #17133d 100%);
}

.runtime-cloudscape {
  position: absolute;
  inset: 0;
  opacity: max(.08, calc(1 - var(--altitude, 0)));
}

.runtime-world-cloud {
  position: absolute;
  display: block;
  width: 150px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .58);
  opacity: .9;
  transform: translateX(-180px) scale(var(--cloud-scale, 1));
  animation: driftCloud 34s linear infinite;
  will-change: transform;
}

.runtime-world-cloud::before,
.runtime-world-cloud::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  background: inherit;
}

.runtime-world-cloud::before {
  left: 24px;
  top: -18px;
  width: 58px;
  height: 58px;
}

.runtime-world-cloud::after {
  right: 24px;
  top: -14px;
  width: 50px;
  height: 50px;
}

.runtime-world-cloud.c1 { left: -12%; top: 12%; animation-delay: -5s; --cloud-scale: 1; }
.runtime-world-cloud.c2 { left: 24%; top: 28%; width: 116px; animation-delay: -18s; --cloud-scale: .84; }
.runtime-world-cloud.c3 { left: 63%; top: 10%; width: 170px; animation-delay: -27s; --cloud-scale: 1.08; }
.runtime-world-cloud.c4 { left: 78%; top: 53%; width: 132px; animation-delay: -11s; --cloud-scale: .76; }

.runtime-cityscape {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  height: min(32vh, 330px);
  opacity: calc(.84 - (var(--altitude, 0) * .58));
  transform: translateY(calc(var(--altitude, 0) * 38vh));
  transition: transform .25s linear, opacity .25s linear;
  will-change: transform, opacity;
  background:
    linear-gradient(180deg, rgba(2, 8, 23, 0), rgba(2, 8, 23, .68)),
    linear-gradient(90deg,
      transparent 0 5%,
      rgba(11, 35, 58, .42) 5% 12%,
      transparent 12% 17%,
      rgba(11, 35, 58, .54) 17% 26%,
      transparent 26% 31%,
      rgba(11, 35, 58, .72) 31% 39%,
      transparent 39% 44%,
      rgba(11, 35, 58, .48) 44% 51%,
      transparent 51% 57%,
      rgba(11, 35, 58, .62) 57% 67%,
      transparent 67% 74%,
      rgba(11, 35, 58, .5) 74% 84%,
      transparent 84% 100%);
}

.runtime-cityscape::before,
.runtime-cityscape::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}

.runtime-cityscape::before {
  height: 100%;
  background:
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(226, 232, 240, .12) 18px 20px, transparent 20px 36px),
    repeating-linear-gradient(0deg, transparent 0 18px, rgba(226, 232, 240, .09) 18px 20px, transparent 20px 38px);
  opacity: .5;
}

.runtime-cityscape::after {
  height: 78%;
  background:
    linear-gradient(90deg,
      rgba(2, 9, 24, .56) 0 7%,
      transparent 7% 11%,
      rgba(2, 9, 24, .45) 11% 18%,
      transparent 18% 25%,
      rgba(2, 9, 24, .62) 25% 36%,
      transparent 36% 41%,
      rgba(2, 9, 24, .5) 41% 49%,
      transparent 49% 58%,
      rgba(2, 9, 24, .56) 58% 70%,
      transparent 70% 79%,
      rgba(2, 9, 24, .47) 79% 89%,
      transparent 89% 100%);
}

.runtime-world-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24px;
  background: linear-gradient(180deg, #22354c, #07111f);
  border-top: 4px solid rgba(255, 164, 0, .76);
  box-shadow: 0 -10px 28px rgba(3, 10, 24, .32);
}

.runtime-space {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: var(--altitude, 0);
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, .9) 0 1px, transparent 2px),
    radial-gradient(circle at 56% 16%, rgba(255, 255, 255, .75) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 48%, rgba(255, 255, 255, .7) 0 1px, transparent 2px),
    radial-gradient(circle at 35% 68%, rgba(255, 255, 255, .6) 0 1px, transparent 2px),
    radial-gradient(circle at 60% 42%, rgba(255, 255, 255, .16), transparent 140px),
    linear-gradient(180deg, #020617 0%, #111827 48%, #172554 100%);
  pointer-events: none;
}

.runtime-cloud {
  z-index: 1;
  opacity: calc(.85 - (var(--altitude, 0) * .72));
  pointer-events: none;
}

.runtime-cloud.c1 {
  width: 118px;
  height: 36px;
  left: 9%;
  top: 21%;
}

.runtime-cloud.c2 {
  width: 150px;
  height: 42px;
  left: 61%;
  top: 15%;
}

.runtime-cloud.c3 {
  width: 92px;
  height: 30px;
  left: 43%;
  top: 34%;
  opacity: calc(.62 - (var(--altitude, 0) * .52));
}

.runtime-game-wrap {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 64px;
  pointer-events: none;
}

.runtime-stage {
  position: relative;
  width: min(520px, 72vw);
  height: min(560px, calc(100vh - 170px));
  min-height: 420px;
  overflow: visible;
}

.runtime-player-wrap {
  padding-bottom: 94px;
}

.runtime-player-wrap .runtime-stage {
  width: min(330px, 92vw);
  height: min(440px, calc(100vh - 260px));
  min-height: 320px;
}

.runtime-mast {
  left: 10px;
  height: 100%;
  bottom: 0;
  z-index: 6;
}

.runtime-boom {
  left: 10px;
  top: 42px;
  width: 390px;
  max-width: calc(100% - 16px);
  z-index: 7;
}

.runtime-boom:before,
.runtime-boom:after,
.runtime-mast:before,
.runtime-mast:after {
  content: "";
  position: absolute;
  inset: 5px;
  background:
    repeating-linear-gradient(45deg, transparent 0 17px, rgba(17, 24, 39, .75) 18px 21px),
    repeating-linear-gradient(-45deg, transparent 0 17px, rgba(17, 24, 39, .75) 18px 21px);
  pointer-events: none;
}

.runtime-line {
  z-index: 8;
  transform-origin: top;
  background: linear-gradient(90deg, #111827, #475569 45%, #111827);
}

.runtime-hook {
  z-index: 9;
}

.runtime-stack {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.runtime-active-block,
.runtime-placed {
  z-index: 10;
  width: 170px;
  height: 54px;
  border-radius: 0;
  will-change: left, bottom, transform;
}

.runtime-placed {
  z-index: 5;
}

.runtime-active-block {
  z-index: 11;
  filter: drop-shadow(0 18px 18px rgba(15, 23, 42, .28));
}

.runtime-active-block:after,
.runtime-placed:after {
  content: "";
  position: absolute;
  top: 8px;
  right: -20px;
  width: 20px;
  height: calc(100% - 8px);
  background: #26364a;
  border: 3px solid #111827;
  border-left: 0;
  transform: skewY(-18deg);
  transform-origin: left top;
  box-shadow: inset -8px 0 rgba(0, 0, 0, .18);
}

.runtime-active-block:before,
.runtime-placed:before {
  background:
    linear-gradient(90deg, transparent 0 7px, rgba(255, 255, 255, .15) 7px 10px, transparent 10px 100%),
    repeating-linear-gradient(90deg, #fef3c7 0 12px, #1e293b 12px 20px, #7dd3fc 20px 31px, #1e293b 31px 40px, #34d399 40px 48px, #1e293b 48px 58px);
}

.runtime-player-wrap .runtime-active-block,
.runtime-player-wrap .runtime-placed {
  width: 140px;
  height: 44px;
}

.runtime-player-wrap .runtime-mast {
  left: 0;
}

.runtime-player-wrap .runtime-boom {
  left: 0;
  top: 30px;
  width: 260px;
}

.runtime-player-wrap .runtime-line {
  top: 62px;
}

.runtime-residents {
  position: absolute;
  top: -15px;
  right: -13px;
  z-index: 14;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 18px;
  padding: 0 5px;
  background: #34d399;
  color: #020617;
  border: 2px solid #0f172a;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  line-height: 1;
}

.runtime-results {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, .58);
  backdrop-filter: blur(8px);
}

.runtime-results-card {
  width: min(92vw, 720px);
  max-height: 90vh;
  overflow: auto;
  padding: clamp(24px, 4vw, 40px);
  border: 4px solid #facc15;
  border-radius: 24px;
  background: rgba(15, 23, 42, .96);
  box-shadow: 0 0 100px rgba(255, 215, 0, .22), 0 12px 0 rgba(0, 0, 0, .7);
  text-align: center;
}

@media (max-width: 700px) {
  .runtime-game-wrap {
    padding-bottom: 84px;
  }

  .runtime-stage {
    width: min(330px, 92vw);
    height: min(440px, calc(100vh - 250px));
    min-height: 320px;
  }

  .runtime-active-block,
  .runtime-placed {
    width: 140px;
    height: 44px;
  }

  .runtime-mast {
    left: 0;
  }

  .runtime-boom {
    left: 0;
    top: 30px;
    width: 260px;
  }
}

/* Restored gameplay renderer: this keeps the newer lobby/page UI but uses the better crane and block system. */
.runtime-arcade-wrap {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 28px 58px;
  pointer-events: none;
}

.runtime-host-wrap {
  position: absolute;
  left: 24px;
  right: 360px;
  top: 112px;
  bottom: 28px;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(var(--host-columns), var(--lane-w));
  grid-auto-rows: var(--lane-h);
  gap: 14px;
  align-content: end;
  justify-content: center;
  justify-items: center;
  pointer-events: none;
}

.runtime-lane-shell {
  position: relative;
  width: var(--lane-w, 500px);
  height: var(--lane-h, 560px);
  overflow: visible;
}

.runtime-host-lane .runtime-arcade-stage {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 500px !important;
  max-width: none;
  height: 560px !important;
  min-height: 0;
  transform: translateX(-50%) scale(var(--stage-scale, 1));
  transform-origin: 50% 100%;
}

.runtime-lane-label {
  position: absolute;
  left: 50%;
  top: calc(-32px * var(--stage-scale, 1));
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  width: min(100%, 500px);
  padding: 7px 9px;
  border: 1px solid rgba(15, 23, 42, .7);
  border-radius: 8px;
  background: rgba(2, 6, 23, .72);
  color: #fff;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.runtime-lane-label span {
  color: #ffa400;
}

.runtime-lane-label strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-lane-label em {
  color: #5ee6a8;
  font-style: normal;
}

.runtime-player-wrap {
  padding: 76px 12px 94px;
}

.runtime-player-lane {
  width: var(--lane-w, 500px);
  height: var(--lane-h, 560px);
}

.runtime-arcade-stage {
  width: 500px !important;
  max-width: none;
  flex: 0 0 auto;
  height: 560px !important;
  min-height: 0;
  border: 0;
  overflow: visible;
  background: transparent;
}

.runtime-player-wrap .runtime-arcade-stage {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 500px !important;
  max-width: none;
  height: 560px !important;
  min-height: 0;
  transform: translateX(-50%) scale(var(--stage-scale, 1));
  transform-origin: 50% 100%;
}

.space-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: var(--altitude, 0);
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, .9) 0 1px, transparent 2px),
    radial-gradient(circle at 62% 12%, rgba(255, 255, 255, .8) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 36%, rgba(255, 255, 255, .7) 0 1px, transparent 2px),
    radial-gradient(circle at 36% 58%, rgba(255, 255, 255, .75) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 70%, rgba(255, 255, 255, .8) 0 1px, transparent 2px),
    linear-gradient(180deg, #070b1d, #151038);
}

.cloud-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  opacity: max(.08, calc(1 - var(--altitude, 0)));
  pointer-events: none;
}

.cloud {
  position: absolute;
  width: 130px;
  height: 38px;
  background: rgba(255, 255, 255, .58);
  border-radius: 999px;
  filter: blur(.2px);
  animation: driftCloud 26s linear infinite;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 999px;
}

.cloud::before {
  left: 22px;
  top: -18px;
  width: 54px;
  height: 54px;
}

.cloud::after {
  right: 22px;
  top: -12px;
  width: 48px;
  height: 48px;
}

.cloud.c1 { left: -20%; top: 18%; animation-delay: -2s; }
.cloud.c2 { left: 24%; top: 32%; width: 96px; transform: scale(.8); animation-delay: -12s; }
.cloud.c3 { left: 62%; top: 14%; width: 150px; transform: scale(1.08); animation-delay: -19s; }
.cloud.c4 { left: 8%; top: 55%; width: 110px; transform: scale(.72); animation-delay: -6s; }

.skyline-backdrop {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  height: 27%;
  opacity: calc(.82 - (var(--altitude, 0) * .48));
  background:
    linear-gradient(180deg, rgba(15, 23, 42, .12), rgba(15, 23, 42, .72)),
    linear-gradient(90deg,
      transparent 0 3%,
      rgba(8, 22, 39, .58) 3% 10%,
      transparent 10% 13%,
      rgba(8, 22, 39, .42) 13% 19%,
      transparent 19% 23%,
      rgba(8, 22, 39, .68) 23% 33%,
      transparent 33% 37%,
      rgba(8, 22, 39, .48) 37% 44%,
      transparent 44% 48%,
      rgba(8, 22, 39, .72) 48% 58%,
      transparent 58% 63%,
      rgba(8, 22, 39, .5) 63% 72%,
      transparent 72% 77%,
      rgba(8, 22, 39, .6) 77% 88%,
      transparent 88% 100%);
}

.skyline-backdrop::before,
.skyline-backdrop::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.skyline-backdrop::before {
  height: 72%;
  background:
    repeating-linear-gradient(90deg, transparent 0 9px, rgba(226, 232, 240, .12) 9px 11px, transparent 11px 20px),
    repeating-linear-gradient(0deg, transparent 0 13px, rgba(226, 232, 240, .08) 13px 15px, transparent 15px 28px);
  opacity: .5;
}

.skyline-backdrop::after {
  height: 100%;
  background:
    linear-gradient(90deg,
      transparent 0 7%,
      rgba(3, 10, 24, .42) 7% 8%,
      transparent 8% 28%,
      rgba(3, 10, 24, .38) 28% 29%,
      transparent 29% 52%,
      rgba(3, 10, 24, .42) 52% 53%,
      transparent 53% 81%,
      rgba(3, 10, 24, .34) 81% 82%,
      transparent 82% 100%);
}

.ground-line {
  position: absolute;
  left: 64px;
  right: 64px;
  bottom: 0;
  z-index: 18;
  height: 14px;
  background: linear-gradient(180deg, #31455d, #142238);
  border-top: 4px solid rgba(255, 164, 0, .72);
  box-shadow: 0 7px 0 rgba(3, 10, 24, .5);
}

.crane {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.crane-mast {
  position: absolute;
  bottom: 0;
  width: 20px;
  min-height: 100%;
  background:
    linear-gradient(45deg, transparent 0 42%, rgba(35, 21, 0, .42) 42% 52%, transparent 52% 100%),
    linear-gradient(-45deg, transparent 0 42%, rgba(35, 21, 0, .42) 42% 52%, transparent 52% 100%),
    linear-gradient(90deg, var(--accent), #ffc04d);
  background-size: 26px 26px, 26px 26px, 100% 100%;
  border: 2px solid var(--accent-dark);
  box-shadow: 0 0 0 2px rgba(35, 21, 0, .22);
}

.crane-left .crane-mast { left: 100px; }
.crane-right .crane-mast { right: 100px; }

.crane-boom {
  position: absolute;
  top: 7.5%;
  height: 20px;
  background:
    linear-gradient(135deg, transparent 0 36%, rgba(35, 21, 0, .45) 36% 49%, transparent 49% 100%),
    linear-gradient(45deg, transparent 0 36%, rgba(35, 21, 0, .45) 36% 49%, transparent 49% 100%),
    linear-gradient(180deg, #ffc04d, var(--accent));
  background-size: 24px 18px, 24px 18px, 100% 100%;
  border: 2px solid var(--accent-dark);
  transform: translateY(-50%);
}

.crane-counterweight {
  position: absolute;
  top: calc(7.5% - 19px);
  width: 42px;
  height: 36px;
  background: #5a431f;
  border: 3px solid var(--accent);
}

.crane-left .crane-counterweight { left: 68px; }
.crane-right .crane-counterweight { right: 68px; }

.cable-svg {
  position: absolute;
  inset: 0;
  z-index: 7;
  overflow: visible;
  pointer-events: none;
}

.cable-line {
  stroke: #202833;
  stroke-width: 1.4;
  stroke-linecap: square;
  vector-effect: non-scaling-stroke;
}

.cable-up {
  stroke-width: 1.1;
  opacity: .78;
}

.crane-trolley {
  position: absolute;
  z-index: 13;
  width: 14px;
  height: 14px;
  border: 3px solid #7a4b00;
  background: #ffc04d;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hook {
  position: absolute;
  z-index: 12;
  width: 14px;
  height: 16px;
  border: 3px solid #252c36;
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: rgba(203, 213, 225, .22);
  transform: translate(-50%, -50%);
}

.hook::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 3px;
  height: 12px;
  background: #252c36;
  transform: translateX(-50%);
}

.tower-stack,
.falling-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.falling-layer {
  z-index: 14;
}

.active-block,
.placed-block,
.falling-block {
  position: absolute;
  width: 120px;
  height: 66px;
  transform: translateX(-50%);
  z-index: 8;
}

.active-block {
  transition: none;
  will-change: left, bottom;
}

.active-block .building-block {
  transform: none;
  transform-origin: 50% 0;
  filter: none;
}

.placed-block {
  z-index: 6;
}

.preview-block {
  z-index: 7;
  opacity: .9;
  animation: previewSettle .18s ease-out both;
}

.falling-block {
  bottom: 45%;
  z-index: 14;
  animation: fallRight 1.7s cubic-bezier(.22, .7, .28, 1) forwards;
}

.fall-left {
  animation-name: fallLeft;
}

.building-block {
  position: relative;
  width: 100%;
  height: 56px;
  transform-style: preserve-3d;
}

.block-face {
  position: absolute;
  left: 0;
  right: 12px;
  top: 12px;
  bottom: 0;
  overflow: hidden;
  border: 2px solid #4f6376;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .16), transparent 40%),
    linear-gradient(90deg, var(--building), #8ea3b7);
}

.block-side {
  position: absolute;
  top: 18px;
  right: 0;
  width: 14px;
  height: 38px;
  border: 2px solid #4f6376;
  border-left: 0;
  background: linear-gradient(180deg, #869bae, var(--building-side));
  transform: skewY(-31deg);
  transform-origin: left top;
}

.block-top {
  position: absolute;
  left: 8px;
  right: 6px;
  top: 0;
  height: 18px;
  border: 2px solid #5d7184;
  border-bottom: 0;
  background: linear-gradient(120deg, #c3d1dd, #93a7ba);
  transform: skewX(-42deg);
}

.window-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  height: 100%;
  padding: 7px 8px;
}

.window {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(10, 20, 32, .45);
  background: var(--window-dark);
}

.window.lit {
  background: var(--window-lit);
  box-shadow: 0 0 10px rgba(255, 229, 141, .65);
}

.window.open {
  background: #112337;
  border-top: 4px solid #dbe9f5;
}

.window.plant::after,
.window.person::after,
.window.cat::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 7px;
  height: 7px;
  background: #5ee6a8;
  transform: translateX(-50%);
}

.window.person::after {
  width: 6px;
  height: 10px;
  background: #ffcf66;
}

.window.cat::after {
  width: 8px;
  height: 5px;
  border-radius: 0;
  background: #1f2935;
}

.resident-pop {
  position: absolute;
  top: -6px;
  right: 0;
  padding: 2px 6px;
  background: rgba(94, 230, 168, .9);
  color: #062016;
  font-size: .72rem;
  font-weight: 900;
}

.runtime-stage-metrics {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  width: 420px;
  max-width: calc(100% - 70px);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .72);
  background: rgba(2, 6, 23, .68);
  color: #fff;
  font-family: "Press Start 2P", monospace;
  transform: translateX(-50%);
  pointer-events: none;
}

.runtime-stage-metrics > div {
  display: grid;
  gap: 4px;
  justify-items: center;
  min-width: 0;
  padding: 8px 6px 9px;
  border-right: 1px solid rgba(148, 163, 184, .2);
}

.runtime-stage-metrics > div:last-child {
  border-right: 0;
}

.runtime-stage-metrics span {
  color: #b7c4d6;
  font-size: 7px;
  line-height: 1;
}

.runtime-stage-metrics strong {
  color: #fff;
  font-size: 10px;
  line-height: 1;
}

.runtime-stage-metrics .runtime-stability i {
  position: relative;
  display: block;
  width: 72px;
  max-width: 100%;
  height: 6px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .82);
  background: rgba(15, 23, 42, .75);
}

.runtime-stage-metrics .runtime-stability i::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--stability, 100%);
  background: linear-gradient(90deg, #ef4444 0 28%, #facc15 45%, #5ee6a8 70% 100%);
}

.drop-badge {
  position: absolute;
  top: 52px;
  left: 50%;
  z-index: 20;
  padding: 8px 12px;
  border: 2px solid var(--accent);
  background: #142237;
  color: var(--accent);
  font-weight: 950;
  letter-spacing: .04em;
  transform: translateX(-50%);
  animation: badgePop 1.1s ease forwards;
}

.drop-badge.perfect,
.drop-badge.great {
  border-color: #5ee6a8;
  color: #5ee6a8;
}

.drop-badge.shaky,
.drop-badge.rough {
  border-color: #ffcf66;
  color: #ffcf66;
}

.drop-badge.miss,
.drop-badge.collapse {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

@keyframes fallRight {
  0% { opacity: 1; transform: translateX(-50%) rotate(0deg); }
  100% { opacity: 0; transform: translate(120px, 230px) rotate(72deg); }
}

@keyframes fallLeft {
  0% { opacity: 1; transform: translateX(-50%) rotate(0deg); }
  100% { opacity: 0; transform: translate(-170px, 230px) rotate(-72deg); }
}

@keyframes badgePop {
  0% { opacity: 0; transform: translate(-50%, 14px) scale(.92); }
  18%, 70% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -18px) scale(.98); }
}

@keyframes previewSettle {
  from { opacity: .55; transform: translateX(-50%) translateY(-8px); }
  to { opacity: .9; transform: translateX(-50%) translateY(0); }
}

@keyframes driftCloud {
  from { transform: translateX(-180px) scale(var(--cloud-scale, 1)); }
  to { transform: translateX(calc(100vw + 220px)) scale(var(--cloud-scale, 1)); }
}

@media (max-width: 700px) {
  .runtime-host-wrap {
    left: 8px;
    right: 8px;
    top: 96px;
    bottom: 12px;
  }

  .runtime-arcade-wrap {
    padding: 76px 8px 92px;
  }

  .runtime-arcade-stage {
    width: 500px !important;
    max-width: none;
    height: 560px !important;
    min-height: 0;
  }

  .active-block,
  .placed-block,
  .falling-block {
    width: 120px;
  }

  .runtime-stage-metrics {
    width: 390px;
    max-width: calc(100% - 58px);
  }

  .runtime-stage-metrics span {
    font-size: 6px;
  }

  .runtime-stage-metrics strong {
    font-size: 9px;
  }
}
