/* ═══════════════════════════════════════════════════════════
   RESET + BASE
═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blekit:    #1E90FF;
  --zielen:    #2ECC40;
  --zolc:      #FFD700;
  --pomarancz: #FF6B35;
  --granat:    #003580;
  --czerwien:  #E63946;
  --kontur:    #1A1A1A;
  --font: "Trebuchet MS", "Verdana", system-ui, -apple-system, sans-serif;
}

html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: var(--font);
  user-select: none;
}

/* ═══════════════════════════════════════════════════════════
   SLIDES + PHASES
═══════════════════════════════════════════════════════════ */
.slide {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  overflow: hidden;
}

.phase {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}

/* ═══════════════════════════════════════════════════════════
   BACKGROUNDS
═══════════════════════════════════════════════════════════ */
.microworld-bg {
  background: linear-gradient(160deg, #003580 0%, #1A1A2E 100%);
}

/* ═══════════════════════════════════════════════════════════
   PARTICLES (mikroświat)
═══════════════════════════════════════════════════════════ */
.particles-container {
  position: absolute; inset: 0; pointer-events: none;
}
.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: shimmer var(--dur, 2s) var(--delay, 0s) infinite ease-in-out;
}
@keyframes shimmer {
  0%, 100% { opacity: 0; }
  50%       { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   PROFESOR
═══════════════════════════════════════════════════════════ */
.profesor {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(220px, 30vh, 400px);
  z-index: 35;
  opacity: 0;
  transition: opacity 0.4s ease, bottom 0.3s ease;
  pointer-events: none;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.25));
  display: block;
}
.profesor.visible {
  opacity: 1;
}

/* Slajd 1A — profesor bliżej napisu intro */
#prof-1a {
  width: clamp(180px, 26vh, 290px);
  top: 22%;
  bottom: auto;
  opacity: 1;
}

/* Slajd 1C — profesor nad bubble, pozycja CSS (bez alignProfToDialog) */
#prof-1c {
  bottom: 32vh;
}
.profesor-left {
  left: 15%; transform: none;
}
.profesor-hidden {
  opacity: 0 !important;
}
.talking {
  animation: talkBounce 0.25s ease-in-out infinite alternate;
}
@keyframes talkBounce {
  from { transform: translateX(-50%) translateY(-6px); }
  to   { transform: translateX(-50%) translateY(6px); }
}
.talking.profesor-left {
  animation: talkBounceLeft 0.25s ease-in-out infinite alternate;
}
@keyframes talkBounceLeft {
  from { transform: translateY(-6px); }
  to   { transform: translateY(6px); }
}

/* Slide 1A: profesor slides in from right */
.slide-in-right {
  animation: slideInRight 0.7s cubic-bezier(.175,.885,.32,1.275) forwards,
             landBounce 0.4s 0.7s ease-out forwards;
}
@keyframes slideInRight {
  from { transform: translateX(calc(50vw + 200px)); opacity: 0; }
  to   { transform: translateX(-50%); opacity: 1; }
}
@keyframes landBounce {
  0%   { transform: translateX(-50%) translateY(0); }
  40%  { transform: translateX(-50%) translateY(-18px); }
  70%  { transform: translateX(-50%) translateY(4px); }
  100% { transform: translateX(-50%) translateY(0); }
}

/* ═══════════════════════════════════════════════════════════
   DIALOG BOX — Pokémon / Game Boy pattern
═══════════════════════════════════════════════════════════ */
.dialog-box {
  position: fixed;
  left: 50%; bottom: 3vh;
  transform: translateX(-50%) translateY(200px);
  width: 94vw; max-width: 1500px;
  background: #fff;
  border: 4px solid var(--kontur);
  border-radius: 16px;
  padding: clamp(14px, 2.4vh, 24px) clamp(20px, 3vw, 40px) clamp(18px, 3vh, 32px);
  z-index: 30;
  opacity: 0;
  transition: opacity 0.4s 0.2s ease, transform 0.4s 0.2s ease;
  box-shadow: inset 0 0 0 4px #fff,
              inset 0 0 0 7px var(--kontur),
              6px 6px 0 rgba(0,53,128,0.22);
}
.dialog-box.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@keyframes dialogSlideUp {
  from { transform: translateY(150px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.dialog-box--small {
  border-radius: 16px;
  bottom: 20px;
  margin: 0 20px;
}
.dialog-text {
  font-size: clamp(15px, 2.6vh, 24px);
  line-height: 1.55;
  color: #1A1A1A;
  margin-bottom: clamp(10px, 1.6vh, 18px);
}
.dialog-text--big {
  font-size: clamp(18px, 3.2vh, 30px);
  font-weight: 700;
  margin-bottom: 0;
}
.dialog-hint {
  font-size: clamp(12px, 1.7vh, 16px);
  color: #777;
  margin-bottom: clamp(5px, 1vh, 10px);
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-block;
  padding: clamp(9px, 1.5vh, 14px) clamp(22px, 3.5vw, 44px);
  font-family: var(--font);
  font-size: clamp(17px, 2.7vh, 26px);
  font-weight: 700;
  color: #FFFFFF;
  border: 3px solid var(--kontur);
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
  margin-top: clamp(10px, 1.5vh, 16px);
}
.btn:hover  { transform: translateY(-3px); }
.btn:active { transform: translateY(0); }
.btn-green  { background: var(--zielen);    box-shadow: 5px 5px 0 #1f8a2e; }
.btn-green:hover  { background: #41dd54; }
.btn-green:active { box-shadow: 2px 2px 0 #1f8a2e; }
.btn-blue   { background: var(--blekit);    box-shadow: 5px 5px 0 #1264c8; }
.btn-blue:hover   { background: #3aa8ff; }
.btn-blue:active  { box-shadow: 2px 2px 0 #1264c8; }
.btn-orange { background: var(--pomarancz); box-shadow: 5px 5px 0 #b8431d; }
.btn-orange:hover  { background: #ff844f; }
.btn-orange:active { box-shadow: 2px 2px 0 #b8431d; }
.btn-start  {
  background: var(--blekit); border: 4px solid var(--kontur);
  border-radius: 50px; padding: clamp(14px, 2.5vh, 24px) clamp(40px, 7vw, 80px);
  font-size: clamp(26px, 4.5vh, 46px); font-weight: 900; color: #FFF;
  cursor: pointer; box-shadow: 6px 6px 0 var(--granat);
  animation: btnBounce 0.6s 1.2s ease-out both;
  margin-top: 0;
}
.btn-start:hover  { background: #42a1ff; transform: translateY(-3px); }
.btn-start:active { box-shadow: 3px 3px 0 var(--granat); transform: translateY(0); }
/* Przyciski "Dalej →" odblokowane JS — fixed prawy dół jak w swiat_atomow */
.btn-next-hidden {
  display: none;
}
#btn-2c-next,
#btn-3b-next {
  position: fixed;
  bottom: 28px;
  right: 36px;
  z-index: 60;
  visibility: hidden;
  opacity: 0;
}
#btn-2c-next.shown,
#btn-3b-next.shown {
  display: block;
  visibility: visible;
  animation: btnBounce 0.4s ease-out forwards;
}
@keyframes btnBounce {
  from { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); }
  to   { transform: scale(1);   opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   SLIDE 1A — INTRO TEXT
═══════════════════════════════════════════════════════════ */
.intro-text {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.parent-hint {
  font-size: clamp(15px, 2.2vh, 22px);
  color: #FFFFFFCC;
  margin-bottom: clamp(16px, 2.8vh, 28px);
  max-width: 560px;
  font-style: italic;
}
.fade-in-delayed {
  opacity: 0;
  animation: fadeIn 0.6s 0.7s ease forwards;
}
@keyframes fadeIn {
  to { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   LUPA (Slajd 1C) — identyczna z swiat_atomow/slajd1.html
═══════════════════════════════════════════════════════════ */
#lupaWrap {
  position: fixed;
  left: calc(60vw - 20px);
  bottom: clamp(48vh, calc(50vh + 8vh), 62vh);
  width: clamp(110px, 18vh, 180px);
  height: clamp(175px, 29vh, 290px);
  z-index: 40;
  cursor: pointer;
  opacity: 0;
  transform: translateY(300px) rotate(-85deg);
  transition: opacity 0.4s ease, transform 0.6s ease-out;
}
#lupaWrap.lupa-active {
  opacity: 1;
  transform: translateY(0) rotate(-85deg);
}
#lupaWrap.lupa-blast {
  transform: scale(8) rotate(-85deg);
  transition: transform 0.6s ease-in;
}
#lupaInner {
  width: 100%; height: 100%;
  transform-origin: center center;
  transition: filter 0.15s ease;
}
#lupaWrap.lupa-active:not(.lupa-blast) #lupaInner {
  animation: lupaPulse 1.5s ease-in-out infinite;
}
#lupaWrap:hover #lupaInner { filter: brightness(1.15); }
#lupaInner svg { display: block; width: 100%; height: 100%; overflow: visible; }

@keyframes lupaPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.08); }
}

/* Overlay błysku przejścia */
#flash-overlay {
  position: fixed; inset: 0;
  background: #AED6F1;
  opacity: 0;
  z-index: 90;
  pointer-events: none;
  transition: opacity 0.6s ease-in;
}
#flash-overlay.active { opacity: 1; }

/* ═══════════════════════════════════════════════════════════
   ATOMS
═══════════════════════════════════════════════════════════ */
.atom-wrap {
  position: absolute;
  display: flex; flex-direction: column;
  align-items: center;
  cursor: default;
  z-index: 5;
}
.atom { width: clamp(65px, 11vh, 110px); display: block; }
.atom-label {
  color: #FFFFFF;
  font-size: clamp(17px, 2.7vh, 26px); font-weight: 700;
  text-shadow: 2px 2px 0 #1A1A1A;
  margin-top: 4px;
}
.no-interact { pointer-events: none; }

/* Float animations (3 variants) */
.float-1 { animation: float1 3.0s 0.0s ease-in-out infinite; }
.float-2 { animation: float1 3.4s 0.6s ease-in-out infinite; }
.float-3 { animation: float1 2.8s 1.1s ease-in-out infinite; }
@keyframes float1 {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-18px); }
}

/* Hover glow for interactive atoms */
.atom-wrap:not(.no-interact):hover .atom {
  filter: drop-shadow(0 0 12px #FFD700);
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════
   ATOM BUBBLE (Slajd 2C)
═══════════════════════════════════════════════════════════ */
.atom-bubble {
  position: absolute;
  padding: 16px 22px;
  border: 4px solid #1A1A1A;
  border-radius: 18px;
  font-size: 20px; font-weight: 700;
  color: #1A1A1A;
  max-width: 320px;
  z-index: 30;
  animation: bubblePop 0.3s cubic-bezier(.175,.885,.32,1.275) forwards;
}
@keyframes bubblePop {
  from { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.08); }
  to   { transform: scale(1);   opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   INSTRUCTION BUBBLE
═══════════════════════════════════════════════════════════ */
.instruction-bubble {
  position: absolute;
  top: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: #FFF;
  font-size: clamp(15px, 2.2vh, 22px); font-weight: 700;
  padding: clamp(8px, 1.2vh, 12px) clamp(16px, 2.5vw, 28px);
  border-radius: 12px;
  white-space: nowrap;
  z-index: 15;
  animation: fadeIn 0.4s ease forwards;
}

/* ═══════════════════════════════════════════════════════════
   WATER MOLECULE (Slajd 3B)
═══════════════════════════════════════════════════════════ */
.water-molecule {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: clamp(130px, 24vh, 220px); height: clamp(130px, 24vh, 220px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #72e2ff, #1E90FF, #003580);
  border: 6px solid #1A1A1A;
  box-shadow: 0 0 40px rgba(30,144,255,0.7),
              inset 0 -10px 20px rgba(0,0,80,0.3),
              inset 8px 8px 16px rgba(255,255,255,0.25);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 10;
  transition: transform 0.55s cubic-bezier(.175,.885,.32,1.275);
}
.water-formula {
  font-size: clamp(34px, 6.2vh, 62px); font-weight: 900; color: #FFF;
  text-shadow: 3px 3px 0 #1A1A1A;
}
.water-label {
  font-size: clamp(19px, 3.2vh, 32px); color: #FFD700;
  text-shadow: 2px 2px 0 #1A1A1A;
}

.success-text {
  position: absolute;
  top: 30%; left: 50%; transform: translateX(-50%);
  font-size: clamp(54px, 10vh, 108px); font-weight: 900; color: #FFD700;
  text-shadow: 6px 6px 0 #1A1A1A, 0 0 30px #FF6B35;
  z-index: 20;
  animation: successPop 0.6s cubic-bezier(.175,.885,.32,1.275) forwards;
}
@keyframes successPop {
  0%   { transform: translateX(-50%) scale(0) rotate(-3deg); opacity: 0; }
  60%  { transform: translateX(-50%) scale(1.18) rotate(3deg); }
  100% { transform: translateX(-50%) scale(1) rotate(0deg); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   CONFETTI
═══════════════════════════════════════════════════════════ */
.confetti-piece {
  position: fixed;
  width: 10px; height: 10px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 999;
  animation: confettiFall var(--dur, 2s) var(--delay, 0s) ease-in forwards;
}
@keyframes confettiFall {
  from { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  to   { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════
   URANIUM — green glow
═══════════════════════════════════════════════════════════ */
.green-glow {
  animation: greenGlow 2s ease-in-out infinite;
}
@keyframes greenGlow {
  0%, 100% { filter: drop-shadow(0 0 0px #2ECC40); }
  50%       { filter: drop-shadow(0 0 20px #2ECC40); }
}

/* ═══════════════════════════════════════════════════════════
   SLAJD 7 — CHAIN REACTION GAME
═══════════════════════════════════════════════════════════ */
.uranium-grid, #uranium-game-grid {
  position: absolute; inset: 0; pointer-events: none;
}
#uranium-game-grid { pointer-events: auto; }

.u-atom {
  position: absolute;
  width: clamp(65px, 11vh, 110px);
  cursor: pointer;
  animation: atomPulse 1.8s ease-in-out infinite;
  transition: filter 0.1s;
}
.u-atom:hover { filter: drop-shadow(0 0 12px #FFD700); }

@keyframes atomPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.08); }
}
.u-atom.splitting {
  animation: shake 0.3s ease-in-out;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-8px); }
  40%     { transform: translateX(8px); }
  60%     { transform: translateX(-6px); }
  80%     { transform: translateX(6px); }
}

.fragment-uranium {
  position: fixed;
  width: 48px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 50;
}

.chain-text {
  position: absolute;
  top: 38%; left: 50%; transform: translateX(-50%);
  font-size: clamp(40px, 8vh, 86px); font-weight: 900; color: #FFD700;
  text-shadow: 4px 4px 0 #1A1A1A, 0 0 30px #FF6B35;
  text-align: center;
  z-index: 20;
  white-space: nowrap;
  animation: chainPop 0.7s cubic-bezier(.175,.885,.32,1.275) forwards;
}
@keyframes chainPop {
  from { transform: translateX(-50%) scale(0) rotate(-5deg); }
  60%  { transform: translateX(-50%) scale(1.15) rotate(2deg); }
  to   { transform: translateX(-50%) scale(1) rotate(0); }
}

.bg-pulse-overlay {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 8;
  animation: bgPulse 1.2s ease-in-out forwards;
}
@keyframes bgPulse {
  0%   { background: rgba(255,215,0,0); }
  30%  { background: rgba(255,107,53,0.5); }
  70%  { background: rgba(255,215,0,0.3); }
  100% { background: rgba(255,215,0,0); }
}

/* ═══════════════════════════════════════════════════════════
   SLAJD 8 — FLASH
═══════════════════════════════════════════════════════════ */
.flash-core {
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}
.flash-wave {
  position: absolute;
  border-radius: 50%;
  width: 200px; height: 200px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  z-index: 3;
}
@keyframes waveExpand {
  from { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  to   { transform: translate(-50%, -50%) scale(5); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════
   SLAJD 8C — BALON
═══════════════════════════════════════════════════════════ */
.balloon {
  position: absolute;
  left: 58%; top: 50%; transform: translate(-50%, -50%);
  width: 140px; height: 180px;
  background: radial-gradient(circle at 35% 30%, #FF8A95, #E63946, #9B1B26);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  border: 5px solid #1A1A1A;
  box-shadow: 4px 4px 0 #1A1A1A;
  cursor: pointer;
  z-index: 5;
}
.balloon::after {
  content: '';
  position: absolute;
  bottom: -70px; left: 50%;
  transform: translateX(-50%);
  width: 2px; height: 60px;
  background: #1A1A1A;
}
.breathe {
  animation: breathe 1.5s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1);    box-shadow: 4px 4px 0 #1A1A1A, 0 0 0 rgba(230,57,70,0.3); }
  50%       { transform: translate(-50%, -50%) scale(1.06); box-shadow: 4px 4px 0 #1A1A1A, 0 0 25px rgba(230,57,70,0.4); }
}

.pyk-text {
  position: absolute;
  font-size: clamp(60px, 11vh, 118px); font-weight: 900; color: #FF6B35;
  text-shadow: 5px 5px 0 #1A1A1A;
  z-index: 30;
  animation: pykPop 0.3s cubic-bezier(.175,.885,.32,1.275) forwards;
}
@keyframes pykPop {
  from { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  60%  { transform: translate(-50%, -50%) scale(1.3); }
  to   { transform: translate(-50%, -50%) scale(1);  opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   EXPERIMENT CARD
═══════════════════════════════════════════════════════════ */
.experiment-card {
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(600px, 90vw);
  background: #FFFDE7;
  border: 4px solid #1A1A1A;
  border-radius: 20px;
  padding: clamp(24px, 4vh, 44px) clamp(24px, 4vw, 48px);
  box-shadow: 6px 6px 0 #1A1A1A;
  z-index: 10;
  animation: slideUp 0.5s ease-out forwards;
}
@keyframes slideUp {
  from { transform: translate(-50%, calc(-50% + 40px)); opacity: 0; }
  to   { transform: translate(-50%, -50%);               opacity: 1; }
}
.experiment-header {
  font-size: clamp(22px, 3.8vh, 38px); font-weight: 900; color: #FF6B35;
  margin-bottom: clamp(10px, 1.8vh, 18px);
}
.experiment-text {
  font-size: clamp(16px, 2.4vh, 22px); line-height: 1.6; color: #1A1A1A;
  margin-bottom: clamp(10px, 1.8vh, 18px);
}
.experiment-hr {
  border: 2px solid #1A1A1A; margin: clamp(10px, 1.8vh, 18px) 0;
}
.experiment-science {
  font-size: clamp(14px, 2.1vh, 20px); font-style: italic; color: #003580;
  line-height: 1.6; margin-bottom: clamp(16px, 2.8vh, 28px);
}

/* ═══════════════════════════════════════════════════════════
   ZOOM OVERLAY (Slajd 2A)
═══════════════════════════════════════════════════════════ */
.zoom-overlay {
  position: absolute; inset: 0;
  background: #1E90FF;
  z-index: 100;
}

/* ═══════════════════════════════════════════════════════════
   PAGINACJA
═══════════════════════════════════════════════════════════ */
#pagination {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: clamp(5px, 0.8vh, 10px);
  z-index: 200;
  background: rgba(0,0,0,0.45);
  padding: clamp(5px, 0.9vh, 9px) clamp(10px, 1.5vw, 18px);
  border-radius: 50px;
  border: 2px solid rgba(255,255,255,0.2);
}
.page-btn {
  width: clamp(28px, 4vh, 42px); height: clamp(28px, 4vh, 42px);
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-family: var(--font);
  font-size: clamp(12px, 1.7vh, 17px); font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.page-btn:hover {
  background: rgba(255,255,255,0.35);
  transform: scale(1.12);
}
.page-btn.active {
  background: var(--blekit);
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--blekit);
}

/* ═══════════════════════════════════════════════════════════
   SLAJDY 9–14 — ELEKTROWNIA ATOMOWA
═══════════════════════════════════════════════════════════ */

/* Tło — jasne industrialne niebo */
.plant-bg {
  background: linear-gradient(180deg, #B8D4E8 0%, #E8F4F8 60%, #C8DDA0 100%);
}

/* Etykieta kroku */
.step-badge {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--granat);
  color: var(--zolc);
  font-size: clamp(14px, 2.2vh, 22px); font-weight: 700;
  padding: clamp(6px, 1vh, 10px) clamp(14px, 2.5vw, 28px);
  border-radius: 50px;
  border: 3px solid var(--kontur);
  z-index: 20;
}

/* ── Diagram elektrowni ── */
.plant-diagram {
  position: absolute;
  top: 35%; left: 50%;
  transform: translate(-50%, -50%) scale(clamp(0.85, 0.13vh, 1.7));
  display: flex;
  align-items: center;
  z-index: 5;
}

/* REAKTOR */
.plant-reactor {
  width: 130px; height: 130px;
  background: radial-gradient(circle at 35% 30%, #6ef86e, #2ECC40, #1a8a2a);
  border: 5px solid var(--kontur);
  border-radius: 20px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  position: relative;
  cursor: default;
  box-shadow: 0 0 18px rgba(46,204,64,0.35), 4px 4px 0 var(--kontur);
}
.reactor-core {
  width: 46px; height: 46px;
  background: radial-gradient(circle, #FFD700, #FF6B35);
  border-radius: 50%;
  border: 3px solid var(--kontur);
  animation: coreGlow 2s ease-in-out infinite;
}
@keyframes coreGlow {
  0%,100% { box-shadow: 0 0 6px var(--zolc); }
  50%      { box-shadow: 0 0 22px var(--zolc), 0 0 36px var(--pomarancz); }
}

/* RURA */
.plant-pipe-h {
  width: 120px; height: 38px;
  background: linear-gradient(180deg, #c0d8e8, #80a8c0, #c0d8e8);
  border-top: 4px solid var(--kontur);
  border-bottom: 4px solid var(--kontur);
  position: relative;
  overflow: hidden;
  cursor: default;
}

/* TURBINA */
.plant-turbine {
  width: 130px; height: 150px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
}
.turbine-circle {
  width: 100px; height: 100px;
  background: radial-gradient(circle at 38% 38%, #e8e8e8, #909090);
  border-radius: 50%;
  border: 4px solid var(--kontur);
  position: relative;
  box-shadow: 3px 3px 0 var(--kontur);
}
.turbine-blade {
  position: absolute;
  width: 7px; height: 38px;
  background: #555;
  border-radius: 3px;
  top: 50%; left: 50%;
  transform-origin: 50% 100%;
}
.tb1 { transform: translate(-50%, -100%) rotate(0deg); }
.tb2 { transform: translate(-50%, -100%) rotate(90deg); }
.tb3 { transform: translate(-50%, -100%) rotate(180deg); }
.tb4 { transform: translate(-50%, -100%) rotate(270deg); }
@keyframes spinTurbine {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* KABEL */
.plant-cable {
  width: 100px; height: 10px;
  background: var(--zolc);
  border-top: 3px solid var(--kontur);
  border-bottom: 3px solid var(--kontur);
  position: relative;
  overflow: hidden;
}

/* DOM */
.plant-house {
  font-size: clamp(44px, 7.5vh, 74px);
  position: relative;
  cursor: default;
  line-height: 1;
  display: flex; flex-direction: column;
  align-items: center;
  user-select: none;
}

/* Stany: highlighted / dimmed */
.plant-reactor.highlighted { cursor: pointer; animation: highlightPulse 1.6s ease-in-out infinite; }
.plant-pipe-h.highlighted  { cursor: pointer; background: linear-gradient(180deg, #87CEEB, #4ab0e0, #87CEEB);
                              box-shadow: 0 0 18px rgba(30,144,255,.5); animation: highlightPulse 1.6s ease-in-out infinite; }
.plant-turbine.highlighted .turbine-circle { box-shadow: 0 0 28px rgba(255,215,0,.8), 3px 3px 0 var(--kontur); }
.plant-cable.highlighted   { box-shadow: 0 0 14px rgba(255,215,0,.8); }
.plant-house.highlighted   { cursor: pointer; animation: highlightPulse 1.6s ease-in-out infinite; }

.plant-reactor.dimmed,
.plant-pipe-h.dimmed,
.plant-turbine.dimmed,
.plant-cable.dimmed,
.plant-house.dimmed { opacity: 0.3; cursor: default !important; }

@keyframes highlightPulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}

/* Etykieta pod elementem */
.plant-label {
  font-size: clamp(11px, 1.6vh, 15px); font-weight: 700; color: var(--kontur);
  text-shadow: 1px 1px 0 rgba(255,255,255,.8);
  margin-top: 4px;
}

/* Podpowiedź kliknięcia */
.click-hint {
  position: absolute;
  bottom: -26px; left: 50%;
  transform: translateX(-50%);
  font-size: clamp(11px, 1.6vh, 15px); color: var(--pomarancz); font-weight: 700;
  white-space: nowrap;
  animation: fadeIn 0.5s 1.2s both;
}

/* Bąbelki w rurze */
.bubble-container { position: absolute; inset: 0; pointer-events: none; }
.bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(255,255,255,.9);
  animation: bubbleFlow var(--dur, 1s) var(--delay, 0s) linear infinite;
}
@keyframes bubbleFlow {
  from { left: -12px; }
  to   { left: 132px; }
}

/* Wybuch pary */
.steam-burst {
  position: absolute;
  top: 28%; left: 50%;
  transform: translateX(-50%);
  font-size: 30px; font-weight: 900; color: var(--blekit);
  text-shadow: 2px 2px 0 var(--kontur);
  z-index: 20;
  animation: successPop 0.5s cubic-bezier(.175,.885,.32,1.275) forwards;
}

/* Iskry w kablu */
.sparks-container { position: absolute; inset: 0; pointer-events: none; }
.spark {
  position: absolute;
  width: 9px; height: 9px;
  background: #FFF;
  border-radius: 50%;
  top: 50%; transform: translateY(-50%);
  animation: sparkFlow var(--dur, .6s) var(--delay, 0s) linear infinite;
  box-shadow: 0 0 6px var(--zolc);
}
@keyframes sparkFlow {
  from { left: -12px; opacity: 1; }
  to   { left: 112px; opacity: 0; }
}

/* Popup reaktora */
.reactor-popup {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #FFF;
  border: 4px solid var(--kontur);
  border-radius: 20px;
  padding: 28px 36px;
  text-align: center;
  z-index: 40;
  box-shadow: 6px 6px 0 var(--kontur);
  animation: bubblePop 0.4s cubic-bezier(.175,.885,.32,1.275) forwards;
  max-width: 380px;
}
.popup-atoms { font-size: 48px; margin-bottom: 12px; display: flex; justify-content: center; gap: 8px; }
.popup-atom  { display: inline-block; animation: float1 1.2s ease-in-out infinite; }
.reactor-popup p { font-size: 18px; line-height: 1.5; margin-bottom: 20px; }

/* Sterowanie turbiną */
.turbine-controls {
  position: absolute;
  bottom: 26vh; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
  z-index: 10;
}
.steam-bar-wrap {
  width: 220px; height: 22px;
  background: #ddd;
  border: 3px solid var(--kontur);
  border-radius: 12px;
  overflow: hidden;
}
.steam-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--blekit), var(--zielen));
  border-radius: 12px;
  transition: width 0.35s ease;
}

/* Okienka domu */
.house-windows {
  position: absolute;
  top: 26%; right: 6%;
  display: flex; gap: 12px;
  z-index: 20;
}
.house-window {
  width: 62px; height: 62px;
  background: var(--zolc);
  border: 3px solid var(--kontur);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px;
  box-shadow: 0 0 20px rgba(255,215,0,.7), 3px 3px 0 var(--kontur);
  animation: windowLight 0.4s ease-out both;
}
@keyframes windowLight {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── Slajd 14 — Infografika ── */
.infographic {
  position: absolute;
  top: 38%; left: 50%;
  transform: translate(-50%, -50%) scale(clamp(0.75, 0.13vh, 1.7));
  display: flex;
  align-items: center;
  gap: 0;
  z-index: 5;
}
.info-step {
  width: 110px;
  background: #FFF;
  border: 4px solid #ccc;
  border-radius: 16px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s, box-shadow .2s;
}
.info-step:hover:not(.locked) { transform: translateY(-5px); }
.info-step.active {
  border-color: var(--kontur);
  box-shadow: 4px 4px 0 var(--kontur);
  background: #FFFDE7;
  animation: bubblePop .35s cubic-bezier(.175,.885,.32,1.275) forwards;
}
.info-step.locked { opacity: .35; cursor: not-allowed; pointer-events: none; }
.info-icon  { font-size: 38px; }
.info-label { font-size: 13px; font-weight: 900; color: var(--kontur); margin: 6px 0 3px; }
.info-desc  { font-size: 11px; color: #555; line-height: 1.3; }
.info-arrow { font-size: 26px; font-weight: 900; color: var(--kontur); padding: 0 6px; }

@media (max-width: 700px) {
  .plant-diagram { transform: translate(-50%, -50%) scale(0.58); }
  .infographic   { transform: translate(-50%, -50%) scale(0.68); }
  .wind-scene    { transform: scale(0.65); transform-origin: center bottom; }
  .dam-scene     { transform: translate(-50%, -50%) scale(0.7); }
}

/* ═══════════════════════════════════════════════════════════
   SLAJDY 15–19 — ENERGIE ODNAWIALNE
═══════════════════════════════════════════════════════════ */

/* ── Slajd 15 — Bridge ── */
.energy-icons-wrap {
  position: absolute;
  top: 30%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex; gap: 40px;
  align-items: center;
  z-index: 5;
}
.energy-icon {
  font-size: clamp(55px, 9.5vh, 100px);
  opacity: 0; transform: scale(0);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(.175,.885,.32,1.275);
  user-select: none;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

/* ── Slajd 16 — Energia słoneczna ── */
.solar-bg {
  background: linear-gradient(180deg, #87CEEB 0%, #E0F0FF 45%, #7EC850 100%);
}
.solar-scene {
  position: absolute;
  inset: 0 0 35% 0;
  pointer-events: none;
}
.solar-scene .cloud { pointer-events: auto; }

.sun-circle {
  position: absolute;
  right: 12%; top: 8%;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFF176, #FFD700, #FF8F00);
  border: 4px solid var(--kontur);
  box-shadow: 0 0 0 8px rgba(255,215,0,.25);
  animation: sunPulse 2s ease-in-out infinite;
}
@keyframes sunPulse {
  0%,100% { box-shadow: 0 0 0 8px rgba(255,215,0,.2), 0 0 30px rgba(255,215,0,.4); }
  50%     { box-shadow: 0 0 0 16px rgba(255,215,0,.15), 0 0 60px rgba(255,215,0,.6); }
}

.cloud {
  position: absolute;
  left: 22%; top: 12%;
  width: 90px; height: 50px;
  cursor: pointer;
  transition: transform 0.65s ease-in, opacity 0.4s 0.3s ease;
  z-index: 10;
}
.cloud-puff {
  position: absolute;
  background: #FFF;
  border: 3px solid var(--kontur);
  border-radius: 50%;
  bottom: 0; left: 10px;
  width: 70px; height: 46px;
}
.cloud-puff.cp2 {
  width: 46px; height: 38px;
  left: 4px; bottom: 22px;
}
.cloud-puff.cp3 {
  width: 38px; height: 32px;
  left: 38px; bottom: 28px;
}

.solar-home {
  position: absolute;
  bottom: 10px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column;
  align-items: center;
}
.solar-panel-row {
  display: flex; gap: 4px;
  margin-bottom: -4px;
}
.solar-panel {
  width: 40px; height: 24px;
  background: linear-gradient(135deg, #1565C0, #1976D2, #1565C0);
  border: 2px solid var(--kontur);
  border-radius: 3px;
}
.house-emoji { font-size: clamp(56px, 10vh, 96px); line-height: 1; }

.solar-light {
  position: absolute;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  font-size: 48px;
  animation: bubblePop 0.4s cubic-bezier(.175,.885,.32,1.275) forwards;
  z-index: 15;
}

.solar-charge-wrap {
  position: absolute;
  top: 55%; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  z-index: 15;
}
.charge-label {
  font-size: 16px; font-weight: 700; color: var(--kontur);
}

/* ── Slajd 17 — Energia wiatru ── */
.wind-bg {
  background: linear-gradient(180deg, #87CEEB 0%, #D0E8F5 55%, #7EC850 100%);
}
.wind-scene {
  position: absolute;
  inset: 0 0 35% 0;
  overflow: hidden;
}
.hill-shape {
  position: absolute;
  background: #7EC850;
  border-top: 4px solid #5A9A2E;
  border-radius: 50% 50% 0 0;
}
.wind-turbine-wrap {
  position: absolute;
  display: flex; flex-direction: column;
  align-items: center;
}
.wind-turbine-wrap .turbine-circle {
  width: 80px; height: 80px;
}
.wind-pole {
  width: 8px; height: 80px;
  background: linear-gradient(90deg, #999, #ccc, #999);
  border: 2px solid var(--kontur);
  border-radius: 2px;
}

.wind-line {
  position: fixed;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.85);
  pointer-events: none;
  z-index: 50;
  animation: windBlow 0.85s ease-out forwards;
}
@keyframes windBlow {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(60vw); opacity: 0; }
}

/* ── Slajd 18 — Energia wody ── */
.water-bg {
  background: linear-gradient(180deg, #87CEEB 0%, #E0F4FF 50%, #4DBDE8 100%);
}
.dam-scene {
  position: absolute;
  top: 30%; left: 50%;
  transform: translate(-50%, -50%) scale(clamp(0.85, 0.13vh, 1.7));
  display: flex;
  align-items: center;
  gap: 0;
  z-index: 5;
}
.water-body {
  width: 120px; height: 140px;
  background: linear-gradient(180deg, #4DBDE8, #2e9ab8);
  border: 4px solid var(--kontur);
  border-radius: 8px 0 0 8px;
}
.dam-block {
  width: 44px; height: 160px;
  background: linear-gradient(90deg, #888, #bbb, #888);
  border: 4px solid var(--kontur);
  border-radius: 4px;
  box-shadow: 4px 0 0 var(--kontur);
  z-index: 2;
}
.water-channel-wrap {
  display: flex; flex-direction: column;
  align-items: center;
  position: relative;
}
.water-channel {
  width: 200px; height: 38px;
  background: #c8e8f4;
  border-top: 4px solid var(--kontur);
  border-bottom: 4px solid var(--kontur);
  overflow: hidden;
  position: relative;
}
.water-flow-div {
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 100%;
  background: linear-gradient(90deg, #4DBDE8, #2e9ab8);
  transition: width 2s ease;
}
.valve-circle {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FF6B6B, var(--czerwien));
  border: 4px solid var(--kontur);
  box-shadow: 3px 3px 0 var(--kontur);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-top: -6px;
  transition: transform 0.8s ease;
  position: relative;
  z-index: 3;
}
.valve-cross {
  width: 28px; height: 28px;
  position: relative;
}
.valve-cross::before,
.valve-cross::after {
  content: '';
  position: absolute;
  background: #FFF;
  border-radius: 2px;
}
.valve-cross::before { width: 4px; height: 28px; left: 12px; top: 0; }
.valve-cross::after  { width: 28px; height: 4px; left: 0; top: 12px; }

.water-turbine-wrap {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  padding-left: 12px;
}
.water-turbine-wrap .turbine-circle {
  width: 90px; height: 90px;
}

/* ── Slajd 19 — Porównanie ── */
.compare-wrap {
  position: absolute;
  top: 45%; left: 55%;
  transform: translate(-50%, -50%);
  width: min(620px, 85vw);
  z-index: 5;
}
.compare-title {
  font-size: clamp(20px, 3.2vh, 30px); font-weight: 900; color: var(--granat);
  margin-bottom: clamp(10px, 1.8vh, 18px);
  text-align: center;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(14px, 2vh, 19px);
  background: #FFF;
  border: 4px solid var(--kontur);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--kontur);
  margin-bottom: 20px;
}
.compare-table th {
  background: var(--granat);
  color: var(--zolc);
  font-size: clamp(13px, 1.8vh, 17px); font-weight: 700;
  padding: clamp(7px, 1.2vh, 12px) clamp(10px, 1.5vw, 16px);
  text-align: center;
  border-bottom: 3px solid var(--kontur);
}
.compare-table th:first-child { background: #222; }
.compare-table td {
  padding: 10px 14px;
  border-bottom: 2px solid #e0e0e0;
  text-align: center;
}
.compare-table td:first-child {
  text-align: left; font-weight: 700;
  background: #F5F5F5; color: var(--kontur);
}
.compare-row {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.compare-row.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════
   SLAJD 20 — QUIZ
═══════════════════════════════════════════════════════════ */
.quiz-wrap {
  position: absolute;
  top: 44%; left: 56%;
  transform: translate(-50%, -50%);
  width: min(580px, 82vw);
  z-index: 5;
}
.quiz-num {
  font-size: 14px; font-weight: 700; color: #777;
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: .5px;
}
.quiz-question {
  font-size: clamp(18px, 2.8vh, 26px); font-weight: 900; color: var(--kontur);
  line-height: 1.4; margin-bottom: clamp(12px, 2vh, 20px);
}
.quiz-answers {
  display: flex; flex-direction: column; gap: clamp(7px, 1.2vh, 12px);
}
.quiz-btn {
  padding: clamp(10px, 1.6vh, 15px) clamp(14px, 2vw, 22px);
  font-size: clamp(15px, 2.2vh, 20px); font-weight: 700;
  font-family: var(--font);
  text-align: left;
  background: #FFF;
  border: 3px solid var(--kontur);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
  box-shadow: 3px 3px 0 rgba(0,0,0,.08);
}
.quiz-btn:hover:not(:disabled) { transform: translateX(5px); background: #F0F4FF; }
.quiz-btn:disabled { cursor: default; }
.quiz-btn.quiz-correct { background: var(--zielen); color: #FFF; border-color: #1a8a2e; box-shadow: 3px 3px 0 #1a8a2e; }
.quiz-btn.quiz-wrong   { background: var(--czerwien); color: #FFF; border-color: #9b1b26; box-shadow: 3px 3px 0 #9b1b26; }

.quiz-feedback {
  margin-top: 13px;
  font-size: 16px; font-weight: 700;
  min-height: 22px;
}
.feedback-correct { color: #1a8a2e; }
.feedback-wrong   { color: var(--czerwien); }

.quiz-result {
  text-align: center; padding: 16px 0;
  animation: slideUp 0.5s ease-out forwards;
}
.result-score {
  font-size: clamp(52px, 9.5vh, 98px); font-weight: 900; color: var(--granat);
  text-shadow: 4px 4px 0 rgba(0,53,128,.15);
  margin-bottom: clamp(8px, 1.4vh, 14px);
  line-height: 1;
}
.result-msg {
  font-size: clamp(18px, 2.7vh, 26px); font-weight: 700; color: var(--kontur);
  margin-bottom: clamp(18px, 3.2vh, 34px); line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════
   NARRATED LINES — typewriter
═══════════════════════════════════════════════════════════ */
.narrated-line {
  display: block;
  min-height: 1.55em;
}
.narrated-line.typing::after {
  content: '|';
  color: var(--blekit);
  font-weight: 700;
  animation: cursorBlink 0.55s step-end infinite;
}
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════
   PRZYCISK GŁOŚNIKA
═══════════════════════════════════════════════════════════ */
.btn-voice-mute {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 300;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid var(--kontur);
  border-radius: 50%;
  width: clamp(42px, 5.5vh, 58px);
  height: clamp(42px, 5.5vh, 58px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(16px, 2.2vh, 24px);
  color: var(--kontur);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.12s ease, background 0.15s ease;
  padding: 0;
}
.btn-voice-mute:hover {
  transform: scale(1.1);
  background: #fff;
}
.btn-voice-mute.muted {
  background: rgba(230, 57, 70, 0.12);
  color: var(--czerwien);
  border-color: var(--czerwien);
}
