/* =========================================================
   Witryna z materiałami – matematyka, klasy 4–8, SP nr 12
   Wspólny styl: strona główna + slajdy + (podstawy) karty pracy
   Silnik i układ przeniesione z witryny informatyki (sp12inf.prv.pl),
   kolorystyka zmieniona na odcienie zieleni.
   Elementy matematyczne i styl karty pracy: zasoby/matma.css
   ========================================================= */

:root {
  --tusz: #12291d;
  --tekst: #263a2f;
  --przygaszony: #56695e;
  --linia: #d9e6dd;
  --tlo: #f2f7f3;
  --karta: #ffffff;
  --niebieski: #15803d;      /* nazwa z witryny informatyki – kolor akcentu (zielony) */
  --zielony: #15803d;
  --czerwony: #c0262d;
  --zolty: #f5b301;
  --cien: 0 1px 2px rgba(18, 41, 29, .06), 0 6px 18px rgba(18, 41, 29, .07);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, "Liberation Mono", monospace;

  /* kolor klasy – nadpisywany przez data-klasa (4–8) */
  --dzial: #15803d;
  --dzial-ciemny: #14532d;
  --dzial-jasny: #e3f5e9;
}

/* Kolory klas – odcienie zieleni (kontrast z białym tekstem min. 4,5 : 1) */
[data-klasa="4"] { --dzial: #4d7c0f; --dzial-ciemny: #365314; --dzial-jasny: #ecf7d4; }  /* limonkowa */
[data-klasa="5"] { --dzial: #15803d; --dzial-ciemny: #14532d; --dzial-jasny: #dcf5e4; }  /* trawiasta */
[data-klasa="6"] { --dzial: #047857; --dzial-ciemny: #064e3b; --dzial-jasny: #d5f5e8; }  /* szmaragdowa */
[data-klasa="7"] { --dzial: #0f766e; --dzial-ciemny: #134e4a; --dzial-jasny: #d3f4ef; }  /* morska */
[data-klasa="8"] { --dzial: #2f6b3a; --dzial-ciemny: #1c4325; --dzial-jasny: #e2efe4; }  /* butelkowa */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--tekst);
  background: var(--tlo);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
svg.ik { width: 1em; height: 1em; flex: none; vertical-align: -0.125em; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--zolty); outline-offset: 2px; }

/* =========================================================
   STRONA GŁÓWNA
   ========================================================= */

.strona { min-height: 100vh; display: flex; flex-direction: column; }

.baner {
  background: var(--tusz);
  color: #fff;
  padding: 40px 16px 76px;
  position: relative;
  overflow: hidden;
}
.baner::after {
  content: "";
  position: absolute; inset: auto -10% -60% auto;
  width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(34,197,94,.45), transparent);
  pointer-events: none;
}
.baner .wnetrze, .glowna, .stopka .wnetrze { max-width: 1120px; margin: 0 auto; }
.baner .wnetrze { position: relative; z-index: 1; }
.baner .etykieta {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: #b5d6c0;
}
.baner h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.1; margin: 10px 0 8px; color: #fff; }
.baner p { margin: 0; font-size: 18px; color: #cfe3d6; max-width: 640px; }
.baner .motyw {
  position: absolute; top: 0; right: 0;
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #e7f3eb;
  font-size: 20px; cursor: pointer;
}
.baner .motyw:hover { background: rgba(255,255,255,.16); }
.baner .wnetrze.z-motywem { padding-right: 56px; }

.glowna { width: 100%; padding: 0 16px 48px; margin-top: -48px; position: relative; z-index: 2; flex: 1; }

/* zakładki klas */
.klasy {
  display: flex; gap: 8px; flex-wrap: wrap;
  background: var(--karta); border-radius: 14px; box-shadow: var(--cien);
  padding: 8px; margin-bottom: 14px;
}
.klasy button {
  flex: 1 1 0; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 12px 8px; cursor: pointer;
  background: transparent; color: var(--tusz); font-weight: 700; font-size: 17px; white-space: nowrap;
}
.klasy button .kropka { width: 12px; height: 12px; border-radius: 50%; background: var(--dzial); flex: none; }
.klasy button:hover { background: var(--dzial-jasny); }
.klasy button[aria-selected="true"] { background: var(--dzial); color: #fff; }
.klasy button[aria-selected="true"] .kropka { background: #fff; }
.klasy .krotko { display: none; }

.pasek-narzedzi {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  background: var(--karta); border-radius: 14px; box-shadow: var(--cien);
  padding: 12px; margin-bottom: 28px;
}
.szukaj {
  flex: 1 1 260px; display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--linia); border-radius: 10px; padding: 0 12px;
  background: #fff;
}
.szukaj:focus-within { border-color: var(--dzial); }
.szukaj svg { color: var(--przygaszony); font-size: 18px; }
.szukaj input {
  border: 0; outline: 0; font: inherit; font-size: 16px; padding: 11px 0; width: 100%;
  background: transparent; color: var(--tekst);
}
.przelacznik { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--przygaszony); cursor: pointer; user-select: none; padding: 4px 6px; }
.przelacznik input { width: 18px; height: 18px; accent-color: var(--dzial); }

.klasa-naglowek { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 0 0 18px; }
.klasa-naglowek h2 { margin: 0; font-size: 28px; color: var(--tusz); }
.klasa-naglowek span { color: var(--przygaszony); font-size: 15px; }

.nowosc {
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
  background: var(--karta); border-radius: 16px; box-shadow: var(--cien);
  padding: 20px 22px; margin-bottom: 36px; text-decoration: none;
  border-left: 6px solid var(--dzial);
}
.nowosc .znaczek {
  background: var(--zolty); color: #3b2a00; font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px; border-radius: 99px;
}
.nowosc .tresc { flex: 1 1 300px; min-width: 0; }
.nowosc h2 { margin: 6px 0 2px; font-size: 22px; color: var(--tusz); }
.nowosc p { margin: 0; color: var(--przygaszony); }
.nowosc .przyciski { flex: none; display: flex; gap: 8px; flex-wrap: wrap; }

.dzial { margin-bottom: 38px; }
.dzial-naglowek { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.dzial-naglowek .nr {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--dzial); color: #fff; font-weight: 700; font-size: 18px; flex: none;
  align-self: center;
}
.dzial-naglowek h2 { margin: 0; font-size: 24px; color: var(--tusz); }
.dzial-naglowek .ile { color: var(--przygaszony); font-size: 15px; }

.tematy { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.temat {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--karta); border-radius: 14px; padding: 18px 18px 16px;
  box-shadow: var(--cien); text-decoration: none; position: relative;
  border-top: 5px solid var(--dzial);
  min-height: 170px;
}
.temat .numer { font-size: 14px; font-weight: 700; color: var(--dzial); letter-spacing: .03em; }
.temat h3 { margin: 0; font-size: 19px; line-height: 1.25; color: var(--tusz); padding-right: 54px; }
.temat .opis { margin: 0; font-size: 15px; color: var(--przygaszony); }
.temat .meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--przygaszony); padding-top: 8px; flex-wrap: wrap; }
.temat .przyciski { display: flex; gap: 8px; flex-wrap: wrap; }
.temat .przyciski .przycisk { flex: 1 1 130px; justify-content: center; }
.temat.wkrotce { background: transparent; box-shadow: none; border: 2px dashed #c9d8ce; border-top: 5px solid #c9d8ce; min-height: 0; }
.temat.wkrotce h3 { color: #64786b; }
.temat.wkrotce .numer { color: #879a8d; }
.temat .nowe { position: absolute; top: 14px; right: 14px; background: var(--zolty); color: #3b2a00; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .05em; }

.przycisk {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--dzial); color: #fff; text-decoration: none; font-weight: 600;
  padding: 10px 16px; border-radius: 10px; border: 2px solid var(--dzial); cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.przycisk:hover { background: var(--dzial-ciemny); border-color: var(--dzial-ciemny); transform: translateY(-1px); }
.przycisk.obrys { background: transparent; color: var(--dzial-ciemny); }
.przycisk.obrys:hover { background: var(--dzial-jasny); }
.przycisk.maly { padding: 8px 12px; font-size: 15px; }

.brak-wynikow { text-align: center; color: var(--przygaszony); padding: 40px 0; font-size: 18px; display: none; }
.brak-wynikow .gdzie { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

.pomoc {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px 28px;
  background: var(--karta); border-radius: 14px; box-shadow: var(--cien); padding: 20px 22px; margin-top: 8px;
}
.pomoc section { display: flex; flex-direction: column; gap: 12px; }
.pomoc h2 { margin: 0; font-size: 18px; color: var(--tusz); display: flex; align-items: center; gap: 8px; }
.pomoc h2 .ik { color: var(--dzial); font-size: 22px; }
.pomoc .wiersz-pomocy { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.pomoc .wiersz-pomocy > .ik { font-size: 20px; color: var(--dzial); margin-top: 1px; }
kbd {
  font-family: var(--mono); font-size: .85em; background: #eef4f0; border: 1px solid #cbdcd1;
  border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--tusz); white-space: nowrap;
}

.stopka { padding: 20px 16px 28px; color: var(--przygaszony); font-size: 14px; border-top: 1px solid var(--linia); }
.stopka .wnetrze { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* aplikacje do ćwiczeń – ikony z dymkiem (lekcje.js → APLIKACJE) */
.aplikacje { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: -12px 0 26px; }
.aplikacje-etykieta { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--przygaszony); }
.aplikacja {
  position: relative; display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  background: var(--karta); color: var(--tusz); font-weight: 700; font-size: 16px;
  border-radius: 14px; box-shadow: var(--cien); padding: 6px 16px 6px 6px;
}
.aplikacja-ikona {
  display: inline-grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, #22c55e, #15803d); color: #fff;
  font-size: 32px; font-weight: 800; line-height: 1; transition: transform .15s ease;
}
.aplikacja-ikona .ik { font-size: 24px; }
.aplikacja-ikona.tekst { font-size: 17px; letter-spacing: -.01em; }
.aplikacja:hover .aplikacja-ikona, .aplikacja:focus-visible .aplikacja-ikona { transform: scale(1.07); }
.dymek {
  position: absolute; left: 0; top: calc(100% + 10px); z-index: 10; width: min(330px, calc(100vw - 48px));
  background: #12291d; color: #eef6f0; border: 1px solid rgba(255,255,255,.14);
  font-size: 14px; font-weight: 400; line-height: 1.45; text-align: left;
  padding: 10px 13px; border-radius: 10px; box-shadow: 0 12px 28px rgba(0,0,0,.25);
  opacity: 0; visibility: hidden; transform: translateY(-4px); pointer-events: none;
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.dymek::before { content: ""; position: absolute; left: 20px; top: -7px; width: 12px; height: 12px; background: #12291d; border-left: 1px solid rgba(255,255,255,.14); border-top: 1px solid rgba(255,255,255,.14); transform: rotate(45deg); }
.dymek b { color: #a7d7b5; font-weight: 700; }
.aplikacja:hover .dymek, .aplikacja:focus-visible .dymek { opacity: 1; visibility: visible; transform: none; }

/* załączniki do pobrania w kafelku tematu (lekcje.js → zalaczniki) – opis w dymku po najechaniu */
.zalaczniki { display: flex; flex-direction: column; gap: 6px; }
.zalacznik {
  position: relative; display: flex; align-items: center; gap: 8px; text-decoration: none;
  padding: 7px 10px; border-radius: 10px; border: 1.5px dashed var(--dzial);
  color: var(--dzial-ciemny); font-size: 14px; font-weight: 600; line-height: 1.3;
  transition: background .15s ease;
}
.zalacznik .ik { flex: none; font-size: 17px; }
.zalacznik-nazwa { flex: 1; min-width: 0; }
.zalacznik:hover, .zalacznik:focus-visible { background: var(--dzial-jasny); }
.zalacznik .dymek { left: 0; right: 0; width: auto; }
.zalacznik:hover .dymek, .zalacznik:focus-visible .dymek { opacity: 1; visibility: visible; transform: none; }
html[data-motyw="ciemny"] body.strona-glowna .zalacznik { color: #b9e4c6; }
html[data-motyw="ciemny"] body.strona-glowna .zalacznik:hover, html[data-motyw="ciemny"] body.strona-glowna .zalacznik:focus-visible { background: #1d3024; }
@media (prefers-color-scheme: dark) {
  html:not([data-motyw]) body.strona-glowna .zalacznik { color: #b9e4c6; }
  html:not([data-motyw]) body.strona-glowna .zalacznik:hover, html:not([data-motyw]) body.strona-glowna .zalacznik:focus-visible { background: #1d3024; }
}

/* ---------- tryb ciemny (strona główna) ----------
   Domyślnie według ustawień systemu; przycisk na stronie głównej
   zapisuje wybór (localStorage „matma-motyw”: jasny / ciemny). */
html[data-motyw="ciemny"] body.strona-glowna {
  --tekst: #d5e4da; --przygaszony: #95ab9c; --linia: #24382c; --tlo: #0b1510; --karta: #14231a; --tusz: #ecf5ef;
  color-scheme: dark;
}
html[data-motyw="ciemny"] body.strona-glowna .baner { background: #07110b; }
html[data-motyw="ciemny"] body.strona-glowna .szukaj { background: #0f1c14; }
html[data-motyw="ciemny"] body.strona-glowna .temat.wkrotce { border-color: #2f4637; }
html[data-motyw="ciemny"] body.strona-glowna .temat.wkrotce h3 { color: #84998b; }
html[data-motyw="ciemny"] body.strona-glowna .przycisk.obrys { color: #b9e4c6; }
html[data-motyw="ciemny"] body.strona-glowna .klasy button { color: #dcebe1; }
html[data-motyw="ciemny"] body.strona-glowna .klasy button:hover { background: #1d3024; }
html[data-motyw="ciemny"] body.strona-glowna .klasy button[aria-selected="true"] { background: var(--dzial); color: #fff; }
html[data-motyw="ciemny"] body.strona-glowna .temat:not(.wkrotce) .numer { color: #86d39f; }
html[data-motyw="ciemny"] kbd { background: #1d3024; border-color: #33503d; color: #e3efe7; }
@media (prefers-color-scheme: dark) {
  html:not([data-motyw]) body.strona-glowna {
    --tekst: #d5e4da; --przygaszony: #95ab9c; --linia: #24382c; --tlo: #0b1510; --karta: #14231a; --tusz: #ecf5ef;
    color-scheme: dark;
  }
  html:not([data-motyw]) body.strona-glowna .baner { background: #07110b; }
  html:not([data-motyw]) body.strona-glowna .szukaj { background: #0f1c14; }
  html:not([data-motyw]) body.strona-glowna .temat.wkrotce { border-color: #2f4637; }
  html:not([data-motyw]) body.strona-glowna .temat.wkrotce h3 { color: #84998b; }
  html:not([data-motyw]) body.strona-glowna .przycisk.obrys { color: #b9e4c6; }
  html:not([data-motyw]) body.strona-glowna .klasy button { color: #dcebe1; }
  html:not([data-motyw]) body.strona-glowna .klasy button:hover { background: #1d3024; }
  html:not([data-motyw]) body.strona-glowna .klasy button[aria-selected="true"] { background: var(--dzial); color: #fff; }
  html:not([data-motyw]) body.strona-glowna .temat:not(.wkrotce) .numer { color: #86d39f; }
  html:not([data-motyw]) kbd { background: #1d3024; border-color: #33503d; color: #e3efe7; }
}

@media (max-width: 560px) {
  .baner { padding-top: 28px; }
  .tematy { grid-template-columns: 1fr; }
  .nowosc .przyciski { width: 100%; }
  .nowosc .przyciski .przycisk { flex: 1 1 0; justify-content: center; }
  .dzial-naglowek h2 { flex: 1 1 0; font-size: 20px; }
  .dzial-naglowek .ile { flex-basis: 100%; padding-left: 48px; margin-top: -6px; font-size: 14px; }
  .temat.wkrotce { padding: 12px 16px; gap: 2px; }
  .temat.wkrotce h3 { font-size: 17px; }
  .temat.wkrotce .meta { padding-top: 2px; }
  .klasy { gap: 4px; padding: 6px; }
  .klasy button { padding: 10px 2px; font-size: 15px; gap: 5px; }
  .klasy button .kropka { display: none; }
  .klasy .dlugo { display: none; }
  .klasy .krotko { display: inline; }
  .klasa-naglowek h2 { font-size: 24px; }
}

/* =========================================================
   PREZENTACJA – pasek, scena, tryby
   ========================================================= */

body.prezentacja { background: #0b1a12; overflow: hidden; height: 100vh; height: 100dvh; }
body.prezentacja.tryb-lista, body.prezentacja.tryb-mobilny { overflow: auto; height: auto; background: #e8f0ea; }

.pasek {
  position: fixed; inset: var(--gora, 0px) 0 auto 0; height: 52px; z-index: 20;
  display: flex; align-items: center; gap: 8px; padding: 0 10px;
  background: rgba(11, 26, 18, .92); color: #e3f0e7; backdrop-filter: blur(6px);
  transition: opacity .25s ease, transform .25s ease;
}
.pasek .powrot, .pasek .do-karty {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: #e3f0e7;
  padding: 8px 10px; border-radius: 8px; font-size: 15px; white-space: nowrap;
}
.pasek .powrot:hover, .pasek .do-karty:hover { background: rgba(255,255,255,.1); }
.pasek .do-karty { background: rgba(255,255,255,.08); }
.pasek .tytul { flex: 1; min-width: 0; font-size: 15px; color: #a9c4b2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pasek .tytul b { color: #fff; font-weight: 600; }
.pasek .licznik { font-variant-numeric: tabular-nums; font-size: 15px; color: #d4e5da; min-width: 64px; text-align: center; }
.pasek button {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px;
  border: 0; background: transparent; color: #e3f0e7; cursor: pointer; font-size: 20px;
}
.pasek button:hover { background: rgba(255,255,255,.12); }
.pasek button:disabled { opacity: .35; cursor: default; background: transparent; }
.pasek button[aria-pressed="true"] { background: rgba(255,255,255,.18); }
.postep { position: fixed; left: 0; top: calc(var(--gora, 0px) + 52px); height: 3px; background: var(--dzial); z-index: 21; transition: width .25s ease, opacity .25s ease; }

body.ukryj-pasek .pasek { opacity: 0; transform: translateY(-100%); }
body.ukryj-pasek .postep { opacity: 0; }
body.ukryj-pasek { cursor: none; }

.scena { position: fixed; inset: calc(var(--gora, 0px) + 52px) 0 0 0; overflow: hidden; }
body.pelny-ekran .scena { inset: var(--gora, 0px) 0 0 0; }
/* miejsce na reklamę hostingu (PRV.PL) – przesuwa pasek i slajdy w dół */
#prv-billboard { position: relative; z-index: 30; }
.scena .ramka { position: absolute; inset: 0; pointer-events: none; }
.scena .slajd {
  position: absolute; left: 0; top: 0;
  transform-origin: 0 0;
  visibility: hidden; opacity: 0; pointer-events: auto;
  transition: opacity .28s ease, visibility .28s;
}
.scena .slajd.aktywny { visibility: visible; opacity: 1; }
.scena .ramka .nr-slajdu { display: none; }

/* tryb listy (desktop): slajdy pod sobą, przeskalowane */
body.tryb-lista .scena { position: static; overflow: visible; padding: 76px 16px 40px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
body.tryb-lista .scena .ramka { position: relative; inset: auto; pointer-events: auto; box-shadow: 0 6px 24px rgba(11,26,18,.18); border-radius: 6px; overflow: hidden; flex: none; }
body.tryb-lista .scena .slajd { visibility: visible; opacity: 1; transition: none; }
body.tryb-lista .scena .ramka .nr-slajdu { display: block; }
body.tryb-mobilny .scena .ramka { position: static; inset: auto; pointer-events: auto; }
body.tryb-lista .scena .ramka .nr-slajdu { position: absolute; right: 10px; bottom: 8px; z-index: 3; font-size: 13px; background: rgba(11,26,18,.7); color: #fff; padding: 2px 8px; border-radius: 99px; }

/* =========================================================
   SLAJD – płótno 1280 × 720
   ========================================================= */

.slajd {
  width: 1280px; height: 720px; overflow: hidden;
  background: #fff; color: var(--tekst);
  padding: 52px 72px 48px;
  display: flex; flex-direction: column; gap: 22px;
  font-size: 22px; line-height: 1.4;
  position: relative;
}
.slajd::before { /* pasek koloru klasy po lewej */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 12px; background: var(--dzial);
}
.slajd > .stopka-slajdu {
  position: absolute; left: 72px; right: 72px; bottom: 18px;
  display: flex; justify-content: space-between; font-size: 14px; color: #85998c;
}

.slajd h1, .slajd h2, .slajd h3, .slajd p { margin: 0; }
.slajd h2 { font-size: 44px; line-height: 1.12; color: var(--tusz); font-weight: 700; letter-spacing: -.01em; }
.slajd h2 .ik { color: var(--dzial); margin-right: 14px; vertical-align: -0.12em; }
.slajd h3 { font-size: 24px; line-height: 1.2; color: var(--tusz); font-weight: 700; }
.slajd .wstep { font-size: 24px; color: var(--tekst); max-width: 1050px; }
.slajd .maly { font-size: 18px; color: var(--przygaszony); }
.slajd strong, .slajd b { color: var(--tusz); }
.slajd .akcent { color: var(--dzial); }
.slajd .wypelnij { flex: 1; min-height: 0; }
.slajd .srodek { display: flex; flex-direction: column; justify-content: center; }

/* siatki */
.siatka { display: grid; gap: 18px; }
.siatka.k2 { grid-template-columns: repeat(2, 1fr); }
.siatka.k3 { grid-template-columns: repeat(3, 1fr); }
.siatka.k4 { grid-template-columns: repeat(4, 1fr); }
.siatka.k5 { grid-template-columns: repeat(5, 1fr); }
.kolumny { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: start; }
.kolumny.rowne { grid-template-columns: 1fr 1fr; }

/* karta */
.karta {
  background: #f5f9f6; border: 1.5px solid #e0ebe3; border-radius: 16px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 6px;
}
.karta p { font-size: 19px; color: var(--przygaszony); line-height: 1.35; }
.karta.biala { background: #fff; }
.karta.wyrozniona { background: var(--dzial-jasny); border-color: transparent; }
.karta.pozioma { flex-direction: row; align-items: center; gap: 16px; }
.karta.pozioma > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.karta.dobrze { border-color: #9ad3ae; background: #effaf2; }
.karta.zle { border-color: #f0a9ad; background: #fdf0f1; }
.karta .etykieta-karty { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; display: inline-flex; align-items: center; gap: 6px; }
.karta.dobrze .etykieta-karty { color: var(--zielony); }
.karta.zle .etykieta-karty { color: var(--czerwony); }

.ikona {
  display: inline-grid; place-items: center; flex: none;
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--dzial-jasny); color: var(--dzial); font-size: 28px;
}
.karta.wyrozniona .ikona { background: #fff; }
.ikona.duza { width: 72px; height: 72px; border-radius: 18px; font-size: 38px; }
.ikona.mala { width: 40px; height: 40px; border-radius: 11px; font-size: 22px; }

/* pasek z uwagą na dole slajdu */
.uwaga {
  display: flex; align-items: center; gap: 14px;
  background: var(--dzial-jasny); color: var(--tusz); border-radius: 14px;
  padding: 14px 20px; font-size: 20px; line-height: 1.35;
}
.uwaga > .ik { font-size: 28px; color: var(--dzial); }
.uwaga.ostrzezenie { background: #fff4d6; }
.uwaga.ostrzezenie > .ik { color: #b26b00; }
.uwaga.wazne { background: #fdecee; }
.uwaga.wazne > .ik { color: var(--czerwony); }

/* lista celów */
.cele { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.cele.wypelnij { margin-bottom: 14px; }
.cele.wypelnij li { flex: 1; max-height: 104px; }
.cele li { display: flex; align-items: center; gap: 18px; font-size: 25px; background: #f5f9f6; border-radius: 14px; padding: 12px 18px; }
.cele li .zad { margin-left: auto; font-size: 18px; font-weight: 700; color: var(--dzial); background: var(--dzial-jasny); padding: 4px 12px; border-radius: 99px; white-space: nowrap; }

/* chip / kod w tekście */
code, .kodzik {
  font-family: var(--mono); font-size: .92em; background: #edf3ef; color: #14532d;
  padding: 1px 7px; border-radius: 6px; white-space: nowrap;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600;
  background: var(--dzial-jasny); color: var(--dzial-ciemny); padding: 3px 10px; border-radius: 99px;
}

/* wiersze (np. reguła – opis – przykład) */
.wiersze { display: flex; flex-direction: column; gap: 12px; }
.wiersz {
  display: grid; grid-template-columns: 180px 1fr 1.3fr; gap: 20px; align-items: center;
  background: #f5f9f6; border-radius: 14px; padding: 12px 20px;
}
.wiersz .klucz {
  font-weight: 700; font-size: 26px; color: var(--dzial-ciemny);
  background: #fff; border: 2px solid var(--dzial-jasny); border-radius: 10px; text-align: center; padding: 4px 6px;
}
.wiersz .co { font-weight: 700; color: var(--tusz); }
.wiersz .przyklad { display: flex; flex-direction: column; gap: 2px; }
.wiersz .przyklad span { font-size: 17px; color: var(--przygaszony); }

/* kroki */
.kroki { display: grid; gap: 18px; }
.kroki.k3 { grid-template-columns: repeat(3, 1fr); }
.kroki.k4 { grid-template-columns: repeat(4, 1fr); }
.krok { background: #f5f9f6; border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.krok .nr { display: inline-grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--dzial); color: #fff; font-weight: 700; font-size: 22px; }
.krok h3 { font-size: 25px; }
.krok p { font-size: 20px; color: var(--przygaszony); }
.krok > .ikona { margin-top: auto; align-self: flex-end; }

/* duże liczby (slajd „Teraz Ty”) */
.liczby { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.liczba { background: rgba(255,255,255,.1); border-radius: 18px; padding: 22px 24px; display: flex; flex-direction: column; gap: 6px; }
.liczba strong { font-size: 76px; line-height: 1; font-weight: 800; color: #fff; }
.liczba span { font-size: 21px; color: rgba(255,255,255,.85); }

/* slajd tytułowy i końcowy */
.slajd.ciemny { background: var(--tusz); color: #e3efe7; }
.slajd.ciemny::before { width: 100%; height: 12px; bottom: auto; }
.slajd.ciemny h1, .slajd.ciemny h2, .slajd.ciemny strong, .slajd.ciemny b { color: #fff; }
.slajd .nadtytul { font-size: 18px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dzial); }
.slajd.ciemny .nadtytul { color: #a7d7b5; }
.slajd h1 { font-size: 68px; line-height: 1.05; letter-spacing: -.015em; font-weight: 800; }
.slajd.ciemny .pytanie {
  display: flex; align-items: center; gap: 20px;
  background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.14); border-radius: 18px; padding: 20px 26px; font-size: 26px;
}
.slajd.ciemny .pytanie .ikona { background: var(--dzial); color: #fff; }
.slajd.ciemny .maly { color: #b3cbbb; }
.slajd.ciemny code { background: rgba(255,255,255,.1); color: #ffd28a; }
.dekoracja { position: absolute; right: -60px; bottom: -80px; width: 420px; height: 420px; color: var(--dzial); opacity: .22; pointer-events: none; }
.dekoracja svg { width: 100%; height: 100%; }
.slajd.ciemny .dekoracja { color: #4ade80; opacity: .14; }

/* tabelka (wiersze z zaokrąglonymi rogami) */
.tabelka { width: 100%; border-collapse: separate; border-spacing: 0 8px; font-size: 20px; }
.tabelka td { background: #f5f9f6; padding: 10px 16px; }
.tabelka td:first-child { border-radius: 12px 0 0 12px; }
.tabelka td:last-child { border-radius: 0 12px 12px 0; }

/* ---------- dodatkowe elementy slajdów ---------- */
.slajd.zwarty { gap: 16px; }
.slajd.zwarty .karta { padding: 14px 18px; gap: 4px; }
.slajd.zwarty .karta h3 { font-size: 22px; }
.karta.wyrozniona .chip { background: #fff; }
.siatka.wypelnij > .karta { justify-content: center; }
.wiersze.wypelnij > .wiersz { flex: 1; }
.kolumny.wypelnij { align-items: stretch; }
.stos { display: flex; flex-direction: column; gap: 12px; }
.stos.rozloz { justify-content: space-between; }
.ikona.tekst { font-weight: 800; font-size: 22px; letter-spacing: .02em; }
.ikona.duza.tekst { font-size: 28px; }
.slajd .duzy-tekst { font-size: 30px; font-weight: 700; color: var(--tusz); line-height: 1.25; }
.slajd .wycentrowane { text-align: center; }
.slajd .wiersz-chipow { display: flex; flex-wrap: wrap; gap: 8px; }

body.tryb-mobilny .ikona.tekst { font-size: 15px; }
body.tryb-mobilny .slajd .duzy-tekst { font-size: 19px; }

/* =========================================================
   TRYB MOBILNY – slajdy jako przewijane bloki (telefon)
   ========================================================= */

body.tryb-mobilny .scena { position: static; overflow: visible; padding: 64px 10px 32px; display: flex; flex-direction: column; gap: 16px; }
body.tryb-mobilny .scena .slajd {
  position: relative; left: auto; top: auto; transform: none !important;
  visibility: visible; opacity: 1; transition: none;
  width: 100%; height: auto; min-height: 0; overflow: visible;
  padding: 22px 18px 22px 26px; gap: 14px; font-size: 16px; border-radius: 10px;
  box-shadow: 0 2px 10px rgba(11,26,18,.1);
}
body.tryb-mobilny .slajd::before { width: 6px; border-radius: 10px 0 0 10px; }
body.tryb-mobilny .slajd.ciemny::before { width: 100%; height: 6px; border-radius: 10px 10px 0 0; }
body.tryb-mobilny .slajd > .stopka-slajdu { display: none; }
body.tryb-mobilny .slajd h1 { font-size: 30px; }
body.tryb-mobilny .slajd h2 { font-size: 24px; }
body.tryb-mobilny .slajd h3 { font-size: 17px; }
body.tryb-mobilny .slajd .wstep { font-size: 16px; }
body.tryb-mobilny .slajd .maly { font-size: 14px; }
body.tryb-mobilny .slajd .nadtytul { font-size: 13px; }
body.tryb-mobilny .karta { padding: 12px 14px; border-radius: 12px; }
body.tryb-mobilny .karta p { font-size: 15px; }
body.tryb-mobilny .ikona { width: 38px; height: 38px; font-size: 20px; border-radius: 10px; }
body.tryb-mobilny .ikona.duza { width: 48px; height: 48px; font-size: 26px; }
body.tryb-mobilny .uwaga { font-size: 15px; padding: 10px 12px; }
body.tryb-mobilny .uwaga > .ik { font-size: 20px; }
body.tryb-mobilny .siatka { gap: 10px; }
body.tryb-mobilny .siatka.k3, body.tryb-mobilny .siatka.k4, body.tryb-mobilny .siatka.k5 { grid-template-columns: repeat(2, 1fr); }
body.tryb-mobilny .siatka.k2, body.tryb-mobilny .kolumny, body.tryb-mobilny .kolumny.rowne { grid-template-columns: 1fr; gap: 12px; }
body.tryb-mobilny .cele li { font-size: 16px; padding: 10px 12px; gap: 12px; flex-wrap: wrap; }
body.tryb-mobilny .cele li .zad { font-size: 13px; }
body.tryb-mobilny .wiersz { grid-template-columns: 1fr; gap: 6px; padding: 12px; }
body.tryb-mobilny .wiersz .klucz { font-size: 20px; justify-self: start; padding: 2px 14px; }
body.tryb-mobilny .wiersz .przyklad span { font-size: 13px; }
body.tryb-mobilny .kroki.k3, body.tryb-mobilny .kroki.k4 { grid-template-columns: 1fr; gap: 10px; }
body.tryb-mobilny .krok { padding: 12px; }
body.tryb-mobilny .krok .nr { width: 32px; height: 32px; font-size: 16px; }
body.tryb-mobilny .krok h3 { font-size: 16px; }
body.tryb-mobilny .krok p { font-size: 14px; }
body.tryb-mobilny .liczby { grid-template-columns: 1fr; gap: 10px; }
body.tryb-mobilny .liczba { padding: 12px 14px; flex-direction: row; align-items: center; gap: 14px; }
body.tryb-mobilny .liczba strong { font-size: 36px; }
body.tryb-mobilny .liczba span { font-size: 15px; }
body.tryb-mobilny .slajd.ciemny .pytanie { font-size: 17px; padding: 12px 14px; gap: 12px; }
body.tryb-mobilny .slajd { overflow: hidden; }
body.tryb-mobilny .dekoracja { display: none !important; }
body.tryb-mobilny .slajd .karta h3 { font-size: 17px !important; }
body.tryb-mobilny .cele.wypelnij li { flex: none; max-height: none; }
body.tryb-mobilny .cele li { flex-wrap: nowrap; }
body.tryb-mobilny .cele li .zad { padding: 2px 8px; flex: none; min-width: max-content; }
body.tryb-mobilny .liczba strong { white-space: nowrap; flex: none; min-width: max-content; }
body.tryb-mobilny .siatka.k3 { grid-template-columns: 1fr; }
body.tryb-mobilny .slajd * { min-width: 0; }
body.tryb-mobilny .slajd h1, body.tryb-mobilny .slajd h2, body.tryb-mobilny .slajd h3 { overflow-wrap: anywhere; hyphens: auto; }
/* style wpisane bezpośrednio w slajdzie – uproszczenie na telefonie */
body.tryb-mobilny .slajd [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
body.tryb-mobilny .slajd h1[style*="font-size"] { font-size: 28px !important; }
body.tryb-mobilny .slajd h3[style*="font-size"] { font-size: 17px !important; }
body.tryb-mobilny .slajd p[style*="font-size"], body.tryb-mobilny .slajd span[style*="font-size"] { font-size: 15px !important; }
body.tryb-mobilny .slajd [style*="margin-top:auto"] { margin-top: 0 !important; margin-bottom: 0 !important; }
body.tryb-mobilny .tabelka { font-size: 14px; }
body.tryb-mobilny code { white-space: normal; }
body.tryb-mobilny .mobilny-ukryj { display: none !important; }
body.tryb-mobilny .pasek .licznik, body.tryb-mobilny .pasek .nawigacja { display: none !important; }
@media (max-width: 700px) { .pasek .mobilny-ukryj-tekst { display: none; } }

/* =========================================================
   DRUK / PDF prezentacji – każdy slajd na osobnej stronie
   ========================================================= */
@media print {
  @page { size: 1280px 720px; margin: 0; }
  body.prezentacja { background: #fff !important; overflow: visible !important; height: auto !important; }
  body.prezentacja .pasek, body.prezentacja .postep { display: none !important; }
  .scena { position: static !important; padding: 0 !important; display: block !important; }
  .scena .ramka { position: static !important; width: auto !important; height: auto !important; box-shadow: none !important; border-radius: 0 !important; pointer-events: auto; }
  .scena .ramka .nr-slajdu { display: none; }
  .scena .slajd {
    position: relative !important; left: 0 !important; top: 0 !important; transform: none !important;
    visibility: visible !important; opacity: 1 !important; break-after: page; page-break-after: always;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
