/* W29 (Elad 3/11: "why do the transitions and the look and feel feel so technical?"): the playful motion language,
   one sheet for the whole app. Short (200-400 ms), soft springs. prefers-reduced-motion: base.css turns every CSS
   animation / transition off, so nothing here moves then (the screen change is a plain fade, transition.js).
   The screen change itself (slide + spring, never two screens at once) is transition.js; the owl is mascot.css. */
:root { --spring: cubic-bezier(.34, 1.36, .64, 1); --ease-out: cubic-bezier(.2, .8, .2, 1); }

/* buttons: press down, then bounce back */
.btn, .opt, .pcard, .rowbtn, .tab, .mk-prog, .mk-rcard, .seg-b {
  transition: transform 220ms var(--spring), box-shadow 220ms var(--ease-out), background-color 160ms linear;
}
.btn:active:not(:disabled), .rowbtn:active, .mk-prog:active, .mk-rcard:active { transform: scale(.96); transition-duration: 90ms; }
.opt:active:not(:disabled), .pcard:active { transform: scale(.97); transition-duration: 90ms; }
.tab:active { transform: scale(.92); transition-duration: 90ms; }
.tab .tab-ic { transition: transform 260ms var(--spring); }
.tab.tab-on .tab-ic { animation: mo-tab 360ms var(--spring) 1; }

/* a right answer: the card lifts a touch, the check pops and a ring of sparks bursts out of it */
.opt.right { animation: mo-lift 360ms var(--spring) 1; }
.opt .check { position: relative; }
.opt.right .check { animation: mo-pop 380ms var(--spring) 1; }
.opt.right .check::after {
  content: ""; position: absolute; inset: -10px; border-radius: 50%; pointer-events: none;
  background:
    radial-gradient(circle, var(--teal) 0 2.5px, transparent 3px) 50% 0 / 8px 8px no-repeat,
    radial-gradient(circle, var(--teal-c) 0 2.5px, transparent 3px) 100% 50% / 8px 8px no-repeat,
    radial-gradient(circle, var(--teal) 0 2.5px, transparent 3px) 50% 100% / 8px 8px no-repeat,
    radial-gradient(circle, var(--teal-c) 0 2.5px, transparent 3px) 0 50% / 8px 8px no-repeat,
    radial-gradient(circle, #ffb870 0 2px, transparent 2.5px) 15% 15% / 7px 7px no-repeat,
    radial-gradient(circle, #ffb870 0 2px, transparent 2.5px) 85% 85% / 7px 7px no-repeat,
    radial-gradient(circle, var(--teal-c) 0 2px, transparent 2.5px) 85% 15% / 7px 7px no-repeat,
    radial-gradient(circle, var(--teal-c) 0 2px, transparent 2.5px) 15% 85% / 7px 7px no-repeat;
  opacity: 0; animation: mo-burst 520ms var(--ease-out) 80ms 1;
}
.opt.wrong { animation: mo-nudge 300ms ease-in-out 1; }
.pcard.found { animation: ppulse 0.5s ease-out 1; } /* W57c r4 (Elad, option A): the soft pulse 1 -> 1.07 -> 1 (webapp.css), not mo-pop's 40% -> 100% spring */
/* W57c r4: sequences, a tapped square lights (the lit look, briefly) with a soft press; a wrong one nudges, calm */
.game-area .sequences-cell.seq-tap { animation: mo-seq-press 320ms var(--spring) 1; }
.game-area .sequences-cell.seq-miss { animation: mo-nudge 300ms ease-in-out 1; }
@keyframes mo-seq-press { 0% { transform: scale(.94); } 100% { transform: none; } }
.ptoast { animation: mo-toast 340ms var(--spring) 1; }

/* the practice's progress bar fills smoothly */
.sessbar i { transition: width 450ms var(--ease-out); } /* W29 r2: no spring here - an overshoot reads as the bar jumping back */

/* the feedback line comes up softly */
.sess .fb:not([hidden]), .fb:not([hidden]) { animation: mo-rise 300ms var(--spring) 1; }

@keyframes mo-tab { 0% { transform: scale(.8); } 100% { transform: none; } }
@keyframes mo-lift { 0% { transform: none; } 45% { transform: translateY(-3px) scale(1.015); } 100% { transform: none; } }
@keyframes mo-pop { 0% { transform: scale(.4); } 60% { transform: scale(1.18); } 100% { transform: none; } }
@keyframes mo-burst { 0% { opacity: 1; transform: scale(.5); } 70% { opacity: 1; } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes mo-nudge { 0%, 100% { transform: none; } 30% { transform: translateX(-4px); } 60% { transform: translateX(3px); } }
@keyframes mo-toast { 0% { transform: translateY(-50%) scale(.6); opacity: 0; } 100% { transform: translateY(-50%); opacity: 1; } }
@keyframes mo-rise { 0% { transform: translateY(10px); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* the practice opening (sess/intro.js): over the screen, the X stays on top (rule 7: leaving is always possible) */
main.sess { position: relative; }
.sess .sess-h { position: relative; z-index: 4; }
.sess-intro { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3);
  background: radial-gradient(120% 80% at 50% 38%, #e6fbf7 0%, var(--bg) 62%); cursor: pointer; text-align: center; overflow: hidden; border-radius: inherit;
  padding: calc(var(--target-min) + var(--space-6)) var(--space-6) var(--space-6); /* W29 r1: room above the owl for the header (X + pill) */ }
.sess-intro > * { flex: none; } /* W29 r1: never squeezed, so the count never sits on the tap line */
.intro-title { margin: 0; font-size: var(--fs-hero); color: var(--navy); animation: mo-rise 380ms var(--spring) 260ms both; }
/* W29 r2: the count = a ring that drains continuously + stacked digits that cross-fade (no hard swap, no layout jump) */
.intro-n { position: relative; display: grid; place-items: center; inline-size: 3.6rem; block-size: 3.6rem; visibility: hidden;
  font-size: var(--fs-2xl); font-weight: 800; color: var(--teal); font-variant-numeric: tabular-nums; }
.intro-n[data-n] { visibility: visible; }
.intro-ring { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; transform: rotate(-90deg); }
.intro-ring circle { fill: none; stroke-width: 5; }
.intro-ring-bg { stroke: var(--teal-t); fill: #fff !important; }
.intro-ring-fg { stroke: var(--teal); stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: 0; }
.intro-n[data-run] .intro-ring-fg { animation: mo-drain var(--count-ms, 1440ms) linear forwards; }
[dir="rtl"] .intro-ring { transform: rotate(-90deg) scaleY(-1); } /* drains the way the language reads */
.intro-d { grid-area: 1 / 1; opacity: 0; transform: scale(.7); transition: opacity 180ms ease-out, transform 360ms var(--spring); }
.intro-d[data-state="on"] { opacity: 1; transform: none; }
.intro-d[data-state="gone"] { opacity: 0; transform: scale(1.2); transition-duration: 340ms, 340ms; } /* fades out slower than the next fades in: always a digit on screen */
@keyframes mo-drain { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 100; } }
.intro-tap { color: var(--ink2); font-size: var(--fs-sm); animation: mo-rise 380ms var(--spring) 420ms both; }

/* success moments: a small owl that claps next to "מצאתם!" and on the end screen, a star burst behind it */
.owl-cheer { position: relative; display: inline-grid; place-items: center; }
.owl-cheer::before { content: ""; position: absolute; inset: -18%; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 8deg, #ffd27a 8deg 16deg, transparent 16deg 45deg, var(--teal-c) 45deg 53deg, transparent 53deg 90deg,
    #ffd27a 90deg 98deg, transparent 98deg 135deg, var(--teal-c) 135deg 143deg, transparent 143deg 180deg, #ffd27a 180deg 188deg, transparent 188deg 225deg,
    var(--teal-c) 225deg 233deg, transparent 233deg 270deg, #ffd27a 270deg 278deg, transparent 278deg 315deg, var(--teal-c) 315deg 323deg, transparent 323deg);
  -webkit-mask: radial-gradient(circle, transparent 46%, #000 47% 70%, transparent 71%); mask: radial-gradient(circle, transparent 46%, #000 47% 70%, transparent 71%);
  opacity: 0; animation: mo-star 700ms var(--ease-out) 120ms 1; }
.ptoast .owl { display: inline-block; vertical-align: middle; margin-inline-end: .4rem; }
@keyframes mo-star { 0% { opacity: 1; transform: scale(.4) rotate(0); } 100% { opacity: 0; transform: scale(1.35) rotate(40deg); } }

/* the end screen: the owl (with its star burst) replaces the round check / trophy mark */
.sess-done .big.sd-owl { background: none; box-shadow: none; inline-size: auto; block-size: auto; border-radius: 0; }
/* home: the owl peeks over the hero photo's bottom corner (opposite "מוכנים?") */
.mk-ph { overflow: hidden; }
.mk-peek { position: absolute; z-index: 2; inset-block-end: -0.9rem; inset-inline-end: var(--space-3); }
/* the end screen's rows rise in one after another */
.sess-done .sd-row { animation: mo-rise 320ms var(--spring) both; }
.sess-done .sd-row:nth-child(1) { animation-delay: 380ms; } .sess-done .sd-row:nth-child(2) { animation-delay: 425ms; }
.sess-done .sd-row:nth-child(3) { animation-delay: 470ms; } .sess-done .sd-row:nth-child(4) { animation-delay: 515ms; }
.sess-done .sd-row:nth-child(5) { animation-delay: 560ms; } .sess-done .sd-row:nth-child(n+6) { animation-delay: 605ms; }
.sess:has(.sess-intro) .sess-n { visibility: hidden; } /* the "loading" line stays behind the opening */

/* W29 r1 (desktop, Elad): the wide panel sizes to its content, and the opening is absolutely positioned, so while it
   shows the practice panel keeps a real height (like the board), the opening centred in it. Installed app: the column
   already fills the window. */
@media (min-width: 768px) and (min-height: 600px) {
  html #app > main.sess[data-intro="on"] { min-block-size: min(680px, 100%); }
}

/* W30a: the level-up line on the end screen (new best level), pops in after the owl */
.sd-levelup { display: flex; align-items: center; gap: var(--space-3); background: linear-gradient(160deg, #fff5e6, #ffffff); border: 2px solid var(--peach);
  animation: mo-pop-in 420ms var(--spring) 300ms both; }
.sd-levelup > div { display: grid; gap: 0.1rem; }
.sd-levelup strong { font-size: var(--fs-lg); color: var(--navy); }
.sd-levelup small { font-size: var(--fs-sm); color: var(--ink2); font-variant-numeric: tabular-nums; }
.sd-star { inline-size: 2.4rem; block-size: 2.4rem; border-radius: 50%; background: var(--peach); color: var(--peach-ink); display: grid; place-items: center; flex: none; }
@keyframes mo-pop-in { 0% { opacity: 0; transform: scale(.85); } 100% { opacity: 1; transform: none; } }

/* W30a: a played game's level on the games tab, next to its name */
.gname { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.glevel { font-size: var(--fs-sm); font-weight: 700; color: var(--teal); background: var(--teal-t); border-radius: 99px; padding: 0.05rem 0.55rem; font-variant-numeric: tabular-nums; }
