/* MOTION (2026-11-10, speed plan step 3, the owner: "very very fast and smooth, with crazy animations just like an iPhone").
   One motion language for the whole game, loaded last (after liquid.css). Only transform, translate and opacity move, so the phone's graphics
   chip does the work and nothing is laid out again while it moves. The curves are real damped springs (written as linear() points; phones
   without linear() get a close cubic curve):
     --sp-smooth  big panels: the phone, place cards, apps opening (rises fast, settles with a hair of overshoot, like iOS sheets)
     --sp-bouncy  pop-ups (a little overshoot, then settle)
     --sp-snappy  small things (presses, chips)
   Leaving is always quicker than arriving (an ease-in, no bounce). Fingers: js/motion.js (drag the phone or a card down to close, swipe back from
   the left edge with the page following, apps zoom from the icon you tapped). "Reduce motion" on the phone: simple fades only. */
:root {
  --sp-smooth: cubic-bezier(.2, .9, .25, 1);
  --sp-bouncy: cubic-bezier(.34, 1.3, .64, 1);
  --sp-snappy: cubic-bezier(.3, 1.15, .5, 1);
  --mo-leave: cubic-bezier(.4, 0, .9, .55);
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --sp-smooth: linear(0, 0.0508, 0.1647, 0.3016, 0.4381, 0.5618, 0.6675, 0.7538, 0.8221, 0.8745, 0.9137, 0.9424, 0.9628, 0.977, 0.9866, 0.993, 0.9969, 0.9993, 1.0007, 1.0013, 1.0015, 1.0015, 1.0013, 1.0011, 1);
    --sp-bouncy: linear(0, 0.0416, 0.1435, 0.2769, 0.4207, 0.5601, 0.6858, 0.7926, 0.8789, 0.9449, 0.9924, 1.0242, 1.0432, 1.0523, 1.0542, 1.0512, 1.0453, 1.0379, 1.0301, 1.0226, 1.0159, 1.0103, 1.0059, 1.0025, 1, 0.9985, 0.9975, 0.9971, 0.9971, 0.9973, 1);
    --sp-snappy: linear(0, 0.0694, 0.2204, 0.3936, 0.5565, 0.6938, 0.8012, 0.8801, 0.9348, 0.9704, 0.9921, 1.004, 1.0095, 1.0111, 1.0105, 1.0089, 1.007, 1.0051, 1.0036, 1.0023, 1);
  }
}

/* ---------- the phone and the place cards: rise on the smooth spring, leave quickly; a finger can hold them (js/motion.js, class .mo-drag) ---------- */
.phone, .sheet { transition: transform .3s var(--mo-leave), translate .45s var(--sp-smooth); }
.phone.on, .sheet.on { transition: transform .52s var(--sp-smooth), translate .45s var(--sp-smooth); }
.phone.mo-drag, .sheet.mo-drag, .phone .screen.mo-drag { transition: none !important; }

/* ---------- apps open from the icon you tapped (js/motion.js sets --zx/--zy on the phone) and fall back into it ---------- */
.phone .screen { transform: scale(.2); opacity: 0; transform-origin: var(--zx, 50%) var(--zy, 72%); transition: transform .28s var(--mo-leave), opacity .2s ease-in .06s, translate .4s var(--sp-smooth); }
.phone .screen.on { transform: none; opacity: 1; transition: transform .5s var(--sp-smooth), opacity .14s ease-out, translate .4s var(--sp-smooth); }

/* ---------- pop-ups: a bouncy arrival (the liquid look keeps its own "pour" arrival, which is more specific) ---------- */
.modal { animation: moFade .18s ease-out both; }
.modal .box { animation: moPop .48s var(--sp-bouncy) both; }
@keyframes moFade { from { opacity: 0; } }
@keyframes moPop { from { opacity: 0; transform: scale(.86) translateY(14px); } }

/* ---------- presses: in fast, back out on a spring (the liquid look has its own, more specific) ---------- */
.btn, .act, .chip, .pbtn { transition: transform .42s var(--sp-snappy), background-color .2s, color .2s, box-shadow .2s, opacity .2s, border-color .2s; }
.btn:active:not(:disabled), .pbtn:active { transform: scale(.96); transition-duration: .08s; }
.act:active { transform: scale(.98); transition-duration: .08s; }

/* ---------- "reduce motion": nothing flies or bounces, things fade ---------- */
@media (prefers-reduced-motion: reduce) {
  .phone, .sheet, .phone.on, .sheet.on { transition-duration: .2s !important; transition-timing-function: ease !important; }
  .phone .screen, .phone .screen.on { transform: none !important; transition: opacity .2s ease !important; }
  .modal .box { animation: moFade .2s ease both; }
  .btn:active:not(:disabled), .pbtn:active, .act:active { transform: none; }
}
