/* Ice Cream Tower: a sunny boardwalk with Alanna's kiosk and a giant cone on a striped stand.
   The world is a tall column of sky (beach, birds, clouds, a plane, stars and the moon) that slides
   down as the tower grows. --u is 1% of the stage's height. The world is twelve screens wide (and
   grows taller with the tower), so there's still beach and sky all round when it zooms out at the end. */
.icecream { background: #bfe9ff; }
.icecream .hud-time.low { background: #ffd6d8; animation: pulse .5s ease-in-out infinite; }
.icecream .ic-stage { flex: 1; position: relative; min-height: 0; overflow: hidden; container-type: size; }
.icecream .ic-view { position: absolute; inset: 0; overflow: hidden; --u: 1cqh; background: #c8eeff; }
.icecream .ic-world { position: absolute; left: -550%; width: 1200%; bottom: 0; height: calc(var(--u) * var(--top, 480)); transform-origin: 50% 100%;
  transition: transform .7s cubic-bezier(.3, .8, .3, 1); will-change: transform;
  background: linear-gradient(to top, #c8eeff 0, #8fd6ff calc(var(--u) * 70), #6fb8f5 calc(var(--u) * 150), #8a8ee8 calc(var(--u) * 215),
    #5a55c0 calc(var(--u) * 260), #2a2a72 calc(var(--u) * 320), #11113a calc(var(--u) * 400), #0b0b26 100%); }
.icecream .ic-ground, .icecream .ic-high { position: absolute; left: 45.8333%; width: 8.3333%; bottom: 0; top: 0; }
.icecream .ic-stars { position: absolute; left: 37.5%; width: 25%; bottom: 0; top: 0; }

/* ---------- the beach ---------- */
.icecream .ic-board { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--u) * 7); border-top: 3px solid var(--ink);
  background: repeating-linear-gradient(90deg, #dba46a 0 calc(var(--u) * 7), #c98a52 calc(var(--u) * 7) calc(var(--u) * 7.4)); }
.icecream .ic-sand { position: absolute; left: 0; right: 0; bottom: calc(var(--u) * 7); height: calc(var(--u) * 5); background: #f6dfa6; }
.icecream .ic-sea { position: absolute; left: 0; right: 0; bottom: calc(var(--u) * 12); height: calc(var(--u) * 15); background: linear-gradient(#3fb6ec, #6fd2f5); border-top: 3px solid #2a8fc4; overflow: hidden; }
.icecream .ic-sea i { position: absolute; left: -10%; right: -10%; height: calc(var(--u) * 1.2); border-top: 3px solid rgba(255, 255, 255, .7); border-radius: 50%; animation: ic-wave 3s ease-in-out infinite alternate; }
.icecream .ic-sea .w1 { top: 30%; }
.icecream .ic-sea .w2 { top: 65%; animation-delay: -1.5s; }
.icecream .ic-sun { position: absolute; right: 12%; bottom: calc(var(--u) * 58); width: calc(var(--u) * 16); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #fffbe0 0 34%, #ffe066 35% 48%, rgba(255, 224, 102, .4) 49% 64%, transparent 72%); }
.icecream .ic-palm { position: absolute; bottom: calc(var(--u) * 6); height: calc(var(--u) * 44); transform-origin: 50% 100%; animation: ic-palm 5s ease-in-out infinite; }
.icecream .ic-palm svg { display: block; height: 100%; width: auto; }
.icecream .ic-palm.p1 { left: -3%; }
.icecream .ic-palm.p2 { right: -2%; animation-delay: -2.5s; }
.icecream .ic-kiosk { position: absolute; left: 2%; bottom: calc(var(--u) * 5); height: calc(var(--u) * 46); }
.icecream .ic-kiosk svg { display: block; height: 100%; width: auto; }
.icecream .ic-hero { position: absolute; left: calc(2% + var(--u) * 37); bottom: calc(var(--u) * 5.5); height: calc(var(--u) * 28); }
.icecream .ic-hero-in { position: relative; height: 100%; transform-origin: 50% 100%; }
.icecream .ic-hero .avatar-svg { display: block; height: 100%; width: auto; }
.icecream .ic-scooper { position: absolute; right: calc(var(--u) * -4.5); bottom: calc(var(--u) * 9); width: calc(var(--u) * 9); }
.icecream .ic-scooper svg { display: block; width: 100%; height: auto; }
.icecream .ic-hero-in.toss { animation: ic-toss .45s ease-out; }
.icecream .ic-hero-in.cheer { animation: ic-cheer .7s ease-out; }
.icecream .ic-fans { position: absolute; left: calc(56% + var(--u) * 16); bottom: calc(var(--u) * 5.5); display: flex; align-items: flex-end; gap: calc(var(--u) * 1.5); font-size: calc(var(--u) * 12); line-height: 1; }
.icecream .ic-fan .critter-svg, .icecream .ic-giraffe .critter-svg { display: block; }
.icecream .ic-fan.f1 { font-size: calc(var(--u) * 10); }
.icecream .ic-giraffe { position: absolute; right: 8%; bottom: calc(var(--u) * 5.5); font-size: calc(var(--u) * 44); line-height: 1; }
.icecream .ic-fan.hop, .icecream .ic-giraffe.hop { animation: ic-hop .5s ease-out; }

/* ---------- way up high ---------- */
.icecream .ic-stars { pointer-events: none; }
.icecream .ic-stars i { position: absolute; width: calc(var(--u) * .9); height: calc(var(--u) * .9); border-radius: 50%; background: #fff; box-shadow: 0 0 calc(var(--u) * .8) #fff; animation: ic-twinkle 2.4s ease-in-out infinite; }
.icecream .ic-deco { position: absolute; translate: -50% 0; }
.icecream .ic-deco > svg { display: block; height: 100%; width: auto; overflow: visible; }
.icecream .ic-deco.balloon > svg { animation: ic-bob 4s ease-in-out infinite alternate; }
.icecream .ic-deco.cloud { opacity: .95; }
.icecream .ic-deco.plane { translate: 0 0; animation: ic-plane 16s linear infinite; }
.icecream .ic-deco.moon > svg { animation: ic-bob 6s ease-in-out infinite alternate; }
.icecream .fl-bird { transform-box: fill-box; transform-origin: 50% 70%; animation: ic-flap .32s ease-in-out infinite alternate; }

/* the milestones along the right edge */
.icecream .ic-ruler { position: absolute; right: 1%; top: 0; bottom: 0; width: calc(var(--u) * 9); pointer-events: none; }
.icecream .ic-mark { position: absolute; right: 0; translate: 0 50%; display: flex; align-items: center; gap: calc(var(--u) * .6); }
.icecream .ic-mark i { width: calc(var(--u) * 3.5); border-top: 3px dashed rgba(255, 255, 255, .9); }
.icecream .ic-mark b { display: grid; place-items: center; min-width: calc(var(--u) * 6.5); height: calc(var(--u) * 6.5); padding: 0 calc(var(--u) * .8); border-radius: 999px;
  background: rgba(255, 255, 255, .85); border: 3px solid var(--ink); font-size: calc(var(--u) * 3.8); white-space: nowrap; }
.icecream .ic-mark.on b { background: #ffe14d; box-shadow: 0 0 calc(var(--u) * 2) #fff3a0; animation: ic-markpop .5s cubic-bezier(.2, 1.6, .4, 1); }
.icecream .ic-mark.best i { border-top-color: #ffd23f; }
.icecream .ic-mark.best b { background: #fff3b0; font-size: calc(var(--u) * 2.8); }

/* ---------- the tower ---------- */
.icecream .ic-tower { position: absolute; bottom: 0; width: 0; }
.icecream .ic-stand { position: absolute; left: 0; bottom: calc(var(--u) * 5.43); width: calc(var(--u) * 22); translate: -50% 0; }
.icecream .ic-cone { position: absolute; left: 0; bottom: calc(var(--u) * 26.3); width: calc(var(--u) * 19); translate: -50% 0; }
.icecream .ic-stand svg, .icecream .ic-cone svg { display: block; width: 100%; height: auto; overflow: visible; }
.icecream .ic-scoops { position: absolute; left: 0; bottom: 0; }
.icecream .ic-scoop { position: absolute; left: 0; width: calc(var(--u) * 21); transform: translateX(-50%); transform-origin: 50% 67%; will-change: transform; }
.icecream .ic-scoop svg, .icecream .ic-flyer svg { display: block; width: 100%; height: auto; overflow: visible; }
.icecream .ic-scoop.land svg { transform-origin: 50% 85%; animation: ic-land .45s ease-out; }
.icecream .ic-scoop .ic-cherry { position: absolute; left: 50%; bottom: 74%; width: 42%; translate: -50% 0; animation: ic-cherry .7s cubic-bezier(.3, 1.4, .5, 1) both; }
.icecream .ic-cherry svg { display: block; width: 100%; height: auto; overflow: visible; }

/* ---------- on the screen: the order, the wobble meter, flying scoops ---------- */
.icecream .ic-order { position: absolute; left: calc(var(--u) * 2); top: calc(var(--u) * 2.5); z-index: 5; max-width: min(56%, 640px); display: flex; align-items: center; gap: calc(var(--u) * 1.4);
  background: var(--paper); border: 4px solid var(--ink); border-radius: calc(var(--u) * 2.4); padding: calc(var(--u) * .6) calc(var(--u) * 2) calc(var(--u) * .6) calc(var(--u) * 1); box-shadow: 0 calc(var(--u) * .7) 0 rgba(58, 42, 74, .25); }
.icecream .ic-order[hidden] { display: none; }
.icecream .ic-order.pop { animation: ic-orderpop .35s cubic-bezier(.2, 1.5, .4, 1); }
.icecream .ic-order.sent { animation: ic-sent .35s ease-in forwards; }
.icecream .ic-order-pic { flex: none; width: calc(var(--u) * 9); }
.icecream .ic-order-pic svg { display: block; width: 100%; height: auto; }
.icecream .ic-word { font-size: min(calc(var(--u) * 7), 46px); font-weight: 800; letter-spacing: .04em; line-height: 1.2; }
.icecream .ic-word span.done { color: var(--good); }
.icecream .ic-word span.now { color: var(--coral-dark); text-decoration: underline .12em var(--coral); text-underline-offset: .18em; }
.icecream .ic-x { flex: none; align-self: center; background: var(--coral); color: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 0 calc(var(--u) * 1.2); font-size: min(calc(var(--u) * 4.6), 28px); }
.icecream .ic-x:empty { display: none; }
.icecream .ic-wob { position: absolute; right: calc(var(--u) * 11); top: calc(var(--u) * 2.5); z-index: 5; width: min(calc(var(--u) * 30), 30%); display: flex; align-items: center; gap: calc(var(--u) * 1.2);
  background: rgba(255, 250, 240, .92); border: 3px solid var(--ink); border-radius: 999px; padding: calc(var(--u) * .5) calc(var(--u) * 1.6); font-weight: 800; font-size: min(calc(var(--u) * 3.6), 20px); }
.icecream .ic-wob[hidden] { display: none; }
.icecream .ic-wob i { flex: 1; height: calc(var(--u) * 2.2); background: #ece6f7; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.icecream .ic-wob b { display: block; height: 100%; width: calc(var(--w, 0) * 100%); border-radius: 999px; background: linear-gradient(90deg, #3ccf7a, #ffd23f 55%, #ff5a5f); transition: width .15s; }
.icecream .ic-wob.danger { animation: ic-danger .3s ease-in-out infinite alternate; }
.icecream .ic-fx { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.icecream .ic-flyer { position: absolute; left: 0; top: 0; }
.icecream .ic-view.jolt .ic-world { animation: ic-jolt .4s ease-out; }
.icecream .ic-view.zoomed .ic-ruler { opacity: .9; }
.icecream .ic-sprinkle { position: absolute; top: -4%; width: calc(var(--u) * 1); height: calc(var(--u) * 2.8); border-radius: 999px; background: var(--c); animation: ic-sprinkle 1.8s ease-in forwards; }
.icecream .ic-comic { position: absolute; left: 50%; top: 32%; z-index: 7; translate: -50% -50%; white-space: nowrap; pointer-events: none; opacity: 0;
  font-size: min(calc(var(--u) * 9), 60px); font-weight: 800; color: #fff;
  text-shadow: 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink), 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 6px 0 var(--coral-dark), 0 8px 0 var(--ink); }
.icecream .ic-comic.show { animation: ic-comic 1.8s ease-out forwards; }

/* ---------- the start card ---------- */
.icecream .ic-panel { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 10px 16px; background: rgba(58, 42, 74, .16); }
.icecream .ic-panel[hidden] { display: none; }
.icecream .ic-card { background: var(--paper); border: 4px solid var(--ink); border-radius: 26px; box-shadow: 0 8px 0 rgba(58, 42, 74, .3); padding: 16px 28px 14px; text-align: center; max-width: 560px; animation: comicIn .35s cubic-bezier(.2, 1.4, .4, 1); }
.icecream .ic-card h3 { font-size: 30px; color: var(--grape); }
.icecream .ic-card p { font-size: 21px; font-weight: 700; margin: 6px 0 8px; line-height: 1.25; text-wrap: balance; }
.icecream .ic-card .ic-tip { font-size: 18px; color: var(--ink-soft); margin: 0 0 8px; }
.icecream .ic-enter { display: block; margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
@media (max-height: 640px) {
  .icecream .ic-card { padding: 8px 22px 8px; border-radius: 20px; }
  .icecream .ic-card h3 { font-size: 24px; }
  .icecream .ic-card p { font-size: 18px; margin: 2px 0 6px; }
  .icecream .ic-card .ic-tip { font-size: 16px; margin-bottom: 6px; }
  .icecream .ic-card .btn { padding: 6px 22px; }
}

@keyframes ic-wave { from { transform: translateX(-4%); } to { transform: translateX(4%); } }
@keyframes ic-palm { 0%, 100% { rotate: -2deg; } 50% { rotate: 2deg; } }
@keyframes ic-twinkle { 0%, 100% { opacity: .35; scale: .6; } 50% { opacity: 1; scale: 1.1; } }
@keyframes ic-bob { from { transform: translateY(-3%); } to { transform: translateY(3%); } }
@keyframes ic-flap { from { transform: scaleY(1); } to { transform: scaleY(-.5); } }
@keyframes ic-plane { from { left: -40%; } to { left: 120%; } }
@keyframes ic-land { 0% { transform: scale(1.15, .7); } 45% { transform: scale(.92, 1.12); } 75% { transform: scale(1.04, .96); } 100% { transform: none; } }
@keyframes ic-cherry { from { translate: -50% calc(var(--u) * -40); } to { translate: -50% 0; } }
@keyframes ic-toss { 0% { transform: none; } 40% { transform: translateY(-8%) rotate(-6deg); } 100% { transform: none; } }
@keyframes ic-cheer { 0%, 100% { transform: none; } 30% { transform: translateY(-14%); } 55% { transform: translateY(0); } 75% { transform: translateY(-7%); } }
@keyframes ic-hop { 0%, 100% { transform: none; } 40% { transform: translateY(-16%); } }
@keyframes ic-markpop { from { scale: .5; } to { scale: 1; } }
@keyframes ic-orderpop { from { scale: .7; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes ic-sent { to { scale: .85; opacity: .3; } }
@keyframes ic-danger { from { background: rgba(255, 250, 240, .92); } to { background: #ffd6d8; } }
@keyframes ic-jolt { 0%, 100% { translate: 0 0; } 25% { translate: calc(var(--u) * -1.2) 0; } 50% { translate: calc(var(--u) * 1) 0; } 75% { translate: calc(var(--u) * -.5) 0; } }
@keyframes ic-sprinkle { from { transform: translateY(0) rotate(0); opacity: 1; } to { transform: translateY(calc(var(--u) * 110)) rotate(var(--r)); opacity: .9; } }
@keyframes ic-comic { 0% { opacity: 0; scale: .3; rotate: -10deg; } 12% { opacity: 1; scale: 1.15; rotate: -5deg; } 22% { scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .icecream .ic-palm, .icecream .ic-sea i, .icecream .ic-deco.plane { animation: none; }
}
