/* Odporni! — dodatki do wspólnego systemu wyglądu (../wspolne/system.css).
   Kolory, kroje pisma, nagłówek, panele, przyciski i zasada wciśnięcia są we wspólnym pliku; tu tylko to, co inne w tej grze. */
:root {
  --hand: var(--body); /* dawniej odręczna (Noteworthy) — zwykła czcionka czyta się łatwiej */
}

/* --- nagłówek --------------------------------------------------------------- */
.brand h1 em { color: var(--berry); } /* kolor tej gry */

/* --- układ ------------------------------------------------------------------- */
.desk { grid-template-columns: minmax(400px, 1fr) minmax(0, 1.5fr); }

/* --- pole obrony --------------------------------------------------------------- */
/* plansza to płótno: nic nie przewija się w środku, etykieta choroby leży na płótnie */
.stage { overflow: hidden; background: #f6e7da; }
#field { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.stage-label { position: absolute; left: 50px; top: 12px; z-index: 2; }
.stage-hint { position: absolute; right: 14px; bottom: 8px; margin: 0; font: 14px var(--hand); color: var(--ink-soft); pointer-events: none; }

.hud {
  position: absolute; right: 12px; top: 12px; z-index: 2; width: 250px; padding: 9px 12px 10px; pointer-events: none;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 10px; box-shadow: var(--lift-sm);
}
.meter { display: grid; grid-template-columns: 1fr 40px; align-items: center; column-gap: 8px; margin-bottom: 6px; }
.meter span { grid-column: 1 / -1; font: 700 10.5px var(--type); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); }
.meter b { font: 700 14px var(--type); text-align: right; }
.bar { position: relative; height: 12px; border: 1.5px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--moss); transition: width .2s; }
.bar i.low { background: var(--berry); }
.bar em { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--berry); }
.bar.energy i { background: var(--resin); }
.wave { font: 15px var(--hand); text-align: center; }

.lab { position: absolute; inset: 0; z-index: 1; display: grid; padding: 70px 30px 54px; background: radial-gradient(ellipse at 50% 45%, #fffdf6, #f2ead6); }
.lab .pic { width: 100%; height: 100%; }
.lab-v { display: none; }
.lab-lbl { font-family: var(--type); font-weight: 700; }
.lab-note { font-family: var(--hand); }

/* komunikat na polu obrony (we wspólnym systemie jest przyklejony do okna) */
.toast { position: absolute; bottom: 40px; z-index: 4; max-width: 80%; }

/* --- panel boczny ------------------------------------------------------------------ */
.vcard h2 { margin: 6px 0 2px; font: 700 23px/1.15 var(--type); }
.note { margin: 4px 0 10px; font: 15px/1.25 var(--hand); color: var(--ink-soft); }

/* laboratorium */
.feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.feat {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 9px 10px 9px 14px;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 12px; font: 600 15px/1.25 var(--body);
}
.feat button { padding: 6px 12px; border: 1.5px solid var(--ink); border-radius: 999px; background: #fff; font: 700 13px var(--type); }
.feat button:hover { background: var(--resin-tint); }
.feat.got { grid-template-columns: 1fr auto; border-style: dashed; }
.feat.got b { padding: 3px 10px; border-radius: 999px; color: var(--na-kolorze); font: 700 12px var(--type); }
.feat.got-org { background: #e8f3f7; } .feat.got-org b { background: var(--sky); }
.feat.got-vir { background: #eef4d9; } .feat.got-vir b { background: var(--moss); }
.feat.shake { animation: shake .35s; border-color: var(--berry); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* karta wirusa */
.vcard { padding: 14px 16px; background: var(--card); border: 1.5px solid var(--ink); border-radius: 14px; box-shadow: var(--lift); margin-bottom: 16px; }
.vcard-head { display: flex; align-items: center; gap: 14px; }
.vcard-head i { font: italic 15px var(--body); color: var(--ink-soft); }
.vcard dl, .recap dl { margin: 10px 0 0; }
dt { font: 700 11.5px var(--type); text-transform: uppercase; letter-spacing: .1em; color: var(--resin); margin-top: 8px; }
dd { margin: 2px 0 0; font-size: 15px; line-height: 1.35; }

/* karty ochrony */
.pick-head { display: flex; align-items: baseline; justify-content: space-between; }
.count { font: 700 15px var(--type); color: var(--resin); }
.pcards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pcard {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 5px 9px; min-height: 120px;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 12px; box-shadow: 2px 3px 0 rgba(38, 48, 42, .1); text-align: center;
  transition: transform .12s, background .12s;
}
.pcard:hover { background: var(--resin-tint); transform: translateY(-2px); }
.pcard .pic { width: 64px; height: 48px; }
.pcard b { font: 700 13.5px/1.15 var(--body); }
.pcard small { font: 12px/1.15 var(--hand); color: var(--ink-soft); }
.pcard.picked { background: var(--resin-tint); border: 2.5px solid var(--resin); transform: rotate(-1.5deg); }
.pcards + .btn { margin-top: 14px; }

/* raport ochrony */
.report { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.report li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 12px; border: 1.5px solid; border-radius: 12px; }
.report li.ok { background: var(--ok-tint); border-color: var(--moss); }
.report li.no { background: var(--berry-tint); border-color: var(--berry); }
.report .mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--na-kolorze); font: 700 16px var(--body); }
.report .ok .mark { background: var(--moss); } .report .no .mark { background: var(--berry); }
.report b { font: 700 15px var(--type); }
.report p { margin: 2px 0 0; font-size: 14.5px; line-height: 1.3; }
.sum { margin-top: 12px; padding: 10px 14px; border: 1.5px dashed var(--ink-soft); border-radius: 12px; font-size: 15px; line-height: 1.35; }
.sum p { margin: 4px 0; }

/* krwinki do postawienia */
.dcards { display: grid; gap: 8px; }
.dcard {
  position: relative; display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px 8px 10px; text-align: left;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 14px; box-shadow: 2px 3px 0 rgba(38, 48, 42, .1);
}
.dcard:hover { background: var(--resin-tint); }
.dcard.on { border: 2.5px solid var(--resin); background: var(--resin-tint); box-shadow: 0 0 0 4px rgba(201, 119, 43, .2); }
.dcard.poor em { color: var(--berry); }
.dcard .pic { width: 56px; height: 56px; }
.dcard b { font: 700 15px var(--type); }
.dcard small { display: block; font-size: 13.5px; line-height: 1.25; color: var(--ink-soft); }
.dcard em { font: 700 18px var(--type); font-style: normal; color: var(--resin); }
.dcard .key { position: absolute; left: -8px; top: -8px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper); font: 700 12px var(--type); }
.log-h { margin-top: 16px; }
.log { list-style: none; margin: 6px 0 0; padding: 0; }
.log li { padding: 6px 0 6px 18px; border-bottom: 1px dashed var(--line); font: 15px/1.25 var(--hand); position: relative; animation: rise .3s ease-out both; }
.log li::before { content: "✎"; position: absolute; left: 0; color: var(--resin); }
.log li:first-child { color: var(--ink); } .log li:not(:first-child) { color: var(--ink-soft); }

/* wynik */
.verdict { margin-top: 14px; }
.verdict:first-child { margin-top: 0; }
.verdict .hint { font: 16px/1.25 var(--hand); }
.recap { margin-top: 14px; padding: 12px 16px; background: var(--card); border: 1.5px solid var(--ink); border-radius: 14px; }
.fact { margin: 10px 0 0; font: 16px/1.3 var(--hand); }

/* atlas */
.atlas { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px; background: rgba(38, 48, 42, .45); }
.atlas-card { width: min(1100px, 100%); max-height: 100%; overflow: auto; padding: 22px 24px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 18px; box-shadow: var(--lift); }
.atlas table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.3; }
.atlas th, .atlas td { padding: 8px 10px; border-bottom: 1px dashed var(--line); text-align: left; vertical-align: top; }
.atlas thead th { font: 700 11.5px var(--type); text-transform: uppercase; letter-spacing: .1em; color: var(--resin); }
.atlas tbody th { display: flex; align-items: center; gap: 8px; font: 700 15px var(--type); white-space: nowrap; }
.atlas tr.locked { opacity: .55; }
/* przyciski ściągi zawsze pod ręką (Piotr, 27.10.2026): pasek przyklejony do dołu karty, treść przewija się pod nim */
.atlas-card { padding-bottom: 0; }
.atlas-card > .row:last-child { position: sticky; bottom: 0; z-index: 1; margin: 14px -24px 0; padding: 12px 24px 18px; background: var(--paper); border-top: 1.5px dashed var(--line); }

@media print {
  body { display: block; background: #fff; }
  .top, .desk { display: none; }
  .atlas { position: static; background: none; padding: 0; }
  .atlas .row { display: none; }
}

/* --- przełącznik 2D/3D, laboratorium 3D --------------------------------------------- */
.lab2d, .lab3d { width: 100%; height: 100%; min-height: 0; }
.lab2d { display: grid; place-items: center; }
.lab3d { display: block; cursor: grab; touch-action: pan-y; } /* w bok obraca, w pionie przewija stronę */
.lab3d.grabbing { cursor: grabbing; }
.viewtoggle { position: absolute; left: 14px; bottom: 12px; z-index: 3; display: flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--card); box-shadow: var(--lift-sm); }
.viewtoggle button { padding: 6px 14px; border: 0; background: none; font: 700 14px var(--type); }
.viewtoggle button + button { border-left: 1.5px solid var(--ink); }
.viewtoggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.viewtoggle button:hover:not([aria-pressed="true"]) { background: var(--resin-tint); }

/* --- pasek krwinek na polu (telefon) ---------------------------------------------- */
.minidefs { position: absolute; right: 10px; bottom: 10px; z-index: 3; display: none; gap: 6px; }
.mini { position: relative; width: 50px; height: 50px; padding: 3px; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--card); box-shadow: 2px 2px 0 rgba(38, 48, 42, .14); }
.mini .pic { width: 100%; height: 100%; }
.mini em { position: absolute; right: -6px; bottom: -7px; padding: 0 5px; border-radius: 999px; background: var(--resin); color: var(--na-kolorze); font: 700 11px/16px var(--type); font-style: normal; }
.mini.on { border: 2.5px solid var(--resin); background: var(--resin-tint); }
.mini.poor em { background: var(--berry); }
.mini-pause { font: 700 16px var(--body); }

/* --- telefon i wąski tablet (na końcu pliku, żeby wygrywało z resztą) ---------------- */
@media (max-width: 900px) {
  .desk { grid-template-columns: 1fr; } /* musi być tu: dwie kolumny z góry pliku wygrałyby z systemem */
  .stage { height: 62vw; min-height: 300px; }
  .stage.is-lab { height: min(175vw, 720px); }
  .stage.in-battle { height: min(165vw, 780px); height: min(165vw, 780px, 100svh); } /* pasek sił i krwinki widać naraz, też poziomo */
  .stage.in-battle .stage-label { display: none; }
  .stage-hint { display: none; }
  #field { touch-action: manipulation; }
  .hud { left: 10px; right: 10px; top: 8px; width: auto; display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; padding: 6px 10px; }
  .meter { margin: 0; grid-template-columns: 1fr 30px; column-gap: 6px; }
  .meter span { font-size: 9px; }
  .meter b { font-size: 12px; }
  .wave { font-size: 13px; white-space: nowrap; }
  .minidefs:not([hidden]) { display: flex; }
  .toast { bottom: 76px; max-width: 92%; }
  .lab { padding: 58px 10px 52px; }
  .pcards { grid-template-columns: repeat(2, 1fr); }
  .feat { grid-template-columns: 1fr 1fr; }
  .feat > span { grid-column: 1 / -1; }
  .feat.got { grid-template-columns: 1fr auto; }
  .feat.got > span { grid-column: auto; }
  .dcard small { font-size: 12.5px; }
  .atlas { padding: 10px; }
  .atlas-card { padding: 16px 14px 0; }
  .atlas-card > .row:last-child { margin-right: -14px; margin-left: -14px; padding: 10px 14px 14px; }
  .atlas table, .atlas thead, .atlas tbody, .atlas tr, .atlas th, .atlas td { display: block; }
  .atlas thead { display: none; }
  .atlas tr { padding: 10px 0; border-bottom: 1.5px dashed var(--line); }
  .atlas th, .atlas td { border: 0; padding: 3px 0; }
}
@media (max-width: 620px) {
  .lab-h { display: none; }
  .lab-v { display: block; }
}

/* --- rozkładanie na części (3D i 3DPro) -------------------------------------------- */
.stage.is-lab[data-view="pro"] .lab { padding-bottom: 184px; } /* miejsce na opis części */
.lab3d, .lab2d { grid-area: 1 / 1; }
.pro-msg { position: absolute; left: 50%; top: 45%; z-index: 2; margin: 0; transform: translate(-50%, -50%); font: 16px var(--hand); color: var(--ink-soft); }
.ptag {
  position: absolute; z-index: 2; transform: translate(-50%, -50%); pointer-events: none; white-space: nowrap; transition: opacity .15s;
  padding: 1px 9px 2px; background: rgba(255, 250, 240, .95); border: 1.2px solid var(--ink); border-radius: 999px; font: 700 12.5px var(--type);
}
.ptag.on { background: var(--resin); color: var(--na-kolorze); }
.ptag-head { padding: 0; background: none; border: 0; font-size: 15px; letter-spacing: .08em; transition: color .3s; }
@media (max-width: 900px) {
  .ptag { font-size: 11px; }
}

/* --- opis wybranej części: tytuł zawsze na górze, bez przewijania, zwykła czcionka --- */
.partinfo {
  position: absolute; left: 12px; right: 12px; bottom: 54px; z-index: 3; max-width: 620px; margin: 0 auto; /* bez transform — animacja „rise” go nie psuje */
  padding: 10px 16px 11px; background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 14px;
  box-shadow: 3px 4px 0 rgba(38, 48, 42, .18); animation: rise .25s ease-out both;
}
.pi-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pi-head b { font: 700 17px/1.2 var(--type); color: var(--ink); }
.pi-head span { flex: none; padding: 1px 9px; border-radius: 999px; background: var(--resin); color: var(--na-kolorze); font: 700 11px var(--type); letter-spacing: .06em; }
.partinfo p { margin: 4px 0 0; font: 500 15px/1.35 var(--body); }
.partinfo .pi-sum { margin-top: 8px; padding-top: 7px; border-top: 1.5px dashed var(--line); font: 13.5px/1.35 var(--body); color: var(--ink-soft); }
@media (max-width: 900px) {
  .partinfo { padding: 8px 12px 9px; }
  .pi-head b { font-size: 15.5px; }
  .partinfo p { font-size: 14px; }
  .partinfo .pi-sum { font-size: 12.5px; }
}

/* --- 3DPro po rozłożeniu: reszta okna przygasa, zostają modele, podpisy i opis --------- */
.lab { transition: background .35s; }
.lab.dim { background: radial-gradient(ellipse at 50% 42%, #3a443d, #1c221f); }
.lab.dim .ptag-head { color: var(--paper); }
.stage.lab-dim .stage-label, .stage.lab-dim .viewtoggle { opacity: .35; transition: opacity .3s; }
.stage.lab-dim .viewtoggle:hover, .stage.lab-dim .viewtoggle:focus-within { opacity: 1; }

@media (max-width: 900px) {
  .stage.is-lab[data-view="pro"] .lab { padding-bottom: 214px; }
  .stage.is-lab { height: min(190vw, 780px); }
}

/* --- część 1 (wirusy) / część 2 (bakterie) ----------------------------------------- */
.brand-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 6px; }
.brand-row .home { margin-bottom: 0; }
.parts { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--card); box-shadow: 2px 2px 0 rgba(38, 48, 42, .14); }
.parts button { padding: 3px 12px 4px; border: 0; background: none; font: 700 12px var(--type); letter-spacing: .05em; }
.parts button + button { border-left: 1.5px solid var(--ink); }
.parts button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.parts button:hover:not([aria-pressed="true"]) { background: var(--resin-tint); }

/* lista „Tryb” (kolory i wygląd, wspolne/wyglad.js): w prawym górnym rogu, nad postępem */
.top-prawo { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.wyglad { display: flex; align-items: center; gap: 8px; }
.wybor {
  -webkit-appearance: none; appearance: none; padding: 5px 30px 6px 12px; border: 1.5px solid var(--ink); border-radius: 999px; cursor: pointer;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2326302a' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 13px;
  color: var(--ink); font: 700 13px var(--type); box-shadow: 2px 2px 0 rgba(38, 48, 42, .14);
}
.wybor:hover { background-color: var(--resin-tint); }
.wybor:active { transform: translateY(1px) scale(.97); box-shadow: none; }
/* „Tryb:” w środku listy, przed wybraną wartością: napis leży nad lewym marginesem listy (kliknięcie przechodzi do niej);
   szerokość napisu mierzy wspolne/wyglad.js (--pre-w), bez skryptu — przybliżenie. Kolor tuszu: szary --ink-soft ma tu mniej niż 7:1 */
.wybor-pole { position: relative; display: inline-flex; align-items: center; }
.wybor-pre { position: absolute; left: 13.5px; z-index: 1; pointer-events: none; color: var(--ink); font: 600 13px var(--type); }
.wybor-pre + .wybor { padding-left: calc(17px + var(--pre-w, 2.5em)); }
.wybor-pole:has(.wybor:active) .wybor-pre { transform: translateY(1px); }
@media (max-width: 900px) { .top-prawo { align-items: flex-start; } }
.feat.got-bak { background: #fbf0d0; } .feat.got-bak b { background: var(--resin); }

/* antybiotyk: lek na jeden raz, tylko w części o bakteriach */
.dcard.abx { border-style: dashed; border-color: #c23a6a; background: #fdf0f4; }
.dcard.abx:hover:not(:disabled) { background: #fadbe6; }
.dcard.abx em { color: #c23a6a; }
.dcard.abx:disabled { opacity: .45; cursor: default; }
.mini-ab { border-color: #c23a6a; background: #fdf0f4; }
.mini-ab:disabled { opacity: .4; cursor: default; }
.atlas-h { margin: 18px 0 2px; font: 700 15px var(--type); }

/* --- tryb ciemny („Ciemny, Uczeń”) -------------------------------------------------------------------------------------
   Kartki, panele i przyciski są ciemne (tokeny w wspolne/system.css). Rysunki gry mają ciemny tusz, więc:
   • obrazki w kartach leżą na jasnej kartce,
   • plansza (pole obrony, laboratorium 2D/3D/3DPro) zostaje jasnym arkuszem — jej napisy i podpisy części mają ciemny tusz. */
:root[data-tryb="ciemny"] .pic { background: #fffaf0; border-radius: 8px; }
:root[data-tryb="ciemny"] .bar { background: var(--paper-2); }
:root[data-tryb="ciemny"] .feat button { background: var(--paper-2); }
:root[data-tryb="ciemny"] .feat.got-org { background: #1c2c34; }
:root[data-tryb="ciemny"] .feat.got-vir { background: #252f1b; }
:root[data-tryb="ciemny"] .feat.got-bak { background: #36291a; }
:root[data-tryb="ciemny"] .dcard.abx, :root[data-tryb="ciemny"] .mini-ab { border-color: #ff8fb5; background: #2f1822; }
:root[data-tryb="ciemny"] .dcard.abx:hover:not(:disabled) { background: #40202d; }
:root[data-tryb="ciemny"] .dcard.abx em { color: #ff8fb5; }
:root[data-tryb="ciemny"] :is(.stage-hint, .pro-msg) { color: #5b6257; }
:root[data-tryb="ciemny"] .ptag { background: rgba(255, 250, 240, .95); border-color: #26302a; color: #26302a; }
:root[data-tryb="ciemny"] .ptag.on { background: #c9772b; color: #fff; }
:root[data-tryb="ciemny"] .ptag-head { background: none; border: 0; color: #26302a; }
:root[data-tryb="ciemny"] .lab.dim .ptag-head { color: #f4eede; }
:root[data-tryb="ciemny"] .wybor { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f1ead8' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }

/* telefon: w bitwie przełącznik widoku jest w panelu pod polem (na polu jest pasek krwinek) */
.side-views { display: none; }
@media (max-width: 900px) {
  .stage.in-battle > .viewtoggle { display: none; }
  .side-views { display: flex; align-items: center; gap: 8px; margin-left: auto; font: 13px var(--body); color: var(--ink-soft); }
  .side-views .viewtoggle { position: static; box-shadow: none; }
  .side-views .viewtoggle button { padding: 4px 10px; font-size: 13px; }
}
