/* WillowinWorlds CSS: Stack Tower page (games/stack-tower.html). Loaded after upcoming-game.css.
   Signature element: a CSS-drawn crane swings a floor, the floor drops, lands with a flash and a grade, and the camera lifts.
   The scene is decoration only (aria-hidden) and an illustration, not gameplay footage.
   Loop: 8 s (two pendulum periods of 4 s), two landings (Perfect, then Good). The tower is two floors periodic, so the reset at the end of the loop is invisible.
   Units: inside .st-scene 1em = 1% of the stage width (container query unit), so the scene scales with the stage.
   Only transform and opacity are animated; transitions handle hover and press, so they still work while animations are paused. */

/* ---------- Hero ---------- */
/* No box behind the headline: the page-wide sky (.st-sky) is the backdrop, and the copy keeps its contrast through the veil and a text halo. */
body[data-game="stack-tower"] .ug-hero-frame {
  overflow: visible;
  padding-inline: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

body[data-game="stack-tower"] .ug-hero-frame::before {
  display: none;
}

.st-figure {
  justify-self: center;
  width: min(100%, 25rem);
  margin: 0;
}

.st-figure figcaption {
  margin-top: 14px;
  color: var(--ug-ink);
  text-shadow: 0 0 12px color-mix(in srgb, var(--ug-bg) 88%, transparent);
  font-size: 0.9rem;
  font-weight: 760;
  line-height: 1.4;
  text-align: center;
}

.st-stage {
  --st-h: 10.4em;
  container-type: inline-size;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 20 / 27;
  border: 1px solid color-mix(in srgb, var(--ug-fill) 45%, var(--ug-line));
  border-radius: 28px;
  background: linear-gradient(180deg, #78AEDB 0%, #A1C7E6 46%, #D2E6F4 100%);
  box-shadow:
    0 30px 70px var(--ug-shadow),
    0 0 0 8px color-mix(in srgb, var(--ug-fill) 14%, transparent);
}

.st-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    inset 0 -50px 60px rgba(16, 32, 46, 0.2);
  pointer-events: none;
}

.st-scene {
  position: absolute;
  inset: 0;
  font-size: 1cqw;
}

.st-scene > * {
  position: absolute;
}

/* ---------- Sky: clouds and distant towers ---------- */
.st-clouds {
  top: 9em;
  left: 0;
  width: 200em;
  height: 30em;
  opacity: 0.92;
  background:
    radial-gradient(circle 3.6em at 18em 7.4em, #fff 0 92%, transparent 100%),
    radial-gradient(circle 4.6em at 24.5em 6.4em, #fff 0 92%, transparent 100%),
    radial-gradient(circle 3.2em at 30em 8.6em, #fff 0 92%, transparent 100%),
    radial-gradient(ellipse 12.5em 3.4em at 24em 10em, #fff 0 92%, transparent 100%),
    radial-gradient(circle 2.8em at 72em 20.4em, #fff 0 92%, transparent 100%),
    radial-gradient(circle 3.5em at 77em 19.4em, #fff 0 92%, transparent 100%),
    radial-gradient(ellipse 9em 2.6em at 75em 22.2em, #fff 0 92%, transparent 100%);
  background-size: 100em 30em;
  background-repeat: repeat-x;
}

.st-far {
  top: -30em;
  bottom: -30em;
  left: 0;
  right: 0;
}

.st-far::before,
.st-far::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  background:
    repeating-linear-gradient(180deg, transparent 0 4.3em, rgba(255, 255, 255, 0.3) 4.3em 5.2em),
    linear-gradient(90deg, #8DB6D8, #9FC3DF);
  opacity: 0.8;
}

.st-far::before {
  left: 15em;
  width: 15em;
}

.st-far::after {
  left: 71em;
  width: 20em;
  opacity: 0.6;
}

/* ---------- Crane (fixed to the screen: it climbs with the tower) ---------- */
.st-crane {
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.st-crane > * {
  position: absolute;
}

.st-mast {
  top: 0;
  bottom: 0;
  left: 4em;
  width: 7em;
  background:
    linear-gradient(90deg, #E1A11F 0 1em, transparent 1em calc(100% - 1em), #E1A11F calc(100% - 1em)),
    repeating-linear-gradient(45deg, transparent 0 3.4em, #3B5062 3.4em 4em),
    repeating-linear-gradient(-45deg, transparent 0 3.4em, #3B5062 3.4em 4em);
}

.st-jib {
  top: 2em;
  left: 4em;
  width: 104em;
  height: 6em;
  background:
    linear-gradient(180deg, #E1A11F 0 1.1em, transparent 1.1em calc(100% - 1.1em), #E1A11F calc(100% - 1.1em)),
    repeating-linear-gradient(60deg, transparent 0 3.2em, #3B5062 3.2em 3.8em),
    repeating-linear-gradient(-60deg, transparent 0 3.2em, #3B5062 3.2em 3.8em);
}

.st-cab {
  top: 8.4em;
  left: 12.4em;
  width: 10em;
  height: 7.4em;
  border: 0.5em solid #E1A11F;
  border-radius: 1.2em;
  background: linear-gradient(180deg, #E4F5FF 0 56%, #3B5062 56%);
}

.st-trolley {
  top: 8em;
  left: 45em;
  width: 10em;
  height: 5em;
  border-bottom: 0.9em solid #E1A11F;
  border-radius: 0.9em 0.9em 1.6em 1.6em;
  background: #3B5062;
}

/* ---------- Tower and camera lift ---------- */
.st-world {
  inset: 0;
  z-index: 1;
  will-change: transform;
  animation: st-lift 8s linear infinite;
}

/* Height ruler: ticks every floor, so the camera lift reads. Period equals one floor, so the loop reset does not show. */
.st-world::before {
  content: "";
  position: absolute;
  top: -30em;
  bottom: -40em;
  left: 90.6em;
  width: 3em;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0 0.35em, transparent 0.35em 10.4em) 0 10em;
}

.st-world::after {
  content: "";
  position: absolute;
  top: -30em;
  bottom: -40em;
  left: 93.4em;
  width: 0.35em;
  background: rgba(255, 255, 255, 0.5);
}

.st-tower {
  position: absolute;
  top: 84em;
  left: 0;
  right: 0;
}

.st-floor {
  --f: #9A6A3A;
  --f-hi: #BA8751;
  --f-lo: #6F4824;
  --p: #86A0AE;
  --p-hi: #A6BCC7;
  --band: #8A5E31;
  position: relative;
  display: block;
  width: 34em;
  height: 10.4em;
  margin-inline: auto;
  border-radius: 1.7em;
  background: linear-gradient(180deg, var(--f-hi) 0 12%, var(--f) 12%);
  box-shadow:
    inset 0 -0.7em 0 var(--f-lo),
    0 0.15em 0 rgba(20, 34, 46, 0.38);
}

.st-floor::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0 14%, transparent 14% 86%, rgba(0, 0, 0, 0.18) 86%);
}

.st-floor::after {
  content: "";
  position: absolute;
  inset: 2em 17% 2.3em;
  border-radius: 0.9em;
  background: linear-gradient(180deg, var(--p-hi) 0 42%, var(--band) 42% 54%, var(--p) 54%);
  box-shadow: 0 0.3em 0 rgba(0, 0, 0, 0.16);
}

.st-floor--b {
  --f: #D08A33;
  --f-hi: #E8A850;
  --f-lo: #9E6420;
  --p: #E6CB93;
  --p-hi: #F4E2B7;
  --band: #C98A36;
  transform: translateX(-3.2em);
}

/* ---------- Dropped floors (in the world, so they lift with the tower) ---------- */
.st-drop {
  position: absolute;
  left: 33em;
  opacity: 0;
  transform-origin: 50% 100%;
}

.st-drop--a {
  top: 73.6em;
  animation: st-drop-a 8s linear infinite;
}

.st-drop--b {
  top: 63.2em;
  animation: st-drop-b 8s linear infinite;
}

/* ---------- Crane pendulum ---------- */
.st-swing {
  top: 12em;
  left: 50em;
  z-index: 2;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  will-change: transform;
  animation: st-swing 4s linear infinite;
}

.st-swing > * {
  position: absolute;
}

.st-cable {
  top: 0;
  left: -0.2em;
  width: 0.4em;
  height: 14em;
  background: #2B3E4D;
}

.st-hook {
  top: 12.6em;
  left: -2em;
  width: 4em;
  height: 5.6em;
  border: 0.5em solid #3B5062;
  border-radius: 1em 1em 1.8em 1.8em;
  background: #E1A11F;
}

.st-hang {
  top: 18em;
  left: -17em;
  width: 34em;
  height: 16.4em;
  transform-origin: 50% 0;
}

.st-hang--a {
  animation: st-hang-a 8s linear infinite;
}

.st-hang--b {
  opacity: 0;
  animation: st-hang-b 8s linear infinite;
}

.st-hang .st-floor {
  position: absolute;
  top: 6em;
  left: 0;
  margin: 0;
  transform: none;
}

.st-sling {
  position: absolute;
  top: 0;
  left: 6em;
  width: 22em;
  height: 6.2em;
  background:
    linear-gradient(to top left, transparent calc(50% - 0.22em), #2B3E4D calc(50% - 0.22em) calc(50% + 0.22em), transparent calc(50% + 0.22em)) left / 50% 100% no-repeat,
    linear-gradient(to top right, transparent calc(50% - 0.22em), #2B3E4D calc(50% - 0.22em) calc(50% + 0.22em), transparent calc(50% + 0.22em)) right / 50% 100% no-repeat;
}

/* ---------- Landing flash and grade ---------- */
.st-flash {
  z-index: 2;
  top: 84em;
  width: 0;
  height: 0;
  opacity: 0;
}

.st-flash--a {
  left: 50em;
  animation: st-flash-a 8s linear infinite;
}

.st-flash--b {
  left: 46.8em;
  animation: st-flash-b 8s linear infinite;
}

.st-flash::before {
  content: "";
  position: absolute;
  top: -10em;
  left: -36em;
  width: 72em;
  height: 20em;
  background:
    radial-gradient(circle at 21% 30%, #fff 0 0.55em, transparent 0.9em),
    radial-gradient(circle at 80% 26%, #fff 0 0.45em, transparent 0.8em),
    radial-gradient(circle at 36% 80%, #fff 0 0.4em, transparent 0.7em),
    radial-gradient(circle at 68% 78%, #fff 0 0.55em, transparent 0.9em),
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.95) 0 6%, rgba(255, 238, 168, 0.72) 22%, rgba(255, 214, 102, 0) 62%);
}

.st-flash::after {
  content: "";
  position: absolute;
  top: -0.4em;
  left: -17em;
  width: 34em;
  height: 0.8em;
  border-radius: 0.4em;
  background: linear-gradient(90deg, transparent, #fff 22% 78%, transparent);
  box-shadow: 0 0 1.6em 0.4em rgba(255, 240, 170, 0.9);
}

.st-flash--b::before {
  background:
    radial-gradient(circle at 24% 32%, #fff 0 0.4em, transparent 0.7em),
    radial-gradient(circle at 76% 70%, #fff 0 0.4em, transparent 0.7em),
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.85) 0 5%, rgba(214, 246, 190, 0.6) 22%, rgba(154, 219, 124, 0) 60%);
}

.st-flash--b::after {
  box-shadow: 0 0 1.4em 0.3em rgba(190, 240, 160, 0.8);
}

.st-grade {
  z-index: 4;
  top: 64cqw;
  padding: 0.3em 0.95em 0.34em;
  border-radius: 999px;
  color: #1E2F3B;
  background: linear-gradient(180deg, #FFE69E, #FFC84B);
  box-shadow:
    0 0.1em 0 rgba(0, 0, 0, 0.16),
    0 0 0.55em rgba(255, 214, 102, 0.85);
  font-size: max(12px, 4.4em);
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
  opacity: 0;
}

.st-grade--a {
  left: 50%;
  animation: st-grade-a 8s linear infinite;
}

.st-grade--b {
  left: calc(50% - 3.2cqw);
  background: linear-gradient(180deg, #DDF7CD, #9ADB7C);
  box-shadow:
    0 0.1em 0 rgba(0, 0, 0, 0.16),
    0 0 0.55em rgba(154, 219, 124, 0.85);
  animation: st-grade-b 8s linear infinite;
}

/* ---------- Keyframes ----------
   Pendulum: 4 s, centre at 0 s, 2 s, 4 s ...; extremes at 1 s, 3 s ...; sine easing.
   Loop (8 s, 1% = 80 ms): floor A drops at 2.0 s (pendulum at centre, Perfect) and lands at 2.55 s; the camera lifts to 3.45 s;
   floor B hangs from 3.5 s, drops at 6.26 s (just past centre, so it lands 3 units off-centre: Good) and lands at 6.81 s; lift to 7.7 s. */
@keyframes st-swing {
  0% { transform: rotate(0deg); animation-timing-function: cubic-bezier(0.61, 1, 0.88, 1); }
  25% { transform: rotate(-16deg); animation-timing-function: cubic-bezier(0.12, 0, 0.39, 0); }
  50% { transform: rotate(0deg); animation-timing-function: cubic-bezier(0.61, 1, 0.88, 1); }
  75% { transform: rotate(16deg); animation-timing-function: cubic-bezier(0.12, 0, 0.39, 0); }
  100% { transform: rotate(0deg); }
}

@keyframes st-lift {
  0%,
  31.9% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
  }

  43.1%,
  85.1% {
    transform: translateY(var(--st-h));
    animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
  }

  96.3%,
  100% { transform: translateY(calc(var(--st-h) * 2)); }
}

@keyframes st-hang-a {
  0%,
  24.9% { opacity: 1; transform: scale(1); }
  25% { opacity: 0; transform: scale(1); }
  91.9% { opacity: 0; transform: scale(0.6); }
  96.9%,
  100% { opacity: 1; transform: scale(1); }
}

@keyframes st-hang-b {
  0%,
  43.7% { opacity: 0; transform: scale(0.6); }
  48.7%,
  78.2% { opacity: 1; transform: scale(1); }
  78.3%,
  100% { opacity: 0; transform: scale(1); }
}

@keyframes st-drop-a {
  0%,
  24.9% { opacity: 0; transform: translate(0, -37.6em) rotate(0deg) scale(1, 1); }

  25% {
    opacity: 1;
    transform: translate(0, -37.6em) rotate(0deg) scale(1, 1);
    animation-timing-function: cubic-bezier(0.55, 0.05, 0.9, 0.5);
  }

  31.9% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1, 1);
    animation-timing-function: ease-out;
  }

  33.5% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1.04, 0.93); }
  35.5%,
  100% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1, 1); }
}

@keyframes st-drop-b {
  0%,
  78.2% { opacity: 0; transform: translate(-3.2em, -37.9em) rotate(6.4deg) scale(1, 1); }

  78.3% {
    opacity: 1;
    transform: translate(-3.2em, -37.9em) rotate(6.4deg) scale(1, 1);
    animation-timing-function: cubic-bezier(0.55, 0.05, 0.9, 0.5);
  }

  85.1% {
    opacity: 1;
    transform: translate(-3.2em, 0) rotate(0deg) scale(1, 1);
    animation-timing-function: ease-out;
  }

  86.7% { opacity: 1; transform: translate(-3.2em, 0) rotate(0deg) scale(1.04, 0.93); }
  88.7%,
  100% { opacity: 1; transform: translate(-3.2em, 0) rotate(0deg) scale(1, 1); }
}

@keyframes st-flash-a {
  0%,
  31.9% { opacity: 0; transform: scale(0.5); }
  32.7% { opacity: 1; transform: scale(0.85); }
  37.5%,
  100% { opacity: 0; transform: scale(1.3); }
}

@keyframes st-flash-b {
  0%,
  85.1% { opacity: 0; transform: scale(0.5); }
  85.9% { opacity: 1; transform: scale(0.85); }
  90.7%,
  100% { opacity: 0; transform: scale(1.3); }
}

@keyframes st-grade-a {
  0%,
  31.9% { opacity: 0; transform: translate(-50%, 2cqw) scale(0.8); animation-timing-function: ease-out; }
  34.4% { opacity: 1; transform: translate(-50%, -1cqw) scale(1.07); }
  36.3% { opacity: 1; transform: translate(-50%, -1.8cqw) scale(1); animation-timing-function: ease-in; }
  42.3% { opacity: 1; transform: translate(-50%, -3.4cqw) scale(1); }
  46.8%,
  100% { opacity: 0; transform: translate(-50%, -4.6cqw) scale(1); }
}

@keyframes st-grade-b {
  0%,
  85.1% { opacity: 0; transform: translate(-50%, 2cqw) scale(0.8); animation-timing-function: ease-out; }
  87.6% { opacity: 1; transform: translate(-50%, -1cqw) scale(1.07); }
  89.5% { opacity: 1; transform: translate(-50%, -1.8cqw) scale(1); animation-timing-function: ease-in; }
  95.5% { opacity: 1; transform: translate(-50%, -3.1cqw) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -3.6cqw) scale(1); }
}

/* ---------- Sections ---------- */
/* Features: a small floor chip before each title; the card lifts on hover and the chip drops into place. */
body[data-game="stack-tower"] .ug-features .detail-card {
  position: relative;
  transition: transform 0.22s ease-out, border-color 0.22s ease-out, box-shadow 0.22s ease-out;
}

body[data-game="stack-tower"] .ug-features .detail-card h3 {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

body[data-game="stack-tower"] .ug-features .detail-card h3::before {
  content: "";
  flex: 0 0 auto;
  width: 1.9rem;
  height: 0.7rem;
  border-radius: 0.24rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0 28%, transparent 28%), #9A6A3A;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
  transform: translateY(-3px);
  transition: transform 0.38s cubic-bezier(0.3, 1.7, 0.5, 1);
}

body[data-game="stack-tower"] .ug-features .detail-card:nth-child(even) h3::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0 28%, transparent 28%), #D08A33;
}

body[data-game="stack-tower"] .ug-features .detail-card:hover,
body[data-game="stack-tower"] .ug-features .detail-card:focus-within {
  border-color: var(--ug-accent);
  box-shadow: 0 16px 34px var(--ug-shadow);
  transform: translateY(-4px);
}

body[data-game="stack-tower"] .ug-features .detail-card:hover h3::before,
body[data-game="stack-tower"] .ug-features .detail-card:focus-within h3::before {
  transform: translateY(0);
}

body[data-game="stack-tower"] .ug-features .detail-card:active {
  transform: translateY(-1px) scale(0.99);
}

body[data-game="stack-tower"] .btn:active {
  transform: translateY(1px) scale(0.98);
}

/* How it plays: each step carries a tiny pictogram of its moment, idling slowly. */
body[data-game="stack-tower"] .ug-steps li {
  position: relative;
  transition: transform 0.22s ease-out, border-color 0.22s ease-out;
}

body[data-game="stack-tower"] .ug-steps li:hover {
  border-color: var(--ug-accent);
  transform: translateY(-3px);
}

body[data-game="stack-tower"] .ug-steps li::before,
body[data-game="stack-tower"] .ug-steps li::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 18px;
  width: 2.6rem;
  height: 2.6rem;
  pointer-events: none;
}

/* Step 1: a floor on a swinging cable. */
body[data-game="stack-tower"] .ug-steps li:nth-child(1)::before {
  display: none;
}

body[data-game="stack-tower"] .ug-steps li:nth-child(1)::after {
  background:
    linear-gradient(var(--ug-muted), var(--ug-muted)) 50% 0 / 2px 1.5rem no-repeat,
    linear-gradient(180deg, #E8A850 0 30%, #D08A33 30%) 50% 100% / 1.7rem 0.72rem no-repeat;
  border-radius: 0.2rem;
  transform-origin: 50% 0;
  animation: st-step-swing 4.4s ease-in-out infinite;
}

/* Step 2: a floor falling onto a line. */
body[data-game="stack-tower"] .ug-steps li:nth-child(2)::before {
  background: linear-gradient(var(--ug-line), var(--ug-line)) 50% 100% / 100% 2px no-repeat;
}

body[data-game="stack-tower"] .ug-steps li:nth-child(2)::after {
  background: linear-gradient(180deg, #BA8751 0 30%, #9A6A3A 30%) 50% 100% / 1.7rem 0.72rem no-repeat;
  transform-origin: 50% 100%;
}

/* Step 3: the grade ring around a golden floor. */
body[data-game="stack-tower"] .ug-steps li:nth-child(3)::before {
  background: linear-gradient(180deg, #F4D76A 0 30%, #D9A91F 30%) 50% 50% / 1.7rem 0.72rem no-repeat;
}

body[data-game="stack-tower"] .ug-steps li:nth-child(3)::after {
  border: 2px solid var(--ug-accent);
  border-radius: 50%;
  opacity: 0.55;
  transform: scale(0.82);
}

/* Steps 2 and 3 only animate while hovered (the page-wide world already uses the loop budget). The paused state shows the still pictogram. */
@media (prefers-reduced-motion: no-preference) {
  body[data-game="stack-tower"] .ug-steps li:nth-child(2):hover::after {
    animation: st-step-drop 4.8s ease-in infinite;
  }

  body[data-game="stack-tower"] .ug-steps li:nth-child(3):hover::after {
    animation: st-step-ring 4.2s ease-out infinite;
  }

  body[data-game="stack-tower"].animations-paused .ug-steps li:nth-child(n+2):hover::after {
    animation: none;
  }
}

@keyframes st-step-swing {
  0%,
  100% { transform: rotate(-16deg); }
  50% { transform: rotate(16deg); }
}

@keyframes st-step-drop {
  0%,
  8% { opacity: 0; transform: translateY(-1.3rem); }
  16% { opacity: 1; transform: translateY(-1.3rem); animation-timing-function: cubic-bezier(0.55, 0.05, 0.9, 0.5); }
  34% { opacity: 1; transform: translateY(0) scale(1, 1); animation-timing-function: ease-out; }
  38% { opacity: 1; transform: translateY(0) scale(1.06, 0.88); }
  44%,
  84% { opacity: 1; transform: translateY(0) scale(1, 1); }
  100% { opacity: 0; transform: translateY(0) scale(1, 1); }
}

@keyframes st-step-ring {
  0%,
  45% { opacity: 0; transform: scale(0.45); }
  50% { opacity: 0.9; transform: scale(0.5); }
  100% { opacity: 0; transform: scale(1.1); }
}

/* Vote: a small stack with a golden floor that floats above it (five Perfect landings in a row queue a Golden floor). */
body[data-game="stack-tower"] .ug-vote {
  position: relative;
}

body[data-game="stack-tower"] .ug-vote::before,
body[data-game="stack-tower"] .ug-vote::after {
  content: "";
  position: absolute;
  right: clamp(18px, 4vw, 38px);
  width: 3.6rem;
  height: 1.2rem;
  border-radius: 0.34rem;
  pointer-events: none;
}

body[data-game="stack-tower"] .ug-vote::before {
  top: clamp(36px, 5vw, 52px);
  height: 2.5rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0 14%, transparent 14%) 0 0 / 100% 1.25rem no-repeat,
    linear-gradient(180deg, #D08A33 0 48%, #B9772A 48%) 0 0 / 100% 1.2rem no-repeat,
    linear-gradient(180deg, #BA8751 0 48%, #9A6A3A 48%) 0 100% / 100% 1.2rem no-repeat;
  opacity: 0.9;
  transform: translateX(-0.5rem);
}

body[data-game="stack-tower"] .ug-vote::after {
  top: calc(clamp(36px, 5vw, 52px) - 1.35rem);
  background: linear-gradient(180deg, #F8E083 0 30%, #E2B02C 30%);
  box-shadow: 0 0 14px rgba(244, 215, 106, 0.55);
  animation: st-vote-float 5s ease-in-out infinite;
}

@keyframes st-vote-float {
  0%,
  100% { transform: translate(0.4rem, 0) rotate(-3deg); }
  50% { transform: translate(0.4rem, -0.45rem) rotate(2deg); }
}

@media (max-width: 560px) {
  body[data-game="stack-tower"] .ug-vote::before,
  body[data-game="stack-tower"] .ug-vote::after {
    width: 2.6rem;
  }

  body[data-game="stack-tower"] .ug-vote::after {
    height: 0.9rem;
  }

  body[data-game="stack-tower"] .ug-vote::before {
    height: 1.9rem;
  }
}

/* ---------- Page-wide sky ----------
   Fixed behind every section. Layers, back to front: sky gradient, sun or moon glow, the hero illustration (faint, decorative),
   far clouds, two tiers of distant towers (lit floor lines in the dark theme), crane silhouettes at the page edges, near clouds, and a veil
   that keeps text readable. Loops: far clouds, near clouds, one crane hook (calm, slow, transform only). */
body[data-game="stack-tower"][data-theme] {
  background: transparent;
}

body.upcoming-game-page[data-game="stack-tower"][data-theme]::before {
  display: none;
}

body[data-game="stack-tower"][data-theme="light"] {
  --st-sky: linear-gradient(180deg, #74AFE2 0%, #A3CFF0 34%, #CDE6F6 68%, #E9F4FB 100%);
  --st-far: #A8CAE6;
  --st-near: #8CB4D6;
  --st-win: rgba(255, 255, 255, 0.32);
  --st-cloud: rgba(255, 255, 255, 0.92);
  --st-cloud-far: rgba(255, 255, 255, 0.62);
  --st-crane: rgba(46, 78, 104, 0.34);
  --st-glow: radial-gradient(circle at 84% 13%, rgba(255, 247, 214, 0.95) 0 2.6%, rgba(255, 231, 160, 0.5) 6%, rgba(255, 231, 160, 0) 26%);
  --st-ghost: 0.2;
  --st-veil: linear-gradient(90deg, rgba(234, 243, 250, 0.8), rgba(234, 243, 250, 0.56) 46%, rgba(234, 243, 250, 0.2) 80%, rgba(234, 243, 250, 0.1));
  --st-veil-m: linear-gradient(180deg, rgba(234, 243, 250, 0.66), rgba(234, 243, 250, 0.52));
}

body[data-game="stack-tower"][data-theme="dark"] {
  --st-sky: linear-gradient(180deg, #0A141D 0%, #12242F 38%, #1B3646 72%, #25495A 100%);
  --st-far: #1B3243;
  --st-near: #10202B;
  --st-win: rgba(255, 214, 140, 0.2);
  --st-cloud: rgba(150, 184, 210, 0.17);
  --st-cloud-far: rgba(150, 184, 210, 0.1);
  --st-crane: rgba(5, 11, 17, 0.62);
  --st-glow: radial-gradient(circle at 84% 13%, rgba(238, 246, 255, 0.7) 0 1.8%, rgba(190, 216, 240, 0.2) 5%, rgba(190, 216, 240, 0) 24%);
  --st-ghost: 0.12;
  --st-veil: linear-gradient(90deg, rgba(10, 20, 29, 0.7), rgba(10, 20, 29, 0.5) 46%, rgba(10, 20, 29, 0.2) 80%, rgba(10, 20, 29, 0.1));
  --st-veil-m: linear-gradient(180deg, rgba(10, 20, 29, 0.62), rgba(10, 20, 29, 0.5));
}

.st-sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--st-sky);
  pointer-events: none;
}

.st-sky > * {
  position: absolute;
}

.st-sky-glow,
.st-sky-veil {
  inset: 0;
}

.st-sky-glow {
  background: var(--st-glow);
}

.st-sky-veil {
  background: var(--st-veil);
}

/* The hero illustration, large and faint, standing behind the skyline like a distant tower. */
.st-sky-ghost {
  right: 3vw;
  bottom: 0;
  width: min(52vw, 760px);
  aspect-ratio: 16 / 9;
  opacity: var(--st-ghost);
  background: url("../assets/upcoming/stack-tower/hero-1280.webp") center / cover;
  -webkit-mask-image: radial-gradient(ellipse 50% 62% at 50% 56%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 62% at 50% 56%, #000 30%, transparent 100%);
}

/* Clouds: one tile repeats sideways and the layer slides by exactly one tile, so the loop has no seam. */
.st-sky-clouds {
  left: 0;
  width: calc(100% + 1500px);
  will-change: transform;
}

.st-sky-clouds--far {
  top: 7vh;
  height: 240px;
  background:
    radial-gradient(circle 34px at 150px 118px, var(--st-cloud-far) 0 92%, transparent 100%),
    radial-gradient(circle 46px at 206px 104px, var(--st-cloud-far) 0 92%, transparent 100%),
    radial-gradient(circle 32px at 262px 122px, var(--st-cloud-far) 0 92%, transparent 100%),
    radial-gradient(ellipse 120px 30px at 206px 134px, var(--st-cloud-far) 0 92%, transparent 100%),
    radial-gradient(circle 28px at 720px 74px, var(--st-cloud-far) 0 92%, transparent 100%),
    radial-gradient(circle 38px at 768px 62px, var(--st-cloud-far) 0 92%, transparent 100%),
    radial-gradient(ellipse 100px 24px at 746px 90px, var(--st-cloud-far) 0 92%, transparent 100%),
    radial-gradient(circle 30px at 1180px 150px, var(--st-cloud-far) 0 92%, transparent 100%),
    radial-gradient(circle 40px at 1228px 138px, var(--st-cloud-far) 0 92%, transparent 100%),
    radial-gradient(ellipse 104px 26px at 1204px 166px, var(--st-cloud-far) 0 92%, transparent 100%);
  background-size: 1500px 240px;
  background-repeat: repeat-x;
  animation: st-sky-drift-far 150s linear infinite;
}

.st-sky-clouds--near {
  top: 30vh;
  height: 300px;
  background:
    radial-gradient(circle 44px at 330px 150px, var(--st-cloud) 0 92%, transparent 100%),
    radial-gradient(circle 60px at 398px 130px, var(--st-cloud) 0 92%, transparent 100%),
    radial-gradient(circle 42px at 462px 154px, var(--st-cloud) 0 92%, transparent 100%),
    radial-gradient(ellipse 158px 38px at 398px 172px, var(--st-cloud) 0 92%, transparent 100%),
    radial-gradient(circle 38px at 1090px 210px, var(--st-cloud) 0 92%, transparent 100%),
    radial-gradient(circle 52px at 1146px 192px, var(--st-cloud) 0 92%, transparent 100%),
    radial-gradient(ellipse 140px 34px at 1120px 232px, var(--st-cloud) 0 92%, transparent 100%);
  background-size: 1500px 300px;
  background-repeat: repeat-x;
  animation: st-sky-drift-near 100s linear infinite;
}

/* Distant towers: two tiers, painted as gradient rectangles; the pseudo-element draws their lit floors. */
.st-sky-skyline {
  right: 0;
  bottom: 0;
  left: 0;
  height: 54vh;
  background:
    linear-gradient(var(--st-near), var(--st-near)) 0vw bottom / 8vw 24vh no-repeat,
    linear-gradient(var(--st-near), var(--st-near)) 11vw bottom / 6vw 30vh no-repeat,
    linear-gradient(var(--st-near), var(--st-near)) 19vw bottom / 9vw 20vh no-repeat,
    linear-gradient(var(--st-near), var(--st-near)) 30vw bottom / 6vw 27vh no-repeat,
    linear-gradient(var(--st-near), var(--st-near)) 44vw bottom / 8vw 22vh no-repeat,
    linear-gradient(var(--st-near), var(--st-near)) 55vw bottom / 6vw 31vh no-repeat,
    linear-gradient(var(--st-near), var(--st-near)) 64vw bottom / 9vw 21vh no-repeat,
    linear-gradient(var(--st-near), var(--st-near)) 76vw bottom / 6vw 29vh no-repeat,
    linear-gradient(var(--st-near), var(--st-near)) 86vw bottom / 8vw 23vh no-repeat,
    linear-gradient(var(--st-near), var(--st-near)) 94vw bottom / 7vw 26vh no-repeat,
    linear-gradient(var(--st-far), var(--st-far)) 2vw bottom / 6vw 34vh no-repeat,
    linear-gradient(var(--st-far), var(--st-far)) 9vw bottom / 5vw 44vh no-repeat,
    linear-gradient(var(--st-far), var(--st-far)) 15vw bottom / 7vw 30vh no-repeat,
    linear-gradient(var(--st-far), var(--st-far)) 24vw bottom / 5vw 48vh no-repeat,
    linear-gradient(var(--st-far), var(--st-far)) 31vw bottom / 6vw 36vh no-repeat,
    linear-gradient(var(--st-far), var(--st-far)) 40vw bottom / 8vw 40vh no-repeat,
    linear-gradient(var(--st-far), var(--st-far)) 50vw bottom / 5vw 52vh no-repeat,
    linear-gradient(var(--st-far), var(--st-far)) 57vw bottom / 7vw 33vh no-repeat,
    linear-gradient(var(--st-far), var(--st-far)) 66vw bottom / 6vw 46vh no-repeat,
    linear-gradient(var(--st-far), var(--st-far)) 74vw bottom / 8vw 38vh no-repeat,
    linear-gradient(var(--st-far), var(--st-far)) 83vw bottom / 5vw 50vh no-repeat,
    linear-gradient(var(--st-far), var(--st-far)) 90vw bottom / 7vw 35vh no-repeat;
}

.st-sky-skyline::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 16px) 0vw bottom / 8vw 24vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 16px) 11vw bottom / 6vw 30vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 16px) 19vw bottom / 9vw 20vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 16px) 30vw bottom / 6vw 27vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 16px) 44vw bottom / 8vw 22vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 16px) 55vw bottom / 6vw 31vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 16px) 64vw bottom / 9vw 21vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 16px) 76vw bottom / 6vw 29vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 16px) 86vw bottom / 8vw 23vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 16px) 94vw bottom / 7vw 26vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 12px) 2vw bottom / 6vw 34vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 12px) 9vw bottom / 5vw 44vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 12px) 15vw bottom / 7vw 30vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 12px) 24vw bottom / 5vw 48vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 12px) 31vw bottom / 6vw 36vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 12px) 40vw bottom / 8vw 40vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 12px) 50vw bottom / 5vw 52vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 12px) 57vw bottom / 7vw 33vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 12px) 66vw bottom / 6vw 46vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 12px) 74vw bottom / 8vw 38vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 12px) 83vw bottom / 5vw 50vh no-repeat,
    repeating-linear-gradient(180deg, var(--st-win) 0 2px, transparent 2px 12px) 90vw bottom / 7vw 35vh no-repeat;
}

/* Crane silhouettes at the page edges; the right one lowers a small floor on a slow sway. */
.st-sky-crane {
  top: 0;
  width: 190px;
  height: 78vh;
}

.st-sky-crane--l {
  left: 0.6vw;
}

.st-sky-crane--r {
  right: 0.6vw;
}

.st-sky-crane::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22px;
  background:
    linear-gradient(90deg, var(--st-crane) 0 3px, transparent 3px calc(100% - 3px), var(--st-crane) calc(100% - 3px)),
    repeating-linear-gradient(45deg, transparent 0 15px, var(--st-crane) 15px 18px),
    repeating-linear-gradient(-45deg, transparent 0 15px, var(--st-crane) 15px 18px);
}

.st-sky-crane::after {
  content: "";
  position: absolute;
  top: 44px;
  width: 168px;
  height: 18px;
  background:
    linear-gradient(180deg, var(--st-crane) 0 3px, transparent 3px calc(100% - 3px), var(--st-crane) calc(100% - 3px)),
    repeating-linear-gradient(60deg, transparent 0 13px, var(--st-crane) 13px 16px),
    repeating-linear-gradient(-60deg, transparent 0 13px, var(--st-crane) 13px 16px);
}

.st-sky-crane--l::before {
  left: 14px;
}

.st-sky-crane--l::after {
  left: 14px;
}

.st-sky-crane--r::before {
  right: 14px;
}

.st-sky-crane--r::after {
  right: 14px;
}

.st-sky-crane i {
  position: absolute;
  top: 62px;
  width: 3px;
  height: 120px;
  background: var(--st-crane);
  transform-origin: 50% 0;
}

.st-sky-crane i::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: -17px;
  width: 37px;
  height: 14px;
  border-radius: 4px;
  background: var(--st-crane);
}

.st-sky-crane--l i {
  left: 150px;
}

.st-sky-crane--r i {
  right: 150px;
  animation: st-sky-sway 9s ease-in-out infinite;
}

@keyframes st-sky-drift-far {
  to { transform: translateX(-1500px); }
}

@keyframes st-sky-drift-near {
  to { transform: translateX(-1500px); }
}

@keyframes st-sky-sway {
  0%,
  100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}

/* ---------- Sections on the sky ----------
   Section wrappers draw no box (a lattice rail from the crane jib and a two-block underline on the heading), so headings sit directly on the sky
   (halo for contrast). The cards are floor slabs, like the floors the crane drops: a lit roof band, shaded end caps, a thick base band, and the
   brown and amber of the two floor types alternating along each row. */
body[data-game="stack-tower"][data-theme="dark"] {
  --st-end: rgba(0, 0, 0, 0.2);
  --st-lattice: rgba(217, 142, 43, 0.62);
  --st-fill: 90%;
  --st-base: color-mix(in srgb, var(--ug-card-2) 72%, var(--ug-bg));
}

body[data-game="stack-tower"][data-theme="light"] {
  --st-end: rgba(40, 30, 10, 0.08);
  --st-lattice: rgba(168, 98, 14, 0.7);
  --st-fill: 90%;
  --st-base: var(--ug-card-2);
}

body[data-game="stack-tower"] {
  --st-f1: #9A6A3A;
  --st-f1-hi: #BA8751;
  --st-f1-lo: #6F4824;
  --st-f2: #D08A33;
  --st-f2-hi: #E8A850;
  --st-f2-lo: #9E6420;
  --st-glass-a: #86A0AE;
  --st-glass-b: #E6CB93;
}

body[data-game="stack-tower"] .game-page-section.soft-card {
  position: relative;
  padding-inline: 0;
  padding-top: clamp(32px, 4vw, 46px);
  border-color: transparent;
  background: none;
  box-shadow: none;
}

/* The lattice of a crane jib: two rails and crossing braces */
body[data-game="stack-tower"] .game-page-section.soft-card:not(.ug-vote)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  pointer-events: none;
  background:
    linear-gradient(var(--st-lattice), var(--st-lattice)) 0 0 / 100% 2px no-repeat,
    linear-gradient(var(--st-lattice), var(--st-lattice)) 0 100% / 100% 2px no-repeat,
    repeating-linear-gradient(60deg, transparent 0 11px, var(--st-lattice) 11px 13px),
    repeating-linear-gradient(-60deg, transparent 0 11px, var(--st-lattice) 11px 13px);
  -webkit-mask-image: linear-gradient(90deg, #000 55%, transparent);
  mask-image: linear-gradient(90deg, #000 55%, transparent);
}

body[data-game="stack-tower"] .game-page-section h2,
body[data-game="stack-tower"] .lab-related-title,
body[data-game="stack-tower"] .ug-hero-copy h1 {
  text-shadow:
    0 0 22px color-mix(in srgb, var(--ug-bg) 88%, transparent),
    0 0 6px color-mix(in srgb, var(--ug-bg) 72%, transparent);
}

/* Two blocks under every heading: a floor sitting a little off-centre on the one below */
body[data-game="stack-tower"] .game-page-section h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 15px;
  margin-top: 12px;
  background:
    linear-gradient(180deg, var(--st-f2-hi) 0 2px, var(--st-f2) 2px) 14px 0 / 34px 7px no-repeat,
    linear-gradient(180deg, var(--st-f1-hi) 0 2px, var(--st-f1) 2px) 0 8px / 46px 7px no-repeat;
  border-radius: 2px;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.35));
}

body[data-game="stack-tower"] :is(.ug-lede, .ug-hero-copy .hero-copy, .ug-genre, .ug-vote .ug-lede) {
  color: color-mix(in srgb, var(--ug-ink) 90%, var(--ug-muted));
  text-shadow: 0 0 12px color-mix(in srgb, var(--ug-bg) 85%, transparent);
}

/* On the light sky the tagline sits directly on the backdrop, so the accent is deepened a little to keep a comfortable contrast margin. */
body[data-game="stack-tower"][data-theme="light"] .ug-tagline {
  color: color-mix(in srgb, var(--ug-accent) 78%, var(--ug-ink));
}

/* Eyebrow: a small floor-shaped tag */
body[data-game="stack-tower"] .eyebrow {
  border-radius: 6px;
  border-color: color-mix(in srgb, var(--st-f2) 48%, var(--ug-line));
  background: color-mix(in srgb, var(--ug-card) 78%, transparent);
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--st-f2-lo) 55%, transparent);
}

body[data-game="stack-tower"] .eyebrow::before {
  width: 15px;
  height: 7px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--st-f2-hi) 0 2px, var(--st-f2) 2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

/* The slab */
body[data-game="stack-tower"] :is(.detail-card, .update-list li, .ug-next li, .lab-related-link) {
  --st-f: var(--st-f1);
  --st-hi: var(--st-f1-hi);
  --st-lo: var(--st-f1-lo);
  padding-bottom: 24px;
  border: 1px solid color-mix(in srgb, var(--st-f) 42%, var(--ug-line));
  border-radius: 14px;
  background:
    linear-gradient(90deg, var(--st-end) 0 10px, transparent 10px calc(100% - 10px), var(--st-end) calc(100% - 10px)),
    linear-gradient(180deg, color-mix(in srgb, var(--st-hi) 72%, transparent) 0 4px, color-mix(in srgb, var(--st-f) 58%, transparent) 4px 7px, transparent 7px),
    linear-gradient(180deg, color-mix(in srgb, color-mix(in srgb, var(--st-f) 4%, var(--st-base)) var(--st-fill), transparent), color-mix(in srgb, var(--st-base) var(--st-fill), transparent));
  box-shadow:
    inset 0 -5px 0 color-mix(in srgb, var(--st-lo) 62%, transparent),
    0 2px 0 rgba(8, 16, 24, 0.34);
}

body[data-game="stack-tower"] :is(.detail-card, .update-list li, .ug-next li, .lab-related-link):nth-child(even) {
  --st-f: var(--st-f2);
  --st-hi: var(--st-f2-hi);
  --st-lo: var(--st-f2-lo);
}

body[data-game="stack-tower"] .ug-facts .game-page-facts > div {
  --st-f: var(--st-f1);
  --st-hi: var(--st-f1-hi);
  --st-lo: var(--st-f1-lo);
  padding-bottom: 18px;
  border: 1px solid color-mix(in srgb, var(--st-f) 42%, var(--ug-line));
  border-radius: 10px;
  background:
    linear-gradient(90deg, var(--st-end) 0 7px, transparent 7px calc(100% - 7px), var(--st-end) calc(100% - 7px)),
    linear-gradient(180deg, color-mix(in srgb, var(--st-hi) 72%, transparent) 0 3px, color-mix(in srgb, var(--st-f) 58%, transparent) 3px 5px, transparent 5px),
    linear-gradient(180deg, color-mix(in srgb, color-mix(in srgb, var(--st-f) 4%, var(--st-base)) var(--st-fill), transparent), color-mix(in srgb, var(--st-base) var(--st-fill), transparent));
  box-shadow:
    inset 0 -4px 0 color-mix(in srgb, var(--st-lo) 62%, transparent),
    0 2px 0 rgba(8, 16, 24, 0.34);
}

body[data-game="stack-tower"] .ug-facts .game-page-facts > div:nth-child(even) {
  --st-f: var(--st-f2);
  --st-hi: var(--st-f2-hi);
  --st-lo: var(--st-f2-lo);
}

body[data-game="stack-tower"] .ug-facts .game-page-facts > div:hover {
  border-color: var(--ug-accent);
}

/* FAQ: two small windows on the slab, like a floor of the tower */
body[data-game="stack-tower"] .ug-faq .detail-card {
  position: relative;
}

body[data-game="stack-tower"] .ug-faq .detail-card::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 18px;
  width: 38px;
  height: 14px;
  pointer-events: none;
  border-radius: 3px;
  background:
    linear-gradient(180deg, var(--st-glass-a) 0 40%, color-mix(in srgb, var(--st-glass-a) 70%, black) 40%) 0 0 / 16px 100% no-repeat,
    linear-gradient(180deg, var(--st-glass-b) 0 40%, color-mix(in srgb, var(--st-glass-b) 70%, black) 40%) 100% 0 / 16px 100% no-repeat;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--st-lo) 80%, transparent);
  opacity: 0.9;
}

body[data-game="stack-tower"] .ug-faq .detail-card h3 {
  padding-right: 48px;
}

/* Next: each goal is a small floor, brown then amber, instead of a diamond */
body[data-game="stack-tower"] .ug-next li {
  padding-left: 58px;
}

body[data-game="stack-tower"] .ug-next li::before {
  top: 1.35rem;
  left: 20px;
  width: 26px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--st-hi) 0 3px, var(--st-f) 3px);
  box-shadow: 0 2px 0 var(--st-lo);
  transform: none;
}

body[data-game="stack-tower"] .ug-status-note {
  padding-bottom: 16px;
  border: 1px solid color-mix(in srgb, var(--st-f2) 45%, var(--ug-line));
  border-inline-start-width: 1px;
  border-radius: 12px;
  background:
    linear-gradient(90deg, var(--st-end) 0 8px, transparent 8px calc(100% - 8px), var(--st-end) calc(100% - 8px)),
    linear-gradient(180deg, color-mix(in srgb, var(--st-f2-hi) 72%, transparent) 0 3px, color-mix(in srgb, var(--st-f2) 58%, transparent) 3px 5px, transparent 5px),
    color-mix(in srgb, var(--st-base) 90%, transparent);
  box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--st-f2-lo) 62%, transparent), 0 2px 0 rgba(8, 16, 24, 0.34);
}

/* Vote: a big slab with a row of lit windows along the top */
body[data-game="stack-tower"] .game-page-section.ug-vote {
  padding: clamp(46px, 5vw, 58px) clamp(24px, 4vw, 38px) clamp(32px, 4vw, 44px);
  border: 1px solid color-mix(in srgb, var(--st-f2) 48%, var(--ug-line));
  border-radius: 18px;
  background:
    linear-gradient(90deg, var(--st-end) 0 18px, transparent 18px calc(100% - 18px), var(--st-end) calc(100% - 18px)),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--st-glass-b) 55%, transparent) 0 14px, transparent 14px 28px) 34px 22px / calc(100% - 68px) 9px no-repeat,
    linear-gradient(180deg, color-mix(in srgb, var(--st-f2-hi) 72%, transparent) 0 6px, color-mix(in srgb, var(--st-f2) 60%, transparent) 6px 10px, transparent 10px),
    radial-gradient(ellipse 60% 120% at 14% 0%, color-mix(in srgb, var(--ug-fill) 16%, transparent), transparent 70%),
    color-mix(in srgb, var(--st-base) 90%, transparent);
  box-shadow: inset 0 -8px 0 color-mix(in srgb, var(--st-f2-lo) 62%, transparent), 0 3px 0 rgba(8, 16, 24, 0.34);
}

/* Buttons: block-shaped, with a lit top and a shaded base like the floors */
body[data-game="stack-tower"] .btn,
body[data-game="stack-tower"].game-detail-page .btn:focus-visible {
  border-radius: 12px;
}

body[data-game="stack-tower"] .btn-primary {
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.24), inset 0 -4px 0 rgba(0, 0, 0, 0.28), 0 10px 22px color-mix(in srgb, var(--ug-fill) 30%, transparent);
}

body[data-game="stack-tower"] .btn-ghost {
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--st-f2-lo) 55%, transparent);
}

body[data-game="stack-tower"] .social-link,
body[data-game="stack-tower"] .lab-related-all {
  background: color-mix(in srgb, var(--ug-card-2) 78%, transparent);
}

body[data-game="stack-tower"] .game-footer {
  background: color-mix(in srgb, var(--ug-card) 84%, transparent);
}

/* ---------- Narrow screens ---------- */
@media (max-width: 920px) {
  .st-figure {
    width: min(100%, 22rem);
    margin-top: 6px;
  }
}

/* Small screens: fewer layers (no cranes, no far clouds, no lit floors), a shorter skyline, a fainter illustration. */
@media (max-width: 760px) {
  .st-sky-crane,
  .st-sky-clouds--far,
  .st-sky-skyline::after {
    display: none;
  }

  .st-sky-skyline {
    height: 34vh;
  }

  .st-sky-ghost {
    width: 90vw;
    opacity: calc(var(--st-ghost) * 0.7);
  }

  .st-sky-clouds--near {
    top: 18vh;
  }

  .st-sky-veil {
    background: var(--st-veil-m);
  }
}

/* ---------- Reduced motion: a still, finished frame (floor hanging over the tower, no flash). ---------- */
@media (prefers-reduced-motion: reduce) {
  .st-sky-clouds,
  .st-sky-crane i,
  .st-world,
  .st-swing,
  .st-hang--a,
  .st-hang--b,
  .st-drop,
  .st-flash,
  .st-grade,
  body[data-game="stack-tower"] .ug-steps li::after,
  body[data-game="stack-tower"] .ug-vote::after {
    animation: none;
  }

  body[data-game="stack-tower"] .ug-features .detail-card,
  body[data-game="stack-tower"] .ug-steps li,
  body[data-game="stack-tower"] .ug-features .detail-card h3::before {
    transition: none;
  }
}
