/* Engine `shapes` (DESIGN §13.1): every selector starts with `.sh-` (state classes `.is-*` allowed). Owned by package A.
   Livada oblika: the lasso scenes, the crates, the stamp table and the shadow theatre, the round-end assemblies.
   Motion is transform/opacity only; no filters, no blend modes (§8.1). */

/* ---------------------------------------------------------------- the board and its scene */
.sh-board-bg { fill: #FFFBF1; }
.sh-board .st-lasso-rope { stroke: var(--sh-rope, #B88A4E); stroke-width: 6; stroke-dasharray: 12 5; }
.sh-obj .sh-wig { transform-box: fill-box; transform-origin: center; }
.sh-obj.is-wrong .sh-wig { animation: sh-shake .36s ease-in-out 3; }
@keyframes sh-shake { 25% { transform: translateX(-5px) rotate(-4deg); } 75% { transform: translateX(5px) rotate(4deg); } }
.sh-rope-drip { fill: none; stroke: var(--sh-rope, #B88A4E); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 12 5; animation: sh-drip .9s ease-in forwards; }
@keyframes sh-drip { 30% { transform: translateY(4px); opacity: 1; } to { transform: translateY(46px); opacity: 0; } }
.sh-dim { opacity: .3; transition: opacity .4s; }
.sh-hint-ring { fill: rgba(255, 197, 61, .22); stroke: #F5A300; stroke-width: 4; stroke-dasharray: 10 6; animation: sh-breathe .9s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes sh-breathe { 50% { transform: scale(1.1); opacity: .65; } }
.sh-hint { animation: sh-btn-pulse .9s ease-in-out infinite; }
@keyframes sh-btn-pulse { 50% { box-shadow: 0 0 0 8px rgba(255, 197, 61, .6); } }

/* ---------------------------------------------------------------- Zuja counts the sides of a wrong catch */
.sh-bee { pointer-events: none; transition: transform .16s ease-in-out; }
.sh-bee .sh-bee-in { animation: sh-buzz .12s linear infinite; }
.sh-bee.is-off { opacity: 0; transition: opacity .2s; }
@keyframes sh-buzz { 50% { transform: translateY(-2px) rotate(3deg); } }
.sh-count circle { fill: #FFFBF1; stroke: #24263B; stroke-width: 2.6; }
.sh-count text { font: 900 18px var(--font, Nunito, sans-serif); fill: #24263B; }
.sh-count { animation: sh-pop-in .25s cubic-bezier(.3, 1.5, .5, 1); transform-box: fill-box; transform-origin: center; }
@keyframes sh-pop-in { from { transform: scale(.2); opacity: 0; } }

/* ---------------------------------------------------------------- crates in the dock */
.sh-crates { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; padding: 2px; }
.sh-crate { position: relative; width: 92px; height: 86px; display: grid; place-items: center; background: #fff; border: 3px solid #24263B; border-radius: 18px; box-shadow: 0 4px 0 #24263B; padding: 0; touch-action: manipulation; }
.sh-crate .sh-crate-art { width: 68px; height: 68px; display: block; }
.sh-crate .sh-crate-art svg { width: 100%; height: 100%; display: block; }
.sh-crate.is-pick { cursor: pointer; background: #FFFBF1; }
.sh-crate.is-pick.is-on { background: #FFF1C2; box-shadow: 0 0 0 4px #fff, 0 0 0 8px var(--sh-cc, #FFC53D), 0 4px 0 #24263B; }
.sh-crate.is-pick:active { transform: translateY(3px); box-shadow: 0 1px 0 #24263B; }
.sh-crate-n { position: absolute; right: -8px; top: -10px; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 16px; background: #17A565; color: #fff; border: 3px solid #24263B; font: 900 18px/26px var(--font, Nunito, sans-serif); text-align: center; box-sizing: border-box; }
.sh-crate-n.is-zero { display: none; }
.sh-crate.is-bump { animation: sh-bump .4s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes sh-bump { 40% { transform: scale(1.12) rotate(-3deg); } }
html[data-layout="short"] .sh-crate { width: 84px; height: 76px; border-radius: 16px; }
html[data-layout="short"] .sh-crate .sh-crate-art { width: 58px; height: 58px; }
html[data-layout="tall"] .sh-crates { gap: 18px; }
.sh-fly { pointer-events: none; }

/* ---------------------------------------------------------------- the stamp table */
.sh-cell { cursor: grab; }
.sh-cell svg { width: 86%; height: 86%; display: block; pointer-events: none; }
button.sh-cell { padding: 0; cursor: pointer; }
.sh-cell.is-on { background: #FFF1C2; box-shadow: 0 0 0 3px #fff, 0 0 0 6px #FFC53D; }
.sh-zones { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.sh-zone { position: absolute; border-radius: 50%; }
.sh-zone.tk-drop-ok { box-shadow: inset 0 0 0 4px rgba(23, 165, 101, .55); }
.sh-zone.tk-drop-over { background: rgba(23, 165, 101, .18); }
.sh-drop-ring { fill: none; stroke: #2F6FD6; stroke-width: 3; stroke-dasharray: 8 6; opacity: .55; }
.sh-print.is-done { opacity: 1; }
.sh-proud { transform-box: fill-box; transform-origin: 50% 100%; }
.sh-proud.is-new { animation: sh-land .55s cubic-bezier(.3, 1.5, .5, 1); }
.sh-proud.is-hop { animation: sh-hop .5s ease-in-out 2; animation-delay: var(--d, 0s); }
@keyframes sh-land { from { transform: translateY(-40px) scale(.6); opacity: 0; } }
@keyframes sh-hop { 50% { transform: translateY(-16px) scaleY(1.06); } }
.sh-outline { fill: rgba(47, 111, 214, .06); stroke: #2F6FD6; stroke-width: 3; stroke-dasharray: 9 6; stroke-linejoin: round; opacity: .55; }
.sh-outline.is-cur { opacity: 1; animation: sh-dash 1.2s linear infinite; }
.sh-outline.is-wall { stroke: #5A4A7A; fill: rgba(90, 74, 122, .07); }
@keyframes sh-dash { to { stroke-dashoffset: -30; } }
.sh-stamped { animation: sh-stamp-in .45s cubic-bezier(.3, 1.5, .5, 1); transform-box: fill-box; transform-origin: center; }
@keyframes sh-stamp-in { from { transform: scale(.4); opacity: 0; } }
.sh-press { transform-box: fill-box; transform-origin: 50% 100%; animation: sh-press .6s ease-in-out forwards; }
@keyframes sh-press { 0% { transform: translateY(-34px); opacity: .9; } 45% { transform: translateY(0) scaleY(.82) scaleX(1.08); opacity: 1; } 70% { transform: translateY(-10px); } to { transform: translateY(-34px); opacity: 0; } }
.sh-wrongprint, .sh-wrongshadow { animation: sh-stamp-in .3s ease-out; transform-box: fill-box; transform-origin: center; }
.sh-wrongprint path, .sh-wrongprint rect, .sh-wrongprint circle { stroke: #FF9636; }
.sh-wrongprint.is-out, .sh-wrongshadow.is-out { opacity: 0; transition: opacity .3s; }
.sh-onbench { transform-box: fill-box; transform-origin: 50% 100%; }
.sh-onbench.is-pick { animation: sh-land .45s cubic-bezier(.3, 1.5, .5, 1); }
.sh-onbench.is-tip { animation: sh-tip .45s cubic-bezier(.3, 1.5, .5, 1); }
.sh-onbench.is-turn { animation: sh-turn .45s ease-out; }
@keyframes sh-tip { from { transform: rotate(-70deg); } }
@keyframes sh-turn { from { transform: scaleX(.2); } }
.sh-benchsolid { cursor: grab; }
.sh-benchsolid.is-dragging { cursor: grabbing; }
.sh-pickme circle { fill: rgba(255, 197, 61, .25); stroke: #F5A300; stroke-width: 3; stroke-dasharray: 7 5; }
.sh-pickme path { stroke: #24263B; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; fill: none; transform: rotate(180deg); transform-box: fill-box; transform-origin: center; }
.sh-pickme { animation: sh-breathe 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.sh-frame { fill: none; stroke: #C98B4E; stroke-width: 12; animation: sh-stamp-in .5s cubic-bezier(.3, 1.5, .5, 1); transform-box: fill-box; transform-origin: center; }

/* ---------------------------------------------------------------- the shadow theatre */
.sh-shadow { fill: #3B3550; stroke: #24263B; stroke-width: 2; }
.sh-shadow.is-wrong { fill: #5A4A6A; stroke: #FF9636; stroke-width: 4; }
.sh-cast { animation: sh-cast .6s ease-out; }
@keyframes sh-cast { from { opacity: 0; } }
.sh-lamp .sh-bulb { fill: #E9EEF5; }
.sh-lamp.is-lit .sh-bulb { fill: #FFE27A; }
.sh-beam { fill: rgba(255, 226, 122, .38); animation: sh-cast .25s ease-out; }
.sh-beam.is-off { opacity: 0; transition: opacity .35s; }
.sh-part.is-dance { animation: sh-dance .5s ease-in-out 4; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes sh-dance { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }

/* ---------------------------------------------------------------- round-end assemblies and surprises */
.sh-pop { transform-box: fill-box; transform-origin: center; animation: sh-pop .5s cubic-bezier(.3, 1.5, .5, 1) backwards; animation-delay: var(--d, 0s); }
@keyframes sh-pop { from { transform: scale(0) translateY(-30px); opacity: 0; } }
.sh-twinkle { animation: sh-twinkle .8s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes sh-twinkle { to { transform: scale(1.18) rotate(12deg); } }
.sh-crawl { animation: sh-crawl 3.2s ease-in .9s forwards; }
@keyframes sh-crawl { 40% { transform: translateX(30px); } to { transform: translateX(900px); } }
.sh-seg { animation-name: sh-pop, sh-bob; animation-duration: .5s, .45s; animation-iteration-count: 1, infinite; animation-delay: var(--d, 0s), calc(var(--d, 0s) + .6s); animation-direction: normal, alternate; }
@keyframes sh-bob { to { transform: translateY(-5px); } }
.sh-drive { animation: sh-drive 3s ease-in 1s forwards; }
@keyframes sh-drive { 15% { transform: translateX(-12px); } to { transform: translateX(1000px); } }
.sh-smoke { animation: sh-smoke .8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes sh-smoke { from { transform: translateY(4px) scale(.6); opacity: 1; } to { transform: translateY(-14px) scale(1.3); opacity: 0; } }
.sh-flag { animation: sh-flag .6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 0 50%; }
@keyframes sh-flag { to { transform: scaleX(.75); } }
.sh-wobble { animation-name: sh-pop, sh-wob; animation-duration: .5s, 1.2s; animation-iteration-count: 1, infinite; animation-delay: var(--d, 0s), calc(var(--d, 0s) + .6s); transform-origin: 50% 100%; }
@keyframes sh-wob { 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }
.sh-sway { animation-name: sh-pop, sh-swing; animation-duration: .5s, 1.6s; animation-iteration-count: 1, infinite; animation-delay: var(--d, 0s), calc(var(--d, 0s) + .5s); transform-origin: 50% 0; }
@keyframes sh-swing { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.sh-bunt-rope { fill: none; stroke: #8A5A2B; stroke-width: 4; stroke-linecap: round; }
.sh-hexfly { animation: sh-hex 1.8s linear forwards; }
@keyframes sh-hex {
  0% { transform: translate(calc(var(--r) * -1.6), calc(var(--r) * -0.4)); }
  16% { transform: translate(var(--r), 0); }
  32% { transform: translate(calc(var(--r) * .5), calc(var(--r) * .866)); }
  48% { transform: translate(calc(var(--r) * -.5), calc(var(--r) * .866)); }
  64% { transform: translate(calc(var(--r) * -1), 0); }
  80% { transform: translate(calc(var(--r) * -.5), calc(var(--r) * -.866)); }
  92% { transform: translate(calc(var(--r) * .5), calc(var(--r) * -.866)); }
  100% { transform: translate(calc(var(--r) * 2), calc(var(--r) * -1.4)); }
}
.sh-confetti { animation: sh-fall 1.7s ease-in forwards; animation-delay: var(--d, 0s); }
@keyframes sh-fall { from { transform: translate(0, 0) rotate(0); } to { transform: translate(var(--x, 0), var(--h, 600px)) rotate(400deg); } }

@media (prefers-reduced-motion: reduce) {
  .sh-hint-ring, .sh-hint, .sh-outline.is-cur, .sh-pickme, .sh-twinkle, .sh-seg, .sh-smoke, .sh-flag, .sh-wobble, .sh-sway, .sh-bee .sh-bee-in, .sh-part.is-dance { animation: none !important; }
  .sh-crawl, .sh-drive { animation-duration: .01s !important; animation-delay: 1.4s !important; }
}
html[data-motion="reduce"] .sh-hint-ring, html[data-motion="reduce"] .sh-outline.is-cur, html[data-motion="reduce"] .sh-pickme, html[data-motion="reduce"] .sh-seg, html[data-motion="reduce"] .sh-wobble, html[data-motion="reduce"] .sh-sway { animation: none !important; }
.sh-veil { fill: #FFFBF1; opacity: .62; animation: sh-cast .5s ease-out; }
html[data-layout="wide"] .sh-crate, html[data-layout="square"] .sh-crate { width: 112px; height: 108px; border-radius: 22px; }
html[data-layout="wide"] .sh-crate .sh-crate-art, html[data-layout="square"] .sh-crate .sh-crate-art { width: 92px; height: 92px; }
html[data-layout="wide"] .sh-crates, html[data-layout="square"] .sh-crates { padding-top: 14px; gap: 14px; }
.sh-badge circle { fill: #FFFBF1; stroke: #24263B; stroke-width: 3; }
.sh-badge { animation: sh-pop-in .3s cubic-bezier(.3, 1.5, .5, 1); }
.sh-badge-turn circle { fill: #FFF1C2; }
html[data-layout="tall"] .sh-tray { grid-template-columns: repeat(6, 50px); grid-auto-rows: 50px; }
/* the picture recipe under the stamp tray (wide layouts only: the phones' dock has no room for it) */
.sh-steps { display: none; align-items: center; justify-content: center; gap: 4px; margin-top: 14px; }
html[data-layout="wide"] .sh-steps, html[data-layout="square"] .sh-steps { display: flex; }
.sh-step { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: #FFFBF1; border: 3px solid #C9D2DE; }
.sh-step svg { display: block; }
.sh-step.is-now { border-color: #F5A300; background: #FFF1C2; animation: sh-btn-pulse 1.1s ease-in-out infinite; }
.sh-step.is-done { opacity: .55; }
.sh-step-arrow { font: 900 28px/1 var(--font, Nunito, sans-serif); color: #24263B; opacity: .6; }
.sh-next path { fill: none; stroke: #F5A300; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 9 7; animation: sh-dash 1s linear infinite; }
.sh-next .sh-next-head { stroke-dasharray: none; animation: none; }
.sh-hopper { animation-name: sh-pop, sh-hop; animation-duration: .5s, .55s; animation-iteration-count: 1, 4; animation-delay: var(--d, 0s), calc(var(--d, 0s) + .6s); transform-origin: 50% 100%; }
