/* Laboratoria — wspólne elementy (wybór, panel) + probówka, reakcja, słupki, suwak */
.lab-krok { font-size: 16px; margin: 14px 0 8px; }
.lab-opis { font-size: 16px; color: var(--ink-2); margin: 8px 0; }
.lab-chipy { display: flex; flex-wrap: wrap; gap: 8px; }
.lab-chip {
  appearance: none; font: 400 15px/1.25 'Atkinson', system-ui, sans-serif; color: var(--ink); background: var(--slab);
  border: 2px solid transparent; border-radius: 999px; padding: 8px 14px; min-height: 42px; cursor: pointer; text-align: left;
  box-shadow: 4px 5px 10px -6px var(--sh), -3px -3px 8px -6px var(--hi), inset 1px 1px 0 rgba(255, 255, 255, .4);
}
.lab-chip.wyb { border-color: var(--hot); font-weight: 700; }
.lab-chip[disabled] { opacity: .35; cursor: default; }
.lab-chip:active:not([disabled]) { transform: translate(1px, 1px); }
.lab-panel { margin-top: 8px; }
.lab-panel .btn { margin-top: 4px; }
.lab-licznik { font-size: 14px; color: var(--ink-2); margin: 8px 0 0; }

/* probówka */
.lab-scena { display: flex; justify-content: center; margin: 12px 0 4px; }
.probowka { width: 136px; height: auto; overflow: visible; }
.p-szklo { fill: none; stroke: var(--ink-2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.p-aq, .p-org, .p-piana { transition: fill .9s ease; }
.p-osad { transition: fill .8s ease; }
.p-metal { fill: #8a9196; opacity: 0; transition: opacity .4s; }
.p-metal.on { opacity: 1; }
.p-bable circle { fill: rgba(255, 255, 255, .9); stroke: rgba(70, 80, 85, .35); stroke-width: .5; opacity: 0; }
.p-bable.on circle { animation: babel 1.6s linear infinite; }
@keyframes babel { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: 1; } 100% { transform: translateY(-92px); opacity: 0; } }
.p-lustro { opacity: 0; transition: opacity 1.6s ease; }
.p-lustro.on { opacity: .88; }
.p-plomien { fill: #e3873a; opacity: 0; transition: opacity .3s; transform-box: fill-box; transform-origin: 50% 100%; }
.p-plomien.on { opacity: 1; animation: plom .35s ease-in-out infinite alternate; }
@keyframes plom { from { transform: scaleY(1); } to { transform: scaleY(1.15); } }

/* konstruktor estrów */
.rx-linia { font-weight: 700; font-size: 22px; display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px;
  padding: 18px 10px; background: var(--slab-2); box-shadow: var(--carve); border-radius: 12px; margin: 14px 0 4px; }
.rx-linia span { transition: transform .9s ease, opacity .9s ease; display: inline-block; }
.rx-kw, .kol-kw { color: var(--cold); }
.rx-al, .kol-al { color: var(--hot); }
.rx-oh, .rx-h { border-bottom: 2px dashed var(--ink-2); }
.rx-plus { margin: 0 8px; }
.o18 { text-decoration: underline; text-underline-offset: 3px; }
.rx-woda { text-align: center; font-weight: 700; font-size: 20px; opacity: 0; transition: opacity .6s ease .5s; min-height: 28px; }
.lab-rx.laczy .rx-oh { transform: translate(10px, 36px); opacity: 0; }
.lab-rx.laczy .rx-h { transform: translate(-10px, 36px); opacity: 0; }
.lab-rx.laczy .rx-plus { opacity: 0; }
.lab-rx.laczy .rx-woda, .lab-rx.po .rx-woda { opacity: 1; }
.rx-nazwa { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 24px; margin: 4px 0 8px; }

/* równowaga */
.lab-slupki { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; height: 190px; align-items: end; margin: 14px 0 6px; }
.slupek { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 14px; }
.slupek i { display: block; width: 100%; max-width: 56px; border-radius: 8px 8px 0 0; height: 0; min-height: 2px; transition: height .9s ease; }
.s-a i, .s-b i { background: var(--cold); }
.s-e i, .s-w i { background: var(--hot); }
.slupek .wart { font-weight: 700; margin-bottom: 4px; white-space: nowrap; }
.slupek .pod { margin-top: 6px; color: var(--ink-2); }
.lab-info { min-height: 4.6em; font-size: 16px; }

/* pH */
.lab-suwak { width: 100%; accent-color: var(--hot); height: 34px; margin: 4px 0; }
.lab-wyniki { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.lab-wyniki > div { background: var(--slab-2); box-shadow: var(--carve); border-radius: 12px; padding: 10px 6px; text-align: center; }
.lab-wyniki span { display: block; font-size: 13px; color: var(--ink-2); }
.lab-wyniki b { font-family: 'Fraunces', Georgia, serif; font-size: 21px; }

/* fizyka: cząsteczki, wykresy, zlewka z lodem */
.lab-canvas { display: block; width: 100%; border-radius: 12px; box-shadow: var(--carve); margin: 12px 0 6px; }
.lab-wyniki.dwa { grid-template-columns: 1fr 1fr; }
.lab-wyniki.jeden { grid-template-columns: 1fr; min-width: 120px; }
.lab-wykres { display: block; width: 100%; height: auto; margin: 10px 0; }
.lab-linia { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.lab-lod { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0; }
.zlewka { width: 128px; height: auto; overflow: visible; }
.z-woda { fill: rgba(110, 160, 190, .55); }
.z-kostki rect { fill: rgba(228, 240, 246, .96); stroke: rgba(110, 145, 162, .85); stroke-width: 1.2; }
.z-kostki { transform-box: fill-box; transform-origin: 50% 100%; }
.z-bable circle { fill: rgba(255, 255, 255, .9); stroke: rgba(70, 80, 85, .35); stroke-width: .5; opacity: 0; }
.z-bable.on circle { animation: babel2 1.4s linear infinite; }
@keyframes babel2 { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-46px); opacity: 0; } }
.z-para { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; opacity: 0; transition: opacity .8s; }
.z-para.on { opacity: .55; }

/* genetyka: szachownica, hodowla, crossing-over, rodowody */
.pn-grid { display: grid; gap: 4px; margin: 10px 0; }
.pn-grid.kol2 { grid-template-columns: 56px 1fr; }
.pn-grid.kol3 { grid-template-columns: 56px 1fr 1fr; }
.pn-grid.kol5 { grid-template-columns: 50px repeat(4, 1fr); }
.pn-rog, .pn-gam { display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; padding: 6px 2px; color: var(--ink-2); text-align: center; }
.pn-gam { background: var(--slab-2); border-radius: 8px; color: var(--ink); }
.pn-rog { font-size: 12px; }
.pn-pole { border-radius: 8px; padding: 6px 3px; text-align: center; display: flex; flex-direction: column; justify-content: center; min-height: 54px;
  opacity: 0; transform: scale(.85); transition: opacity .25s ease, transform .25s ease; }
.pn-pole.on { opacity: 1; transform: none; }
.pn-pole b { font-size: 15px; }
.pn-pole small { font-size: 11px; line-height: 1.15; color: var(--ink-2); }
.pn-grid.kol5 .pn-pole b { font-size: 13px; }
.pn-grid.kol5 .pn-pole small { font-size: 9.5px; }
.pn-pole.pyt { outline: 3px solid var(--ink); outline-offset: -3px; }
.f0 { background: rgba(85, 122, 69, .24); }
.f1 { background: rgba(176, 82, 110, .26); }
.f2 { background: rgba(196, 160, 60, .30); }
.f3 { background: rgba(92, 104, 150, .28); }
.pn-kropka { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; }
.pn-bar { display: grid; grid-template-columns: minmax(80px, 1.2fr) 2fr 44px; gap: 2px 8px; align-items: center; font-size: 14px; margin: 6px 0; }
.pn-bar .rura { height: 14px; border-radius: 7px; box-shadow: var(--carve); background: var(--slab-2); overflow: hidden; }
.pn-bar .rura i { display: block; height: 100%; width: 0; border-radius: 7px; transition: width .7s ease; }
.pn-bar b { text-align: right; }
.pn-bar small { grid-column: 2 / -1; color: var(--ink-2); font-size: 12px; margin-top: -2px; }
.cr-a { fill: var(--cold); }
.cr-b { fill: var(--hot); }
.cr-locus { stroke: var(--slab); stroke-width: 3; }
.cr-x { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; fill: none; }
.cr-tab { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.cr-tab > div { background: var(--slab-2); box-shadow: var(--carve); border-radius: 10px; padding: 8px 4px; text-align: center; }
.cr-tab > div.rek { outline: 2px solid var(--hot); outline-offset: -2px; }
.cr-tab span { display: block; font-weight: 700; }
.cr-tab b { font-family: 'Fraunces', Georgia, serif; font-size: 20px; }
.cr-tab small { display: block; font-size: 11px; color: var(--ink-2); }
.cr-tab p { grid-column: 1 / -1; margin: 4px 0 0; font-size: 16px; }
.rd-l { stroke: var(--ink-2); stroke-width: 1.8; }
.rd-os { fill: var(--slab); stroke: var(--ink); stroke-width: 2; }
.rd-os.chory { fill: var(--ink); }
.rd-os.klucz { stroke: var(--hot); stroke-width: 4; }
.srod { color: var(--ink-2); }
