/* Star Count (kids-math). Builds on the ZEKASTRA Kids design system v3 tokens in kids-product.css. */
.km-sr{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.km-defs{position:absolute;width:0;height:0;overflow:hidden}
.km-stage{position:relative;background:
 radial-gradient(600px 300px at 100% 0,rgba(165,148,255,.13),transparent 70%),
 radial-gradient(500px 280px at 0 100%,rgba(61,213,243,.09),transparent 70%),var(--k-surface)}
.km-stage :focus-visible{outline:4px solid var(--k-gold);outline-offset:3px}
.km-stage h3:focus{outline:none}
.km-stage h3:focus-visible{outline:3px dashed var(--k-gold);outline-offset:6px;border-radius:8px}

/* Toolbar */
.km-toolbar h2{display:flex;align-items:center;gap:12px;font-family:"Manrope",Inter,sans-serif}
.km-level-badge{display:inline-grid;place-items:center;width:42px;height:42px;border-radius:14px;background:linear-gradient(135deg,var(--k-gold),#f39c4a);color:#2a1a02;font-size:1.25rem;font-weight:900;flex:none;box-shadow:0 6px 18px rgba(246,201,108,.3)}
.km-score-star{fill:var(--k-gold);flex:none}

/* Levels */
.km-levels{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;border-radius:22px;margin:0 0 18px}
.km-levels button{display:flex;align-items:center;justify-content:center;gap:8px;min-height:52px;padding:6px 10px;border-radius:17px;line-height:1.15;text-align:left;cursor:pointer;min-width:0}
.km-level-num{display:inline-grid;place-items:center;flex:none;width:28px;height:28px;border-radius:50%;background:var(--k-surface-3);color:var(--k-ink);font-weight:900;font-size:.95rem}
.km-levels button[aria-pressed="true"] .km-level-num{background:var(--k-gold);color:#2a1a02}
.km-level-text{font-size:.92rem;overflow-wrap:anywhere;min-width:0}

/* Star meter */
.km-meter-wrap{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 16px;margin:0 0 16px}
.km-meter{display:flex;flex-wrap:wrap;gap:4px;list-style:none;margin:0;padding:6px 10px;border-radius:999px;background:var(--k-bg-2);border:1px solid var(--k-line-soft)}
.km-meter-star{display:grid;place-items:center;width:30px;height:30px}
.km-meter-star svg{display:block;width:26px;height:26px;overflow:visible}
.km-meter-star polygon{fill:#222c66;stroke:#34408a;stroke-width:2.5;stroke-linejoin:round}
.km-meter-star.is-current polygon{fill:#2f2a5a;stroke:var(--k-gold);stroke-width:3.5;stroke-dasharray:6 4}
.km-meter-star.is-gold polygon{fill:var(--k-gold);stroke:#ffe9b0;stroke-width:2}
.km-meter-star.is-silver polygon{fill:#c9d2f0;stroke:#eef2ff;stroke-width:2}
.km-meter-star.is-gold svg,.km-meter-star.is-silver svg{animation:km-pop .5s cubic-bezier(.3,1.6,.5,1)}
.km-legend{margin:0!important;font-size:.85rem}

/* Board */
.km-board{border-radius:24px}
.km-question{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;margin:4px 0 16px}
.km-question h3{margin:0!important;font-family:"Manrope",Inter,sans-serif;font-size:clamp(1.3rem,3vw,1.75rem)!important;line-height:1.3;max-width:36ch;overflow-wrap:anywhere}
.km-equation-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px 22px}
.km-equation-row[hidden]{display:none}
.km-equation{margin:0!important;padding:6px 22px;border-radius:18px;background:var(--k-bg-2);border:2px solid var(--k-line);font-family:"Manrope",Inter,sans-serif;font-weight:900;font-size:clamp(1.8rem,5vw,2.4rem);letter-spacing:.04em;color:var(--k-ink)!important;line-height:1.3}
.km-bond-wrap:empty{display:none}
.km-bond{display:block;width:120px;height:auto}
.km-bond-q,.km-bond-n{font-family:"Manrope",Inter,sans-serif;font-weight:900;fill:#fff}
.km-bond-q{font-size:26px}
.km-bond-n{font-size:22px}

/* Scene */
.km-scene{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:14px;padding:clamp(12px,3vw,26px);border-radius:24px;min-height:150px;
 background:radial-gradient(1.2px 1.2px at 12% 20%,#ffffff70 50%,transparent 51%),radial-gradient(1px 1px at 84% 30%,#ffffff60 50%,transparent 51%),radial-gradient(1.4px 1.4px at 60% 86%,#ffffff60 50%,transparent 51%),linear-gradient(160deg,#0a1030,#151a52 60%,#1d1650);
 border:1px solid #2b3780;box-shadow:inset 0 2px 30px rgba(0,0,0,.35)}
.km-group{display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0;max-width:100%;padding:8px;border-radius:20px;background:rgba(255,255,255,.035);border:2px solid transparent}
.km-tone-gold{border-color:rgba(246,201,108,.45)}
.km-tone-cyan{border-color:rgba(61,213,243,.45)}
.km-scene[data-type="count"] .km-group,.km-scene[data-type="subtract"] .km-group{border-color:rgba(165,148,255,.35)}
.km-group-svg{display:block;max-width:100%;height:auto;overflow:visible}
.km-caption{display:inline-flex;align-items:center;gap:6px;font-weight:800;color:var(--k-ink);font-size:.95rem}
.km-caption-icon{width:26px;height:26px}
.km-op{display:grid;place-items:center;flex:none;width:52px;height:52px;border-radius:50%;background:var(--k-surface-3);border:2px solid var(--k-line);color:var(--k-gold);font-family:"Manrope",Inter,sans-serif;font-size:2rem;font-weight:900;line-height:1}
.km-op-vs{color:var(--k-ink);font-size:1.6rem}
.km-slot{fill:rgba(255,255,255,.03);stroke:#3c4a9e;stroke-width:2;stroke-dasharray:5 5}
.is-frame.km-tone-gold .km-slot{stroke:rgba(246,201,108,.55)}
.is-frame.km-tone-cyan .km-slot{stroke:rgba(61,213,243,.55)}
.km-art{transform-box:fill-box;transform-origin:center;transition:transform .2s ease,opacity .2s ease}
.km-item.is-crossed .km-art{opacity:.42}
.km-cross{stroke:var(--k-coral);stroke-width:4.5;stroke-linecap:round;fill:none;opacity:.95}
.km-badge{opacity:0;transition:opacity .2s ease;pointer-events:none}
.km-badge circle{fill:#ffffff;stroke:#0b1030;stroke-width:2}
.km-badge text{font-family:"Manrope",Inter,sans-serif;font-weight:900;font-size:13px;fill:#0b1030}
.km-item.is-counted .km-badge{opacity:1}
.km-item.is-pointer .km-art{transform:scale(1.18);filter:drop-shadow(0 0 6px rgba(255,233,160,.9))}
.km-scene.is-celebrating .km-item:not(.is-crossed) .km-art{animation:km-hop .6s ease both}
.km-scene.is-celebrating .km-item:nth-child(2n) .km-art{animation-delay:.06s}
.km-scene.is-celebrating .km-item:nth-child(3n) .km-art{animation-delay:.12s}

/* Answer buttons */
.km-choices{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;max-width:560px;margin:20px auto 0}
.km-choices[data-count="3"]{grid-template-columns:repeat(3,minmax(0,1fr));max-width:620px}
.km-choice{position:relative;display:flex;align-items:center;justify-content:center;gap:8px;min-height:84px;min-width:0;padding:8px;border:0;border-radius:24px;cursor:pointer;
 font-family:"Manrope",Inter,sans-serif;font-weight:900;font-size:2.5rem;line-height:1;color:#0b1030;background:var(--km-c,var(--k-gold));
 box-shadow:0 7px 0 var(--km-d,#b98a2c),0 12px 24px rgba(0,0,0,.35);transition:transform .12s ease,box-shadow .12s ease,opacity .2s ease,filter .2s}
.km-c0{--km-c:var(--k-gold);--km-d:#b98a2c}
.km-c1{--km-c:var(--k-cyan);--km-d:#1c8fab}
.km-c2{--km-c:var(--k-pink);--km-d:#c25d97}
.km-c3{--km-c:var(--k-mint);--km-d:#2d9b6c}
.km-choice:not([aria-disabled="true"]):hover{transform:translateY(-3px);box-shadow:0 10px 0 var(--km-d),0 16px 28px rgba(0,0,0,.4)}
.km-choice:not([aria-disabled="true"]):active{transform:translateY(5px);box-shadow:0 2px 0 var(--km-d),0 4px 10px rgba(0,0,0,.35)}
.km-choice[aria-disabled="true"]{cursor:default}
.km-choice.is-wrong{background:#3a4278;color:#aab3da;box-shadow:0 4px 0 #262d5c;animation:km-shake .4s ease}
.km-choice.is-right{background:var(--k-mint);box-shadow:0 0 0 5px #ffffff,0 0 30px rgba(98,227,171,.7);animation:km-pop .5s cubic-bezier(.3,1.6,.5,1)}
.km-choice.is-faded{opacity:.35}
.km-choice-word{font-size:1.15rem;flex-direction:column;gap:6px;padding:10px 8px;text-align:center;overflow-wrap:anywhere}
.km-choice-icon{width:40px;height:40px}
.km-eq{display:grid;place-items:center;width:40px;height:40px;font-size:2.4rem;line-height:1}

/* Feedback */
.km-status{text-align:center;padding:12px 16px;border-radius:18px;margin:22px auto 0!important;max-width:640px;background:rgba(255,255,255,.04);border:1px solid var(--k-line-soft)}
.km-status[data-tone="hint"]{background:rgba(246,201,108,.12);border-color:rgba(246,201,108,.45);color:#ffe7b0!important}
.km-status[data-tone="success"]{background:rgba(98,227,171,.13);border-color:rgba(98,227,171,.5);color:#c9ffe6!important}
.km-actions{justify-content:center}
.km-actions .kp-button{min-width:220px;font-size:1.1rem}
.km-next[hidden]{display:none}

/* Win */
.km-win{padding:32px 20px}
.km-win h3{font-family:"Manrope",Inter,sans-serif}
.km-trophy{gap:10px;margin-bottom:14px}
.km-trophy-star{width:64px;height:64px;overflow:visible}
.km-trophy-star polygon{fill:#2a3266;stroke:#4a5598;stroke-width:2.5;stroke-linejoin:round}
.km-trophy-star.is-on polygon{fill:var(--k-gold);stroke:#fff1c7}
.km-trophy-star.is-on{animation:km-pop .6s cubic-bezier(.3,1.6,.5,1) both}
.km-trophy-star.is-on:nth-child(2){animation-delay:.15s}
.km-trophy-star.is-on:nth-child(3){animation-delay:.3s}
.km-trophy-star:nth-child(2){width:80px;height:80px;margin-top:-10px}
.km-win-actions{justify-content:center}

@keyframes km-pop{0%{transform:scale(.4);opacity:0}100%{transform:scale(1);opacity:1}}
@keyframes km-hop{0%,100%{transform:translateY(0)}40%{transform:translateY(-14%) scale(1.08)}}
@keyframes km-shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}

@media(max-width:760px){
 .km-levels{grid-template-columns:repeat(5,minmax(44px,1fr))}
 .km-levels button{flex-direction:column;gap:2px;padding:6px 2px;text-align:center}
 .km-level-text{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
 .km-level-num{width:34px;height:34px;font-size:1.05rem}
}
@media(max-width:600px){
 .km-choices{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 .km-choices[data-count="3"]{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
 .km-choice{min-height:76px;font-size:2.2rem}
 .km-choice-word{font-size:.98rem;min-height:96px}
 .km-scene{flex-direction:column;gap:10px;padding:10px}
 .km-group{padding:6px}
 .km-op{width:42px;height:42px;font-size:1.6rem}
 .km-actions .kp-button{min-width:0}
 .km-meter{gap:0;padding:4px 6px}
 .km-meter-star{width:27px;height:30px}
 .km-meter-star svg{width:23px;height:23px}
 .km-trophy-star{width:52px;height:52px}
 .km-trophy-star:nth-child(2){width:64px;height:64px}
}
@media(prefers-reduced-motion:reduce){
 .km-stage *,.km-stage *::after{animation:none!important;transition:none!important}
 .km-item.is-pointer .km-art{transform:none}
}
@media print{.km-meter-wrap,.km-choices,.km-actions,.km-levels{display:none!important}.km-scene{background:#fff;box-shadow:none}}
