/* Logic Lab – Tika's lab in the tree (DESIGN §8, §9). On top of the kit's ui.css + tika.css. */
:root {
  --wood: #F3D7A6; --wood-2: #E8C48A; --wood-3: #D9A86A; --wood-dark: #B98352; --leaf: #7CC46B; --leaf-2: #5DAA52;
  --lab: #FFFBF1; --lab-2: #FFF3D9; --screen: #26304F; --glow: #7DF9FF;
  --room: #2A6EE5; --room-deep: #1A52B8; --room-soft: #DCE8FF;
  --top-h: 62px; --dock-w: clamp(260px, 30vw, 360px);
  --tap: 52px;
  --item: 64px;
}
html[data-layout="short"] { --top-h: 50px; --tap: 48px; --item: 52px; }
html.ll-narrow { --tap: 48px; }

body.ll-body {
  background-color: var(--wood);
  background-image:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, .35), transparent 50%),
    radial-gradient(circle at 90% 95%, rgba(150, 95, 40, .16), transparent 50%),
    repeating-linear-gradient(90deg, rgba(185, 131, 82, 0) 0 118px, rgba(185, 131, 82, .14) 118px 121px, rgba(185, 131, 82, 0) 121px 240px);
}

/* ---------------------------------------------------------------- top bar */
.ll-top { min-height: var(--top-h); height: var(--top-h); padding: 0 clamp(.45rem, 1.4vw, .9rem); gap: .5rem; background: linear-gradient(#F6E2BE, #EBCB98); border-bottom: 3px solid var(--ink); box-shadow: 0 3px 0 rgba(36, 38, 59, .16); }
.ll-top-left, .ll-top-right { display: flex; align-items: center; gap: .45rem; flex: 0 0 auto; }
.ll-top-right { min-width: 0; }
.ll-top-mid { display: flex; align-items: center; gap: .7rem; min-width: 0; flex: 0 1 auto; }
.ll-title { font-size: clamp(1.02rem, 2.1vw, 1.32rem); }
.ll-brand { font-weight: 1000; letter-spacing: .01em; }
.ll-top-btn { width: var(--tap); height: var(--tap); }
.ll-top .tk-icon-btn { width: var(--tap); height: var(--tap); }
.ll-top .tk-script-switch { min-height: var(--tap); }
.ll-top-extra { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }
.ll-allgames { display: inline-flex; align-items: center; gap: .35rem; min-height: var(--tap); padding: 0 .9rem 0 .7rem; font-weight: 900; font-size: 1rem; color: var(--ink); text-decoration: none; background: #fff; border: 3px solid var(--ink); border-radius: 999px; box-shadow: var(--shadow-sm); white-space: nowrap; }
.ll-allgames:active { transform: translateY(3px); box-shadow: none; }
.ll-ag-arrow { font-size: 1.2em; line-height: 1; }
@media (max-width: 520px) { .ll-ag-txt { display: none; } .ll-allgames { width: var(--tap); justify-content: center; padding: 0; } }
.ll-dots { display: inline-flex; gap: .35rem; align-items: center; }
.ll-dots > i { width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--ink); background: #fff; transition: background-color .25s, transform .25s var(--ease-pop); }
.ll-dots > i.done { background: var(--sun); }
.ll-dots > i.now { background: #fff; transform: scale(1.25); box-shadow: 0 0 0 3px rgba(255, 197, 61, .6); }
.ll-chipcount { display: inline-flex; align-items: center; gap: .3rem; height: 40px; padding: 0 .7rem 0 .35rem; background: #fff; border: 3px solid var(--ink); border-radius: 999px; box-shadow: var(--shadow-sm); font-weight: 1000; font-size: 1.05rem; }
.ll-chipcount .ll-chip-ico { width: 30px; height: 30px; }
.ll-chip-ico { display: block; overflow: visible; }
@media (max-width: 440px) { .ll-title { font-size: .98rem; } }

/* ---------------------------------------------------------------- main + boot + park */
.ll-main { position: relative; overflow: hidden; }
.ll-boot { margin: auto; text-align: center; font-weight: 900; }
.ll-tika-park { position: fixed; left: -9999px; top: 0; width: 120px; visibility: hidden; }
.ll-screen { position: absolute; inset: 0; display: flex; }

/* ---------------------------------------------------------------- bubble */
.ll-bubble { font-size: clamp(1rem, 1.55vw, 1.12rem); line-height: 1.33; padding: .55rem .95rem; max-width: 100%; border-radius: 20px; box-shadow: 0 4px 0 var(--ink); background: #FFFDF6; }
.ll-bubble.ll-caption { border-radius: 14px; box-shadow: 0 3px 0 var(--ink); font-size: 15px; line-height: 1.25; padding: .28rem .7rem; background: rgba(255, 253, 246, .96); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------------------------------------------------------- task frame (§9) */
.ll-task { position: absolute; inset: 0; display: grid; gap: 10px; padding: 10px; }
.ll-board { position: relative; min-width: 0; min-height: 0; grid-area: board; border-radius: 24px; background: var(--lab); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); overflow: hidden; }
.ll-dock { position: relative; grid-area: dock; display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 8px; }
.ll-dock-head { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; min-width: 0; }
.ll-dock-body { position: relative; flex: 1 1 auto; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; background: var(--lab-2); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 5px 0 var(--ink); padding: 10px; }
.ll-sayrow { grid-area: say; display: flex; align-items: flex-end; gap: 12px; min-width: 0; }
.ll-tslot { flex: 0 0 auto; }
.ll-bslot { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; }
.ll-bslot:empty { display: none; }
.ll-budslot { flex: 0 0 auto; display: flex; align-items: flex-end; }
.ll-budslot:empty { display: none; }
.bip.ll-buddy-bip { width: 74px; }

/* wide / square: board | dock, speech row under the board */
html[data-layout="wide"] .ll-task, html[data-layout="square"] .ll-task { grid-template-columns: minmax(0, 1fr) var(--dock-w); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "board dock" "say dock"; }
html[data-layout="wide"] .ll-task.ll-dock-slim, html[data-layout="square"] .ll-task.ll-dock-slim { --dock-w: clamp(200px, 22vw, 260px); }
html[data-layout="wide"] .ll-task.ll-dock-wide, html[data-layout="square"] .ll-task.ll-dock-wide { --dock-w: clamp(300px, 34vw, 400px); }
html[data-layout="wide"] .ll-sayrow .ll-tslot, html[data-layout="square"] .ll-sayrow .ll-tslot { width: clamp(84px, 9vw, 104px); margin-top: -30px; }
html[data-layout="wide"] .ll-sayrow, html[data-layout="square"] .ll-sayrow { min-height: 88px; }
html[data-layout="wide"] .ll-sayrow .ll-bslot, html[data-layout="square"] .ll-sayrow .ll-bslot { padding-bottom: 12px; max-width: min(46rem, 100%); }
html[data-layout="wide"] .ll-dock-head, html[data-layout="square"] .ll-dock-head { display: none; }
/* short: caption strip on top of the board, Tika at the top of the dock */
html[data-layout="short"] .ll-task { grid-template-columns: minmax(0, 1fr) 250px; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "say dock" "board dock"; gap: 6px; padding: 6px 8px 8px; }
html[data-layout="short"] .ll-task.ll-dock-slim { grid-template-columns: minmax(0, 1fr) 200px; }
html[data-layout="short"] .ll-task.ll-dock-wide { grid-template-columns: minmax(0, 1fr) 286px; }
html[data-layout="short"] .ll-sayrow { min-height: 0; }
html[data-layout="short"] .ll-sayrow .ll-tslot, html[data-layout="short"] .ll-sayrow .ll-budslot { display: none; }
html[data-layout="short"] .ll-dock-head .ll-tslot { width: 54px; }
html[data-layout="short"] .ll-dock-head .ll-bslot { display: none; }
html[data-layout="short"] .ll-dock-head { min-height: 0; justify-content: space-between; height: 58px; }
html[data-layout="short"] .ll-dock-head .bip.ll-buddy-bip { width: 48px; }
html[data-layout="short"] .ll-dock-body { padding: 8px; border-radius: 18px; }
html[data-layout="short"] .ll-board { border-radius: 18px; }
/* tall: board on top, dock below with Tika + bubble at its head */
html[data-layout="tall"] .ll-task { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "board" "dock"; }
html[data-layout="tall"] .ll-sayrow { display: none; }
html[data-layout="tall"] .ll-dock-head .ll-tslot { width: clamp(64px, 11vw, 92px); margin-top: -10px; align-self: flex-start; }
html[data-layout="tall"] .ll-dock-head { min-height: 74px; align-items: center; }
html[data-layout="tall"] .ll-dock-head .bip.ll-buddy-bip { width: clamp(52px, 9vw, 74px); }
html[data-layout="tall"] .ll-dock-body { flex: 0 0 auto; }

/* ---------------------------------------------------------------- Tika extras */
.tika.ll-loop > .tk-owl { animation: ll-loop .9s cubic-bezier(.4, 0, .3, 1); transform-origin: 50% 60%; }
@keyframes ll-loop { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- buttons & bits */
.ll-hold { overflow: hidden; }
.ll-hold .ll-hold-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255, 197, 61, .6); pointer-events: none; }
.ll-hold > span, .ll-hold > svg { position: relative; z-index: 1; }
.ll-glow { animation: ll-glow 1.1s ease-in-out infinite; }
@keyframes ll-glow { 50% { filter: drop-shadow(0 0 10px rgba(255, 197, 61, .95)) drop-shadow(0 0 3px #FFC53D); } }
.ll-ring { box-shadow: 0 0 0 5px var(--sun), 0 0 0 10px rgba(255, 197, 61, .35) !important; }
.ll-dim { opacity: .4; transition: opacity .3s; }
.tk-btn { min-height: var(--tap); }
.ll-btn-go { font-size: 1.3rem; min-height: 60px; }

/* ghost wing (H3) */
.ll-ghost-layer { position: fixed; inset: 0; pointer-events: none; z-index: 8500; transition: opacity .3s; }
.ll-ghost-layer.out { opacity: 0; }
.ll-ghost { position: absolute; left: 0; top: 0; opacity: .6; will-change: transform; display: flex; align-items: center; }
.ll-ghost svg { filter: drop-shadow(0 3px 0 rgba(36, 38, 59, .25)); }
.ll-ghost-carry { position: absolute; left: 26px; top: 30px; opacity: .92; pointer-events: none; }
.ll-ghost-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: rgba(255, 197, 61, .75); transition: opacity .7s, transform .7s; }
.ll-ghost-dot.out { opacity: 0; transform: scale(.3); }

/* ---------------------------------------------------------------- Bip */
.bip { position: relative; display: block; width: 100%; -webkit-tap-highlight-color: transparent; }
.bip-svg { display: block; width: 100%; height: auto; overflow: visible; }
.bip-svg * { transform-box: view-box; }
.bip-btn { cursor: pointer; border-radius: 18px; }
.bip-btn:focus-visible { outline: 4px solid var(--sky); outline-offset: 3px; }
.bip .bip-x, .bip-svg .bip-x { display: none; }
.bip.bip-show-q .bip-x-q, .bip.bip-show-spark .bip-x-spark, .bip.bip-show-notes .bip-x-notes { display: inline; }
.bip-show-q .bip-x-q { animation: bip-pop .35s var(--ease-pop) both; transform-origin: 53px -80px; }
.bip-show-spark .bip-x-spark path { animation: bip-twinkle .5s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.bip-show-notes .bip-x-notes { animation: bip-notes 1.2s ease-in-out infinite; }
.bip .bip-bob { animation: bip-bob 2.6s ease-in-out infinite; }
.bip .bip-eyes { transform-origin: 0 -45px; animation: bip-blink 4.6s infinite; }
.bip .bip-pupils { transition: transform .25s ease; }
.bip .bip-prop { transform-origin: 0 -96px; animation: bip-prop 1.1s linear infinite; }
.bip .bip-flame { transform-origin: 0 50px; animation: bip-flame .16s ease-in-out infinite alternate; }
.bip-hover .bip-in { transform: translateY(-6px); }
.bip .bip-arm-l { transform-origin: -29px 4px; }
.bip .bip-arm-r { transform-origin: 29px 4px; }
.bip .bip-head { transform-origin: 0 -14px; }
.bip .bip-led { animation: bip-led 2.4s steps(1) infinite; }
.bip .bip-led:nth-child(2) { animation-delay: .8s; }
.bip .bip-led:nth-child(3) { animation-delay: 1.6s; }
@keyframes bip-bob { 50% { transform: translateY(-2.5px); } }
@keyframes bip-blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes bip-prop { to { transform: rotateY(360deg); } }
@keyframes bip-flame { to { transform: scaleY(1.25); } }
@keyframes bip-led { 0%, 70% { opacity: 1; } 71%, 100% { opacity: .45; } }
@keyframes bip-pop { from { transform: scale(0); } }
@keyframes bip-twinkle { to { transform: scale(1.3) rotate(10deg); } }
@keyframes bip-notes { 50% { transform: translateY(-6px); } }
/* one-shot actions */
.bip-a-hop .bip-in { animation: bip-hop .52s cubic-bezier(.3, 1.4, .6, 1); }
.bip-a-jump .bip-in { animation: bip-jump .56s cubic-bezier(.3, 1.4, .6, 1); }
.bip-a-hop .bip-arm-l, .bip-a-jump .bip-arm-l { animation: bip-armup-l .52s ease; }
.bip-a-hop .bip-arm-r, .bip-a-jump .bip-arm-r { animation: bip-armup-r .52s ease; }
@keyframes bip-hop { 40% { transform: translateY(-14px); } 70% { transform: translateY(2px) scaleY(.96); } }
@keyframes bip-jump { 45% { transform: translateY(-26px); } 75% { transform: translateY(3px) scaleY(.94); } }
@keyframes bip-armup-l { 40% { transform: rotate(60deg); } }
@keyframes bip-armup-r { 40% { transform: rotate(-60deg); } }
.bip-a-dance .bip-in { animation: bip-dance .85s ease-in-out 2; }
.bip-a-dance .bip-arm-l { animation: bip-wave-l .425s ease-in-out 4; }
.bip-a-dance .bip-arm-r { animation: bip-wave-r .425s ease-in-out 4; animation-delay: .2s; }
@keyframes bip-dance { 25% { transform: rotate(-8deg) translateY(-4px); } 50% { transform: translateY(0); } 75% { transform: rotate(8deg) translateY(-4px); } }
.bip-a-wave .bip-arm-r { animation: bip-wave-r .36s ease-in-out 3; }
@keyframes bip-wave-l { 50% { transform: rotate(70deg); } }
@keyframes bip-wave-r { 50% { transform: rotate(-70deg); } }
.bip-a-bump .bip-in { animation: bip-bump .56s ease; }
@keyframes bip-bump { 15% { transform: translateX(-7px) rotate(-6deg); } 35% { transform: translateX(5px) rotate(4deg); } 55% { transform: translateX(-3px) rotate(-2deg); } 80% { transform: none; } }
.bip-a-shake .bip-head { animation: bip-shake .6s ease; }
@keyframes bip-shake { 20% { transform: rotate(-9deg); } 45% { transform: rotate(8deg); } 70% { transform: rotate(-5deg); } }
.bip-a-nod .bip-head { animation: bip-nod .6s ease; }
@keyframes bip-nod { 30% { transform: translateY(4px); } 60% { transform: translateY(-2px); } }
.bip-a-wiggle .bip-in { animation: bip-dance .5s ease-in-out; }
.bip-a-spin .bip-in { animation: bip-spin .8s ease-in-out; }
@keyframes bip-spin { to { transform: rotateY(360deg); } }
.bip-a-charge .bip-in { animation: bip-charge 1.5s ease; }
@keyframes bip-charge { 10%, 30%, 50%, 70% { filter: drop-shadow(0 0 8px #FFE45C) brightness(1.15); } 20%, 40%, 60% { filter: none; } }
.bip-a-clap .bip-arm-l { animation: bip-clap-l .42s ease; }
.bip-a-clap .bip-arm-r { animation: bip-clap-r .42s ease; }
@keyframes bip-clap-l { 40% { transform: rotate(-78deg); } }
@keyframes bip-clap-r { 40% { transform: rotate(78deg); } }
.bip-a-stomp .bip-in { animation: bip-stomp .42s ease; }
@keyframes bip-stomp { 30% { transform: translateY(-9px) rotate(-4deg); } 60% { transform: translateY(2px) scaleY(.95); } }
.bip-a-drum .bip-arm-r { animation: bip-drum .42s ease; }
@keyframes bip-drum { 35% { transform: rotate(-45deg); } 60% { transform: rotate(20deg); } }
.bip-a-bell .bip-arm-l { animation: bip-bell .42s ease; }
@keyframes bip-bell { 35% { transform: rotate(45deg); } 60% { transform: rotate(-15deg); } }
.bip-a-sneeze .bip-head { animation: bip-sneeze .9s ease; }
@keyframes bip-sneeze { 30% { transform: rotate(-8deg) translateY(-3px); } 45% { transform: rotate(10deg) translateY(4px) scale(1.06); } 70% { transform: none; } }
.bip-walking .bip-legs { animation: bip-walk .26s ease-in-out infinite alternate; }
.bip-walking .bip-wheel { animation: bip-roll .5s linear infinite; }
.bip-walking .bip-spring { animation: bip-spring .26s ease-in-out infinite alternate; transform-origin: 0 34px; }
@keyframes bip-walk { to { transform: translateY(-3px); } }
@keyframes bip-roll { to { transform: rotate(360deg); } }
@keyframes bip-spring { to { transform: scaleY(.7); } }

/* ---------------------------------------------------------------- reduced motion */
html[data-motion="reduce"] :is(.bip .bip-bob, .bip .bip-eyes, .bip .bip-prop, .bip .bip-flame, .bip .bip-led, .ll-glow, .ll-anim) { animation: none !important; }
html[data-motion="reduce"] .ll-glow { filter: drop-shadow(0 0 8px rgba(255, 197, 61, .95)) drop-shadow(0 0 3px #FFC53D); }
html[data-motion="reduce"] [class*="bip-a-"] * { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="full"]) :is(.bip .bip-bob, .bip .bip-eyes, .bip .bip-prop, .bip .bip-flame, .bip .bip-led, .ll-glow, .ll-anim) { animation: none !important; }
  html:not([data-motion="full"]) .ll-glow { filter: drop-shadow(0 0 8px rgba(255, 197, 61, .95)) drop-shadow(0 0 3px #FFC53D); }
  html:not([data-motion="full"]) [class*="bip-a-"] * { animation: none !important; }
}

/* ================================================================ lab props (title, prologue, hub) */
.ll-props { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ll-props svg { display: block; width: 100%; height: auto; overflow: visible; }
.ll-props .lab-leaves { position: absolute; left: 0; top: -20px; width: 100%; height: 58px; overflow: visible; }
.ll-prop-window { position: absolute; right: 5%; top: 9%; width: clamp(110px, 16vw, 200px); }
.ll-prop-shelf { position: absolute; left: 3%; top: 15%; width: clamp(150px, 22vw, 290px); }
.ll-prop-board { position: absolute; right: 3%; top: 47%; width: clamp(130px, 19vw, 240px); }
.ll-prop-cog { position: absolute; left: 10px; top: 50%; width: 92px; opacity: .9; }
.ll-props-hub .ll-prop-cog { display: none; }
.ll-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 15%; background: linear-gradient(#D9A86A, #C9934F); border-top: 4px solid var(--ink); }
.lab-cog-in { animation: ll-spin 18s linear infinite; transform-origin: 0 0; }
.lab-led { animation: ll-led 1.6s steps(1) infinite; }
.lab-led-1 { animation-delay: .3s; } .lab-led-2 { animation-delay: .6s; } .lab-led-3 { animation-delay: .9s; } .lab-led-4 { animation-delay: 1.2s; }
.lab-bubbles circle { animation: ll-bub 2.4s ease-in infinite; }
.lab-bubbles circle:nth-child(2) { animation-delay: .8s; } .lab-bubbles circle:nth-child(3) { animation-delay: 1.6s; }
.lab-cloud { animation: ll-drift 9s ease-in-out infinite alternate; }
@keyframes ll-spin { to { transform: rotate(360deg); } }
@keyframes ll-led { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .35; } }
@keyframes ll-bub { 0% { transform: translateY(8px); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateY(-26px); opacity: 0; } }
@keyframes ll-drift { to { transform: translateX(26px); } }
html[data-layout="tall"] .ll-prop-board, html[data-layout="tall"] .ll-prop-cog { display: none; }
html[data-layout="tall"] .ll-prop-window { width: clamp(84px, 20vw, 150px); top: 3%; right: 4%; }
html[data-layout="tall"] .ll-prop-shelf { width: clamp(120px, 30vw, 230px); top: 4%; left: 3%; }
html[data-layout="short"] .ll-prop-board, html[data-layout="short"] .ll-prop-cog { display: none; }
html[data-layout="short"] .ll-prop-shelf { width: 150px; top: 12%; }
html[data-layout="short"] .ll-prop-window { width: 92px; top: 8%; right: 2%; }

/* ================================================================ title */
.ll-title-scr { display: block; }
.ll-title-center { position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: clamp(.6rem, 2vh, 1.2rem); width: min(640px, 92%); z-index: 2; }
.ll-logo { display: flex; align-items: baseline; justify-content: center; font-weight: 1000; font-size: clamp(3rem, 8vw, 5.8rem); line-height: 1; letter-spacing: .01em; user-select: none; }
.ll-logo-l { display: inline-block; color: var(--c); transform: rotate(var(--r)); text-shadow: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 8px 0 var(--ink); animation: ll-logo-in .6s var(--ease-pop) both; animation-delay: var(--d); }
.ll-logo-sp { display: inline-block; width: .32em; }
@keyframes ll-logo-in { from { opacity: 0; transform: translateY(-30px) rotate(var(--r)) scale(.6); } }
.ll-tagline { font-weight: 1000; font-size: clamp(1.1rem, 2.4vw, 1.5rem); background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: .3em 1.1em; box-shadow: var(--shadow); transform: rotate(-1.5deg); }
.ll-pcards { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.ll-pcard { position: relative; width: 88px; height: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: #fff; border: 3px solid var(--ink); border-radius: 20px; box-shadow: var(--shadow); cursor: pointer; padding: 6px 4px; }
.ll-pcard:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.ll-pcard.is-cur { background: var(--sun-soft); }
.ll-pc-av { width: 58px; height: 58px; display: block; }
.ll-pc-av svg { width: 100%; height: 100%; }
.ll-pc-age { position: absolute; top: -10px; left: -8px; width: 30px; height: 30px; border-radius: 50%; background: var(--sun); border: 3px solid var(--ink); font-weight: 1000; font-size: .95rem; display: flex; align-items: center; justify-content: center; }
.ll-pc-chips { display: flex; align-items: center; gap: 3px; font-weight: 1000; font-size: .95rem; }
.ll-pc-chips .ll-chip-ico { width: 22px; height: 22px; }
.ll-pcard-new { border-style: dashed; background: rgba(255, 255, 255, .7); box-shadow: none; }
.ll-pc-plus { font-size: 2.2rem; font-weight: 1000; line-height: 1; }
.ll-pc-lbl { font-size: .85rem; font-weight: 900; text-align: center; line-height: 1.1; }
.ll-play { font-size: 1.6rem; min-height: 68px; padding: .4em 1.6em; }
.ll-title-tika { position: absolute; left: clamp(8px, 4vw, 60px); bottom: 5%; width: clamp(120px, 17vw, 210px); z-index: 3; }
.ll-title-bip { position: absolute; right: clamp(10px, 6vw, 90px); bottom: 5%; width: clamp(100px, 14vw, 170px); z-index: 3; }
.ll-title-foot { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; align-items: center; gap: .8rem; z-index: 4; white-space: nowrap; }
.ll-free { font-weight: 900; font-size: .9rem; color: var(--ink); background: rgba(255, 251, 241, .85); padding: .2em .7em; border-radius: 999px; }
.ll-parents-btn { font-size: .95rem; min-height: 48px; padding: .3em .9em; }
html[data-layout="tall"] .ll-title-center { top: 44%; }
html[data-layout="tall"] .ll-title-tika { bottom: 70px; width: clamp(110px, 26vw, 200px); }
html[data-layout="tall"] .ll-title-bip { bottom: 70px; width: clamp(90px, 22vw, 160px); }
html[data-layout="tall"] .ll-title-foot { flex-direction: column; gap: .3rem; bottom: 8px; }
html[data-layout="tall"] .ll-free { display: none; }
html[data-layout="short"] .ll-title-center { left: 58%; top: 50%; width: 60%; gap: .5rem; }
html[data-layout="short"] .ll-logo { font-size: 3rem; }
html[data-layout="short"] .ll-title-tika { width: 112px; bottom: 4%; left: 14px; }
html[data-layout="short"] .ll-title-bip { width: 92px; right: 18px; bottom: 4%; }
html[data-layout="short"] .ll-pcard { width: 74px; height: 84px; }
html[data-layout="short"] .ll-pc-av { width: 44px; height: 44px; }
html[data-layout="short"] .ll-play { min-height: 56px; font-size: 1.35rem; }
html[data-layout="short"] .ll-title-foot { left: auto; right: 130px; transform: none; bottom: 8px; }
html[data-layout="short"] .ll-free { display: none; }
.ll-title-tika .ll-bubble { position: absolute; left: 100%; bottom: 60%; width: max-content; max-width: 260px; }

/* ================================================================ new player */
.ll-new-scr { flex-direction: column; align-items: center; gap: 1rem; padding: 1rem; }
.ll-new-head { display: flex; align-items: center; gap: .8rem; width: min(760px, 100%); }
.ll-new-tika { width: clamp(80px, 12vw, 120px); flex: 0 0 auto; }
.ll-new-bubble { flex: 1 1 auto; min-width: 0; }
.ll-new-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; width: 100%; }
.ll-av-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.6rem, 2vw, 1.2rem); width: min(560px, 100%); }
.ll-av { aspect-ratio: 1; background: none; border: 0; padding: 0; border-radius: 50%; cursor: pointer; transition: transform .15s var(--ease-pop); }
.ll-av svg { width: 100%; height: 100%; display: block; }
.ll-av:active { transform: scale(.94); }
.ll-av.is-on { transform: scale(1.1); filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 10px rgba(255, 197, 61, .9)); }
.ll-cakes { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(.4rem, 1.6vw, 1rem); }
.ll-cake { position: relative; width: clamp(96px, 15vw, 140px); background: #fff; border: 3px solid var(--ink); border-radius: 22px; box-shadow: var(--shadow); padding: 6px 6px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.ll-cake:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.ll-cake svg { width: 100%; height: auto; }
.ll-cake b { font-size: 1.8rem; font-weight: 1000; line-height: 1.1; }
.ll-new-back { min-width: 56px; }
html[data-layout="short"] .ll-new-scr { padding: .5rem; gap: .4rem; }
html[data-layout="short"] .ll-new-tika { width: 64px; }
html[data-layout="short"] .ll-av-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); width: min(780px, 100%); }
html[data-layout="short"] .ll-cake { width: 120px; }
html[data-layout="short"] .ll-cake b { font-size: 1.4rem; }
html[data-layout="tall"] .ll-cakes { max-width: 520px; }
@media (max-width: 440px) { .ll-cake { width: 104px; } }

/* ================================================================ prologue */
.ll-pro-scr { display: block; }
.ll-pro-stage { position: absolute; left: 0; right: 0; bottom: 15%; height: 50%; }
.ll-pro-tika { position: absolute; left: 14%; bottom: -4%; width: clamp(120px, 20vw, 230px); }
.ll-pro-bip { position: absolute; right: 16%; bottom: -2%; width: clamp(110px, 17vw, 200px); transition: transform .9s cubic-bezier(.3, 1.2, .5, 1); }
.ll-pro-bip.is-out { transform: translateX(160%); }
.ll-pro-bip.is-in { transform: none; }
.ll-pro-bubble { position: absolute; left: 50%; top: 9%; transform: translateX(-50%); width: min(620px, 90%); display: flex; justify-content: center; z-index: 3; }
.ll-pro-next { position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); z-index: 4; }
.ll-pro-chips { position: absolute; right: 22%; bottom: 40%; width: 1px; height: 1px; }
.ll-pro-chip { position: absolute; width: 54px; height: 54px; margin: -27px; animation: ll-chipfly 1.4s cubic-bezier(.2, .8, .4, 1) both; animation-delay: var(--d); }
.ll-pro-chip svg { width: 100%; height: 100%; }
@keyframes ll-chipfly { 0% { transform: scale(.2); opacity: 0; } 15% { opacity: 1; } 100% { transform: rotate(var(--a)) translateY(-46vh) rotate(calc(-1 * var(--a))) scale(.9); opacity: 0; } }
.ll-skip { min-height: 48px; font-size: 1rem; }
html[data-layout="tall"] .ll-pro-stage { height: 40%; bottom: 12%; }
html[data-layout="tall"] .ll-pro-tika { left: 6%; width: 36%; }
html[data-layout="tall"] .ll-pro-bip { right: 8%; width: 30%; }
html[data-layout="tall"] .ll-pro-bubble { top: 22%; }
html[data-layout="short"] .ll-pro-stage { height: 62%; bottom: 4%; }
html[data-layout="short"] .ll-pro-tika { width: 120px; left: 6%; }
html[data-layout="short"] .ll-pro-bip { width: 100px; right: 6%; }
html[data-layout="short"] .ll-pro-bubble { top: 4%; width: 62%; }
html[data-layout="short"] .ll-pro-next { left: auto; right: 2%; transform: none; bottom: 4%; }

/* ================================================================ hub */
.ll-hub { display: grid; gap: 12px; padding: 12px; grid-template-columns: minmax(0, 1fr) clamp(220px, 25vw, 290px); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "rooms side" "say side"; }
.ll-rooms { grid-area: rooms; position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 12px; min-height: 0; }
.ll-room { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 0; padding: 10px 8px 12px; background: var(--rs); border: 3px solid var(--ink); border-radius: 26px; box-shadow: 0 6px 0 var(--ink); cursor: pointer; font: inherit; color: var(--ink); transition: transform .12s ease, box-shadow .12s ease; overflow: hidden; }
.ll-room::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .0) 0 14px, rgba(255, 255, 255, .35) 14px 18px); pointer-events: none; }
.ll-room:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink); }
.ll-room.is-sug { box-shadow: 0 6px 0 var(--ink), 0 0 0 5px var(--sun); }
.ll-room-door { position: relative; width: min(46%, 110px); aspect-ratio: 1; border-radius: 50% 50% 18px 18px; background: #fff; border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 -6px 0 rgba(36, 38, 59, .08); }
.ll-room-ico { width: 82%; display: block; }
.ll-room-ico svg, .ll-ico { width: 100%; height: auto; display: block; overflow: visible; }
.ll-room-name { position: relative; font-weight: 1000; font-size: clamp(.98rem, 1.7vw, 1.25rem); line-height: 1.1; text-align: center; }
.ll-room-prog { position: relative; display: flex; align-items: center; gap: 6px; width: min(80%, 170px); font-weight: 1000; font-size: .95rem; }
.ll-room-bar { flex: 1 1 auto; height: 12px; background: #fff; border: 2.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.ll-room-bar i { display: block; height: 100%; background: var(--rc); border-right: 2.5px solid var(--ink); }
.ll-room-bar i[style="width:0%"] { border-right: 0; }
.ll-room-star { position: absolute; right: 8px; top: 8px; width: 34px; }
.ll-room-star svg { width: 100%; display: block; }
.ll-room-num { position: absolute; left: 10px; top: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--rc); color: #fff; border: 2.5px solid var(--ink); font-weight: 1000; font-size: .9rem; display: flex; align-items: center; justify-content: center; text-shadow: 0 1px 0 rgba(36, 38, 59, .4); }
.ll-chip, .ll-chip svg { display: block; overflow: visible; }
.ll-side { grid-area: side; position: relative; z-index: 1; display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-height: 0; background: rgba(255, 251, 241, .82); border: 3px solid var(--ink); border-radius: 26px; box-shadow: 0 6px 0 var(--ink); padding: 10px; }
.ll-side-bip { flex: 1 1 auto; min-height: 0; display: flex; align-items: flex-end; justify-content: center; }
.ll-side-bip .bip { width: auto; height: 100%; max-height: 220px; max-width: 100%; aspect-ratio: 140 / 182; }
.ll-side-btn { width: 100%; }
.ll-side-card { position: relative; display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 6px 10px; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow-sm); font: inherit; font-weight: 1000; font-size: 1.05rem; color: var(--ink); cursor: pointer; text-align: left; }
.ll-side-card:active { transform: translateY(3px); box-shadow: none; }
.ll-side-ico { width: 44px; flex: 0 0 auto; }
.ll-sand { background: var(--sky-soft); }
.ll-fin { background: var(--sun-soft); }
.ll-fin.is-locked { background: #EEF0F6; color: var(--ink-2); }
.ll-fin.is-locked .ll-side-ico { filter: grayscale(.8); opacity: .7; }
.ll-fin-lock { position: absolute; right: 6px; top: -12px; display: flex; align-items: center; gap: 2px; background: #fff; border: 2.5px solid var(--ink); border-radius: 999px; padding: 1px 6px 1px 3px; font-size: .8rem; }
.ll-fin-lock .ll-lock { width: 18px; height: 18px; }
.ll-fin-lock .ll-chip-ico { width: 18px; height: 18px; }
.ll-side .ll-parents-btn { margin-top: auto; background: transparent; box-shadow: none; border-style: dashed; }
.ll-hub-say { grid-area: say; position: relative; z-index: 2; display: flex; align-items: flex-end; gap: 10px; min-width: 0; }
.ll-hub-tika { width: clamp(80px, 9vw, 104px); flex: 0 0 auto; margin-top: -26px; }
.ll-hub-bubble { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; padding-bottom: 10px; }
.ll-who { padding: 2px; }
.ll-who svg { width: 100%; height: 100%; }
html[data-layout="tall"] .ll-hub { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; grid-template-areas: "rooms" "side" "say"; }
html[data-layout="tall"] .ll-rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); }
html[data-layout="tall"] .ll-side { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "bip dress sand" "par fin fin"; align-items: center; padding: 8px; gap: 8px; }
html[data-layout="tall"] .ll-side-bip { grid-area: bip; width: 64px; height: 70px; }
html[data-layout="tall"] .ll-side-btn { grid-area: dress; width: auto; padding-left: .5em; padding-right: .5em; white-space: normal; }
html[data-layout="tall"] .ll-sand { grid-area: sand; }
html[data-layout="tall"] .ll-fin { grid-area: fin; }
html[data-layout="tall"] .ll-side .ll-parents-btn { grid-area: par; margin: 0; width: 64px; min-height: 52px; padding: 0; }
html[data-layout="tall"] .ll-side .ll-parents-btn span { display: none; }
html[data-layout="short"] .ll-hub { grid-template-columns: minmax(0, 1fr) 216px; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "say side" "rooms side"; gap: 8px; padding: 6px 8px 8px; }
html[data-layout="short"] .ll-hub-tika { width: 50px; margin-top: 0; }
html[data-layout="short"] .ll-hub-bubble { padding-bottom: 0; }
html[data-layout="short"] .ll-hub-bubble .ll-bubble { font-size: 15px; padding: .25rem .7rem; }
html[data-layout="short"] .ll-rooms { gap: 8px; }
html[data-layout="short"] .ll-room { flex-direction: row; flex-wrap: wrap; gap: 4px 8px; padding: 6px 8px; border-radius: 18px; box-shadow: 0 4px 0 var(--ink); }
html[data-layout="short"] .ll-room-door { width: 54px; }
html[data-layout="short"] .ll-room-name { font-size: .95rem; }
html[data-layout="short"] .ll-room-prog { width: 100%; justify-content: center; }
html[data-layout="short"] .ll-room-bar { max-width: 90px; }
html[data-layout="short"] .ll-room-num { display: none; }
html[data-layout="short"] .ll-side { gap: 6px; padding: 6px; border-radius: 18px; }
html[data-layout="short"] .ll-side-bip { order: 4; flex: 1 1 auto; min-height: 0; }
html[data-layout="short"] .ll-side .ll-parents-btn { order: 5; margin-top: 0; }
html[data-layout="short"] .ll-side-card { min-height: 50px; font-size: .95rem; padding: 4px 8px; }
html[data-layout="short"] .ll-side-ico { width: 36px; }
@media (max-width: 440px) { .ll-room-door { width: 54%; } .ll-room-name { font-size: .95rem; } }

/* ================================================================ room board (PCB) */
.ll-roomscr { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; padding: 12px; }
.ll-pcb { position: relative; min-height: 0; background-color: var(--rs); background-image: radial-gradient(rgba(36, 38, 59, .12) 1.6px, transparent 1.8px); background-size: 22px 22px; border: 4px solid var(--ink); border-radius: 26px; box-shadow: 0 6px 0 var(--ink), inset 0 0 0 8px rgba(255, 255, 255, .45); }
.ll-pcb-badge { position: absolute; right: 14px; bottom: 10px; width: clamp(60px, 9vw, 100px); opacity: .25; }
.ll-pcb-traces { position: absolute; inset: 0; pointer-events: none; }
.ll-pcb-traces svg { position: absolute; left: 0; top: 0; overflow: visible; }
.ll-trace-lit { filter: drop-shadow(0 0 4px rgba(255, 228, 92, .9)); }
.ll-sock { position: absolute; padding: 0; background: none; border: 0; cursor: pointer; border-radius: 22%; }
.ll-sock-chip { position: absolute; inset: 0; }
.ll-sock-chip svg { width: 100%; height: 100%; }
.ll-sock-ico { position: absolute; left: 30%; top: 26%; width: 40%; }
.ll-sock-ico svg { width: 100%; height: auto; }
.ll-sock-n { position: absolute; left: 50%; bottom: -6%; transform: translateX(-50%); min-width: 30px; height: 30px; padding: 0 6px; border-radius: 999px; background: #fff; border: 3px solid var(--ink); font-weight: 1000; font-size: 1rem; display: flex; align-items: center; justify-content: center; }
.ll-sock.is-done .ll-sock-n { background: var(--rc); color: #fff; text-shadow: 0 1px 0 rgba(36, 38, 59, .5); }
.ll-sock.is-open:not(.is-done) .ll-sock-n { background: var(--sun); }
.ll-sock.is-locked { opacity: .62; }
.ll-sock.is-locked .ll-sock-ico { filter: grayscale(1); opacity: .5; }
.ll-sock-lock { position: absolute; right: 2%; top: 0; width: 34%; }
.ll-sock-lock svg { width: 100%; height: auto; }
.ll-sock:active { transform: translateY(3px); }
.ll-room-say { display: flex; align-items: flex-end; gap: 10px; min-width: 0; }
html[data-layout="short"] .ll-roomscr { grid-template-rows: auto minmax(0, 1fr); padding: 6px 8px 8px; gap: 6px; }
html[data-layout="short"] .ll-room-say { order: -1; }
html[data-layout="short"] .ll-room-say .ll-hub-tika { width: 50px; margin: 0; }
html[data-layout="short"] .ll-room-say .ll-hub-bubble { padding: 0; }
html[data-layout="short"] .ll-sock-n { height: 26px; min-width: 26px; font-size: .9rem; }

/* ================================================================ reward (chip ceremony) */
.ll-reward { position: absolute; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(36, 38, 59, .42); animation: tk-fade .25s ease both; }
.ll-reward.out { animation: tk-fade-out .2s ease both; }
.ll-rw-card { position: relative; width: min(640px, 100%); max-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; background: var(--lab); border: 4px solid var(--ink); border-radius: 30px; box-shadow: 0 8px 0 var(--ink); padding: 14px; animation: tk-modal-in .35s var(--ease-pop) both; }
.ll-rw-stage { position: relative; height: clamp(170px, 34vh, 290px); border-radius: 22px; background: radial-gradient(circle at 50% 60%, #fff 0, var(--rs) 70%); border: 3px solid var(--ink); overflow: hidden; }
.ll-rw-stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 18%; background: #E8C48A; border-top: 3px solid var(--ink); }
.ll-rw-bip { position: absolute; left: 50%; bottom: 6%; height: 88%; transform: translateX(-50%); z-index: 2; aspect-ratio: 140 / 182; }
.ll-rw-bip .bip { height: 100%; width: auto; }
.ll-rw-bip .bip-svg { height: 100%; width: auto; }
.ll-rw-chip { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; z-index: 3; opacity: 0; transform: scale(.2); }
.ll-rw-chip svg { width: 100%; height: 100%; }
.ll-rw-chip.is-pop { opacity: 1; transform: translateX(-110%) scale(1.3); transition: transform .5s var(--ease-pop), opacity .3s; }
.ll-rw-chip.is-fly { transform: translate(-2px, 34%) scale(.32); transition: transform .6s cubic-bezier(.5, -.3, .5, 1.3); }
.ll-rw-chip.is-in { opacity: 0; transition: opacity .2s; }
.ll-rw-chip.is-small { opacity: 1; transform: translate(-130%, -60%) scale(.8); transition: transform .5s var(--ease-pop); }
.ll-rw-part { position: absolute; left: 50%; top: 46%; width: 120px; height: 120px; margin: -60px 0 0 -60px; z-index: 4; display: flex; align-items: center; justify-content: center; transform: scale(0); }
.ll-rw-part.is-on { transform: scale(1); transition: transform .5s var(--ease-pop); }
.ll-rw-part.is-go { transform: translateY(-20%) scale(.2); opacity: 0; transition: transform .4s ease-in, opacity .4s ease-in; }
.ll-rw-part svg { position: relative; width: 82%; height: 82%; overflow: visible; z-index: 1; }
.ll-rw-burst { position: absolute; inset: -14%; border-radius: 50%; background: repeating-conic-gradient(from 0deg, #FFE45C 0 12deg, #FFF6C2 12deg 24deg); border: 3px solid var(--ink); animation: ll-spin 6s linear infinite; }
.ll-rw-say { display: flex; align-items: flex-end; gap: 10px; min-width: 0; }
.ll-rw-tika { width: clamp(76px, 10vw, 100px); flex: 0 0 auto; margin-top: -30px; }
.ll-rw-bubble { flex: 1 1 auto; min-width: 0; padding-bottom: 8px; display: flex; }
.ll-rw-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; min-height: 60px; }
html[data-layout="short"] .ll-rw-card { width: min(780px, 100%); grid-template-columns: 250px minmax(0, 1fr); grid-template-rows: auto auto; padding: 10px; gap: 8px; }
html[data-layout="short"] .ll-rw-stage { grid-row: 1 / span 2; height: 100%; min-height: 230px; }
html[data-layout="short"] .ll-rw-tika { width: 64px; margin-top: 0; }
html[data-layout="short"] .ll-rw-say { align-items: center; }
html[data-layout="short"] .ll-rw-actions { justify-content: flex-start; align-items: flex-end; }

/* ================================================================ garage */
.ll-garage { display: grid; gap: 12px; padding: 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "stage panel" "say panel"; }
.ll-gar-stage { grid-area: stage; position: relative; min-height: 0; background: radial-gradient(circle at 50% 40%, #fff, #FFE3EE 75%); border: 3px solid var(--ink); border-radius: 26px; box-shadow: 0 6px 0 var(--ink); overflow: hidden; display: flex; align-items: flex-end; justify-content: center; }
.ll-gar-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 16%; background: #E8C48A; border-top: 3px solid var(--ink); }
.ll-gar-bip { position: relative; z-index: 1; height: 86%; aspect-ratio: 140 / 182; max-width: 92%; margin-bottom: 4%; }
.ll-gar-bip .bip, .ll-gar-bip .bip-svg { height: 100%; width: auto; max-width: 100%; }
.ll-gar-panel { grid-area: panel; min-height: 0; display: flex; flex-direction: column; gap: 10px; background: var(--lab); border: 3px solid var(--ink); border-radius: 26px; box-shadow: 0 6px 0 var(--ink); padding: 10px; }
.ll-gar-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.ll-gar-tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 4px 2px; background: #fff; border: 3px solid var(--ink); border-radius: 16px; font: inherit; font-weight: 900; font-size: .78rem; color: var(--ink); cursor: pointer; box-shadow: var(--shadow-sm); }
.ll-gar-tab.is-on { background: var(--sun); transform: translateY(-2px); }
.ll-gar-tab-ico { width: 34px; height: 30px; display: flex; align-items: center; justify-content: center; }
.ll-gar-tab-ico svg { max-width: 100%; max-height: 100%; }
.ll-new-dot { position: absolute; right: -4px; top: -4px; width: 14px; height: 14px; border-radius: 50%; background: var(--tomato); border: 2px solid var(--ink); }
.ll-gar-items { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); grid-auto-rows: 78px; gap: 10px; align-content: start; }
.ll-gar-item { position: relative; display: flex; align-items: center; justify-content: center; padding: 6px; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow-sm); cursor: pointer; }
.ll-gar-item:active { transform: translateY(3px); box-shadow: none; }
.ll-gar-item.is-on { background: var(--go-soft); box-shadow: 0 3px 0 var(--ink), 0 0 0 4px var(--go); }
.ll-gar-item.is-new::after { content: ""; position: absolute; right: -5px; top: -5px; width: 16px; height: 16px; border-radius: 50%; background: var(--tomato); border: 2px solid var(--ink); }
.ll-gar-item.is-locked { background: #EEF0F6; }
.ll-gar-item.is-locked .ll-gar-art { filter: grayscale(1) brightness(1.4); opacity: .45; }
.ll-gar-art { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.ll-gar-art svg, .bip-part-ico { max-width: 100%; max-height: 100%; width: 100%; height: 100%; overflow: visible; }
.ll-gar-need { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; background: #fff; border: 2.5px solid var(--ink); border-radius: 999px; padding: 0 6px 0 2px; font-weight: 1000; font-size: .85rem; white-space: nowrap; }
.ll-gar-need .ll-chip-ico, .ll-gar-need .ll-lock { width: 20px; height: 20px; }
.ll-gar-need-room { width: 30px; height: 26px; padding: 2px; }
.ll-gar-need-room svg { width: 100%; height: 100%; }
.ll-gar-say { grid-area: say; display: flex; align-items: flex-end; gap: 10px; min-width: 0; }
html[data-layout="tall"] .ll-garage { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, .9fr) auto minmax(0, 1fr); grid-template-areas: "stage" "say" "panel"; }
html[data-layout="tall"] .ll-gar-items { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); grid-auto-rows: 70px; }
html[data-layout="short"] .ll-garage { grid-template-columns: 200px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "stage say" "stage panel"; gap: 8px; padding: 6px 8px 8px; }
html[data-layout="short"] .ll-gar-say .ll-hub-tika { width: 50px; margin: 0; }
html[data-layout="short"] .ll-gar-say .ll-hub-bubble { padding: 0; }
html[data-layout="short"] .ll-gar-tab { min-height: 50px; }
html[data-layout="short"] .ll-gar-tab-lbl { display: none; }
html[data-layout="short"] .ll-gar-items { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); grid-auto-rows: 58px; gap: 8px; }
@media (max-width: 440px) { .ll-gar-tab-lbl { display: none; } .ll-gar-tab { min-height: 52px; } }

/* ================================================================ parents */
.ll-par-modal { width: min(46rem, 100%); text-align: left; }
.ll-par-modal .tk-modal-title { text-align: center; }
.ll-par-sec { margin: .2rem 0 .9rem; }
.ll-par-sec h3 { margin: 0 0 .3rem; font-size: 1.12rem; font-weight: 1000; }
.ll-par-sec p, .ll-par-sec li { font-size: 1rem; font-weight: 700; line-height: 1.4; margin: .2rem 0; }
.ll-par-sec ul { margin: 0; padding-left: 1.2rem; }
.ll-par-ages { display: flex; flex-wrap: wrap; gap: .5rem; margin: .3rem 0 .6rem; }
.ll-par-ages .tk-btn { min-width: 56px; }
.ll-par-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: .5rem 0; }
.ll-par-lbl { font-weight: 900 !important; }

/* ================================================================ engines – shared bits */
.ll-popbeat { animation: ll-popbeat .32s var(--ease-pop); }
@keyframes ll-popbeat { 40% { transform: scale(1.22) translateY(-6px); } }
.ll-piece { display: block; width: 100%; height: 100%; overflow: visible; }

/* ================================================================ PATTERN */
.pt-board { background: radial-gradient(circle at 50% 30%, #fff 0, var(--lab) 60%); }
.pt-track { position: absolute; inset: 0; pointer-events: none; }
.pt-track svg { position: absolute; left: 0; top: 0; overflow: visible; }
.pt-slot { position: absolute; display: flex; align-items: center; justify-content: center; }
.pt-slot.is-gap { border: 4px dashed var(--ink-3); border-radius: 50%; background: rgba(255, 255, 255, .85); }
.pt-voz .pt-slot.is-gap { border-radius: 14px; }
.pt-leja .pt-slot.is-gap { border-radius: 18px; }
.pt-slot.is-gap::after { content: "?"; font-weight: 1000; font-size: 1.4em; color: var(--ink-3); }
.pt-slot.tk-drop-ok { border-color: var(--sun-deep); background: var(--sun-soft); }
.pt-piece { width: 100%; height: 100%; }
.pt-new { animation: ll-popbeat .4s var(--ease-pop); }
.pt-rev .ll-car { transform: scaleX(-1); }
.pt-loco { position: absolute; z-index: 1; }
.pt-loco.pt-rev .ll-loco { transform: scaleX(-1); }
.pt-ogrlica .pt-slot .ll-bead { filter: drop-shadow(0 3px 0 rgba(36, 38, 59, .18)); }
.pt-go .pt-slot, .pt-go .pt-loco { animation: pt-chug .26s ease-in-out 6; }
@keyframes pt-chug { 50% { transform: translateY(-3px); } }
.pt-leja .pt-slot .ll-flower { transform-origin: 50% 90%; }
.pt-tray { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--item), 100px)); justify-content: center; gap: 12px; align-content: center; justify-items: center; flex: 1 1 auto; min-height: 0; }
.pt-src { width: 100%; max-width: 96px; aspect-ratio: 1; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow-sm); padding: 6px; display: flex; align-items: center; justify-content: center; }
.pt-src.ll-dim { opacity: .35; }
.pt-leja .pt-src, .ll-k-pattern .pt-src .ll-flower { padding: 2px; }
.pt-free-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pt-free .pt-slot.is-filled { cursor: pointer; }
html[data-layout="tall"] .ll-k-pattern .pt-tray { grid-template-columns: repeat(auto-fit, minmax(56px, 76px)); justify-content: center; }
html[data-layout="short"] .pt-tray { gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
html[data-layout="short"] .pt-src { border-radius: 14px; padding: 4px; }
html[data-layout="short"] .pt-slot.is-gap { border-width: 3px; }
html[data-layout="reduce"] .pt-go .pt-slot { animation: none; }
.ll-sr { position: fixed; left: 0; top: 0; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; white-space: nowrap; overflow: hidden; overflow: clip; clip-path: inset(50%); }

@media (max-width: 820px) { .ll-top-hub .ll-title { display: none; } }
html[data-layout="wide"] .ll-k-pattern .pt-tray, html[data-layout="square"] .ll-k-pattern .pt-tray { --item: 84px; }

/* ================================================================ RHYTHM */
.rt-board { background: linear-gradient(#FFF6E0 0, #FFF6E0 100%); }
.rt-strip { position: absolute; left: 0; right: 0; top: 10px; display: grid; grid-template-columns: repeat(var(--cols, 6), var(--c, 64px)); justify-content: center; gap: calc(var(--c, 64px) * .12); z-index: 2; }
.rt-card { width: var(--c, 64px); height: var(--c, 64px); background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; padding: 5px; transition: background-color .2s, opacity .25s; }
.rt-card b { font-size: calc(var(--c, 64px) * .5); font-weight: 1000; color: var(--ink-3); }
.rt-card.is-gap { border-style: dashed; border-color: var(--ink-3); background: rgba(255, 255, 255, .7); box-shadow: none; }
.ll-k-rhythm .rt-card.is-todo:not(.is-shown) > svg { opacity: 0; }
.rt-card.is-todo { opacity: .78; }
.rt-card.is-next { box-shadow: 0 3px 0 var(--ink), 0 0 0 5px var(--sun); opacity: 1; }
.rt-card.is-done { background: var(--go-soft); opacity: 1; }
.rt-card.is-play { animation: ll-popbeat .32s var(--ease-pop); }
.rt-stage { position: absolute; left: 0; right: 0; bottom: 0; top: 30%; overflow: hidden; }
.rt-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 22%; background: repeating-linear-gradient(90deg, #D9A86A 0 60px, #CF9C5E 60px 63px); border-top: 4px solid var(--ink); }
.rt-curtain { position: absolute; top: 0; bottom: 18%; width: 12%; background: repeating-linear-gradient(90deg, #E0473B 0 14px, #C93A30 14px 22px); border: 3px solid var(--ink); }
.rt-curtain-l { left: -3px; border-radius: 0 0 40px 0; }
.rt-curtain-r { right: -3px; border-radius: 0 0 0 40px; }
.rt-prop { position: absolute; bottom: 12%; width: clamp(54px, 13%, 100px); aspect-ratio: 1; }
.rt-drum { left: 15%; } .rt-bell { right: 15%; }
.rt-hit { animation: rt-hit .3s ease; }
@keyframes rt-hit { 40% { transform: scale(1.15) rotate(-6deg); } }
.rt-bip { position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); aspect-ratio: 140 / 182; }
.rt-bip .bip, .rt-bip .bip-svg { height: 100%; width: auto; }
.rt-pads { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-content: center; }
.rt-pads.rt-n3 .rt-pad:last-child { grid-column: 1 / -1; justify-self: center; width: calc(50% - 6px); }
.rt-pad { position: relative; aspect-ratio: 1; max-height: 140px; width: 100%; justify-self: center; background: var(--pc); border: 3px solid var(--ink); border-radius: 26px; box-shadow: 0 6px 0 var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 8px; transition: transform .08s ease, box-shadow .08s ease, opacity .2s; }
.rt-pad:active, .rt-pad.rt-ok { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink); }
.rt-pad-art { width: 74%; height: 74%; }
.rt-pad-sym { position: absolute; right: -8px; top: -8px; width: 42%; height: 42%; background: #fff; border: 3px solid var(--ink); border-radius: 50%; padding: 4px; }
.rt-pads.is-busy .rt-pad { opacity: .6; }
.rt-again { align-self: center; font-size: 1rem; }
.rt-again[disabled] { opacity: .45; }
html[data-layout="tall"] .rt-pads { grid-template-columns: repeat(4, minmax(0, 1fr)); }
html[data-layout="tall"] .rt-pads.rt-n3 .rt-pad:last-child { grid-column: auto; width: 100%; }
html[data-layout="tall"] .rt-pads.rt-n2 { grid-template-columns: repeat(2, minmax(0, 120px)); justify-content: center; }
html[data-layout="tall"] .rt-pads.rt-n3 { grid-template-columns: repeat(3, minmax(0, 120px)); justify-content: center; }
html[data-layout="tall"] .rt-pad { max-height: 120px; }
html[data-layout="short"] .rt-pads { gap: 8px; }
html[data-layout="short"] .rt-pad { border-radius: 18px; box-shadow: 0 4px 0 var(--ink); max-height: 110px; }
html[data-layout="short"] .rt-again { min-height: 48px; font-size: .9rem; padding: .2em .8em; }
html[data-layout="short"] .rt-pads { grid-template-rows: repeat(2, minmax(0, 1fr)); }
html[data-layout="short"] .rt-pad { aspect-ratio: auto; height: 100%; max-height: none; padding: 4px; }
html[data-layout="short"] .rt-pad-art { width: auto; height: 82%; aspect-ratio: 1; }

/* ================================================================ SEQ */
.sq-board { background: linear-gradient(#DFF3FF 0, #F2FAFF 55%, #E9F7DD 55%, #E9F7DD 100%); }
.sq-board.sq-line { background: linear-gradient(#FFF6E0, #FFFBF1); }
.sq-hills { position: absolute; left: 0; right: 0; bottom: 0; height: 46%; background: radial-gradient(ellipse at 20% 0%, #CDEBB4 0 38%, transparent 39%), radial-gradient(ellipse at 80% 10%, #BFE3A3 0 34%, transparent 35%); opacity: .9; pointer-events: none; }
.sq-loco { position: absolute; z-index: 2; }
.sq-car { position: absolute; display: flex; align-items: center; justify-content: center; z-index: 1; cursor: pointer; }
.sq-car-art { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sq-num { position: relative; z-index: 1; font-weight: 1000; line-height: 1; margin-top: -12%; color: var(--ink); }
.sq-q { color: var(--ink-3); }
.sq-car.is-gap .sq-car-art rect:first-child { fill: #fff; stroke-dasharray: 6 5; }
.sq-car.is-gap .sq-car-art rect:nth-child(2) { fill: #F5F2EA; }
.sq-car.tk-drop-ok .sq-car-art rect:nth-child(2) { fill: var(--sun-soft); }
.sq-car.is-filled .sq-num { color: var(--go); animation: ll-popbeat .4s var(--ease-pop); }
.sq-dots { position: absolute; z-index: 1; left: 50%; top: 47%; transform: translateX(-50%); display: grid; grid-template-columns: repeat(5, .24em); gap: .05em; justify-content: center; }
.sq-dots i { width: .24em; height: .24em; border-radius: 50%; background: var(--tomato); }
.sq-car:has(.sq-dots) .sq-num { margin-top: -38%; }
.sq-board.sq-train .sq-num { margin-top: -22%; }
.sq-step { position: absolute; z-index: 3; transform: translate(-50%, -50%); background: var(--sun); border: 2.5px solid var(--ink); border-radius: 999px; padding: 0 .45em; font-weight: 1000; line-height: 1.3; opacity: 0; transition: opacity .3s; pointer-events: none; white-space: nowrap; }
.sq-steps .sq-step { opacity: 1; }
.sq-tray { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--item), 100px)); justify-content: center; align-content: center; gap: 12px; flex: 1 1 auto; min-height: 0; }
.sq-tile { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); }
.sq-tile b { font-weight: 1000; font-size: clamp(1.6rem, 3.4vw, 2.4rem); line-height: 1; }
.sq-tile.ll-dim, .sq-opt.ll-dim { opacity: .35; }
.sq-card { position: absolute; background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 6px; display: flex; align-items: center; justify-content: center; }
.sq-card.is-gap { border-style: dashed; border-color: var(--ink-3); background: rgba(255, 255, 255, .85); box-shadow: none; }
.sq-card.tk-drop-ok { background: var(--sun-soft); }
.sq-card .sq-q { font-weight: 1000; font-size: 2rem; }
.sq-pin { position: absolute; left: 50%; top: -12px; width: 12px; height: 22px; margin-left: -6px; background: #B98352; border: 2.5px solid var(--ink); border-radius: 4px; }
.sq-frame { width: 100%; height: 100%; display: block; overflow: visible; }
.sq-opt { width: 100%; aspect-ratio: 1; max-width: 110px; background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 6px; }
html[data-layout="wide"] .sq-tray, html[data-layout="square"] .sq-tray { --item: 84px; }
html[data-layout="short"] .sq-tray { grid-template-columns: repeat(2, minmax(0, 90px)); gap: 8px; }
html[data-layout="short"] .sq-tile b { font-size: 1.5rem; }

/* ================================================================ ORDER */
.od-board { background: linear-gradient(#FFF6E0, #FFFBF1); }
.od-strip { position: absolute; inset: 12px; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 12px; align-content: center; }
.od-strip.od-n3 { --n: 3; } .od-strip.od-n4 { --n: 4; }
.od-slot { position: relative; aspect-ratio: 6 / 5; background: rgba(255, 255, 255, .7); border: 3px dashed var(--ink-3); border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.od-slot.is-filled { border-style: solid; border-color: var(--ink); background: #fff; box-shadow: var(--shadow-sm); }
.od-slot.tk-drop-ok { background: var(--sun-soft); }
.od-slot.is-telling { box-shadow: 0 3px 0 var(--ink), 0 0 0 6px var(--sun); transform: translateY(-4px); transition: transform .2s var(--ease-pop); }
.od-hole { position: absolute; inset: 6px; display: flex; }
.od-hole svg, .od-card svg { width: 100%; height: 100%; display: block; }
.od-num { position: absolute; left: -10px; top: -14px; z-index: 2; display: flex; align-items: center; gap: 3px; background: var(--sun); border: 3px solid var(--ink); border-radius: 999px; padding: 0 8px 0 6px; height: 30px; }
.od-num b { font-weight: 1000; font-size: 1.05rem; }
.od-dots { display: flex; gap: 2px; }
.od-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.od-tray { flex: 1 1 auto; min-height: 0; display: grid; gap: 10px; align-content: center; justify-content: center; }
.od-tray-story { grid-template-columns: repeat(2, minmax(0, 150px)); }
.od-card { aspect-ratio: 6 / 5; background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 4px; }
.od-card.is-used, .od-item.is-used { visibility: hidden; }
.od-tray.is-empty { opacity: .3; }
.od-sign { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); width: 150px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 2px 8px; }
.od-sign svg { display: block; width: 100%; }
.od-shelf { position: absolute; left: 12px; right: 12px; bottom: 16px; display: flex; align-items: flex-end; justify-content: center; gap: 0; padding-bottom: 18px; }
.od-plank { position: absolute; left: 0; right: 0; bottom: 0; height: 20px; background: #B98352; border: 3px solid var(--ink); border-radius: 6px; box-shadow: 0 4px 0 var(--ink); }
.od-sslot { position: relative; display: flex; align-items: flex-end; justify-content: center; border-bottom: 0; }
.od-sslot:not(.is-filled)::after { content: ""; position: absolute; left: 10%; right: 10%; top: 6%; bottom: 0; border: 3px dashed var(--ink-3); border-bottom: 0; border-radius: 14px 14px 0 0; }
.od-sslot.tk-drop-ok::after { background: rgba(255, 240, 194, .7); }
.od-sslot svg, .od-item svg { width: 100%; height: 100%; display: block; overflow: visible; }
.od-tray-size { grid-template-columns: repeat(3, minmax(0, 92px)); }
.od-item { height: 128px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 4px 4px 2px; }
html[data-layout="tall"] .od-tray-story { grid-template-columns: repeat(4, minmax(0, 150px)); }
html[data-layout="tall"] .od-tray-size { grid-template-columns: repeat(6, minmax(0, 80px)); }
html[data-layout="tall"] .od-item { height: 110px; }
html[data-layout="tall"] .od-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html[data-layout="tall"] .od-strip.od-n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html[data-layout="short"] .od-tray-story { grid-template-columns: repeat(2, minmax(0, 112px)); gap: 8px; }
html[data-layout="short"] .od-tray-size { grid-template-columns: repeat(3, minmax(0, 70px)); gap: 6px; }
html[data-layout="short"] .od-item { height: 118px; }
html[data-layout="short"] .od-tray-size.od-n6 .od-item, html[data-layout="short"] .od-tray-size.od-n5 .od-item { height: 112px; }
html[data-layout="short"] .od-num { height: 26px; }
html[data-layout="short"] .od-sign { width: 110px; top: 6px; }
.od-slot + .od-slot::before { content: ""; position: absolute; left: -12px; top: 50%; width: 12px; height: 18px; margin-top: -9px; background: var(--ink-3); clip-path: polygon(0 0, 100% 50%, 0 100%); }
html[data-layout="tall"] .od-strip:not(.od-n3) .od-slot:nth-child(3)::before { display: none; }

/* ================================================================ MAZE */
.mz-board { background: #E9F7DD; touch-action: none; }
.mz-board:focus-visible { outline: 4px solid var(--sky); outline-offset: -4px; }
.mz-svg { position: absolute; left: 0; top: 0; overflow: visible; }
.mz-bip { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; transition: transform .09s linear; }
.mz-door { transition: opacity .4s; }
.mz-door.is-open { opacity: .18; }
.mz-gem { animation: mz-gem 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes mz-gem { 50% { opacity: .75; } }
.mz-dot { animation: mz-dot 1s ease-in-out infinite; }
@keyframes mz-dot { 50% { opacity: .4; } }
.mz-stat { display: flex; flex-direction: column; gap: 10px; align-items: center; flex: 1 1 auto; justify-content: center; }
.mz-gems, .mz-keys { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 6px 8px; }
.mz-gems svg { width: 36px; height: 36px; opacity: .25; filter: grayscale(1); transition: opacity .3s, filter .3s; }
.mz-keys svg { width: 44px; height: 32px; opacity: .25; filter: grayscale(1); }
.mz-gems svg.on, .mz-keys svg.on { opacity: 1; filter: none; }
.mz-restart { align-self: center; font-size: 1rem; }
html[data-layout="tall"] .ll-k-maze .ll-dock-body, html[data-layout="tall"] .ll-k-wires .ll-dock-body { flex-direction: row; align-items: center; justify-content: center; }
html[data-layout="tall"] .mz-stat { flex-direction: row; flex: 0 1 auto; }

/* ================================================================ WIRES */
.wr-board { background: #F2F7FF; touch-action: none; }
.wr-svg { position: absolute; left: 0; top: 0; }
.wr-lit, .wr-hint { pointer-events: none; }
.wr-other { opacity: 0; transition: opacity .3s; }
.wr-dev { position: absolute; background: #fff; border: 3px solid var(--ink); border-radius: 50%; box-shadow: var(--shadow-sm); padding: 6px; z-index: 2; }
.wr-dev.is-ask { box-shadow: 0 3px 0 var(--ink), 0 0 0 5px var(--sun); }
.wr-dev.is-on { background: var(--sun-soft); }
.wr-dev svg, .wr-ch svg { width: 100%; height: 100%; display: block; }
.wr-ch { position: absolute; padding: 4px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm); cursor: pointer; z-index: 2; min-width: 48px; min-height: 48px; }
.wr-ch.is-on { background: #FFF36B; }
.wr-ask { display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1 1 auto; }
.wr-ask-dev, .wr-ask-ch { width: 64px; height: 64px; background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 5px; }
.wr-ask-dev { border-radius: 50%; }
.wr-ask-dev svg, .wr-ask-ch svg { width: 100%; height: 100%; }
.wr-ask-arrow { width: 44px; }

/* ================================================================ CODE */
.cd-board { background: #EEF4FF; }
.cd-svg { position: absolute; left: 0; top: 0; }
.cd-bip { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; transition: transform .42s cubic-bezier(.4, 0, .3, 1); }
.cd-face { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; transition: transform .3s ease; }
.cd-face::after { content: ""; position: absolute; right: -6%; top: 36%; width: 20%; height: 28%; background: #FF9636; border: 2.5px solid var(--ink); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.cd-bump-N { animation: cd-bN .4s ease; } .cd-bump-S { animation: cd-bS .4s ease; } .cd-bump-E { animation: cd-bE .4s ease; } .cd-bump-W { animation: cd-bW .4s ease; }
@keyframes cd-bN { 40% { translate: 0 -14px; } } @keyframes cd-bS { 40% { translate: 0 14px; } } @keyframes cd-bE { 40% { translate: 14px 0; } } @keyframes cd-bW { 40% { translate: -14px 0; } }
.cd-dot { animation: mz-dot 1s ease-in-out infinite; }
.cd-star { transform-box: fill-box; transform-origin: center; animation: mz-gem 1.6s ease-in-out infinite; }
.cd-pad { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 96px)); grid-template-rows: repeat(3, minmax(0, 96px)); grid-template-areas: ". n ." "w . e" ". s ."; gap: 8px; justify-content: center; align-content: center; }
.cd-padbtn { background: #fff; border: 3px solid var(--ink); border-radius: 20px; box-shadow: 0 5px 0 var(--ink); padding: 10px; cursor: pointer; min-width: 52px; min-height: 52px; }
.cd-padbtn:active, .cd-padbtn.is-hit { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.cd-padbtn svg { width: 100%; height: 100%; display: block; }
.cd-pad-N { grid-area: n; } .cd-pad-S { grid-area: s; } .cd-pad-E { grid-area: e; } .cd-pad-W { grid-area: w; }
.cd-starcount { display: flex; justify-content: center; gap: 4px; }
.cd-starcount svg { width: 34px; height: 34px; opacity: .25; filter: grayscale(1); }
.cd-starcount svg.on { opacity: 1; filter: none; }
.cd-dock { gap: 8px !important; }
.cd-palette { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.cd-card { width: 54px; height: 54px; padding: 6px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm); cursor: pointer; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; }
.cd-card svg { width: 100%; height: 100%; display: block; }
.cd-pal { width: 58px; height: 58px; }
.cd-card:active { transform: translateY(3px); box-shadow: none; }
.cd-card.cd-t-F { background: #E3F7E8; } .cd-card.cd-t-L, .cd-card.cd-t-R { background: #FFF0DE; }
.cd-card.cd-t-loop { background: #F1EBFF; } .cd-card.cd-t-call { background: #FFF6D6; }
.cd-strip { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; min-height: 66px; padding: 6px; background: #fff; border: 3px dashed var(--ink-3); border-radius: 16px; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.cd-strip.is-target { border-style: solid; border-color: var(--sky); background: #F5F9FF; }
.cd-fnwrap { display: flex; align-items: stretch; gap: 6px; }
.cd-fn-tag { width: 44px; flex: 0 0 auto; background: #FFF6D6; border: 3px solid var(--ink); border-radius: 12px; padding: 4px; display: flex; align-items: center; }
.cd-fn-tag svg { width: 100%; }
.cd-fn { flex: 1 1 auto; min-height: 62px; background: #FFFBEB; }
.cd-hole { width: 54px; height: 54px; border: 2.5px dashed #C9CEDF; border-radius: 12px; flex: 0 0 auto; }
.cd-hole.is-next { border-color: var(--sky); background: #EAF2FF; animation: ll-glow 1.1s ease-in-out infinite; }
.cd-hole-s, .cd-loop .cd-card { width: 44px; height: 44px; border-radius: 10px; }
.cd-loop { display: flex; align-items: center; gap: 4px; padding: 4px; background: #F1EBFF; border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm); cursor: pointer; }
.cd-loop.is-target { box-shadow: 0 3px 0 var(--ink), 0 0 0 4px #B79BF2; }
.cd-loop-head { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cd-loop-head > svg { width: 36px; height: 36px; }
.cd-count { min-width: 48px; min-height: 48px; padding: 0 6px; border-radius: 999px; background: var(--sun); border: 2.5px solid var(--ink); font-weight: 1000; font-size: 1rem; cursor: pointer; }
.cd-loop-body { display: flex; gap: 4px; padding: 3px; background: #fff; border-radius: 10px; border: 2px dashed #B79BF2; }
.cd-card.is-sel, .cd-loop.is-sel { box-shadow: 0 0 0 4px var(--sun), 0 3px 0 var(--ink); transform: translateY(-2px); }
.cd-card.is-now, .cd-loop.is-now { box-shadow: 0 0 0 5px #7DF9FF, 0 3px 0 var(--ink); transform: translateY(-3px); }
.cd-card.is-bad { background: var(--tomato-soft) !important; box-shadow: 0 0 0 5px var(--tomato), 0 3px 0 var(--ink); }
.cd-ctl { display: flex; gap: 8px; justify-content: center; align-items: center; }
.cd-run { flex: 1 1 auto; font-size: 1.25rem; min-height: 56px; }
.cd-del, .cd-clr { width: 56px; padding: 0; flex: 0 0 auto; }
.cd-dock.is-running .cd-palette, .cd-dock.is-running .cd-del, .cd-dock.is-running .cd-clr { opacity: .45; pointer-events: none; }
html[data-layout="short"] .cd-card, html[data-layout="short"] .cd-hole { width: 46px; height: 46px; border-radius: 11px; }
html[data-layout="short"] .cd-pal { width: 48px; height: 48px; }
html[data-layout="short"] .cd-palette { gap: 5px; }
html[data-layout="short"] .cd-strip { min-height: 0; padding: 4px; gap: 4px; }
html[data-layout="short"] .cd-run { min-height: 48px; font-size: 1.05rem; }
html[data-layout="short"] .cd-del, html[data-layout="short"] .cd-clr { width: 48px; min-width: 48px; }
html[data-layout="short"] .cd-pad { grid-template-columns: repeat(3, minmax(0, 72px)); grid-template-rows: repeat(3, minmax(0, 72px)); gap: 5px; }
html[data-layout="tall"] .ll-k-code .ll-dock-body { max-height: 50vh; }
html[data-layout="tall"] .cd-pad { grid-template-columns: repeat(3, minmax(0, 80px)); grid-template-rows: repeat(3, minmax(0, 66px)); }

/* ================================================================ ODD */
.od-cork { background-color: #E8C48A; background-image: radial-gradient(rgba(150, 95, 40, .25) 1.4px, transparent 1.6px); background-size: 14px 14px; }
.oj-grid { position: absolute; inset: 0; display: grid; justify-content: center; align-content: center; gap: 16px; }
.oj-card { position: relative; width: var(--s); height: var(--s); background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); padding: 12%; cursor: pointer; transition: opacity .3s, transform .2s; }
.oj-card:nth-child(odd) { transform: rotate(-2deg); } .oj-card:nth-child(even) { transform: rotate(1.5deg); }
.oj-card:active { translate: 0 3px; }
.oj-art { display: block; width: 100%; height: 100%; }
.oj-pin { position: absolute; left: 50%; top: -9px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--tomato); border: 2.5px solid var(--ink); }
.oj-card.is-odd { background: var(--sun-soft); box-shadow: 0 5px 0 var(--ink), 0 0 0 6px var(--sun); transform: scale(1.06); }
.oj-card.is-same { opacity: .55; }
.oj-stamp { position: absolute; right: -10px; bottom: -10px; width: 46px; height: 46px; border-radius: 50%; background: var(--grape); color: #fff; font-weight: 1000; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; border: 3px solid var(--ink); animation: ll-popbeat .4s var(--ease-pop); }
.oj-card.ll-dim { opacity: .35; }
.oj-lupa { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; }
.oj-lupa svg { width: min(70%, 140px); }

/* ================================================================ SORT */
.st-board { display: flex; flex-direction: column; background: #F4EFFF; }
.st-top { flex: 0 0 auto; padding: 10px 10px 0; }
.st-belt { display: flex; align-items: center; gap: 10px; height: 92px; padding: 6px 12px; background: repeating-linear-gradient(90deg, #575B7C 0 14px, #6C7193 14px 28px); border: 3px solid var(--ink); border-radius: 46px; }
.st-slot { width: 76px; height: 76px; flex: 0 0 auto; background: #fff; border: 3px solid var(--ink); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.st-item { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; }
.st-item svg { width: 100%; height: 100%; }
.st-cur { cursor: grab; }
.st-queue { display: flex; gap: 6px; opacity: .8; }
.st-qi { width: 40px; height: 40px; background: rgba(255, 255, 255, .85); border-radius: 50%; padding: 4px; }
.st-qi svg { width: 100%; height: 100%; }
.st-area { flex: 1 1 auto; min-height: 0; display: flex; gap: 12px; padding: 12px; align-items: stretch; justify-content: center; }
.st-zone { position: relative; }
.st-bin { flex: 1 1 0; max-width: 300px; display: flex; flex-direction: column; align-items: center; background: #fff; border: 3px solid var(--ink); border-radius: 0 0 26px 26px; box-shadow: var(--shadow); padding: 8px; }
.st-sign { width: 64px; height: 64px; background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; padding: 6px; margin-top: -2px; }
.st-sign svg { width: 100%; height: 100%; }
.st-in { flex: 1 1 auto; width: 100%; display: flex; flex-wrap: wrap; align-content: flex-end; justify-content: center; gap: 2px; padding-top: 6px; }
.st-in .st-item { width: 46px; height: 46px; }
.st-ex { opacity: .9; }
.st-grid { display: grid; grid-template-columns: 64px repeat(2, minmax(0, 1fr)); grid-template-rows: 64px repeat(2, minmax(0, 1fr)); gap: 8px; flex: 1 1 auto; max-width: 560px; }
.st-head { background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; padding: 8px; display: flex; align-items: center; justify-content: center; }
.st-head svg { width: 44px; height: 44px; }
.st-cell { background: #fff; border: 3px solid var(--ink); border-radius: 16px; display: flex; }
.st-cell .st-in { align-content: center; }
.st-venn { position: relative; flex: 2 1 0; min-width: 0; }
.st-venn-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.st-vl { position: absolute; top: -4px; width: 52px; height: 52px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 5px; z-index: 2; }
.st-vl svg { width: 100%; height: 100%; }
.st-vl-l { left: 18%; } .st-vl-r { right: 18%; }
.st-reg { position: absolute; top: 18%; bottom: 8%; display: flex; border-radius: 20px; }
.st-reg-l { left: 4%; width: 28%; } .st-reg-b { left: 36%; width: 28%; } .st-reg-r { right: 4%; width: 28%; }
.st-reg .st-in { align-content: center; }
.st-out { flex: 0 0 26%; max-width: 200px; }
.st-zone.tk-drop-ok { box-shadow: 0 0 0 4px rgba(255, 197, 61, .7); }
.st-mach { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; }
.st-mach svg { width: min(80%, 150px); }
html[data-layout="tall"] .st-area { flex-wrap: wrap; }
html[data-layout="tall"] .st-venn { flex: 1 1 100%; min-height: 220px; }
html[data-layout="tall"] .st-out { flex: 0 0 60%; min-height: 110px; max-width: none; }
html[data-layout="short"] .st-belt { height: 64px; }
html[data-layout="short"] .st-slot { width: 52px; height: 52px; }
html[data-layout="short"] .st-item { width: 48px; height: 48px; }
html[data-layout="short"] .st-sign { width: 44px; height: 44px; }
html[data-layout="short"] .st-area { padding: 6px; gap: 6px; }
html[data-layout="short"] .st-in .st-item { width: 32px; height: 32px; }
html[data-layout="short"] .st-grid { grid-template-columns: 44px repeat(2, minmax(0, 1fr)); grid-template-rows: 44px repeat(2, minmax(0, 1fr)); }
html[data-layout="short"] .st-head svg { width: 28px; height: 28px; }

/* ================================================================ SUDOKU */
.sd-board { display: flex; align-items: center; justify-content: center; background: #F4EFFF; }
.sd-grid { display: grid; gap: 0; background: var(--ink); border: 4px solid var(--ink); border-radius: 16px; overflow: hidden; }
.sd-grid.sd-n3 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 3px; }
.sd-grid.sd-n4 { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 3px; }
.sd-cell { background: #fff; display: flex; align-items: center; justify-content: center; padding: 12%; }
.sd-cell svg { width: 100%; height: 100%; }
.sd-cell.is-given { background: #EFE8FF; }
.sd-cell.sd-vr { margin-right: 4px; } .sd-cell.sd-hb { margin-bottom: 4px; }
.sd-cell.tk-drop-ok { background: var(--sun-soft); }
.sd-cell.is-filled svg { animation: ll-popbeat .4s var(--ease-pop); }
.sd-clash { animation: sd-clash .9s ease; }
@keyframes sd-clash { 30%, 70% { background: var(--tomato-soft); box-shadow: inset 0 0 0 4px var(--tomato); } }
.sd-tray { flex: 1 1 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 100px)); justify-content: center; align-content: center; gap: 12px; }
.sd-src { aspect-ratio: 1; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow-sm); padding: 12%; }
.sd-src svg { width: 100%; height: 100%; }
html[data-layout="tall"] .sd-tray { grid-template-columns: repeat(4, minmax(0, 90px)); }
html[data-layout="short"] .sd-tray { grid-template-columns: repeat(2, minmax(0, 84px)); gap: 8px; }

/* ================================================================ SEATS */
.zt-board { display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(#ECE2FF, #FFFBF1 70%); padding: 10px; }
.zt-clues { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.zt-clue { position: relative; display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 6px 12px 6px 10px; background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-sm); cursor: pointer; }
.zt-art { display: flex; align-items: center; gap: 4px; }
.zt-h { position: relative; width: 44px; height: 44px; display: inline-block; }
.zt-h svg { width: 100%; height: 100%; }
.zt-maybe { opacity: .55; }
.zt-no { opacity: .5; }
.zt-x { position: absolute; width: 30px; height: 30px; margin: 7px 0 0 -37px; }
.zt-mb { display: flex; gap: 3px; padding: 3px; background: #B07E52; border: 2.5px solid var(--ink); border-radius: 8px; }
.zt-ms { position: relative; width: 46px; height: 46px; background: #F3D7A6; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.zt-ms .zt-h { width: 40px; height: 40px; }
.zt-ms .zt-x { margin: 0; left: 8px; top: 8px; }
.zt-link { font-weight: 1000; font-size: 1.4rem; color: var(--grape); }
.zt-nolink { position: relative; width: 30px; height: 30px; }
.zt-nolink .zt-x { margin: 0; left: 0; top: 0; }
.zt-dots { font-weight: 1000; font-size: 1.3rem; }
.zt-lamp { position: absolute; right: -9px; top: -9px; width: 22px; height: 22px; border-radius: 50%; background: #D7DAE5; border: 3px solid var(--ink); transition: background .25s; }
.zt-lamp.is-on, .zt-clue:has(.is-on) .zt-lamp { background: #3DDC84; box-shadow: 0 0 10px #3DDC84; }
.zt-lamp.is-off { background: var(--tomato); }
.zt-clue.is-on .zt-lamp { background: #3DDC84; box-shadow: 0 0 10px #3DDC84; }
.zt-clue.is-off .zt-lamp { background: var(--tomato); }
.zt-bench { position: relative; isolation: isolate; display: flex; justify-content: center; gap: 12px; padding: 0 20px 26px; }
.zt-seat { position: relative; width: clamp(80px, 16vw, 130px); aspect-ratio: 1; background: #F3D7A6; border: 3px solid var(--ink); border-radius: 18px 18px 6px 6px; display: flex; align-items: center; justify-content: center; }
.zt-seat.tk-drop-ok { background: var(--sun-soft); }
.zt-in { width: 86%; height: 86%; display: flex; align-items: center; justify-content: center; }
.zt-in .zt-char { width: 100%; height: 100%; border: 0; box-shadow: none; background: transparent; }
.zt-num { position: absolute; left: 50%; bottom: -24px; transform: translateX(-50%); display: flex; gap: 3px; z-index: 2; }
.zt-num i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.zt-plank { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 14px; background: #8E5B33; border: 3px solid var(--ink); border-radius: 6px; z-index: -1; }
.zt-tray { flex: 1 1 auto; display: flex; flex-wrap: wrap; gap: 12px; align-content: center; justify-content: center; }
.zt-char { width: 84px; height: 84px; background: #fff; border: 3px solid var(--ink); border-radius: 50%; box-shadow: var(--shadow-sm); padding: 6px; }
.zt-char svg { width: 100%; height: 100%; }
html[data-layout="short"] .zt-clue { min-height: 52px; padding: 3px 8px; }
html[data-layout="short"] .zt-h { width: 32px; height: 32px; }
html[data-layout="short"] .zt-ms { width: 34px; height: 34px; }
html[data-layout="short"] .zt-ms .zt-h { width: 30px; height: 30px; }
html[data-layout="short"] .zt-seat { width: 74px; }
html[data-layout="short"] .zt-char { width: 60px; height: 60px; }
html[data-layout="short"] .zt-board { padding: 6px; }
html[data-layout="short"] .zt-clues { gap: 6px; }

/* ================================================================ BALANCE */
.bl-board { background: linear-gradient(#ECE2FF, #FFFBF1 80%); }
.bl-rules { position: absolute; left: 10px; top: 10px; display: flex; gap: 8px; z-index: 2; }
.bl-rule { width: clamp(120px, 20vw, 190px); background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 4px; box-shadow: var(--shadow-sm); }
.bl-rule svg { width: 100%; display: block; }
.bl-main { position: absolute; overflow: visible; }
.bl-pan { position: absolute; border-radius: 20px; z-index: 3; cursor: pointer; }
.bl-pan.tk-drop-ok { box-shadow: 0 0 0 4px rgba(255, 197, 61, .8); background: rgba(255, 240, 194, .35); }
.bl-tray { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.bl-src { width: 96px; height: 96px; background: #fff; border: 3px solid var(--ink); border-radius: 50%; box-shadow: var(--shadow); padding: 14px; }
.bl-src svg { width: 100%; height: 100%; }
.bl-minus { width: 60px; padding: 0; }
.bl-order .bl-cmps { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.bl-cmp { position: relative; width: clamp(150px, 26vw, 220px); background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 4px; box-shadow: var(--shadow-sm); }
.bl-cmp svg { width: 100%; display: block; }
.bl-cmp-h { position: absolute; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); }
.bl-cmp-h svg { width: 100%; height: 100%; }
.bl-podium { position: absolute; left: 10%; right: 10%; bottom: 14px; height: 48%; display: flex; align-items: flex-end; gap: 10px; }
.bl-step { position: relative; flex: 1 1 0; height: var(--hh); background: #FFC53D; border: 3px solid var(--ink); border-radius: 12px 12px 0 0; box-shadow: var(--shadow-sm); }
.bl-step:nth-child(2) { background: #C9D3E0; } .bl-step:nth-child(3) { background: #E8A86A; } .bl-step:nth-child(4) { background: #B7E3C8; }
.bl-step-in { position: absolute; left: 50%; bottom: 100%; width: 80px; height: 80px; transform: translateX(-50%); display: flex; align-items: flex-end; justify-content: center; }
.bl-step-n { position: absolute; left: 50%; top: 20%; transform: translateX(-50%); font-weight: 1000; font-size: 1.6rem; }
.bl-step.tk-drop-ok { filter: brightness(1.08); box-shadow: 0 0 0 4px var(--sun); }
.bl-step-in .zt-char { width: 76px; height: 76px; }
html[data-layout="short"] .bl-src { width: 70px; height: 70px; }
html[data-layout="short"] .bl-step-in { width: 56px; height: 56px; }
html[data-layout="short"] .bl-step-in .zt-char { width: 54px; height: 54px; }
html[data-layout="short"] .bl-podium { height: 40%; }

/* ================================================================ PIXEL */
.px-board { background: #E7FAFC; display: flex; align-items: center; justify-content: center; }
.px-wrap { --cs: 44px; display: grid; grid-template-columns: calc(var(--cs) * .8) auto auto; grid-template-rows: calc(var(--cs) * .7) auto auto; gap: 4px 8px; align-items: start; }
.px-corner { grid-area: 1 / 1; }
.px-colhead { grid-area: 1 / 2; display: grid; font-weight: 1000; text-align: center; font-size: calc(var(--cs) * .42); align-self: end; }
.px-rowhead { grid-area: 2 / 1; display: grid; grid-auto-rows: var(--cs); font-weight: 1000; font-size: calc(var(--cs) * .42); align-items: center; justify-items: end; }
.px-grid { grid-area: 2 / 2; display: grid; grid-auto-rows: var(--cs); background: var(--ink); gap: 2px; border: 3px solid var(--ink); border-radius: 8px; touch-action: none; }
.px-grid { grid-template-columns: repeat(var(--w, 5), var(--cs)); }
.px-cell { width: var(--cs); height: var(--cs); background: #fff; transition: background .12s; cursor: pointer; }
.px-blink { animation: px-blink .5s ease 3; }
@keyframes px-blink { 50% { box-shadow: inset 0 0 0 4px var(--sun); background-color: var(--sun-soft); } }
.px-drip { animation: px-drip .5s ease; }
@keyframes px-drip { 40% { transform: translateY(4px); opacity: .6; } }
.px-shine { animation: ll-popbeat .4s var(--ease-pop); }
.px-codes { grid-area: 2 / 3; display: grid; grid-auto-rows: var(--cs); align-items: center; }
.px-coderow { display: flex; align-items: center; gap: 2px; height: calc(var(--cs) * .78); }
.px-coderow i { width: calc(var(--cs) * .48); height: calc(var(--cs) * .48); border-radius: 50%; border: 2px solid var(--ink); display: inline-block; }
.px-coderow b { font-weight: 1000; font-size: calc(var(--cs) * .44); margin-left: 6px; }
.px-coderow b:first-child { margin-left: 0; }
.px-coords .px-codes { grid-area: 3 / 1 / 4 / 4; grid-auto-rows: auto; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.px-coords.px-side .px-codes { grid-area: 1 / 3 / 4 / 4; flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; margin-top: 0; max-width: 200px; }
.px-card { display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 4px 10px 4px 6px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm); font-weight: 1000; font-size: .95rem; cursor: pointer; text-align: left; }
.px-card i { width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%; border: 2.5px solid var(--ink); }
.px-pots { flex: 1 1 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 84px)); gap: 10px; justify-content: center; align-content: center; }
.px-pot { aspect-ratio: 1; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow-sm); padding: 8px; cursor: pointer; }
.px-pot svg { width: 100%; height: 100%; }
.px-pot.is-on { background: var(--sun-soft); box-shadow: 0 3px 0 var(--ink), 0 0 0 5px var(--pc); transform: translateY(-3px); }
.px-eraser.is-on { box-shadow: 0 3px 0 var(--ink), 0 0 0 5px #FF8FB8; }
html[data-layout="short"] .px-pots { grid-template-columns: repeat(3, minmax(0, 64px)); gap: 6px; }
html[data-layout="short"] .px-card { min-height: 48px; font-size: .8rem; padding: 2px 6px; }
.px-coords:not(.px-side) { grid-template-columns: calc(var(--cs) * .8) auto; }
.px-coords:not(.px-side) .px-codes { grid-area: 3 / 1 / 4 / 3; }

/* ================================================================ FINALE */
.fn-prog { display: flex; gap: 4px; }
.fn-step { position: relative; width: 40px; height: 40px; border-radius: 12px; background: #fff; border: 3px solid var(--ink); padding: 3px; opacity: .5; }
.fn-step.is-now { opacity: 1; box-shadow: 0 0 0 3px var(--sun); }
.fn-step.is-done { opacity: 1; background: var(--sun-soft); }
.fn-ico svg { width: 100%; height: 100%; display: block; }
.fn-chip { position: absolute; right: -8px; bottom: -8px; width: 22px; height: 22px; }
.fn-chip svg { width: 100%; height: 100%; }
@media (max-width: 600px) { .fn-step { width: 30px; height: 30px; } }
.fn-dip { background: #FFFBEB; border: 4px double var(--ink); border-radius: 18px; padding: 12px; }
.fn-dip-row { display: flex; justify-content: center; align-items: flex-end; gap: 14px; }
.fn-dip-av { width: 84px; }
.fn-dip-bip { width: 100px; }
.fn-dip-t { font-weight: 1000; font-size: 1.6rem; margin: 8px 0 0; }
.fn-dip-s { font-weight: 900; color: var(--ink-2); margin: 0; }

/* ================================================================ SANDBOX */
.sb-tabs { display: flex; gap: 6px; }
.sb-tab { width: 48px; height: 48px; border-radius: 14px; background: #fff; border: 3px solid var(--ink); font-weight: 1000; font-size: 1.1rem; box-shadow: var(--shadow-sm); cursor: pointer; }
.sb-tab.is-on { background: var(--sun); }
.sb-tools { flex: 1 1 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 76px)); gap: 10px; justify-content: center; align-content: center; }
.sb-tool { aspect-ratio: 1; background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 8px; cursor: pointer; }
.sb-tool svg { width: 100%; height: 100%; display: block; }
.sb-tool.is-on { background: var(--sun-soft); box-shadow: 0 3px 0 var(--ink), 0 0 0 4px var(--sun); }
.sb-row { display: flex; gap: 8px; }
.sb-play { flex: 1 1 auto; }
.sb-clear { width: 56px; padding: 0; }
.sb-edit { width: 56px; padding: 0; flex: 0 0 auto; }
html[data-layout="short"] .sb-edit { width: 48px; }
.cd-run { min-width: 0; }
.ll-k-sandbox .ll-board { touch-action: none; }
html[data-layout="short"] .sb-tools { grid-template-columns: repeat(4, minmax(0, 54px)); gap: 6px; }
html[data-layout="short"] .sb-tab { width: 48px; height: 48px; }
.ll-k-sandbox .cd-run { padding-inline: .5em; font-size: 1.1rem; gap: .3em; }
.ll-k-sandbox .cd-ctl { gap: 6px; }
html[data-layout="short"] .cd-loop-head { flex-direction: row; gap: 3px; }
html[data-layout="short"] .cd-loop-head > svg { width: 24px; height: 24px; }
html[data-layout="short"] .cd-loop { padding: 3px; }
html[data-layout="short"] .cd-strip { overflow-y: auto; overscroll-behavior: contain; }
html[data-layout="short"] .st-item.st-cur { min-width: 48px; flex: 0 0 auto; }
html[data-layout="short"] .bl-order .bl-cmps { right: auto; top: 6px; bottom: 6px; left: 8px; flex-direction: column; flex-wrap: nowrap; gap: 6px; justify-content: center; }
html[data-layout="short"] .bl-order .bl-cmp { width: 132px; padding: 2px; }
html[data-layout="short"] .bl-order .bl-podium { left: 160px; right: 4%; height: 46%; bottom: 8px; }
