/* aplicatie.css — desenele din variante și din text (doar variabile de culoare) */
.ans.cu-desen { display:flex!important;flex-direction:column;justify-content:center;align-items:center;gap:4px;padding:6px;position:relative }
.ans.cu-desen .k { position:absolute;left:8px;top:8px }
.ans.cu-desen svg { height:96px;width:auto;max-width:100% }
.ans .desen { font-size:3.2em }
.pr-pass .w svg, .pr-pass .w .desen { height:150px;width:auto;vertical-align:middle }
.desen { display:inline-block;font-size:3em;line-height:1.1 }
.pr-pass.doar-desen { justify-content:center }
.pr-pass.doar-desen .pr-em2, .pr-pass:has(.w .desen) .pr-em2 { display:none }

/* ---------- unealta liberă ---------- */
.un-lesson { grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);align-items:stretch }
.un-chip { min-height:38px;padding:5px 12px;font-size:calc(14px * var(--fs));border-style:dashed }
.un-svg { display:block;width:100%;height:auto;max-height:430px;touch-action:none;cursor:pointer }
.un-plate { background:var(--card);border:2px solid var(--line);border-radius:20px;box-shadow:var(--shadow);padding:12px;display:grid;place-items:center;color:var(--ink) }
.un-cit { display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px }
.un-cit .stat { background:var(--card);border:2px solid var(--line);border-radius:14px;padding:8px 12px;color:var(--ink) }
.un-cit .stat .val { font-size:1.7em }
.un-ascuns .stat .val { visibility:hidden }
.un-pasi { margin:0;padding-left:1.2em;display:grid;gap:4px;font-weight:700 }
.btn[aria-pressed="true"] { outline:3px solid var(--sun);outline-offset:1px }
html.flow .un-lesson { grid-template-columns:minmax(0,1fr) }

/* desene în text: stau în stânga, textul curge lângă ele */
.pr-pass:has(.w svg) .pr-em2 { display:none }
.pr-pass p:has(.w svg) { display:flow-root;width:100% }
.pr-pass .w:has(svg) { float:left;margin-right:14px;padding:0 }
.pr-pass p:has(.w svg) .w:not(:has(svg)) { position:relative;top:.9em }
/* sarcini fără text: variantele desenate umplu foaia */
.pr-pass[hidden] ~ .pr-opts:has(.cu-desen) { flex:1;margin-top:0;grid-auto-rows:1fr }
.pr-pass[hidden] ~ .pr-opts .ans.cu-desen svg { height:150px }
html.flow .pr-pass[hidden] ~ .pr-opts .ans.cu-desen svg { height:120px }
.un-btns { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px }
.un-btns .btn { white-space:normal;padding:8px 6px }
html:not(.flow) .toast { bottom:6px }
/* contoare + / − */
.cont3 { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px }
.cont4 { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px }
.cont4 .cont { grid-template-columns:1fr auto;align-items:center;justify-items:start;padding:5px 10px }
.cont { background:var(--card);border:2px solid var(--line);border-radius:14px;padding:7px 8px;display:grid;gap:5px;justify-items:center;color:var(--ink) }
.cont .lab { font-weight:800;font-size:.74em;letter-spacing:.06em;text-transform:uppercase;color:var(--leaf);white-space:nowrap }
.cont .row { flex-wrap:nowrap;gap:6px }
.cont .row b { font-family:var(--f-display);font-size:1.6em;min-width:1.4em;text-align:center }
.cont .btn { min-height:38px;min-width:38px;padding:2px 8px;font-size:1.2em }
html.flow .cont3, html.flow .cont4 { grid-template-columns:minmax(0,1fr) }
html.flow .cont { grid-template-columns:1fr auto;align-items:center;justify-items:start }
/* calcul pe coloane și tabele: desen în stânga, text alături */
.pr-pass .w svg { height:176px }
.pr-pass p:has(.w svg) .w:not(:has(svg)) { top:.3em }
.ans.cu-desen svg { height:110px }
.pr-pass .w svg[viewBox^="0 0 600"], .pr-pass .w svg[viewBox^="0 0 36"], .pr-pass .w svg[viewBox^="0 0 37"] { height:auto;width:100%;max-width:600px }
.pr-pass .w:has(svg[viewBox^="0 0 600"]), .pr-pass .w:has(svg[viewBox^="0 0 36"]), .pr-pass .w:has(svg[viewBox^="0 0 37"]) { float:none;display:block;margin:0 0 4px }
.pr-pass p:has(svg[viewBox^="0 0 600"]) .w:not(:has(svg)), .pr-pass p:has(svg[viewBox^="0 0 36"]) .w:not(:has(svg)), .pr-pass p:has(svg[viewBox^="0 0 37"]) .w:not(:has(svg)) { top:0 }
.pr-pass .w svg[viewBox^="0 0 36"], .pr-pass .w svg[viewBox^="0 0 37"] { max-width:440px }
.pr-pass.mare p { font-size:1.5em }
.pr-pass .w svg[viewBox^="0 0 320 "] { height:auto;width:100%;max-width:400px }
.pr-pass .w:has(svg[viewBox^="0 0 320 "]) { float:none;display:block;margin:0 0 4px }
.pr-pass p:has(svg[viewBox^="0 0 320 "]) .w:not(:has(svg)) { top:0 }
.ans.cu-desen svg[viewBox^="0 0 600"] { height:auto;width:96%;max-height:none }

/* ---------- animații în desene: se construiesc pas cu pas ---------- */
@keyframes desApar { from { opacity:0; transform:translateY(5px) } }
@keyframes desArc { from { stroke-dashoffset:1 } to { stroke-dashoffset:0 } }
@keyframes desAc { from { transform:rotate(calc(-1 * var(--u))) } }
@keyframes desCreste { from { transform:scaleY(0) } }
@keyframes desMers { from { transform:translateX(var(--dx)) } }
.pr-pass svg:not(.des-fix) > * { animation:desApar .34s ease-out both; animation-delay:2600ms }
.pr-pass svg:not(.des-fix) > :nth-child(1) { animation-delay:40ms }
.pr-pass svg:not(.des-fix) > :nth-child(2) { animation-delay:80ms }
.pr-pass svg:not(.des-fix) > :nth-child(3) { animation-delay:120ms }
.pr-pass svg:not(.des-fix) > :nth-child(4) { animation-delay:160ms }
.pr-pass svg:not(.des-fix) > :nth-child(5) { animation-delay:200ms }
.pr-pass svg:not(.des-fix) > :nth-child(6) { animation-delay:240ms }
.pr-pass svg:not(.des-fix) > :nth-child(7) { animation-delay:280ms }
.pr-pass svg:not(.des-fix) > :nth-child(8) { animation-delay:320ms }
.pr-pass svg:not(.des-fix) > :nth-child(9) { animation-delay:360ms }
.pr-pass svg:not(.des-fix) > :nth-child(10) { animation-delay:400ms }
.pr-pass svg:not(.des-fix) > :nth-child(11) { animation-delay:440ms }
.pr-pass svg:not(.des-fix) > :nth-child(12) { animation-delay:480ms }
.pr-pass svg:not(.des-fix) > :nth-child(13) { animation-delay:520ms }
.pr-pass svg:not(.des-fix) > :nth-child(14) { animation-delay:560ms }
.pr-pass svg:not(.des-fix) > :nth-child(15) { animation-delay:600ms }
.pr-pass svg:not(.des-fix) > :nth-child(16) { animation-delay:640ms }
.pr-pass svg:not(.des-fix) > :nth-child(17) { animation-delay:680ms }
.pr-pass svg:not(.des-fix) > :nth-child(18) { animation-delay:720ms }
.pr-pass svg:not(.des-fix) > :nth-child(19) { animation-delay:760ms }
.pr-pass svg:not(.des-fix) > :nth-child(20) { animation-delay:800ms }
.pr-pass svg:not(.des-fix) > :nth-child(21) { animation-delay:840ms }
.pr-pass svg:not(.des-fix) > :nth-child(22) { animation-delay:880ms }
.pr-pass svg:not(.des-fix) > :nth-child(23) { animation-delay:920ms }
.pr-pass svg:not(.des-fix) > :nth-child(24) { animation-delay:960ms }
.pr-pass svg:not(.des-fix) > :nth-child(25) { animation-delay:1000ms }
.pr-pass svg:not(.des-fix) > :nth-child(26) { animation-delay:1040ms }
.pr-pass svg:not(.des-fix) > :nth-child(27) { animation-delay:1080ms }
.pr-pass svg:not(.des-fix) > :nth-child(28) { animation-delay:1120ms }
.pr-pass svg:not(.des-fix) > :nth-child(29) { animation-delay:1160ms }
.pr-pass svg:not(.des-fix) > :nth-child(30) { animation-delay:1200ms }
.pr-pass svg:not(.des-fix) > :nth-child(31) { animation-delay:1240ms }
.pr-pass svg:not(.des-fix) > :nth-child(32) { animation-delay:1280ms }
.pr-pass svg:not(.des-fix) > :nth-child(33) { animation-delay:1320ms }
.pr-pass svg:not(.des-fix) > :nth-child(34) { animation-delay:1360ms }
.pr-pass svg:not(.des-fix) > :nth-child(35) { animation-delay:1400ms }
.pr-pass svg:not(.des-fix) > :nth-child(36) { animation-delay:1440ms }
.pr-pass svg:not(.des-fix) > :nth-child(37) { animation-delay:1480ms }
.pr-pass svg:not(.des-fix) > :nth-child(38) { animation-delay:1520ms }
.pr-pass svg:not(.des-fix) > :nth-child(39) { animation-delay:1560ms }
.pr-pass svg:not(.des-fix) > :nth-child(40) { animation-delay:1600ms }
.pr-pass svg:not(.des-fix) > :nth-child(41) { animation-delay:1640ms }
.pr-pass svg:not(.des-fix) > :nth-child(42) { animation-delay:1680ms }
.pr-pass svg:not(.des-fix) > :nth-child(43) { animation-delay:1720ms }
.pr-pass svg:not(.des-fix) > :nth-child(44) { animation-delay:1760ms }
.pr-pass svg:not(.des-fix) > :nth-child(45) { animation-delay:1800ms }
.pr-pass svg:not(.des-fix) > :nth-child(46) { animation-delay:1840ms }
.pr-pass svg:not(.des-fix) > :nth-child(47) { animation-delay:1880ms }
.pr-pass svg:not(.des-fix) > :nth-child(48) { animation-delay:1920ms }
.pr-pass svg:not(.des-fix) > :nth-child(49) { animation-delay:1960ms }
.pr-pass svg:not(.des-fix) > :nth-child(50) { animation-delay:2000ms }
.pr-pass svg:not(.des-fix) > :nth-child(51) { animation-delay:2040ms }
.pr-pass svg:not(.des-fix) > :nth-child(52) { animation-delay:2080ms }
.pr-pass svg:not(.des-fix) > :nth-child(53) { animation-delay:2120ms }
.pr-pass svg:not(.des-fix) > :nth-child(54) { animation-delay:2160ms }
.pr-pass svg:not(.des-fix) > :nth-child(55) { animation-delay:2200ms }
.pr-pass svg:not(.des-fix) > :nth-child(56) { animation-delay:2240ms }
.pr-pass svg:not(.des-fix) > :nth-child(57) { animation-delay:2280ms }
.pr-pass svg:not(.des-fix) > :nth-child(58) { animation-delay:2320ms }
.pr-pass svg:not(.des-fix) > :nth-child(59) { animation-delay:2360ms }
.pr-pass svg:not(.des-fix) > :nth-child(60) { animation-delay:2400ms }
.pr-pass svg:not(.des-fix) > :nth-child(61) { animation-delay:2440ms }
.pr-pass svg:not(.des-fix) > :nth-child(62) { animation-delay:2480ms }
.pr-pass svg:not(.des-fix) > :nth-child(63) { animation-delay:2520ms }
.pr-pass svg:not(.des-fix) > :nth-child(64) { animation-delay:2560ms }
.pr-pass svg:not(.des-fix) > :nth-child(65) { animation-delay:2600ms }
.pr-pass svg > path.des-arc { stroke-dasharray:1; animation-name:desArc; animation-duration:.65s }
.pr-pass svg .des-ac { transform-box:view-box; transform-origin:100px 100px; animation:desAc 1.5s cubic-bezier(.3,.8,.3,1) .2s both }
.pr-pass svg .des-creste { transform-box:fill-box; transform-origin:50% 100%; animation:desCreste 1.3s ease-out .2s both }
.pr-pass svg > .des-mers { animation-name:desMers; animation-duration:1.1s; animation-timing-function:ease-in-out }
.pr-pass .w svg { height:200px }
.pr-pass p { white-space:pre-wrap }
