:root {
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-synthesis:none; color:#282b31; background:#f5f5f7;
  -webkit-tap-highlight-color:transparent;
}
* { box-sizing:border-box; }
html,body { margin:0; min-height:100%; width:100%; overscroll-behavior:none; }
body { user-select:none; -webkit-user-select:none; }
[hidden] { display:none !important; }
button,select { font:inherit; cursor:pointer; touch-action:manipulation; }
button:focus-visible,a:focus-visible,select:focus-visible { outline:3px solid #367bc9; outline-offset:3px; }
.tower-shell {
  width:min(100%,940px); height:var(--peri-viewport-height,100dvh);
  min-height:0; margin:auto; padding:max(8px,env(safe-area-inset-top))
    max(12px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom))
    max(12px,env(safe-area-inset-left));
  display:flex; flex-direction:column; overflow:hidden;
}
.tower-page .topbar {
  height:48px; flex:0 0 48px; display:flex; justify-content:space-between;
  align-items:center; gap:8px;
}
.tower-brand { font-size:27px; font-weight:770; letter-spacing:-.075em; line-height:1; color:#24262a; text-decoration:none; }
.tower-brand .brand-dot { color:#c697a1; }
.tower-page .topbar .brand-mark { display:none; }
.tower-page .topbar-tools { display:flex; align-items:center; margin-left:auto; gap:6px; }
.tower-page .topbar-tools .language-control--flag { position:relative; display:grid; place-items:center; flex:none; width:44px; height:44px; border-radius:12px; }
.tower-page .topbar-tools .language-flag { font-size:23px; line-height:1; }
.tower-page .topbar-tools .language-control--flag select { position:absolute; inset:0; width:100%; height:100%; opacity:0; }
.tower-page .topbar-tools .language-control--flag:focus-within { outline:3px solid #367bc9; outline-offset:2px; }
#fullscreen-button { display:none; }
.tower-game { min-height:0; width:100%; flex:1; display:flex; flex-direction:column; align-items:center; }
.tower-heading { flex:0 0 auto; text-align:center; padding:0; }
.tower-heading h1 { font-size:clamp(25px,5.5vw,32px); letter-spacing:-.065em; line-height:1.10; font-weight:780; margin:0; }
.tower-heading p { margin:2px 0 0; color:#7b7c84; font-size:clamp(12px,2.5vw,14px); }
.tower-stage { flex:1; min-height:0; width:100%; display:flex; align-items:flex-start; justify-content:center; padding:4px 0 0; }
.tower-frame {
  position:relative; isolation:isolate; flex:none;
  width:min(100%,calc((var(--peri-viewport-height,100dvh) - 113px)*.5625),480px);
  aspect-ratio:9/16; max-height:100%; border-radius:26px; overflow:hidden;
  /* One fixed surface; scrolling the SVG cannot change the sky color. */
  background:#eff6fb;
  box-shadow:0 8px 28px rgba(51,59,69,.046),0 23px 54px rgba(51,59,69,.055);
  contain:layout style paint; touch-action:none;
}
.tower-illustration { display:block; width:100%; height:100%; pointer-events:none; }
/* Fixed foreground: the next toy and grab area never follow the tower camera. */
.tower-dock-scene {
  position:absolute; inset:0; z-index:2;
  display:block; width:100%; height:100%;
  pointer-events:none; overflow:hidden;
}
/* Hide old world-space sky/land decorations; they caused camera color bands.
   The physical platform and blocks remain in world coordinates. */
.tower-illustration > rect:first-of-type,
.tower-illustration > circle,
.tower-illustration > g:not([id]),
.tower-illustration > path,
.tower-illustration > ellipse { display:none; }
/* Next block and its 76-unit shelf share fixed coordinates in tower-dock-scene. */
.tower-block-shape { transform-box:fill-box; transform-origin:center 74%; }
.tower-block-shape .block-top-light { opacity:.55; }

.tower-hold {
  position:absolute; z-index:3;
  left:var(--block-left,25.28%); top:var(--block-top,85.42%);
  transform:translate(-50%,-50%); width:clamp(72px,34%,138px);
  height:clamp(54px,10.5%,78px); border:0; border-radius:18px;
  background:transparent; outline:none; box-shadow:none;
  touch-action:none; cursor:grab;
}
.tower-hold:active { cursor:grabbing; background:transparent; }
.tower-hold:focus-visible { outline:3px solid #327ac3; outline-offset:4px; }
.tower-reset {
  position:absolute; z-index:6; right:12px; top:12px; display:grid; place-items:center;
  width:44px; height:44px; border:1px solid rgba(73,76,79,.09);
  border-radius:14px; background:rgba(255,255,255,.67); color:#687077;
  backdrop-filter:blur(8px);
}
.tower-reset svg { width:21px; height:21px; display:block; }
.tower-fall {
  position:absolute; z-index:4; inset:0; width:100%; height:100%; border:0;
  background:transparent; display:flex; align-items:flex-end; justify-content:center;
  padding:0 12px 10%; color:#384d4e;
}
.tower-fall span {
  display:grid; place-items:center; min-width:145px; min-height:58px; padding:12px 24px;
  font-weight:740; font-size:18px; letter-spacing:-.01em;
  border:1px solid rgba(121,150,142,.16); border-radius:20px;
  background:rgba(246,254,249,.91); box-shadow:0 8px 23px rgba(34,65,56,.09);
}
.tower-fall:focus-visible { outline:3px solid #367bc9; outline-offset:-8px; }
.tower-fall:active span { transform:scale(.96); }
.tower-caption {
  flex:0 0 auto; width:100%; min-height:41px; padding:3px 8px 5px;
  margin:0; display:grid; place-items:center; text-align:center;
  font-size:clamp(16px,3.7vw,19px); font-weight:640;
  line-height:1.23; letter-spacing:-.02em;
}
/* Keep announced updates for assistive technology, but no on-screen hints. */
.tower-page[data-game-active="true"] .tower-caption {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; white-space:nowrap; clip-path:inset(50%);
}
.tower-caption[data-mode="falling"] { color:#737b82; }
.tower-welcome {
  position:fixed; z-index:20; inset:0; display:grid; place-items:center;
  padding:24px; background:rgba(245,245,247,.90); backdrop-filter:blur(16px);
}
.tower-welcome-content { width:min(100%,340px); display:flex; flex-direction:column; align-items:center; text-align:center; }
.tower-welcome-art {
  width:118px; height:118px; display:grid; place-items:center;
  margin-bottom:24px; border-radius:34px; background:#fff;
  box-shadow:0 12px 42px rgba(31,38,45,.07);
}
.tower-welcome-art svg { width:91px; height:91px; }
.tower-welcome h2 { font-size:clamp(31px,7vw,38px); font-weight:780; line-height:1.13; letter-spacing:-.06em; margin:0; }
.tower-welcome p { color:#7b7f87; line-height:1.4; margin:12px 0 29px; font-size:15px; }
.tower-start {
  min-height:58px; min-width:190px; padding:14px 27px; border-radius:19px;
  background:#27303b; color:#fff; border:0; font-weight:720;
  box-shadow:0 7px 22px rgba(30,38,48,.14); transition:transform .18s ease;
}
.tower-start:active { transform:scale(.97); }
@media (max-height:580px) {
  .tower-page .topbar { height:44px; flex-basis:44px; }
  .tower-heading { padding:0; }
  .tower-heading h1 { font-size:24px; }
  .tower-heading p { margin-top:2px; }
  .tower-stage { padding:2px 0 0; }
  .tower-caption { min-height:33px; padding:0 4px; font-size:15px; }
  .tower-frame { width:min(100%,calc((var(--peri-viewport-height,100dvh) - 106px)*.5625),480px); }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { transition-duration:0ms !important; }
}
