/* aplicatie.css — stiluri proprii lecției „Toate denumirile unui patrulater” (doar variabile de culoare). */

/* ---------- planșele: fundal de carte, text lizibil în toate stilurile ---------- */
.plate .tn-arb,.plate .tn-chei,.plate .tn-venn,.plate .tn-dp,.plate .tn-rot,.plate .tn-trei,.plate .tn-schs,.plate .tn-gal,.plate .tn-str,.plate .tn-lab,.plate .tn-q{
  background:var(--card);color:var(--ink);border-radius:12px;padding:12px;font-weight:800}
.tn-svg{display:block;width:100%;height:auto;overflow:visible}
.tn-gr{stroke:var(--line);stroke-width:1.2}
.tn-fig{fill:var(--sky-tint);stroke:var(--ink);stroke-width:3.5;stroke-linejoin:round}
.tn-fig2{fill:var(--sun-tint)}
.tn-fig3{fill:var(--berry-tint)}
.tn-v{fill:var(--ink)}
.tn-et,.tn-et2{fill:var(--berry);font-weight:900;font-size:15px;font-family:"Nunito",system-ui,sans-serif}
.tn-lit{fill:var(--ink);font-weight:900;font-size:18px;font-family:"Baloo 2",system-ui,sans-serif}
.tn-nrf{fill:var(--leaf-deep);font-weight:900;font-size:22px;font-family:"Baloo 2",system-ui,sans-serif}
.tn-mic{margin:6px 0 0;font-size:calc(14px * var(--fs));color:var(--muted);font-weight:700;text-align:center;line-height:1.3}

/* ---------- arborele familiei (copertă, stația 1, stația 12): un singur ceas în js/aplicatie.js ---------- */
.tn-arb-svg{max-height:300px}
.tn-nod rect{fill:var(--card);stroke:var(--line);stroke-width:2.5;transition:fill .3s,stroke .3s}
.tn-nod text{fill:var(--muted);font-weight:800;font-size:17px;font-family:"Nunito",system-ui,sans-serif;transition:fill .3s}
.tn-nod.on rect{fill:var(--sun-tint);stroke:var(--sun-edge);stroke-width:4}
.tn-nod.on text{fill:var(--ink)}
.tn-m{stroke:var(--line);stroke-width:3;transition:stroke .3s}
.tn-m.on{stroke:var(--berry);stroke-width:5}
.tn-tok{transition:transform .8s ease-in-out}
.tn-tok polygon{fill:var(--sky);stroke:var(--ink);stroke-width:2.5;stroke-linejoin:round}
.tn-sari .tn-tok{transition:none}
.tn-cap{margin:6px 0 0;display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;text-align:center;font-size:calc(16px * var(--fs));line-height:1.3;min-height:2.7em}
.tn-nr{flex:0 0 auto;background:var(--berry);color:var(--card);border-radius:999px;padding:2px 12px;font-size:calc(17px * var(--fs))}
.tn-txt{color:var(--ink)}
html.a-still .tn-tok,html.a-still .tn-nod rect,html.a-still .tn-m{transition:none}

/* ---------- stația 2: cheile numelor ---------- */
.tn-chei table{width:100%;border-collapse:separate;border-spacing:0 5px;font-size:calc(15px * var(--fs))}
.tn-chei thead th{font-size:calc(13px * var(--fs));color:var(--muted);font-weight:800;line-height:1.2;padding:0 6px 2px;text-align:center}
.tn-chei tbody th{text-align:left;padding:4px 8px;background:var(--sky-tint);border-radius:10px 0 0 10px}
.tn-chei td{text-align:center;padding:4px 6px;background:var(--leaf-tint);color:var(--leaf-deep)}
.tn-chei td:last-child{border-radius:0 10px 10px 0}
.tn-chei td.nu{background:var(--card);color:var(--muted);box-shadow:inset 0 0 0 2px var(--line)}
.tn-chn{display:flex;align-items:center;gap:8px}
.tn-ic{width:30px;height:30px;flex:0 0 30px}
.tn-ic .tn-fig,.tn-ic2 .tn-fig{stroke-width:2.5}

/* ---------- stația 3: diagrama cu zone ---------- */
.tn-venn-svg{max-height:300px}
.tn-z0{fill:var(--card);stroke:var(--line);stroke-width:3}
.tn-z1{fill:var(--sun-tint);stroke:var(--sun-edge);stroke-width:3}
.tn-z2{fill:var(--leaf-tint);stroke:var(--leaf);stroke-width:3}
.tn-z3{fill:var(--sky-tint);fill-opacity:.7;stroke:var(--sky);stroke-width:3}
.tn-z4{fill:var(--berry-tint);fill-opacity:.6;stroke:var(--berry);stroke-width:3}
.tn-zt{fill:var(--ink);font-weight:900;font-size:16px;font-family:"Nunito",system-ui,sans-serif}
.tn-zt-mic{font-size:13px;fill:var(--muted)}
.tn-zl circle{fill:var(--card);stroke:var(--ink);stroke-width:2.5}
.tn-zl text{fill:var(--ink);font-weight:900;font-size:17px;font-family:"Baloo 2",system-ui,sans-serif}

/* ---------- stația 5: dreptunghiul și pătratul, cu fișele lor ---------- */
.tn-dp .tn-svg{max-height:190px}
.tn-dp-f{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:8px}
.tn-fisa{display:flex;flex-direction:column;gap:4px;background:var(--card);border:2px solid var(--line);border-radius:10px;padding:6px 10px;font-size:calc(14px * var(--fs))}
.tn-fisa b{font-size:calc(15px * var(--fs));color:var(--leaf-deep)}

/* ---------- stația 6: același romb, rotit ---------- */
.tn-rot{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;align-items:end}
.tn-rr{display:flex;flex-direction:column;align-items:center;gap:4px}
.tn-rr .tn-svg{max-height:170px}
.tn-rr b{font-size:calc(15px * var(--fs))}
.tn-rot .tn-mic{grid-column:1/-1;display:flex;align-items:center;justify-content:center;gap:8px}
.tn-arc{fill:none;stroke:var(--berry);stroke-width:4;stroke-linecap:round}
.tn-arc-leg{display:inline-block;width:22px;height:12px;border:4px solid var(--berry);border-bottom:0;border-radius:14px 14px 0 0}

/* ---------- stația 7: trei figuri pe aceeași rețea ---------- */
.tn-trei .tn-svg{max-height:240px}

/* ---------- stația 9: o schimbare, alte nume ---------- */
.tn-schs{display:flex;flex-direction:column;gap:10px}
.tn-sch{display:flex;align-items:center;gap:10px;background:var(--card);border:2px solid var(--line);border-radius:10px;padding:6px 10px}
.tn-ic2{width:52px;height:52px;flex:0 0 52px}
.tn-sag{font-size:calc(24px * var(--fs));color:var(--muted)}
.tn-led,.tn-tr-led{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.tn-led i,.tn-tr-led i{font-style:normal;font-weight:900;border-radius:999px;padding:2px 10px;font-size:calc(15px * var(--fs));border:2px solid}
i.plus{background:var(--leaf-tint);color:var(--leaf-deep);border-color:var(--leaf)}
i.minus{background:var(--berry-tint);color:var(--berry);border-color:var(--berry)}
i.egal{background:var(--card);color:var(--muted);border-color:var(--line)}

/* ---------- stația 10: galeria ---------- */
.tn-gal{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.tn-gc{position:relative;background:var(--card);border:2px solid var(--line);border-radius:10px;padding:4px}
.tn-gc .tn-svg{max-height:150px}
.tn-gn{position:absolute;top:4px;left:4px;z-index:1;width:26px;height:26px;border-radius:50%;background:var(--leaf);color:var(--on-leaf);display:flex;align-items:center;justify-content:center;font-size:calc(15px * var(--fs))}

/* ---------- stația 13 și verificarea ---------- */
.tn-str .tn-svg{max-height:230px}
.tn-q .tn-svg{max-height:200px;max-width:280px;margin:0 auto}

/* ---------- laboratoarele: planșa din dreapta ---------- */
.tn-lab{min-height:120px}
.tn-lab-svg{max-height:260px}
.tn-lab-cap{margin:6px 0 0;text-align:center;font-size:calc(16px * var(--fs));color:var(--ink);min-height:1.4em}
.tn-lab-cap b{color:var(--leaf-deep)}

/* rândul de sus al laboratoarelor */
.tn-top{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;font-weight:800;color:var(--muted);font-size:calc(14px * var(--fs));min-height:30px}
.tn-gata{display:flex;gap:6px;flex-wrap:wrap}
.tn-ok{background:var(--leaf-tint);color:var(--leaf-deep);border:2px solid var(--leaf);border-radius:999px;padding:1px 10px;font-weight:800;animation:tn-pop .35s ease-out}

/* laborator „Toate numele”: plăcuțe mari, la fel de înalte, cu bifa vizibilă */
.tn-nume{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:8px 0 4px}
.tn-tn .tn-nume .chip.tn-n{display:flex;align-items:center;justify-content:flex-start;gap:8px;min-height:calc(50px * var(--fs));padding:4px 10px;font-size:calc(17px * var(--fs));font-weight:800;color:var(--ink);border:3px solid var(--stripe);border-radius:14px;box-shadow:0 4px 0 var(--stripe);cursor:pointer;text-align:left}
.tn-tn .tn-nume .chip.tn-n:hover{transform:translateY(-2px)}
.tn-bif{flex:0 0 22px;width:22px;height:22px;border:3px solid var(--line);border-radius:6px;background:var(--card);display:flex;align-items:center;justify-content:center;font-size:15px;line-height:1}
.tn-tn .tn-nume .chip.tn-n.ales{background:var(--sky-tint);border-color:var(--sky);box-shadow:0 4px 0 var(--sky)}
.tn-n.ales .tn-bif{background:var(--sky);border-color:var(--sky);color:var(--card)}
.tn-n.ales .tn-bif::after{content:"✓";font-weight:900}
.tn-tn .tn-nume .chip.tn-n.bun{background:var(--leaf-tint);border-color:var(--leaf);box-shadow:0 4px 0 var(--leaf);color:var(--leaf-deep)}
.tn-n.bun .tn-bif{background:var(--leaf);border-color:var(--leaf)}
.tn-tn .tn-nume .chip.tn-n:disabled{transform:none;cursor:default}
.tn-tn .tn-nume .chip.tn-n:disabled:not(.bun){opacity:.55}

/* butoanele de jos: separate de plăcuțe */
.tn-act{display:flex;gap:12px;justify-content:space-between;align-items:center;flex-wrap:wrap;margin-top:10px;padding-top:10px;border-top:2px dashed var(--line)}
.tn-act .verif{margin-left:auto}
.tn-act .verif:disabled,.tn-act .tn-start:disabled{opacity:.45;box-shadow:none;cursor:not-allowed}

/* laborator „Transformă figura” */
.tn-mis{margin:4px 0 2px;font-size:calc(19px * var(--fs));font-weight:900;color:var(--ink);line-height:1.3}
.tn-tr .tn-mic{text-align:left}
.tn-tr-svg{max-height:250px;touch-action:none;user-select:none;-webkit-user-select:none}
.tn-h{cursor:grab;outline:none}
.tn-h.trag{cursor:grabbing}
.tn-hit{fill:transparent}
.tn-hv{fill:var(--sun);stroke:var(--ink);stroke-width:2.5;transition:r .15s}
.tn-h:hover .tn-hv,.tn-h:focus .tn-hv,.tn-h.trag .tn-hv{r:12;fill:var(--berry)}
.tn-h:focus-visible .tn-hit{stroke:var(--sky);stroke-width:3;stroke-dasharray:4 3}
.tn-tr-nume{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin-top:6px}
.tn-nm{border:2px solid var(--line);background:var(--card);color:var(--muted);border-radius:999px;padding:2px 8px;font-size:calc(14px * var(--fs));transition:background .3s,color .3s,border-color .3s}
.tn-nm.on{background:var(--sun-tint);border-color:var(--sun-edge);color:var(--ink)}
.tn-nm.on::before{content:"✓ ";color:var(--leaf-deep)}
.tn-tr-fisa{margin:6px 0 0;text-align:center;font-size:calc(15px * var(--fs));color:var(--ink)}
.tn-tr-fisa b{color:var(--leaf-deep)}
.tn-tr-led{justify-content:center;min-height:30px;margin:6px 0 0}
.tn-tr-led i{animation:tn-pop .35s ease-out}

/* ---------- laborator: antrenament rapid ---------- */
.an-top{display:flex;align-items:center;gap:10px;font-weight:800;color:var(--muted);font-size:calc(14px * var(--fs))}
.an-bar{flex:1;height:10px;background:var(--line);border-radius:99px;overflow:hidden}
.an-bar i{display:block;height:100%;background:var(--leaf);transition:width .4s}
.an-serie{transition:transform .2s}
.an-serie.aprinsa{color:var(--berry);animation:tn-pop .4s ease-out}
.an-q{font-size:calc(22px * var(--fs));font-weight:800;margin:12px 0;color:var(--ink);text-align:center}
.an-var{justify-content:center}
.an-var .chip{font-size:calc(18px * var(--fs));min-width:5.5em;min-height:46px}
.an-var.lung{flex-direction:column;align-items:stretch}
.an-var.lung .chip{font-size:calc(15px * var(--fs));text-align:left}
.an-msg{min-height:1.5em;margin:8px 0 0;text-align:center;font-weight:800}
.an-msg.bine{color:var(--leaf-deep)} .an-msg.rau{color:var(--berry)}
.an-final{text-align:center}
.an-scor{font-family:"Baloo 2",system-ui,sans-serif;font-size:calc(54px * var(--fs));color:var(--leaf-deep);animation:tn-pop .5s}

/* stația 12: cele trei coșuri pe un singur rând */
html:not(.flow) #v-s12 .sort{grid-template-columns:repeat(3,minmax(0,1fr))}
#v-s12 .bin{min-height:64px}

@keyframes tn-pop{0%{transform:scale(.6)}70%{transform:scale(1.12)}100%{transform:none}}

/* telefon: plăcuțele cu nume pe două coloane */
html.flow .tn-nume{grid-template-columns:repeat(2,minmax(0,1fr))}

/* mișcare redusă (sistem) și „Oprește animațiile”: fără mișcare; arborele e oprit din js/aplicatie.js */
@media (prefers-reduced-motion: reduce){
  .tn-tok,.tn-nod rect,.tn-m{transition:none!important}
  .tn-ok,.tn-tr-led i,.an-serie,.an-scor{animation:none!important}
}
html.a-still .tn-ok,html.a-still .tn-tr-led i,html.a-still .an-serie,html.a-still .an-scor{animation:none!important}

/* Butonul „Verifică” din bara de jos este ascuns; verificarea se deschide din cuprins sau după ultima stație. */
.bottom #checkBtn{display:none!important}


/* ===== aliniere comună (lecțiile refăcute): fără suprapuneri de butoane și text ===== */
/* plasă de siguranță: dacă o stație e mai înaltă decât scena, se derulează în interior, nu intră sub bara de jos */
html:not(.flow) .view.on{overflow-y:auto;overflow-x:hidden;scrollbar-width:thin}
/* ordonare: toate cartonașele pe un rând, loc pentru bulina cu numărul, textul rămâne în cartonaș */
.task .order{grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);grid-template-columns:none;gap:10px;margin-top:16px}
.task .order .ocard{min-width:0;padding:10px 6px 8px;overflow-wrap:anywhere;hyphens:auto}
.task .order .oc-emoji{font-size:2.1em;line-height:1.1}
.task .order .ocard .lab{font-size:calc(14px * var(--fs));line-height:1.2}
.task .order .ocard .more{font-size:calc(12px * var(--fs));line-height:1.2;color:var(--muted)}
.task .order .ocard .badge{top:-14px;left:-8px}
html.flow .task .order{grid-auto-flow:row;grid-template-columns:repeat(2,minmax(0,1fr))}
/* perechi: bulina cu numărul stă pe același rând cu textul, deci butonul nu crește după rezolvare */
.perechi .chip{display:flex;align-items:center;gap:8px;min-width:0;overflow-wrap:anywhere}
.perechi .chip[data-p]::after{flex:0 0 22px}
/* rânduri de butoane: se rup pe rândul următor în loc să se calce */
.grp,.chips,.actions{flex-wrap:wrap;row-gap:10px}
.chip,.btn{max-width:100%}
.btn{white-space:normal}
