
.play-shell { --plum:#231535; --ivory:#fff3da; background:#271548; font-family:system-ui,"Apple SD Gothic Neo","Malgun Gothic",sans-serif; }
.tower-game { isolation:isolate; position:relative; display:grid; place-items:center; min-height:100svh; overflow:clip; color:var(--plum); }
.scenery, #stars { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.scenery { z-index:-3; object-fit:cover; }
#stars { z-index:-1; }
.playing-field { position:relative; container-type:inline-size; width:min(100%,150svh); aspect-ratio:3 / 2; }
.live-round,.vista { position:absolute; inset:0; }
.live-round { isolation:isolate; --controls:url("play/controls-desk.5b971f64a7fc.webp"); --first:url("play/first-desk.97ec57b26797.webp"); }
.live-round::after,.tower-game[data-segment="0"] .live-round::before { content:""; position:absolute; inset:0; pointer-events:none; background:center / contain no-repeat; }
.live-round::after { z-index:-1; background-image:var(--controls); }
.tower-game[data-segment="0"] .live-round::before { z-index:-2; background-image:var(--first); }
@media (aspect-ratio < 3/5), (1/1 < aspect-ratio < 1.48) {
  .live-round::before { mask-image:linear-gradient(to bottom,transparent,black 8%,black 93%,transparent); }
}
@media (2/3 < aspect-ratio <= 1/1), (aspect-ratio > 1.52) {
  .live-round::before { mask-image:linear-gradient(to right,transparent,black 7%,black 93%,transparent); }
}
.live-round :is(.round-home,.stage-display,.timer-display,.question-board,.floor-ladder,.jumper,.choices,.jump-feedback) { position:absolute; }
.round-home { left:.7%; top:.5%; width:17.7%; height:14.4%; border-radius:35%; }
.stage-display,.timer-display,.question-board,.floor-ladder,.choices,.vista { font-weight:850; }
.stage-display { left:24.6%; top:6.5%; width:23.2%; height:7.5%; display:grid; grid-template-columns:minmax(0,35fr) minmax(0,65fr); grid-template-rows:minmax(0,1fr); align-items:stretch; text-align:center; color:white; column-gap:3%; padding:0.3% 0.5%; line-height:1.07; }
.stage-display :is(b,strong) { min-width:0; min-height:0; align-content:center; }
.stage-display b { font-size:clamp(15px,3.9cqw,65px); color:#ffd438; white-space:nowrap; }
.stage-display strong { font-size:clamp(12px,2.7cqw,44px); word-break:keep-all; overflow-wrap:anywhere; text-wrap:balance; letter-spacing:-.04em; }
#floor.wide { font-size:clamp(13px,2.55cqw,45px); }
.timer-display { left:84.2%; top:6.1%; width:11.4%; height:8%; display:grid; place-items:center; white-space:nowrap; color:#fff5df; font-size:clamp(18px,4cqw,69px); font-variant-numeric:tabular-nums; line-height:1; }
.timer-display.urgent { color:#ffe08a; }
.question-board { left:27%; top:27.4%; width:46%; height:21.2%; display:grid; grid-template-rows:24% minmax(0,1fr); align-items:stretch; justify-items:stretch; text-align:center; gap:1%; line-height:1; }
.question-board small { align-content:center; font-size:clamp(13px,2.76cqw,45px); font-weight:850; }
.question-board strong { color:#181739; font-size:clamp(25px,9.1cqw,155px); display:block; align-content:center; justify-self:center; width:98%; min-height:0; line-height:1.03; letter-spacing:-.035em; overflow-wrap:anywhere; }
.question-board strong:lang(en),.choices button:lang(en) { white-space:nowrap; }
.question-board strong.long { font-size:clamp(21px,4.5cqw,79px); line-height:1.25; }
.question-board strong.medium { font-size:clamp(23px,6.2cqw,106px); }
.floor-ladder { left:89.5%; top:22.9%; width:6%; height:51.1%; margin:0; padding:0; list-style:none; color:#eee1ff; text-align:center; font-size:clamp(9px,1.6cqw,25px); font-variant-numeric:tabular-nums; }
.floor-ladder li { position:absolute; top:var(--step-y); left:0; width:100%; line-height:1.12; transform:translateY(-50%); }
.floor-ladder.big-floors { font-size:max(8px,1.25cqw); }
.floor-ladder .flag { font-size:1.16em; }
.floor-ladder .current { color:#ffe152; outline:2px solid #ffdc4b; border-radius:.45em; box-shadow:0 0 .28em #ff9a36; }
.floor-ladder .cleared { color:#a4f4e3; }
.jumper { left:0; top:52.73%; width:19.66%; height:29.2%; pointer-events:none; z-index:2; }
.jumper img { width:100%; height:100%; }
.choices { left:21.35%; top:66.5%; width:62.6%; height:11.4%; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1.4%; }
.choices button { position:relative; min-width:0; min-height:44px; border:0; padding:0 4%; background:transparent; color:#1a1836; font-size:clamp(17px,3.9cqw,64px); font-weight:850; line-height:1.07; letter-spacing:-.045em; overflow-wrap:anywhere; border-radius:20%; touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
.choices button.long { font-size:clamp(13px,2.22cqw,37px); }
.choices button.medium { font-size:clamp(15px,2.85cqw,50px); }
@media (hover:hover) { .choices button:enabled:hover { color:#6e2b69; } }
.choices button:enabled:active,.choices button.picked { color:#783435; }
.choices button:is(:active,.picked)::after {
  content:""; position:absolute; z-index:3; pointer-events:none; bottom:87%; right:3%;
  width:44%; aspect-ratio:245/159; background:url("records/press-impact.df3dfe3700ed.webp") center / contain no-repeat;
}
.choices button.landed::after {
  bottom:76%; right:16%; width:68%; aspect-ratio:236/220;
  background-image:url("records/answer-medal.a282b5db9f9b.webp"); transform-origin:50% 90%;
  animation:land-medal 160ms ease-out;
}
@keyframes land-medal { from {transform:scale(.72) rotate(-8deg)} 70% {transform:scale(1.08)} to {transform:none} }
@media (prefers-reduced-motion:reduce) { .choices button.landed::after { animation:none; } }
.jump-feedback { bottom:2%; left:50%; transform:translateX(-50%); color:white; background:#231535ef; border-radius:1em; padding:.12em .85em; font-weight:800; font-size:clamp(14px,2cqw,30px); white-space:nowrap; z-index:3; }
.jump-feedback:empty { display:none; }
.vista { text-align:center; }
@media (1.48 < aspect-ratio < 1.52) {
  .tower-game[data-segment="1"] .vista { background:url("play/pinball-postcard.a74d57acc20f.webp") center / cover; }
}
.ribbon,.cheering,.earned,.next-world { position:absolute; }
.ribbon { top:0; left:22.25%; width:56.2%; aspect-ratio:863/447; background:url("play/ribbon.880cd543ebe1.webp") center / contain no-repeat; }
.ribbon h2,.ribbon p { position:absolute; left:50%; transform:translateX(-50%); width:87%; text-align:center; white-space:nowrap; line-height:1; }
.ribbon h2 { top:61.7%; transform:translate(-50%,-50%); font-size:8.4cqw; font-weight:950; letter-spacing:-.06em; color:white; -webkit-text-stroke:.065em #36104b; paint-order:stroke fill; text-shadow:0 .06em #451b56,0 .09em #fdbe52; }
.ribbon h2 b,.next-world b { color:#ffdc41; }
.ribbon p { line-height:1.3; top:81.8%; width:48%; font-size:3.4cqw; color:#301b3d; font-weight:900; }
.ribbon p.extended { top:84.5%; font-size:1.8cqw; }
.cheering { left:9.8%; top:40.6%; width:26.4%; }
.earned { left:60%; top:47%; width:32%; aspect-ratio:16/9; object-fit:cover; border:.55cqw solid #ffe5a0; border-radius:1.4cqw; box-shadow:0 .55cqw #4c1b50,0 .2cqw 1.15cqw #49204b; rotate:3deg; }
.next-world .action-label { position:absolute; left:4%; width:76%; top:42.5%; transform:translateY(-50%); text-align:center; }
.next-world { left:26.1%; top:78.6%; width:47.85%; aspect-ratio:734/174; border:0; padding:0 10% .7% 3%; white-space:nowrap; background:transparent url("play/continue.1d3a5a629054.webp") center / contain no-repeat; font-weight:950; font-size:5.3cqw; line-height:1; color:white; -webkit-text-stroke:.085em #371543; paint-order:stroke fill; text-shadow:0 .065em #411849; }
.vista:not([hidden]) .earned { animation:earn-medal .65s ease-out both; }
.vista:not([hidden]) .cheering { animation:cheer .65s ease-out both; }
@keyframes earn-medal { from {opacity:0;transform:scale(.6) rotate(-12deg)} 70% { transform:scale(1.06) rotate(3deg) } to {opacity:1;transform:none} }
@keyframes cheer { from {transform:translateY(16%) scale(.92)} 60% {transform:translateY(-5%)} to {transform:none} }
/* The ready marquee, name plate and record ticket are crops of the same
   illustrated cabinet. Interactive content sits in its painted recesses. */
.tower-game { --kiosk-width:min(100%,max(355px,56svh),590px); }
.tower-game:is([data-screen="ready"],[data-screen="result"],[data-screen="failure"]) {
  align-content:center; gap:3px; padding:0 0 max(4px,env(safe-area-inset-bottom));
}
.tower-game:is([data-screen="ready"],[data-screen="result"],[data-screen="failure"]) .playing-field { display:none; }
.tower-game[data-screen="ready"] { --kiosk-width:min(100%,max(355px,58svh),600px); }
.ready-ticket,.record-ticket { width:var(--kiosk-width); text-align:center; }
.ready-hero { margin:0; line-height:0; }
.ready-hero img { width:100%; height:auto; display:block; }
.launch-panel,.record-header,.record-body { position:relative; container-type:inline-size; background-size:100% 100%; }
.launch-panel { aspect-ratio:643/384; background-image:url("records/launch-panel.eb7268125b6d.webp"); }
.launch-panel :is(.player-name,.ready-grade,.ready-rule,#start),
.record-header :is(span,strong),.record-body > :is(h2,.record-stars,.correction,.travel-picture,.run-stats,.record-actions) {
  position:absolute; margin:0;
}
.player-name,.ready-grade,.ready-rule,#start,.record-header span,.record-header strong,#record,.correction,.run-stats > div,.record-actions > * {
  display:flex; justify-content:center; align-items:center; text-align:center;
}
.player-name { left:32%; width:53%; top:4%; height:20%; color:#321348; font-size:clamp(18px,6.8cqw,48px); font-weight:950; letter-spacing:-.055em; white-space:nowrap; }
.ready-grade { left:39%; width:32%; top:27.4%; height:13%; font-size:clamp(13px,4.3cqw,29px); font-weight:850; white-space:nowrap; }
.ready-rule { display:block; align-content:center; left:9%; width:82%; top:42.4%; height:14%; color:#371a43; font-size:clamp(14px,4.15cqw,28px); font-weight:750; white-space:pre-wrap; }
#start { left:6%; width:88%; top:58%; height:37%; min-height:56px; border:0; border-radius:16% / 40%; padding:0 4% 2% 13%; background:transparent; color:#37104f; font-size:clamp(22px,8.15cqw,55px); line-height:1.05; font-weight:950; letter-spacing:-.06em; }
.record-header { aspect-ratio:643/269; background-image:url("records/record-header.91f24a655e41.webp"); color:white; text-shadow:0 2px #3d1054; }
.record-header span { top:57%; left:20%; width:60%; height:15%; color:#ffedbc; font-size:clamp(14px,3.45cqw,23px); font-weight:800; }
.record-header strong { top:72%; left:21%; width:58%; height:24%; font-size:clamp(16px,7.6cqw,48px); font-weight:950; line-height:1; letter-spacing:-.05em; word-break:keep-all; }
.record-header strong.extended { font-size:clamp(12px,4.2cqw,26px); }
.record-body { aspect-ratio:643/851; background-image:url("records/record-body.9989039c3f4d.webp"); }
#record { white-space:nowrap; left:15%; width:70%; top:0; height:15.7%; font-size:clamp(32px,12.1cqw,76px); letter-spacing:-.065em; font-weight:950; }
.record-stars { left:8.3%; width:83.4%; top:15%; height:5.6%; display:grid; grid-template-columns:repeat(10,minmax(0,1fr)); align-items:center; gap:1%; }
.record-stars span { aspect-ratio:1; background:url("records/progress-star.a5f2bd8045c2.webp") center / contain no-repeat; filter:grayscale(1); opacity:.33; }
.record-stars span.lit { filter:none; opacity:1; }
.correction { left:9%; width:82%; top:23.9%; height:14%; flex-direction:column; gap:2%; }
.correction small { font-size:clamp(12px,3.15cqw,24px); font-weight:750; color:#693c77; }
#pair { font-size:clamp(17px,6.9cqw,44px); line-height:1.12; overflow-wrap:anywhere; word-break:keep-all; letter-spacing:-.04em; }
.travel-picture { left:6.9%; width:86.2%; top:39.8%; height:24.8%; overflow:hidden; isolation:isolate; border-radius:4% / 12%; background:#311649; }
.travel-picture img { display:block; width:100%; height:100%; object-fit:cover; object-position:50% 28%; }
#floor-pin { position:absolute; right:1.5%; bottom:3%; width:13%; aspect-ratio:1; background:url("records/floor-pins.106600802a50.webp") 0 center / 1000% 100% no-repeat; background-position-x:calc(var(--pin,0) * 100% / 9); }
.run-stats { left:6.8%; width:86.4%; top:66.4%; height:12.5%; display:grid; grid-template-columns:1fr 1fr; gap:2%; font-variant-numeric:tabular-nums; }
.run-stats > div { flex-direction:column; gap:.2em; }
.run-stats dt { margin-left:10%; font-size:clamp(14px,3.3cqw,22px); font-weight:800; }
.run-stats dd { margin:0; font-size:clamp(17px,5cqw,35px); line-height:1.3; font-weight:900; }
.record-actions { left:4.5%; width:91%; top:82.5%; height:13%; display:grid; grid-template-columns:1fr 1fr; gap:1.5%; }
.record-actions > * { min-width:0; min-height:44px; padding:0 3% 3% 18%; border:none; border-radius:14% / 37%; background:transparent; color:#2e123c; font-size:clamp(13px,4.55cqw,28px); font-weight:900; letter-spacing:-.06em; text-decoration:none; white-space:nowrap; }
.record-actions #retry { color:white; text-shadow:0 1px 2px #360a65; }
.game-links { width:var(--kiosk-width); container-type:inline-size; display:flex; justify-content:center; gap:1%; padding:0 1%; max-width:100%; }
.game-links a { flex:0 1 24%; max-width:145px; min-width:0; min-height:52px; aspect-ratio:1.15; display:flex; align-items:flex-end; justify-content:center; padding:0 1px 4%; border-radius:18%; background:var(--key-art) center / 100% 100% no-repeat; color:#2d1547; text-decoration:none; text-align:center; font-size:clamp(12px,3.8cqw,21px); font-weight:850; letter-spacing:-.055em; line-height:1; white-space:nowrap; }
.nav-home { --key-art:url("records/nav-home.92bd3d4584d8.webp"); }
.nav-study { --key-art:url("records/nav-study.03346d9d4390.webp"); }
.nav-hall { --key-art:url("records/nav-hall.fcc50752c2ad.webp"); }
.nav-share { --key-art:url("records/nav-share.0c05ef6d4e26.webp"); }
.game-links .nav-home { color:white; text-shadow:0 1px 2px #340f69; }
.game-links .nav-share { font-size:clamp(11px,3cqw,17px); }
.tower-game:is([data-screen="round"],[data-screen="milestone"]) .game-links { display:none; }
.tower-game:is([data-screen="round"],[data-screen="milestone"]) .game-links:has([data-distribute]) {
  display:flex; position:absolute; right:max(5px,env(safe-area-inset-right)); bottom:max(4px,env(safe-area-inset-bottom)); width:clamp(78px,8vw,104px); padding:0;
}
.tower-game:is([data-screen="round"],[data-screen="milestone"]) .game-links a:not([data-distribute]) { display:none; }
.tower-game:is([data-screen="round"],[data-screen="milestone"]) [data-distribute] { flex-basis:100%; aspect-ratio:1.4; padding-bottom:11%; font-size:12px; }
.game-links a:hover,.record-actions > :hover,#start:hover { filter:brightness(1.08); }
.game-links a:active,.record-actions > :active,#start:active { transform:translateY(2px); }
#failure { width:min(90%,445px); padding:clamp(23px,5vw,42px); text-align:center; border:12px solid transparent; border-image:url("lobby/small.bf0e57695f94.webp") 20 fill / 15px stretch; }
#failure p { margin:.7em 0; }
#recover { min-height:52px; width:100%; border:0; background:transparent url("lobby/start-wide.1ba8ed1848e3.webp") center / 100% 100% no-repeat; font-weight:900; color:#361244; }
@media (min-width:660px) and (min-aspect-ratio:6/5) {
  .ready-ticket,.record-ticket { width:min(94vw,max(650px,115svh),1080px); }
  .ready-ticket { display:grid; grid-template-columns:1.05fr 1fr; align-items:center; gap:1%; }
  .ready-hero img,.launch-panel { border-radius:4%; }
  .game-links { width:min(92vw,max(370px,66svh),610px); padding:0; }
  .game-links a { padding-bottom:3.2%; }
  .record-ticket {
    display:grid; grid-template-columns:1fr 1fr; grid-template-rows:auto auto auto auto auto; gap:8px 3%; align-items:center;
    padding:clamp(12px,2vw,26px); border:6px solid transparent; border-image:url("lobby/small.bf0e57695f94.webp") 22 fill / 16px stretch;
  }
  .record-body { display:contents; }
  .record-header { grid-area:1/1/4/2; width:100%; border-radius:14px; }
  .record-body > :is(h2,.record-stars,.correction,.travel-picture,.run-stats,.record-actions) { position:relative; inset:auto; width:100%; height:auto; }
  #record { grid-area:1/2; font-size:clamp(30px,4.5vw,70px); }
  .record-stars { grid-area:2/2; max-width:94%; justify-self:center; }
  .correction { grid-area:3/2; background:#eddcf8; border-radius:12px; padding:8px; }
  .correction small,.run-stats dt { font-size:clamp(14px,1.3vw,19px); }
  #pair { font-size:clamp(17px,2.5vw,35px); }
  .travel-picture { grid-area:4/1/6/2; aspect-ratio:2.3; }
  .run-stats { grid-area:4/2; background:#f9eef1; padding:10px 0; border-radius:12px; }
  .run-stats dd { font-size:clamp(19px,2.4vw,33px); }
  .run-stats dt { margin:0; }
  .record-actions { grid-area:5/2; }
  .record-actions > * { aspect-ratio:2.55; padding-left:14%; background:center / 100% 100% no-repeat; font-size:clamp(12px,1.45vw,22px); }
  .record-actions #retry { background-image:url("records/retry-key.b1d846edcdc3.webp"); }
  .record-actions #review { background-image:url("records/review-key.f0d6c6b3477d.webp"); }
}
.tower-game :is(a,button):focus-visible { outline:3px solid #40f3f7; outline-offset:2px; box-shadow:0 0 0 5px #432151; }
@media (max-aspect-ratio:1/1) {
  .playing-field { width:min(100%,66.6667svh); aspect-ratio:2 / 3; }
  .live-round { --controls:url("play/controls-phone.05bbeab137a7.webp"); --first:url("play/first-phone.93425c1e9d15.webp"); }
  .round-home { top:.5%; left:31.8%; width:36.4%; height:12.4%; }
  .stage-display { left:17.1%; width:38%; top:13.7%; height:4.95%; }
  .stage-display b { font-size:6cqw; }
  .stage-display strong { font-size:max(12px,4.12cqw); }
  #floor.wide { font-size:3.9cqw; }
  .timer-display { left:73.1%; width:17%; top:13.7%; height:4.95%; font-size:5.8cqw; }
  .question-board { left:17.1%; width:55.7%; top:31.6%; height:18.6%; }
  .question-board small { align-content:center; font-size:max(14px,5.5cqw); }
  .question-board strong { font-size:19cqw; }
  .question-board strong.medium { font-size:10.8cqw; }
  .question-board strong.long { font-size:7cqw; }
  .floor-ladder { left:83.65%; top:25.95%; width:8.1%; height:34.32%; font-size:max(9px,2.6cqw); }
  .floor-ladder.big-floors { font-size:max(8px,2cqw); }
  .jumper { left:12.5%; top:54.1%; width:34%; height:19.66%; }
  .choices { left:3.6%; top:74.3%; width:92.8%; height:7.7%; gap:1.2%; }
  .choices button { font-size:max(17px,6.1cqw); }
  .choices button.medium { font-size:max(14px,4.5cqw); }
  .choices button.long { font-size:max(13px,3.7cqw); }
  .jump-feedback { bottom:2%; font-size:4.4cqw; }
  .ribbon { top:4%; left:1%; width:98%; }
  .ribbon h2 { font-size:12.4cqw; }
  .ribbon p { font-size:5.8cqw; }
  .ribbon p.extended { font-size:3.25cqw; }
  .cheering { left:2%; top:40%; width:44%; }
  .earned { left:49%; top:49%; width:48%; }
  .next-world { left:7%; width:86%; top:80%; font-size:8.8cqw; padding-right:17%; }
}
@media (prefers-reduced-motion:reduce) { .vista:not([hidden]) :is(.earned,.cheering) { animation:none; } }

#achievement:focus,#prompt:focus { outline:none; }

.live-round.bare :is(.question-board,.choices button) { background:#fff2da; border:2px solid #de9341; border-radius:12px; }
.live-round.bare :is(.stage-display,.timer-display,.floor-ladder) { background:#211738; }
