/* ============================================================================
   Nexivo Design Kit — motion.css  (requires tokens.css; load AFTER kit.css)
   Every motion in every product comes from here. Rules (KIT.md ## Motion):
   appear = fade + 8 px rise · ease-out in AND out (never ease-in) · never from scale 0 · ≤ 200 ms when a tap caused it ·
   transform + opacity only (RTL-safe: no left/right, no margins, no inline-size/block-size) · springs = linear() minted offline ·
   reduced-motion keeps fades + colour, removes movement. CSS primitives work without JS; motion.js adds ink tabs, count-up,
   ticker, sheet gestures + snap points, toast stack, FLIP layout, magnetic buttons, row swipe actions, header collapse,
   view-transition navigation and the table (deal / pin / flip / toss / collect / turn / emote).
   Sources: docs/research/lane2-motion.md (vaul · sonner · Emil STANDARDS · Material 3 · baloot-game · Phaser · auto-animate)
   + lane 2b: kammelna-recon/HANDOVER.md (the real deal timings), Chrome view-transitions doc, iOS Mail swipe thresholds.
   ========================================================================== */

/* ---------------------------------------------------------------- motion-only tokens (tokens.css owns --ease / --ease-out-strong / --ease-drawer / --dur-*)
   Duration bands (Emil STANDARDS): press 100–160 · tooltip 125–200 · dropdown 150–250 · modal/sheet 200–500 · nothing tap-triggered > 200 except sheets. */
:root {
  --ease-anticipate: cubic-bezier(0.68, -0.6, 0.32, 1.6);   /* inOutBack (easings.net): chip-toss wind-up + flip lift ONLY */
  --ease-out-back:   cubic-bezier(0.34, 1.56, 0.64, 1);     /* outBack = Phaser Back.Out 1.70158: chip release pop, toss landing */
  --press-scale: 0.97; --row-press-scale: 0.985;            /* press range .95–.98, never lower (Emil + Rauno ~.96) */
  --ease-deal: cubic-bezier(0.165, 0.84, 0.44, 1);          /* Kammelna's deal = DOTween OutQuart (kammelna-recon/HANDOVER.md:527); KM.deal only */
  /* real springs as linear(): docs/research/spring-linear.py from Material 3 expressive tokens, mass 1. A spring curve is
     normalised to its settle time, so ALWAYS pair --spring-x with --spring-x-dur (the curve at any other duration is a different spring). */
  --spring-spatial-dur: 454ms; --spring-fast-dur: 379ms; --spring-effects-dur: 250ms;
  --spring-spatial: linear(0, 0.056, 0.183, 0.336, 0.488, 0.625, 0.739, 0.828, 0.895, 0.943, 0.975, 0.996, 1.008, 1.013, 1.015, 1.015, 1.013, 1.011, 1.008, 1.006, 1.004, 1.003, 1.002, 1.001, 1);   /* ζ .8 / k 380 — FAB enter (the one UI overshoot), pull-to-refresh release */
  --spring-fast:    linear(0, 0.083, 0.27, 0.491, 0.698, 0.864, 0.982, 1.054, 1.088, 1.094, 1.084, 1.065, 1.044, 1.025, 1.01, 1, 0.994, 0.991, 0.991, 0.992, 0.994, 0.996, 0.998, 0.999, 1);        /* ζ .6 / k 800 — ticker digits, seat scale, emote pop, chip-stack bounce */
  --spring-effects: linear(0, 0.066, 0.203, 0.355, 0.496, 0.616, 0.713, 0.788, 0.845, 0.888, 0.92, 0.943, 0.96, 0.971, 0.98, 0.986, 0.99, 0.993, 0.995, 0.997, 0.998, 0.998, 0.999, 0.999, 1);        /* ζ 1 / k 1600 — colour / opacity effects (turn-ring colour) */
}
@supports not (animation-timing-function: linear(0, 1)) {   /* Safari < 17.2: the old overshoot bezier stands in */
  :root { --spring-spatial: var(--ease-spring); --spring-fast: var(--ease-spring); --spring-effects: var(--ease); }
}

/* ---------------------------------------------------------------- press (global on every tappable kit class) */
.k-press, .k-btn, .k-chip, .k-row--tap, .k-card--interactive, .k-fab, .k-tab, .k-seg__item, .k-tabbar__item, .k-section__action, .k-toast__action {
  transition-property: transform, filter, background-color, color, box-shadow, opacity;
  transition-duration: var(--dur-press), var(--dur-fast), var(--dur-fast), var(--dur-fast), var(--dur-fast), var(--dur-fast); transition-timing-function: var(--ease);   /* press = 160 ms (kit.css agrees) */
}
:is(.k-press, .k-btn, .k-chip, .k-fab, .k-tab, .k-seg__item, .k-tabbar__item, .k-section__action, .k-toast__action):active { transform: scale(0.97); filter: brightness(0.92); }
:is(.k-row--tap, .k-card--interactive):active { transform: scale(0.985); filter: brightness(0.92); }
@media (hover: hover) and (pointer: fine) { .k-card--interactive:hover { transform: translateY(-2px); } }
.k-card--interactive:active { transform: translateY(0) scale(0.985); }
.k-btn:active { transform: scale(0.97); }

/* press extras: native tap flash replaced by our own darken (Rauno); .is-pressed = programmatic :active (KM.press, demos);
   chip RELEASE pops through outBack — a transition retargets mid-flight where the old k-pop keyframe restarted (Emil) */
:is(.k-press, .k-btn, .k-chip, .k-row--tap, .k-card--interactive, .k-fab, .k-tab, .k-seg__item, .k-tabbar__item) { -webkit-tap-highlight-color: transparent; }
:is(.k-press, .k-btn, .k-chip, .k-fab, .k-tab, .k-seg__item, .k-tabbar__item).is-pressed { transform: scale(var(--press-scale)); filter: brightness(0.92); }
:is(.k-row--tap, .k-card--interactive).is-pressed { transform: scale(var(--row-press-scale)); filter: brightness(0.92); }
.k-chip:not(:active):not(.is-pressed) {
  transition: transform var(--dur) var(--ease-out-back), filter var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
/* magnetic / press-depth button (lane 2b, research #11 — Emil "friction instead of hard stops"): KM.magnetic(el) / auto on .k-btn--magnetic.
   pointer:fine only (touch has no hover): the button leans toward the pointer by 20 % of its offset from the centre, ≤ 6 px;
   pressed = 10 % of the offset, ≤ 2 px, + the usual .97 (research #11); the follow is a 90 ms linear glide, the return is --spring-fast. */
.k-btn--magnetic { --mx: 0px; --my: 0px; transform: translate(var(--mx), var(--my)); }
@media (hover: hover) and (pointer: fine) {
  .k-btn--magnetic {
    transition-property: transform, filter, background-color, color, box-shadow, opacity;
    transition-duration: var(--spring-fast-dur), var(--dur-fast), var(--dur-fast), var(--dur-fast), var(--dur-fast), var(--dur-fast);
    transition-timing-function: var(--spring-fast), var(--ease), var(--ease), var(--ease), var(--ease), var(--ease);
  }
  .k-btn--magnetic.is-magnet { transition-duration: 90ms, var(--dur-fast), var(--dur-fast), var(--dur-fast), var(--dur-fast), var(--dur-fast); transition-timing-function: linear, var(--ease), var(--ease), var(--ease), var(--ease), var(--ease); }
}
.k-btn.k-btn--magnetic:active, .k-btn--magnetic.is-pressed { transform: translate(var(--mx), var(--my)) scale(var(--press-scale)); }

/* ---------------------------------------------------------------- enter (mount): fade + 8 px rise, style="--i:3" for stagger (KM.enter(c, {from:'center'}) re-indexes) */
.k-enter { animation: k-enter var(--dur-enter) var(--ease-out-strong) backwards; animation-delay: calc(min(var(--i, 0), 8) * var(--stagger)); }
@keyframes k-enter { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------- page transition (SPA screen swap) — exits are ease-out too (Emil: never ease-in on UI) */
.k-page-enter { animation: k-page-in 240ms var(--ease-out-strong) backwards; }
.k-page-leave { animation: k-page-out 160ms var(--ease-out-strong) forwards; pointer-events: none; }
@keyframes k-page-in  { from { opacity: 0; transform: translateY(12px); } }
@keyframes k-page-out { to   { opacity: 0; transform: translateY(-6px); } }

/* ---------------------------------------------------------------- view transitions (lane 2b, research #25): KM.navigate(fn, {el, hero, back}) wraps document.startViewTransition,
   falling back to .k-page-leave → fn → .k-page-enter. Chrome's shared-axis recipe (developer.chrome.com same-document VT): 30 px travel,
   old = fade 90 ms + slide 300 ms, new = fade 210 ms after 90 ms + slide 300 ms — all on --ease-out-strong, not Chrome's (0.4,0,1,1)
   ease-in (KIT rule 2). Direction is logical: forward slides from inline-end (mirrored in RTL), {back:true} reverses.
   Shared element: give the tapped card AND the destination hero .k-vt-hero (or pass {hero: el}); its group glides 300 ms. */
:root { --vt-x: 30px; }
[dir="rtl"] { --vt-x: -30px; }
[data-vt-back] { --vt-x: -30px; }
[dir="rtl"][data-vt-back] { --vt-x: 30px; }
::view-transition-old(root) { animation: k-vt-out 90ms var(--ease-out-strong) both, k-vt-slide-out 300ms var(--ease-out-strong) both; }
::view-transition-new(root) { animation: k-vt-in 210ms var(--ease-out-strong) 90ms both, k-vt-slide-in 300ms var(--ease-out-strong) both; }
.k-vt-hero { view-transition-name: k-hero; }
::view-transition-group(k-hero) { animation-duration: 300ms; animation-timing-function: var(--ease-out-strong); }
::view-transition-image-pair(k-hero) { isolation: isolate; }
::view-transition-old(k-hero) { animation: k-vt-out 150ms var(--ease-out-strong) both; }
::view-transition-new(k-hero) { animation: k-vt-in 150ms var(--ease-out-strong) 60ms both; }
@keyframes k-vt-out { to { opacity: 0; } }
@keyframes k-vt-in { from { opacity: 0; } }
@keyframes k-vt-slide-out { to { transform: translateX(calc(var(--vt-x) * -1)); } }
@keyframes k-vt-slide-in { from { transform: translateX(var(--vt-x)); } }

/* ---------------------------------------------------------------- header collapse (lane 2b, research #42): <header class="k-topbar k-topbar--large"> + KM.header(el, {range: 64, scroller}).
   --hdr-p 0 → 1 over the first 64 px of scroll: title 24 px scales to .85 (= 20 px, the compact size) from its start edge, the sub line fades;
   the bar's box never changes (height via transform only — web.dev). Chrome / Safari 26: scroll-driven, animation-timeline: scroll(nearest)
   (ProMotion ghosting with scroll timelines was reported Jan 2026 → gated behind @supports, OPEN: device test); elsewhere motion.js writes
   --hdr-p from a passive rAF scroll listener. KM.header also plants a 1 px sentinel at the top of the scroller and toggles .k-topbar.is-scrolled
   (the 1 px edge kit.css already styles) from an IntersectionObserver. */
@property --hdr-p { syntax: '<number>'; inherits: true; initial-value: 0; }
.k-topbar--large { --hdr-p: 0; }
.k-topbar--large .k-topbar__title { font-size: var(--t-xl); line-height: var(--lh-xl); transform-origin: 0 50%; transform: translateY(calc(var(--hdr-p) * 5px)) scale(calc(1 - 0.15 * var(--hdr-p))); }
[dir="rtl"] .k-topbar--large .k-topbar__title { transform-origin: 100% 50%; }
.k-topbar--large .k-topbar__sub { opacity: calc(1 - var(--hdr-p) * 1.6); transform: translateY(calc(var(--hdr-p) * -4px)); }
@supports (animation-timeline: scroll()) {
  .k-topbar--large { animation: k-hdr linear both; animation-timeline: scroll(nearest); animation-range: 0 var(--hdr-range, 64px); }
}
@keyframes k-hdr { to { --hdr-p: 1; } }
.k-scroll-sentinel { position: absolute; inset-block-start: 0; inset-inline-start: 0; inline-size: 1px; block-size: 1px; pointer-events: none; visibility: hidden; }

/* ---------------------------------------------------------------- row swipe actions (lane 2b, research #29; component rules at the end of kit.css): .k-row--swipe > .k-row + .k-row__actions.
   The row follows the finger 1:1 toward inline-start (mirrored in RTL: motion.js works in logical px, --sw-dir flips the sign);
   release snaps on --spring-fast; --sw is the revealed width. .is-full = past 60 % of the row (iOS Mail full swipe): the primary action
   (last child) fills and the others fade. */
.k-row--swipe { --sw: 0px; --sw-dir: -1; }
[dir="rtl"] .k-row--swipe { --sw-dir: 1; }
.k-row--swipe > .k-row { transform: translateX(calc(var(--sw) * var(--sw-dir))); transition: transform var(--spring-fast-dur) var(--spring-fast), background-color var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease); }
.k-row--swipe > .k-row--tap:active, .k-row--swipe > .k-row--tap.is-pressed { transform: translateX(calc(var(--sw) * var(--sw-dir))) scale(var(--row-press-scale)); }
.k-row--swipe.is-dragging > .k-row, .k-row--swipe.is-dragging > .k-row__actions { transition: none; }
.k-row--swipe > .k-row__actions { transition: inline-size var(--spring-fast-dur) var(--spring-fast); }
.k-row__action { transition: opacity var(--dur-fast) var(--ease), flex-basis var(--dur-press) var(--ease); }

/* ---------------------------------------------------------------- tabs: one ink underline that SLIDES (motion.js sets --x / --w) */
.k-tabs { --x: 0px; --w: 0px; }
.k-tabs__ink {
  position: absolute; inset-block-end: -1px; inset-inline-start: 0; block-size: 2px; inline-size: var(--w);
  border-radius: 2px 2px 0 0; background: var(--accent); pointer-events: none;
  transform: translateX(var(--x)); transition: transform var(--dur) var(--ease-out-strong), inline-size var(--dur) var(--ease-out-strong);
}
.k-tabs.has-ink .k-tab::after { display: none; }

/* ---------------------------------------------------------------- sheet (vaul): 500 ms --ease-drawer BOTH ways (the curve's early speed makes it feel like 200),
   transition:none while the finger owns it; drag-to-dismiss, over-drag damping and the backdrop fade live in motion.js (KM.sheet).
   Backdrop: solid --overlay on touch; blur 4 px only on desktop (lane 1 / Rauno: large blurs are slow) — and only while body scroll is locked. */
.k-sheet { transition: transform 500ms var(--ease-drawer); touch-action: pan-y; }
.k-sheet.is-open { transition: transform 500ms var(--ease-drawer); }
.k-sheet__grip, .k-sheet__title { touch-action: none; }          /* the handle zone always drags, even when the body scrolls */
.k-sheet.is-dragging, .k-sheet-backdrop.is-dragging, .k-sheet-root.is-dragging { transition: none !important; }
.k-sheet-backdrop { transition: opacity 400ms var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .k-sheet-backdrop { -webkit-backdrop-filter: blur(0px); backdrop-filter: blur(0px); transition: opacity 400ms var(--ease), -webkit-backdrop-filter 400ms var(--ease), backdrop-filter 400ms var(--ease); }
  .k-sheet-backdrop.is-open { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
}
/* optional iOS look: wrap the PAGE (never the sheet — a transformed ancestor would trap position:fixed) in .k-sheet-root;
   KM.sheet.open sets --sheet-scale = (innerWidth − 26) / innerWidth; radius 8, drops 14 px (vaul getScale / BORDER_RADIUS / WINDOW_TOP_OFFSET) */
.k-sheet-root { transform-origin: 50% 0; transition: transform 500ms var(--ease-drawer), border-radius 500ms var(--ease-drawer); }
.k-sheet-root.is-scaled { transform: scale(var(--sheet-scale, 0.94)) translateY(calc(env(safe-area-inset-top, 0px) + 14px)); border-radius: 8px; overflow: hidden; }
/* snap points (lane 2b, vaul use-snap-points): <div class="k-sheet" data-snap="0.4,0.9"> — fractions of the viewport height, like vaul.
   motion.js sizes the sheet to the LAST point and parks it at the FIRST on open (--snap-y = hidden part); KM.sheet.snap(el, i) moves it.
   Release: velocity > 2 px/ms → last (up) / dismiss (down) · > 0.4 and |Δ| < 40 % of the viewport → one point in the drag direction (below the
   first = dismiss) · else nearest, and nearest-is-first dragged ≥ 25 % of its height below it = dismiss (our rule #13). Backdrop + page scale
   fade between the last two points only (vaul fadeFromIndex), so the page stays usable at the small point. */
.k-sheet.is-open[data-snap] { transform: translateY(var(--snap-y, 0px)); }

/* ---------------------------------------------------------------- toast (sonner): transition + @starting-style so re-fires retarget; 400 ms --ease-drawer (no spring: KIT rule 2);
   4 s life paused on hover / hidden tab (motion.js); stack: newest in front, behind-toasts lift 14 px and shrink 5 % per depth, 3 visible, hover expands; swipe-down 45 px or > 0.11 px/ms */
.k-toast-host { display: grid; align-items: end; }
.k-toast-host > .k-toast { grid-area: 1 / 1; }
.k-toast {
  --n: 0; animation: none; transform-origin: 50% 100%; z-index: calc(10 - var(--n));
  transform: translateY(calc(var(--n) * -14px)) scale(calc(1 - var(--n) * 0.05));
  transition: transform 400ms var(--ease-drawer), opacity 400ms var(--ease-drawer);
}
@starting-style { .k-toast-host > .k-toast { opacity: 0; transform: translateY(16px) scale(0.98); } }
.k-toast-host > .k-toast:nth-last-child(2 of :not(.is-leaving, .is-swiped)) { --n: 1; }
.k-toast-host > .k-toast:nth-last-child(3 of :not(.is-leaving, .is-swiped)) { --n: 2; }
.k-toast-host > .k-toast:nth-last-child(n + 4 of :not(.is-leaving, .is-swiped)) { opacity: 0; pointer-events: none; }
.k-toast.is-leaving { opacity: 0; transform: translateY(8px) scale(0.98); transition: transform 200ms var(--ease-out-strong), opacity 200ms var(--ease-out-strong); pointer-events: none; }
.k-toast.is-swiped { opacity: 0; transform: translateY(calc(100% + 16px)); transition: transform 200ms var(--ease-out-strong), opacity 200ms var(--ease-out-strong); pointer-events: none; }
.k-toast.is-dragging { transition: none; }
@media (hover: hover) and (pointer: fine) { .k-toast-host:hover > .k-toast:not(.is-leaving, .is-swiped) { transform: translateY(calc(var(--n) * (-100% - 8px))) scale(1); } }

/* ---------------------------------------------------------------- FAB: the one spring entry; never from scale 0 (Emil: .9–.97) */
.k-fab { animation: k-fab-in var(--spring-spatial-dur) var(--spring-spatial) backwards; }
@keyframes k-fab-in { from { opacity: 0; transform: scale(0.9); } }

/* ---------------------------------------------------------------- skeleton → content: crossfade + 2 px blur masks the swap (Emil: blur hides an imperfect crossfade, keep < 20 px) */
.k-skeleton.is-loaded {
  color: inherit !important; background: transparent; pointer-events: auto; user-select: auto; inline-size: auto; block-size: auto;
  animation: k-fade-in var(--dur-slow) var(--ease) backwards;
}
.k-skeleton.is-loaded::after { content: none; }
/* <div class="k-swap"><div class="k-swap__ghost">skeleton rows</div><div class="k-swap__content">real rows</div></div> + .is-loaded */
.k-swap { display: grid; }
.k-swap > * { grid-area: 1 / 1; transition: opacity var(--dur-slow) var(--ease), filter var(--dur-slow) var(--ease); }
.k-swap > .k-swap__content { opacity: 0; filter: blur(2px); pointer-events: none; }
.k-swap.is-loaded > .k-swap__content { opacity: 1; filter: blur(0); pointer-events: auto; }
.k-swap.is-loaded > .k-swap__ghost { opacity: 0; pointer-events: none; }
@keyframes k-fade-in { from { opacity: 0; } }

/* ---------------------------------------------------------------- live dot pulse (badge + standalone dot) */
.k-badge--live::before, .k-badge-dot--live { animation: k-live 1.4s var(--ease) infinite; }
.k-badge-dot--live { background: var(--danger); box-shadow: none; }
@keyframes k-live {
  0%   { opacity: 1;   box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45); }
  70%  { opacity: 0.5; box-shadow: 0 0 0 5px rgba(255, 255, 255, 0); }
  100% { opacity: 1;   box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* ---------------------------------------------------------------- progress grows from 0 on mount — scaleX, not inline-size (web.dev: size = layout every frame) */
.k-progress__bar { transform-origin: 0 50%; animation: k-grow var(--dur-slow) var(--ease) backwards; }
[dir="rtl"] .k-progress__bar { transform-origin: 100% 50%; }
@keyframes k-grow { from { transform: scaleX(0); } }

/* ---------------------------------------------------------------- podium rises from 0 (scaleY from the floor; the number fades in over the last 30 %), 3rd → 2nd → winner last */
.k-podium__block { transform-origin: 50% 100%; animation: k-rise var(--dur-slow) var(--ease) backwards; }
.k-podium__who { animation: k-enter var(--dur-enter) var(--ease-out-strong) backwards; }
.k-podium__place--3 .k-podium__block { animation-delay: 0ms; }
.k-podium__place--2 .k-podium__block { animation-delay: calc(var(--stagger) * 2); }
.k-podium__place--1 .k-podium__block { animation-delay: calc(var(--stagger) * 4); }
.k-podium__place--3 .k-podium__who { animation-delay: calc(var(--stagger) * 2); }
.k-podium__place--2 .k-podium__who { animation-delay: calc(var(--stagger) * 4); }
.k-podium__place--1 .k-podium__who { animation-delay: calc(var(--stagger) * 6); }
@keyframes k-rise { 0% { transform: scaleY(0); color: transparent; } 70% { color: transparent; } 100% { transform: none; } }

/* ---------------------------------------------------------------- number / score bump when a value changes: stats 1.15 / 320; a SCORE peaks 1.35 at 40 % of 500 (baloot-game bump) */
.k-bump, .k-stat__value.is-changed, .k-row__value.is-changed { animation: k-bump var(--dur-slow) var(--ease); }
.k-score.is-changed, .k-score > .is-changed { animation: k-bump-score 500ms var(--ease); }
@keyframes k-bump { 0% { transform: scale(1.15); } 100% { transform: none; } }
@keyframes k-bump-score { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: none; } }

/* ---------------------------------------------------------------- number ticker (KM.ticker): each digit is a 0–9 column that scrolls on --spring-fast; LTR isolate, tabular */
.k-ticker { display: inline-flex; direction: ltr; unicode-bidi: isolate; block-size: 1em; line-height: 1; overflow: hidden; vertical-align: -0.08em; font-variant-numeric: tabular-nums lining-nums; }
.k-ticker__d { display: flex; flex-direction: column; transform: translateY(calc(var(--d, 0) * -1em)); transition: transform var(--spring-fast-dur) var(--spring-fast); }
.k-ticker__d > span { display: block; block-size: 1em; line-height: 1; }

/* ---------------------------------------------------------------- pull-to-refresh (CSS only): set --pull 0..1 while dragging (KM.dampen past 56 px), .is-refreshing while loading */
.k-ptr { --pull: 0; position: relative; }
.k-ptr__spinner {
  position: absolute; inset-block-start: 0; inset-inline-start: calc(50% - 14px); z-index: var(--z-raised);
  inline-size: 28px; block-size: 28px; border-radius: 50%; background: var(--surface-3); box-shadow: var(--sh-2);
  display: flex; align-items: center; justify-content: center; pointer-events: none;
  opacity: var(--pull); transform: translateY(calc(var(--pull) * 56px - 28px)) rotate(calc(var(--pull) * 270deg));
  transition: transform var(--dur-fast) linear, opacity var(--dur-fast) linear;
}
.k-ptr__spinner::after { content: ""; inline-size: 16px; block-size: 16px; border-radius: 50%; border: 2px solid var(--accent); border-inline-end-color: transparent; }
.k-ptr.is-refreshing { --pull: 1; }
.k-ptr.is-refreshing .k-ptr__spinner { transform: translateY(28px); transition: transform var(--spring-spatial-dur) var(--spring-spatial); }
.k-ptr.is-refreshing .k-ptr__spinner::after { animation: k-spin 0.7s linear infinite; }

/* ---------------------------------------------------------------- game: felt, playing card (deal / pin / flip), chip token (toss), turn ring, emote — driven by motion.js.
   No permanent will-change (52 cards = 52 layers on an iPhone): motion.js sets it for the flight and clears it on landing.
   Both faces carry backface-visibility:hidden (Safari flicker); the preserve-3d card never gets overflow:hidden (it would flatten). */
.k-felt { position: relative; overflow: hidden; border-radius: var(--r-lg); perspective: 900px; }
.k-pcard {
  --pcard-w: 56px;
  position: absolute; inset-block-start: 0; inset-inline-start: 0; inline-size: var(--pcard-w); block-size: calc(var(--pcard-w) * 1.4);
  transform-style: preserve-3d; pointer-events: none;
}
.k-pcard__inner { position: absolute; inset: 0; transform-style: preserve-3d; }
.k-pcard.is-face .k-pcard__inner { transform: rotateY(180deg); }
.k-pcard__face, .k-pcard__back {
  position: absolute; inset: 0; border-radius: calc(var(--pcard-w) * 0.11);
  -webkit-backface-visibility: hidden; backface-visibility: hidden; background-size: cover; background-position: center;
}
.k-pcard__face { transform: rotateY(180deg); }
.k-chip-token { position: absolute; inset-block-start: 0; inset-inline-start: 0; inline-size: 36px; block-size: 36px; pointer-events: none; }
.k-chip-token > img, .k-pcard__back > img, .k-pcard__face > img { inline-size: 100%; block-size: 100%; object-fit: contain; }
/* turn: KM.turn(avatar, {ms: 5000}) — ring drains linearly over the turn, turns --danger at 20 % left (--spring-effects colour), seat scales 1.1, halo pulses 1.1 s */
.is-turn { position: relative; overflow: visible; transform: scale(1.1); transition: transform 250ms var(--spring-fast); }
.k-avatar.is-turn > img { border-radius: 50%; }
.is-turn::before { content: ""; position: absolute; inset: -2px; border-radius: inherit; box-shadow: 0 0 0 5px var(--accent); opacity: 0.35; animation: k-halo 1.1s ease-in-out infinite; pointer-events: none; }
.k-turn { position: absolute; inset: -5px; inline-size: auto; block-size: auto; transform: rotate(-90deg); pointer-events: none; overflow: visible; }
.k-turn circle { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; transition: stroke var(--spring-effects-dur) var(--spring-effects); }
.k-turn circle:first-child { stroke: rgba(255, 255, 255, 0.16); stroke-dasharray: none !important; }
.k-turn.is-low circle { stroke: var(--danger); }
@keyframes k-halo { 50% { opacity: 0; } }
/* emote: KM.emote(seat, '😂') — pops to 1.3 at 15 % on --spring-fast, settles, floats 50 px up and fades over the last 30 %; 2.4 s then removed (baloot-game emo) */
.k-emote {
  position: absolute; inset-inline-start: 50%; inset-block-end: calc(100% + 4px); z-index: var(--z-raised);
  padding: 4px 8px; border-radius: var(--r-md); background: var(--surface-3); color: var(--text); box-shadow: var(--sh-2);
  font-size: 20px; line-height: 24px; white-space: nowrap; pointer-events: none; transform-origin: 50% 100%;
  animation: k-emote 2400ms var(--ease) forwards;
}
@keyframes k-emote {
  0%   { opacity: 0; transform: translateX(-50%) scale(0.3); animation-timing-function: var(--spring-fast); }
  15%  { opacity: 1; transform: translateX(-50%) scale(1.3); }
  28%  { transform: translateX(-50%) scale(1); }
  70%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-50px); }
}

/* ---------------------------------------------------------------- reduced motion: fades + colour stay (explicit durations: tokens.css zeroes every token), MOVEMENT goes */
@media (prefers-reduced-motion: reduce) {
  .k-enter, .k-page-enter, .k-podium__who, .k-fab, .k-emote { animation: k-fade-in 200ms var(--ease) backwards !important; }
  .k-page-leave { animation: k-fade-out 150ms var(--ease) forwards !important; }
  .k-progress__bar, .k-podium__block, .k-chip, .k-bump, .is-changed, .k-badge--live::before, .k-badge-dot--live, .k-ptr.is-refreshing .k-ptr__spinner::after, .is-turn::before { animation: none !important; }
  .k-toast, .k-sheet-backdrop { transition: opacity 150ms var(--ease) !important; }
  .k-toast.is-leaving, .k-toast.is-swiped { transform: translateY(calc(var(--n) * -14px)) scale(calc(1 - var(--n) * 0.05)); }
  .k-sheet, .k-sheet-root, .k-tabs__ink, .k-ticker__d, .is-turn, .k-chip { transition: none !important; }
  .k-sheet-root.is-scaled { transform: none; border-radius: 0; }
  .k-sheet-backdrop, .k-sheet-backdrop.is-open { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .k-swap > * { transition: opacity 200ms var(--ease) !important; filter: none !important; }
  .is-turn { transform: none; }
  /* lane 2b: no lean, no title scale, no slide; the fades stay (150 ms) */
  .k-btn--magnetic, .k-btn.k-btn--magnetic:active, .k-btn--magnetic.is-pressed { --mx: 0px; --my: 0px; }
  .k-topbar--large .k-topbar__title { transform: none; }
  .k-topbar--large .k-topbar__sub { transform: none; }
  ::view-transition-group(*) { animation-duration: 0s !important; }
  ::view-transition-old(*) { animation: k-vt-out 150ms var(--ease) both !important; }
  ::view-transition-new(*) { animation: k-vt-in 150ms var(--ease) both !important; }
}
@keyframes k-fade-out { to { opacity: 0; } }
