#choose { background: var(--butter-deep) url("/games/_shared/sea.svg") center bottom / cover no-repeat; }
.choice img { width: min(13vw, 18vh, 172px); }

/* ---------- Scene ---------- */
.play { --up: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: var(--butter); }
.sky, .sky > * { position: absolute; inset: 0; }
.sky { overflow: hidden; background: linear-gradient(var(--butter-deep) 0 16%, var(--butter) 16%); }
.sky-dusk { background: #f08a78; opacity: calc((var(--up) - .15) * 2.2); transition: opacity 1.4s; }
.sky-night { background: #7a2f5c url("/games/_shared/night.svg") center / cover; opacity: calc((var(--up) - .5) * 2.4); transition: opacity 1.4s; }
.sky .sun { inset: auto; left: 70%; top: 13%; width: min(20vw, 26vh); aspect-ratio: 1; border-radius: 50%; background: #fffdf2; border: calc(min(20vw, 26vh) * .17) solid #fff4cf; transform: translateY(calc(var(--up) * 60vh)); transition: transform 1.4s ease-out; }
.sky .hills { inset: 34% 0 0; background: url("/games/_shared/hills.svg") center top / max(100%, 900px) auto no-repeat; transform: translateY(calc(var(--up) * 46vh)); transition: transform 1.4s ease-out; }
.stage { position: relative; z-index: 2; min-height: 0; container-type: size; }
.tree { position: absolute; left: 1.5%; bottom: -4%; height: 76%; }
.stage-pip { position: absolute; left: 17%; bottom: -5%; width: min(21vw, 30vh); width: min(21cqw, 62cqh); }
.trapped { position: absolute; left: 51%; top: 5%; translate: -50% 0; width: min(36vw, 36vh); width: min(40cqw, 80cqh); aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; animation: drift 5s ease-in-out infinite; }
.trapped img { position: relative; width: 62%; }
.trapped.gone { visibility: hidden; }
@keyframes drift { 50% { translate: -50% -6px; } }
.friends { position: absolute; right: max(8%, 92px); bottom: 1%; width: 25%; display: flex; flex-wrap: wrap-reverse; justify-content: center; align-content: flex-start; pointer-events: none; }
.friend { position: relative; z-index: 1; width: 31%; margin: -1% 1%; }
/* The second row stands close behind the first, so nobody floats. */
.friend:nth-child(n + 4) { z-index: 0; margin-bottom: -13%; }
.friend.waiting { visibility: hidden; }
.meter { position: absolute; right: max(34px, env(safe-area-inset-right)); top: 92px; bottom: 2%; width: 36px; display: flex; flex-direction: column; align-items: center; }
.meter img { width: 44px; margin-bottom: -2px; z-index: 1; }
.track { position: relative; flex: 1; width: 16px; border-radius: 8px; background: var(--cream); }
.track .fill { position: absolute; inset: auto 0 0; height: calc(var(--up) * 100%); border-radius: 8px; background: #fbbf24; transition: height 1.2s ease-out; }
.track .rider { position: absolute; left: 50%; bottom: calc(var(--up) * 100%); width: 50px; translate: -50% 40%; padding: 8px; border-radius: 50%; background: rgb(255 255 255 / .65); border: 3px solid #fff; transition: bottom 1.2s ease-out; pointer-events: none; }

/* ---------- Island: letters and keys ---------- */
.ground { position: relative; z-index: 1; background: var(--grass); }
.ground::before { content: ""; position: absolute; left: -15%; right: -15%; top: -34px; height: 130px; border-radius: 50% 50% 0 0 / 100% 100% 0 0; background: var(--grass); border-top: 12px solid var(--grass-light); }
.letters {
  --gap: clamp(5px, 1.4vw, 18px);
  --size: min(108px, 11vh, calc((100vw - 28px - (var(--n) - 1) * var(--gap)) / var(--n)));
  position: relative; display: flex; justify-content: center; gap: var(--gap); padding: 8px 14px 16px;
}
.letter { position: relative; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; font-size: calc(var(--size) * .58); font-weight: 700; line-height: 1; }
.letter .bubble-svg circle:first-child { fill-opacity: .72; }
.letter span { position: relative; color: #51615f; }
.letter.secret span { visibility: hidden; }
/* The ink line is what makes the ring stand out from the grass. */
.letter.now { border-radius: 50%; box-shadow: 0 0 0 4px var(--ink), 0 0 0 9px var(--gold); }
.letter.popped { background: var(--pop); animation: letter-pop .28s ease-out; }
.letter.popped .bubble-svg { display: none; }
.letter.popped span { color: var(--ink); }
.letter.popped::after { content: ""; position: absolute; left: 17%; top: 14%; width: 28%; height: 13%; border-radius: 50%; background: rgb(255 255 255 / .75); rotate: -38deg; }
@keyframes letter-pop { 0% { transform: scale(.2); } 55% { transform: scale(1.22); } 78% { transform: scale(.93); } }

.earth { position: relative; background: var(--earth); padding: 14px 8px max(18px, env(safe-area-inset-bottom)); }
.earth::before { content: ""; position: absolute; left: 0; right: 0; top: -11px; height: 12px; background: radial-gradient(ellipse 50% 100% at 50% 100%, var(--earth) 98%, transparent) 0 0 / 150px 100% repeat-x; }
.earth::after { content: ""; position: absolute; inset: 62% 0 0; background: var(--earth-deep); border-radius: 50% 50% 0 0 / 26px 26px 0 0; }
.keys { position: relative; z-index: 1; display: grid; gap: 14px; justify-content: center; }
.key-row { display: flex; justify-content: center; gap: clamp(4px, .8vw, 9px); }
.keys .key { width: min(98px, 7.4vw + 4px, calc((100vw - 16px - 9 * clamp(4px, .8vw, 9px)) / 10)); height: clamp(40px, 7.8vh, 80px); font-size: clamp(20px, 3.2vw, 36px); }
.keys .bump::after { content: ""; position: absolute; left: 50%; bottom: 7%; width: 24%; height: 4px; border-radius: 2px; translate: -50% 0; background: var(--ink); opacity: .5; }

@media (max-aspect-ratio: 1/1) {
  .trapped { top: 12%; width: min(56vw, 36vh); width: min(60cqw, 58cqh); }
  .tree { height: 42%; left: -4%; }
  .stage-pip { left: 5%; width: min(30vw, 22vh); width: min(30cqw, 34cqh); }
  .friends { width: 38%; right: max(9%, 60px); }
  .sky .hills { inset: 48% 0 0; }
}
@media (max-width: 480px) {
  .keys .key { border-radius: 10px; height: 54px; }
  .tree { display: none; }
  .stage-pip { left: 2%; }
  .trapped { top: 15%; left: 46%; width: min(60cqw, 55cqh); }
  .meter { right: 12px; }
  .friends { right: 56px; width: 48%; }
}
@media (max-height: 500px) {
  .round-btn { width: 48px; height: 48px; }
  .keys { gap: 8px; }
  .keys .key { height: 36px; font-size: 20px; border-radius: 10px; box-shadow: 0 4px 0 var(--earth-edge); }
  .letters { --size: 44px; padding: 0 14px 12px; }
  .earth { padding: 6px 8px 8px; }
  .meter { top: 70px; }
  .meter img { width: 26px; }
  .track .rider { width: 34px; padding: 4px; }
}
