/* =============================
   FEAR DROP — Neon System + Horizontal Glitch
   ============================= */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  color: #fff;
}

/* --- SCENA --- */
.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: #000;
}

/* --- VIGNETTE --- */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(0,0,0,0) 50%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: multiply;
}

/* --- ZIARNO --- */
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url('/wp-content/themes/xfear-drop-child/assets/img/noise-pattern1.png') repeat;
  background-size: auto;
  opacity: 0.18;
  mix-blend-mode: overlay;
  animation: grainShift 0.7s steps(6) infinite;
  z-index: 1;
}

@keyframes grainShift {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-5%, -5%); }
  40% { transform: translate(5%, -5%); }
  60% { transform: translate(-5%, 5%); }
  80% { transform: translate(5%, 5%); }
}

/* --- ZDJĘCIE --- */
.hero-wrap {
  position: relative;
  z-index: 10;
  display: grid;
  place-items: center;
  animation: float 8s ease-in-out infinite;
}

.hero-img {
  width: min(80vw, 950px);
  max-height: 88vh;
  object-fit: contain;
  filter: drop-shadow(0 40px 80px rgba(0,0,0,0.8));
  animation:
    imageFade 1.3s ease-out both,
    glitchHorizontal 4s infinite steps(1);
  transition: transform 0.4s ease;
}

/* --- GLITCH – efekt rozjeżdżania RGB --- */
@keyframes glitchHorizontal {
  0%, 90%, 100% {
    filter: none;
    transform: translate(0);
    opacity: 1;
  }

  91% {
    filter: drop-shadow(-2px 0 #00fff2)
            drop-shadow(2px 0 #ff0044)
            contrast(1.1);
    transform: translate(-3px);
  }

  92% {
    filter: drop-shadow(3px 0 #00fff2)
            drop-shadow(-3px 0 #ff0044)
            brightness(1.2);
    transform: translate(3px);
  }

  93% {
    filter: drop-shadow(-4px 0 #00fff2)
            drop-shadow(4px 0 #ff0044)
            saturate(1.3);
    transform: translate(-2px);
  }

  94% {
    filter: drop-shadow(2px 0 #00fff2)
            drop-shadow(-2px 0 #ff0044)
            brightness(1.1);
    transform: translate(2px);
  }

  95% {
    filter: drop-shadow(-3px 0 #00fff2)
            drop-shadow(3px 0 #ff0044)
            contrast(1.3);
    transform: translate(-1px);
  }

  96% {
    filter: none;
    transform: translate(0);
  }
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

@keyframes imageFade {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

/* --- PROCENTY --- */
.percent {
  position: absolute;
  bottom: 8vh;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(16px, 2.2vw, 24px);
  letter-spacing: 0.18em;
  opacity: 0.8;
  z-index: 11;
  text-transform: uppercase;
  font-weight: 500;
}

/* --- META (logo i ikony) --- */
.meta {
  position: absolute;
  top: 25px;
  left: 25px;
  right: 25px;
  z-index: 12;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* LOGO FEAR */
.meta-left img.logo-fear {
  height: 26px;
  filter: invert(1) brightness(2) drop-shadow(0 0 10px rgba(255,255,255,0.4));
  opacity: 0.95;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.meta-left img.logo-fear:hover {
  transform: scale(1.05);
  opacity: 1;
  filter: invert(1) brightness(2.2) drop-shadow(0 0 18px rgba(255,255,255,0.9));
}

/* --- IKONY PRAWE (białe z turkusowym neonem) --- */
.meta-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.meta-right a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0,255,213,0.25);
  background: rgba(0,255,213,0.06);
  color: #fff;
  opacity: 0.9;
  transition: 0.25s ease;
  backdrop-filter: blur(6px);
  animation: pulseCyan 3s ease-in-out infinite;
}

.meta-right a svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  transition: 0.25s ease;
  filter: drop-shadow(0 0 8px rgba(0,255,213,0.6));
}

.meta-right a:hover svg {
  stroke: #fff;
  filter: drop-shadow(0 0 14px rgba(0,255,213,1));
  transform: scale(1.15);
}

.meta-right a:hover {
  transform: translateY(-2px);
  border-color: rgba(0,255,213,0.6);
  box-shadow: 0 0 12px rgba(0,255,213,0.4);
}

/* --- ANIMACJA NEONU --- */
@keyframes pulseCyan {
  0%,100% { box-shadow: 0 0 6px rgba(0,255,213,0.4); }
  50% { box-shadow: 0 0 18px rgba(0,255,213,0.9); }
}

/* --- NAPISY LOSOWE (po lewej stronie) --- */
.floating-text {
  position: absolute;
  left: 8vw;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.6);
  text-shadow: 0 0 10px rgba(255,255,255,0.3);
  font-size: clamp(22px, 2.8vw, 38px);
  font-weight: 600;
  letter-spacing: 0.15em;
  user-select: none;
  pointer-events: none;
  text-transform: uppercase;
  opacity: 0;
  animation:
    floatFade 4.5s ease-in-out forwards,
    textGlitch 1.2s infinite;
  mix-blend-mode: screen;
}

@keyframes floatFade {
  0% { opacity: 0; transform: translateY(10px) scale(0.95); }
  25% { opacity: 0.8; transform: translateY(0) scale(1); }
  75% { opacity: 0.8; transform: translateY(-8px) scale(1.02); }
  100% { opacity: 0; transform: translateY(-16px) scale(1.05); }
}

@keyframes textGlitch {
  0%, 94%, 100% { text-shadow: 0 0 8px rgba(255,255,255,0.3); transform: translate(0,0); }
  96% { text-shadow: -1px 0 rgba(255,255,255,0.6), 1px 0 rgba(255,255,255,0.6); transform: translate(1px, -1px); }
  98% { text-shadow: 1px 0 rgba(255,255,255,0.6), -1px 0 rgba(255,255,255,0.6); transform: translate(-1px, 1px); }
}

/* --- PRZYCISK DŹWIĘKU --- */
.sound-toggle {
  position: absolute;
  bottom: 25px;
  right: 25px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(0,255,213,0.25);
  background: transparent;
  color: #fff;
  cursor: pointer;
  opacity: 0.9;
  transition: 0.25s ease;
  backdrop-filter: blur(6px);
  animation: pulseCyan 3s ease-in-out infinite;
}

.sound-toggle svg {
  width: 26px;
  height: 26px;
  stroke: #fff;
  filter: drop-shadow(0 0 6px rgba(0,255,213,0.5));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.sound-toggle.on svg {
  animation: speakerPulse 1.8s ease-in-out infinite;
}

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

.sound-toggle:hover svg {
  transform: scale(1.1);
  filter: drop-shadow(0 0 12px rgba(0,255,213,1));
}

.sound-toggle.on {
  border-color: rgba(0,255,213,0.6);
  box-shadow: 0 0 16px rgba(0,255,213,0.9);
  background: rgba(0,255,213,0.1);
}

.sound-toggle:not(.on) {
  border-color: rgba(0,255,213,0.25);
  box-shadow: none;
  background: transparent;
}

.sound-toggle:hover {
  transform: translateY(-2px);
}

/* --- RESPONSYWNOŚĆ --- */
@media (max-width: 768px) {
  .hero-img { width: 90vw; max-height: 85vh; }
  .meta-left img.logo-fear { height: 20px; }
  .meta-right a, .sound-toggle { width: 44px; height: 44px; }
  .meta-right a svg, .sound-toggle svg { width: 22px; height: 22px; }
  .floating-text { left: 5vw; top: 40%; font-size: 18px; }
}

/* === MAGAZYN – nazwy bez kolizji z WP === */
.xf-mag {            /* zamiast .page */
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.9);
  color: #fff;
  text-align: center;
  z-index: 0;
}

.xf-mag.xf-active {  /* zamiast .page.active */
  display: flex;
  z-index: 15;
}

/* Spis treści na okładce */
.xf-toc {            /* zamiast .toc */
  position: absolute;
  bottom: 8%;
  left: 10%;
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 20;
}
.xf-toc li {
  font-family: "Orbitron", sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: color .3s, transform .2s;
  color: rgba(255,255,255,.8);
}
.xf-toc li:hover { color:#00ffd5; transform: translateX(4px); }

/* Powrót */
.xf-back {           /* zamiast .nav-back */
  position: absolute;
  top: 30px;
  left: 30px;
  background: none;
  border: 0;
  color: #00ffd5;
  font-family: "Orbitron", sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity .3s, transform .2s;
  z-index: 30;
}
.xf-back:hover { opacity:.7; transform: translateX(-4px); }

/* === FIX: warstwy widoczności === */
.floating-text {
  z-index: 30 !important;
}

.sound-toggle {
  z-index: 40 !important;
}

.xf-mag {
  z-index: 10 !important;
}

#cover.xf-active {
  z-index: 15 !important;
}

/* === ANIMACJA OBRACANIA STRONY (magazyn) === */
.stage {
  perspective: 1200px;
}

.xf-mag {
  transform-origin: left center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform 0.9s cubic-bezier(.77,.2,.05,1.0), opacity 0.6s ease;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.4);
}

.xf-mag:not(.xf-active) {
  opacity: 0;
  transform: rotateY(-90deg);
}

.xf-mag.xf-active {
  opacity: 1;
  transform: rotateY(0deg);
}

/* Delikatny cień pod stroną */
.xf-mag::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.4) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.xf-mag.xf-active::after {
  opacity: 0.3;
}

/* Teksty wewnątrz stron */
.xf-mag h2 {
  font-family: "Orbitron", sans-serif;
  letter-spacing: 3px;
  font-size: clamp(28px, 5vw, 46px);
  text-shadow: 0 0 15px rgba(0,255,213,0.5);
  margin-bottom: 20px;
}

.xf-mag p {
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
  font-size: 1.1rem;
  opacity: 0.85;
}

/* === FLIP 3D — ulepszony efekt przewracania stron === */
.stage {
  perspective: 1600px;
}

.xf-mag {
  position: absolute;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  color: #fff;
  transform-origin: left center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition:
    transform 1s cubic-bezier(0.65, 0, 0.35, 1),
    opacity 0.7s ease;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.45);
  background: linear-gradient(90deg, #000 40%, #0a0a0a 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.xf-mag.xf-active {
  display: flex;
  opacity: 1;
  transform: rotateY(0deg);
  z-index: 20;
}

.xf-mag:not(.xf-active) {
  display: flex;
  opacity: 0;
  transform: rotateY(-90deg);
  z-index: 5;
}

/* Efekt światła po otwarciu strony */
.xf-mag::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.15) 0%,
    rgba(255,255,255,0) 50%,
    rgba(0,0,0,0.25) 100%);
  opacity: 0;
  transition: opacity 0.8s ease;
  mix-blend-mode: overlay;
}

.xf-mag.xf-active::before {
  opacity: 0.3;
}

/* Cień z lewej strony przy otwartej stronie */
.xf-mag.xf-active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 18%;
  height: 100%;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.6), transparent);
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

/* === FLIP tylko okładki (hero-wrap) — poprawka widoczności === */
.hero-wrap {
  position: relative;
  width: min(80vw, 950px);
  max-height: 88vh;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  transition: transform 1.1s cubic-bezier(0.77, 0.2, 0.05, 1.0);
  cursor: pointer;
  z-index: 12; /* wyżej niż tło i ziarno */
}

.hero-wrap.flipped {
  transform: rotateY(-180deg);
}

.hero-front,
.hero-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 8px;
  overflow: hidden;
}

/* FRONT (widoczny obrazek) */
.hero-front {
  z-index: 2;
  transform: rotateY(0deg);
}

.hero-front img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

/* TYŁ (po obróceniu) */
.hero-back {
  z-index: 1;
  transform: rotateY(180deg);
  background: radial-gradient(circle, #000 40%, #0a0a0a 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: #fff;
  padding: 2rem;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5);
}

.hero-back h2 {
  font-family: "Orbitron", sans-serif;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #00ffd5;
  margin-bottom: 10px;
}

.hero-back p {
  font-size: 1rem;
  opacity: 0.85;
  max-width: 400px;
  line-height: 1.6;
  text-align: center;
}

/* przycisk powrotu */
.hero-back .xf-back {
  margin-top: 1.5rem;
  background: none;
  border: 1px solid rgba(0,255,213,0.4);
  color: #00ffd5;
  font-family: "Orbitron", sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  border-radius: 3px;
  transition: all .3s ease;
}
.hero-back .xf-back:hover {
  background: rgba(0,255,213,0.1);
  box-shadow: 0 0 10px rgba(0,255,213,0.6);
  transform: translateY(-2px);
}
/* === MENU PO PRAWEJ (IDEA MARKI / DROP 01) === */
.xf-toc {
  position: absolute;
  top: 90px; /* tuż pod ikonami */
  right: 25px;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 20;
  gap: 12px;
}

.xf-toc li {
  font-family: "Orbitron", sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0,255,213,0.25);
  background: rgba(0,255,213,0.06);
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: pulseCyan 3s ease-in-out infinite;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 6px rgba(0,255,213,0.3);
}

.xf-toc li:hover {
  color: #fff;
  border-color: rgba(0,255,213,0.7);
  background: rgba(0,255,213,0.15);
  box-shadow: 0 0 18px rgba(0,255,213,0.9);
  transform: translateY(-2px);
}

/* Delikatne dopasowanie na mobile */
@media (max-width: 768px) {
  .xf-toc {
    top: 80px;
    right: 15px;
    gap: 8px;
  }
  .xf-toc li {
    font-size: 0.8rem;
    padding: 5px 12px;
  }
}

/* === LŻEJSZY NEON — delikatniejszy puls dla wszystkich elementów === */
@keyframes pulseCyanSoft {
  0%, 100% { box-shadow: 0 0 4px rgba(0,255,213,0.25); }
  50% { box-shadow: 0 0 10px rgba(0,255,213,0.6); }
}

/* --- IKONY PRAWE (delikatniejszy efekt) --- */
.meta-right a {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(0,255,213,0.2);
  background: rgba(0,255,213,0.05);
  color: #fff;
  opacity: 0.85;
  transition: 0.25s ease;
  animation: pulseCyanSoft 3s ease-in-out infinite;
  box-shadow: 0 0 4px rgba(0,255,213,0.25);
}

.meta-right a svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  filter: drop-shadow(0 0 5px rgba(0,255,213,0.3));
}

/* === MENU PO PRAWEJ (IDEA MARKI / DROP 01) — mniejsze i subtelne === */
.xf-toc {
  position: absolute;
  top: 80px;
  right: 25px;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 20;
  gap: 8px;
}

.xf-toc li {
  font-family: "Orbitron", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0,255,213,0.2);
  background: rgba(0,255,213,0.04);
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: pulseCyanSoft 3s ease-in-out infinite;
  backdrop-filter: blur(5px);
  box-shadow: 0 0 4px rgba(0,255,213,0.25);
}

.xf-toc li:hover {
  color: #fff;
  border-color: rgba(0,255,213,0.6);
  background: rgba(0,255,213,0.12);
  box-shadow: 0 0 12px rgba(0,255,213,0.6);
  transform: translateY(-2px);
}

/* --- Dostosowanie na urządzeniach mobilnych --- */
@media (max-width: 768px) {
  .meta-right a {
    width: 28px;
    height: 28px;
  }
  .meta-right a svg {
    width: 18px;
    height: 18px;
  }
  .xf-toc {
    top: 70px;
    right: 15px;
  }
  .xf-toc li {
    font-size: 0.7rem;
    padding: 3px 9px;
  }
}

/* === LŻEJSZY NEON — delikatniejszy puls dla wszystkich elementów === */
@keyframes pulseCyanSoft {
  0%, 100% { box-shadow: 0 0 4px rgba(0,255,213,0.2); }
  50% { box-shadow: 0 0 10px rgba(0,255,213,0.5); }
}

/* === ANIMACJA POJAWIANIA SIĘ ELEMENTÓW (fade + slide) === */
@keyframes fadeSlideIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- IKONY PRAWE --- */
.meta-right a {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(0,255,213,0.2);
  background: rgba(0,255,213,0.05);
  color: #fff;
  opacity: 0.85;
  transition: 0.25s ease;
  animation: pulseCyanSoft 3.2s ease-in-out infinite, fadeSlideIn 1s ease forwards;
  box-shadow: 0 0 4px rgba(0,255,213,0.2);
}

.meta-right a:nth-child(1) { animation-delay: 0.3s; }
.meta-right a:nth-child(2) { animation-delay: 0.5s; }

.meta-right a svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  filter: drop-shadow(0 0 5px rgba(0,255,213,0.25));
}

/* --- MENU PO PRAWEJ (IDEA MARKI / DROP 01) --- */
.xf-toc {
  position: absolute;
  top: 80px;
  right: 25px;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 20;
  gap: 8px;
  animation: fadeSlideIn 1s ease forwards;
  animation-delay: 0.8s;
  opacity: 0;
}

.xf-toc li {
  font-family: "Orbitron", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0,255,213,0.2);
  background: rgba(0,255,213,0.04);
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: pulseCyanSoft 3s ease-in-out infinite;
  backdrop-filter: blur(5px);
  box-shadow: 0 0 4px rgba(0,255,213,0.25);
}

.xf-toc li:hover {
  color: #fff;
  border-color: rgba(0,255,213,0.6);
  background: rgba(0,255,213,0.12);
  box-shadow: 0 0 12px rgba(0,255,213,0.6);
  transform: translateY(-2px);
}

/* --- GŁOŚNIK --- */
.sound-toggle {
  position: absolute;
  bottom: 25px;
  right: 25px;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(0,255,213,0.25);
  background: transparent;
  color: #fff;
  cursor: pointer;
  opacity: 0.85;
  backdrop-filter: blur(6px);
  transition: all 0.3s ease;
  animation: pulseCyanSoft 3.4s ease-in-out infinite, fadeSlideIn 1s ease forwards;
  animation-delay: 1s;
  box-shadow: 0 0 5px rgba(0,255,213,0.25);
}

.sound-toggle svg {
  width: 24px;
  height: 24px;
  stroke: #fff;
  filter: drop-shadow(0 0 5px rgba(0,255,213,0.3));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.sound-toggle:hover svg {
  transform: scale(1.1);
  filter: drop-shadow(0 0 10px rgba(0,255,213,0.7));
}

/* --- PRZYCISK POWRÓT (na dole po lewej) --- */
.xf-back {
  position: absolute;
  bottom: 25px;
  left: 25px;
  background: rgba(0,255,213,0.05);
  border: 1px solid rgba(0,255,213,0.25);
  color: #00ffd5;
  font-family: "Orbitron", sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 8px 16px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 25;
  opacity: 0.9;
  animation: pulseCyanSoft 3.5s ease-in-out infinite, fadeSlideIn 1s ease forwards;
  animation-delay: 1.2s;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 4px rgba(0,255,213,0.25);
}

.xf-back:hover {
  background: rgba(0,255,213,0.12);
  border-color: rgba(0,255,213,0.5);
  box-shadow: 0 0 12px rgba(0,255,213,0.6);
  transform: translateY(-2px);
}

/* --- MOBILE --- */
@media (max-width: 768px) {
  .meta-right a {
    width: 28px;
    height: 28px;
  }
  .meta-right a svg {
    width: 18px;
    height: 18px;
  }
  .xf-toc {
    top: 70px;
    right: 15px;
  }
  .xf-toc li {
    font-size: 0.7rem;
    padding: 3px 9px;
  }
  .sound-toggle {
    width: 42px;
    height: 42px;
  }
  .sound-toggle svg {
    width: 20px;
    height: 20px;
  }
  .xf-back {
    font-size: 0.7rem;
    padding: 6px 12px;
  }
}

/* === POPRAWKA: PRZYCISK POWROTU (tylko strzałka, nie rozciąga się) === */
.xf-back {
  position: absolute;
  bottom: 25px;
  left: 25px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0,255,213,0.05);
  border: 1px solid rgba(0,255,213,0.25);
  color: #00ffd5;
  font-size: 1.2rem;
  font-family: "Orbitron", sans-serif;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.3s ease;
  z-index: 25;
  opacity: 0.9;
  backdrop-filter: blur(6px);
  animation: pulseCyanSoft 3.5s ease-in-out infinite, fadeSlideIn 1s ease forwards;
  animation-delay: 1.2s;
  box-shadow: 0 0 4px rgba(0,255,213,0.25);
}

.xf-back::before {
  content: "←";
  display: inline-block;
  transform: translateX(-1px);
}

.xf-back:hover {
  background: rgba(0,255,213,0.12);
  border-color: rgba(0,255,213,0.5);
  box-shadow: 0 0 12px rgba(0,255,213,0.6);
  transform: translateY(-2px);
}

/* === MENU PO PRAWEJ – większy odstęp od ikon === */
.xf-toc {
  position: absolute;
  top: 120px; /* wcześniej było 80px — teraz niżej */
  right: 25px;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 20;
  gap: 8px;
  animation: fadeSlideIn 1s ease forwards;
  animation-delay: 0.8s;
  opacity: 0;
}

/* --- MOBILE --- */
@media (max-width: 768px) {
  .xf-back {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    bottom: 18px;
    left: 18px;
  }
  .xf-toc {
    top: 95px;
    right: 15px;
  }
}

/* === FIX: Przycisk POWRÓT — tylko strzałka w kółku, na dole po lewej === */
.xf-back {
  all: unset; /* usuwa poprzednie konflikty z wcześniejszych styli */
  position: absolute !important;
  bottom: 25px;
  left: 25px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0,255,213,0.05);
  border: 1px solid rgba(0,255,213,0.25);
  color: #00ffd5 !important;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 50;
  backdrop-filter: blur(6px);
  animation: pulseCyanSoft 3.5s ease-in-out infinite, fadeSlideIn 1s ease forwards;
  animation-delay: 1.2s;
  box-shadow: 0 0 4px rgba(0,255,213,0.25);
}

.xf-back::before {
  content: "←";
  display: inline-block;
  transform: translateX(-1px);
}

.xf-back:hover {
  background: rgba(0,255,213,0.12);
  border-color: rgba(0,255,213,0.5);
  box-shadow: 0 0 12px rgba(0,255,213,0.6);
  transform: translateY(-2px);
}

/* --- MOBILE poprawka --- */
@media (max-width: 768px) {
  .xf-back {
    width: 40px;
    height: 40px;
    bottom: 18px;
    left: 18px;
    font-size: 1.1rem;
  }
}

/* === FINAL: Przycisk STRZAŁKA — idealne wyśrodkowanie + tilt === */
.xf-back {
  all: unset;
  position: absolute !important;
  bottom: 25px;
  left: 25px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0,255,213,0.05);
  border: 1px solid rgba(0,255,213,0.25);
  color: #00ffd5 !important;
  font-size: 1.4rem; /* większa i lepiej dopasowana strzałka */
  cursor: pointer;
  transition: all 0.35s ease;
  z-index: 50;
  backdrop-filter: blur(6px);
  animation: pulseCyanSoft 3.5s ease-in-out infinite, fadeSlideIn 1s ease forwards;
  animation-delay: 1.2s;
  box-shadow: 0 0 5px rgba(0,255,213,0.25);
  text-align: center;
  line-height: 0;
}

.xf-back::before {
  content: "←";
  display: inline-block;
  transform: translate(0, 0);
  font-weight: 400;
}

.xf-back:hover {
  background: rgba(0,255,213,0.12);
  border-color: rgba(0,255,213,0.5);
  box-shadow: 0 0 14px rgba(0,255,213,0.6);
  transform: translateY(-2px) rotate(-10deg); /* lekki tilt */
}

@media (max-width: 768px) {
  .xf-back {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    bottom: 18px;
    left: 18px;
  }
}

/* === FINAL FIX: Przycisk powrotu — jak głośnik, biała zakręcona strzałka === */
.xf-back {
  all: unset;
  position: absolute !important;
  bottom: 25px;
  left: 25px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(0,255,213,0.25);
  background: rgba(0,255,213,0.06);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(6px);
  animation: pulseCyanSoft 3.5s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(0,255,213,0.2);
  z-index: 50;
}

.xf-back svg {
  width: 24px;
  height: 24px;
  stroke: #fff; /* biała strzałka */
  stroke-width: 1.6;
  fill: none;
  filter: drop-shadow(0 0 8px rgba(0,255,213,0.5));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.xf-back:hover {
  transform: translateY(-2px) rotate(-8deg);
  border-color: rgba(0,255,213,0.6);
  box-shadow: 0 0 12px rgba(0,255,213,0.4);
}

.xf-back:hover svg {
  filter: drop-shadow(0 0 14px rgba(0,255,213,0.8));
  transform: scale(1.1);
}

@keyframes pulseCyanSoft {
  0%,100% { box-shadow: 0 0 6px rgba(0,255,213,0.3); }
  50% { box-shadow: 0 0 14px rgba(0,255,213,0.7); }
}

@media (max-width: 768px) {
  .xf-back {
    width: 44px;
    height: 44px;
    bottom: 18px;
    left: 18px;
  }

  .xf-back svg {
    width: 20px;
    height: 20px;
  }
}

/* --- FIX: usuń starą pseudo-strzałkę z przycisku powrotu --- */
.xf-back::before,
.xf-back::after {
  content: none !important;
  display: none !important;
}

/* === DOPASOWANIE PRZYCISKU POWROTU DO GŁOŚNIKA === */
.xf-back {
  position: absolute;
  bottom: 25px;
  left: 25px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;           /* identyczny rozmiar jak sound-toggle */
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(0,255,213,0.25);
  background: transparent;
  color: #fff;
  cursor: pointer;
  opacity: 0.9;
  transition: 0.25s ease;
  backdrop-filter: blur(6px);
  animation: pulseCyan 3s ease-in-out infinite;
}

/* Neonowy efekt aktywacji */
.xf-back:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(0,255,213,0.6);
  border-color: rgba(0,255,213,0.6);
}

/* Strzałka w środku – mniejsza i idealnie wycentrowana */
.xf-back svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  stroke-width: 1.7;
  filter: drop-shadow(0 0 6px rgba(0,255,213,0.4));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.xf-back:hover svg {
  transform: scale(1.08);
  filter: drop-shadow(0 0 10px rgba(0,255,213,0.8));
}

/* === DOPASOWANIE PRZYCISKU POWROTU DO GŁOŚNIKA === */
.xf-back {
  position: absolute;
  bottom: 25px;
  left: 25px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;  /* identyczny jak sound-toggle */
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(0,255,213,0.25);
  background: transparent;
  color: #fff;
  cursor: pointer;
  opacity: 0.9;
  transition: 0.25s ease;
  backdrop-filter: blur(6px);
  animation: pulseCyan 3s ease-in-out infinite;
}

.xf-back:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(0,255,213,0.5);
  border-color: rgba(0,255,213,0.5);
}

/* Strzałka wewnątrz */
.xf-back svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
  stroke-width: 1.6;
  filter: drop-shadow(0 0 5px rgba(0,255,213,0.4));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.xf-back:hover svg {
  transform: scale(1.08);
  filter: drop-shadow(0 0 8px rgba(0,255,213,0.7));
}

/* Wyrównanie rozmiarów: powrót = głośnik (zewnętrznie 42x42) */
.sound-toggle,
.xf-back {
  width: 42px;
  height: 42px;
  box-sizing: border-box;   /* 42x42 liczone łącznie z borderem */
  padding: 0;
  border: 1px solid rgba(0,255,213,0.25);
}

/* Pozycje identyczne przy krawędziach */
.sound-toggle { bottom: 25px; right: 25px; }
.xf-back      { bottom: 25px; left:  25px;  }

/* Ikony w środku – bez wpływu na box */
.sound-toggle svg,
.xf-back svg {
  width: 16px;
  height: 16px;
  display: block;
  pointer-events: none;
  stroke: #fff;
}

/* --- Mikro-wyrównanie ikony powrotu względem głośnika --- */
.xf-back {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  bottom: 25px;
  left: 25px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  box-sizing: border-box;
  border: 1px solid rgba(0,255,213,0.25);
  background: transparent;
  animation: pulseCyanSoft 3s ease-in-out infinite;
  transition: all 0.25s ease;
}

.xf-back svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
  display: block;
  transform: translateY(1px); /* delikatne obniżenie ikony */
}

/* delikatniejsze, subtelne świecenie */
@keyframes pulseCyanSoft {
  0%,100% { box-shadow: 0 0 5px rgba(0,255,213,0.25); }
  50%     { box-shadow: 0 0 10px rgba(0,255,213,0.6); }
}

/* === DROP 01 – siatka kamer === */
.camera-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 20px;
  width: 90vw;
  max-width: 1000px;
  height: 70vh;
  z-index: 5;
}

.cam {
  position: relative;
  background: radial-gradient(circle, #000 70%, #050505 100%);
  border: 1px solid rgba(0, 255, 213, 0.1);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  font-family: "Orbitron", monospace;
  font-size: clamp(18px, 2vw, 28px);
  color: rgba(0,255,213,0.7);
  letter-spacing: 2px;
  text-shadow: 0 0 6px rgba(0,255,213,0.4);
  animation: signalGlitch 6s infinite ease-in-out;
}

.cam::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0,255,213,0.04) 0px,
      rgba(0,255,213,0.04) 1px,
      transparent 2px,
      transparent 4px
    );
  animation: scanLines 2s linear infinite;
  pointer-events: none;
}

.cam::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.25);
  opacity: 0.2;
  animation: staticNoise 0.3s steps(3) infinite;
}

@keyframes staticNoise {
  0% { opacity: 0.2; }
  50% { opacity: 0.35; }
  100% { opacity: 0.2; }
}

@keyframes scanLines {
  0% { background-position-y: 0; }
  100% { background-position-y: 100%; }
}

@keyframes signalGlitch {
  0%, 90%, 100% {
    transform: scale(1);
    filter: none;
  }
  92% {
    filter: hue-rotate(10deg) contrast(1.3);
    transform: scale(1.02);
  }
  94% {
    filter: hue-rotate(-15deg) contrast(1.1);
    transform: scale(0.98);
  }
}

/* Po wejściu na DROP 01 wyłącz losowe napisy */
#page-drop01.xf-active ~ .floating-text {
  display: none !important;
}

/* --- GLOBALNY PRZYCISK POWROTU (idealne wyrównanie) --- */
.xf-back {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(0,255,213,0.15);
  background: radial-gradient(circle at center, rgba(0,255,213,0.08), rgba(0,255,213,0.02));
  box-shadow: 0 0 10px rgba(0,255,213,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  backdrop-filter: blur(2px);
  transition: all 0.25s ease;
  animation: pulseBack 4s infinite ease-in-out;
  pointer-events: auto;
  transform: none !important;
}

/* idealne centrowanie i korekta wysokości SVG */
.xf-back svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  transition: transform 0.3s ease;
  transform: translateY(1px); /* 👈 minimalna korekta wyrównania */
}

.xf-back:hover {
  transform: scale(1.05);
  box-shadow: 0 0 18px rgba(0,255,213,0.45);
}

.xf-back:hover svg {
  transform: translate(-2px, 1px); /* lekki ruch w lewo, ale zachowuje centrowanie */
}

@keyframes pulseBack {
  0%, 100% {
    box-shadow: 0 0 10px rgba(0,255,213,0.25);
  }
  50% {
    box-shadow: 0 0 16px rgba(0,255,213,0.4);
  }
}

/* ukrywamy przycisk na stronie głównej */
#cover.xf-active ~ .xf-back {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

/* --- OPTYCZNE WYRÓWNANIE STRZAŁKI Z GŁOŚNIKIEM --- */
.xf-back {
  bottom: 29px !important; /* było 28px — podnosi o 1px */
}

.xf-back svg {
  transform: translateY(0px) !important; /* reset wcześniejszej korekty */
}

/* === FINALNE OPTYCZNE WYRÓWNANIE STRZAŁKI Z GŁOŚNIKIEM === */

/* wymuszenie identycznych wymiarów i osi bazowej */
.xf-back,
#soundBtn {
  width: 44px !important;
  height: 44px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ręczne wyrównanie strzałki – o 1px w dół */
.xf-back {
  bottom: 29px !important;   /* o 1px wyżej względem głośnika */
}

.xf-back svg {
  width: 17px !important;
  height: 17px !important;
  transform: translateY(2px); /* 👈 przesuwa ikonę minimalnie w dół */
}

/* głośnik lekko do góry dla równowagi halo */
#soundBtn svg {
  transform: translateY(-1px);
}

/* zachowaj pulsację */
.xf-back,
#soundBtn {
  animation: pulseAlign 4s ease-in-out infinite;
}

@keyframes pulseAlign {
  0%, 100% { box-shadow: 0 0 10px rgba(0,255,213,0.25); }
  50% { box-shadow: 0 0 16px rgba(0,255,213,0.4); }
}

/* === WYRÓWNANIE STRZAŁKI I GŁOŚNIKA DO JEDNEJ LINII === */
.xf-back {
  bottom: 25px !important; /* dopasowane do soundBtn */
  width: 42px !important;
  height: 42px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

#soundBtn {
  width: 42px !important;
  height: 42px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* optyczne centrowanie ikon */
.xf-back svg {
  transform: translateY(1px);
}

#soundBtn svg {
  transform: translateY(0px);
}

/* --- GLOBALNE LOGO + IKONY (widoczne na wszystkich stronach) --- */
.global-meta {
  position: fixed;
  top: 25px;
  left: 25px;
  right: 25px;
  z-index: 50; /* nad stronami */
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
}

/* --- FIX: usuń przyciemnienie sceny nad logo i ikonami --- */
.stage::after,
.grain {
  mix-blend-mode: normal !important;
  opacity: 0 !important;
}

/* === RETRO MONITOR (IDEA MARKI) === */
.retro-monitor {
  position: relative;
  width: 80vw;
  max-width: 900px;
  aspect-ratio: 4/3;
  background: #111;
  border: 12px solid #1a1a1a;
  border-radius: 18px;
  box-shadow:
    inset 0 0 60px rgba(0,255,100,0.15),
    0 0 80px rgba(0,0,0,0.9),
    0 0 12px rgba(0,255,100,0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  overflow: hidden;
}

/* efekt refleksu na szkle monitora */
.retro-monitor::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255,255,255,0.08) 0%,
    rgba(255,255,255,0.02) 60%,
    transparent 100%
  );
  mix-blend-mode: screen;
  opacity: 0.3;
  pointer-events: none;
}

.monitor-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #001800 0%, #000900 100%);
  border-radius: 10px;
  box-shadow: inset 0 0 25px rgba(0,255,100,0.15);
  overflow: hidden;
}

.terminal-text {
  color: #00ff88;
  font-family: "Courier New", monospace;
  font-size: 1.05rem;
  line-height: 1.45;
  padding: 25px;
  white-space: pre-wrap;
  text-shadow: 0 0 4px #00ff88;
  animation: flicker 0.15s infinite;
}

/* lekkie migotanie CRT */
@keyframes flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: 0.85; }
}

/* paski zakłóceń */
.screen-overlay {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    rgba(0,255,100,0.08) 0px,
    rgba(0,255,100,0.05) 1px,
    transparent 2px
  );
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.3;
}

/* zielone diody monitora */
.retro-monitor::before {
  content: "";
  position: absolute;
  bottom: 10px;
  right: 25px;
  width: 10px;
  height: 10px;
  background: radial-gradient(circle, #00ff88 0%, #003300 80%);
  border-radius: 50%;
  box-shadow: 0 0 8px #00ff88;
  animation: ledBlink 3s infinite ease-in-out;
}

@keyframes ledBlink {
  0%, 100% { opacity: 0.8; box-shadow: 0 0 6px #00ff88; }
  50% { opacity: 0.3; box-shadow: 0 0 2px #007744; }
}

/* ikony pulpitu */
.desktop-icons {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 5;
}

.icon {
  text-align: center;
  width: 64px;
  cursor: pointer;
}

.icon img {
  width: 48px;
  height: 48px;
  filter: brightness(0) invert(1) drop-shadow(0 0 6px #00ff88);
  transition: 0.25s ease;
}

.icon span {
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  color: #00ff88;
  text-shadow: 0 0 6px #00ff88;
}

.icon:hover img {
  transform: scale(1.1);
  filter: brightness(1.5) drop-shadow(0 0 10px #00ff88);
}

/* === wersja mobilna === */
@media (max-width: 768px) {
  .retro-monitor {
    width: 95vw;
    aspect-ratio: auto;
    border-width: 8px;
    border-radius: 14px;
    box-shadow:
      inset 0 0 40px rgba(0,255,100,0.1),
      0 0 50px rgba(0,0,0,0.9);
  }

  .terminal-text {
    font-size: 0.9rem;
    padding: 18px;
  }

  .desktop-icons {
    display: none;
  }
}

/* === Pasek zadań retro z zegarem === */
.taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 28px;
  background: rgba(0, 255, 128, 0.05);
  border-top: 1px solid rgba(0, 255, 128, 0.3);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 12px;
  font-family: "Courier New", monospace;
  font-size: 14px;
  color: #00ffcc;
  text-shadow: 0 0 6px #00ffcc;
  box-shadow: inset 0 0 8px rgba(0,255,128,0.3);
  pointer-events: none;
  z-index: 5;
}

.task-clock {
  letter-spacing: 1px;
}

/* === Pasek zadań retro === */
.task-clock {
  letter-spacing: 1px;
  color: #ffffff; /* biała godzina */
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.task-clock .cursor {
  display: inline-block;
  margin-left: 2px;
  color: #ffffff;
  text-shadow: 0 0 6px #00ffcc;
  animation: blinkCursor 1.6s steps(1) infinite; /* wolniejsze miganie */
}

@keyframes blinkCursor {
  50% { opacity: 0; }
}

/* --- Efekt mrugnięcia ekranu (CRT flash) --- */
.monitor-screen.crt-flash {
  animation: crtBlink 0.2s ease-in-out;
}

@keyframes crtBlink {
  0% {
    filter: brightness(2) contrast(2);
    background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(0,0,0,0.9) 80%);
  }
  50% {
    filter: brightness(3) contrast(2.5);
    background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(0,0,0,0.95) 90%);
  }
  100% {
    filter: brightness(1) contrast(1);
    background: radial-gradient(circle, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 100%);
  }
}

/* --- DROP01: subtelny efekt glitch kamer --- */
#page-drop01 .cam span {
  display: inline-block;
  transition: all 0.2s ease;
}

#page-drop01 .cam img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.9) contrast(1.1);
  transition: transform 0.4s ease, filter 0.4s ease;
}

#page-drop01 .cam:hover img {
  transform: scale(1.05);
  filter: brightness(1.05) contrast(1.2);
}

/* === PODGLĄD ZDJĘCIA (MODAL) === */
.image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}

.image-modal.active {
  display: flex;
}

.image-modal img {
  max-width: 90%;
  max-height: 90%;
  border: 2px solid rgba(0, 255, 213, 0.3);
  box-shadow: 0 0 25px rgba(0, 255, 213, 0.4);
  animation: zoomIn 0.4s ease;
}

.image-modal .close-modal {
  position: absolute;
  top: 20px;
  right: 35px;
  font-size: 40px;
  color: #00ffd5;
  cursor: pointer;
  transition: color 0.3s;
}

.image-modal .close-modal:hover {
  color: #fff;
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Upewnij się, że nakładki nie blokują kliknięć */
.cam::before,
.cam::after,
.cam span { 
  pointer-events: none; 
}

/* Obrazek nad nakładkami */
.cam img {
  position: relative;
  z-index: 1;
  cursor: zoom-in; /* dla feedbacku */
}

/* --- Delikatniejszy wygląd modala --- */

/* Zamiast lupy z plusem/minusem */
.cam img {
  cursor: pointer; /* lub 'pointer' / 'none' / 'cell' — wybierz swój klimat */
}

/* Subtelny, mniejszy przycisk zamykania */
.image-modal .close-modal {
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 26px; /* mniejszy niż domyślny 40px */
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: color 0.3s ease;
  font-weight: 300;
}

.image-modal .close-modal:hover {
  color: #ffffff;
}

/* Lekka animacja pojawienia się (estetyka FEAR) */
.image-modal.active img {
  animation: fadeInZoom 0.4s ease forwards;
}

@keyframes fadeInZoom {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* --- Efekt CRT przy otwieraniu i zamykaniu modala --- */
.image-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.05) 0px,
    rgba(255, 255, 255, 0.02) 2px,
    transparent 4px
  );
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  animation: crtNoise 2s infinite linear;
}

.image-modal.crt-flash::before {
  opacity: 0.3;
  animation: crtFlash 0.25s ease-in-out;
}

@keyframes crtNoise {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(1px); }
}

@keyframes crtFlash {
  0% { opacity: 0.3; filter: brightness(2) contrast(2); }
  100% { opacity: 0; filter: none; }
}

/* Subtelne drżenie obrazu */
.image-modal.active img {
  animation: fadeInZoom 0.4s ease forwards, crtShake 0.25s ease-in-out;
}

@keyframes crtShake {
  0% { transform: translate(0, 0); }
  20% { transform: translate(1px, -1px); }
  40% { transform: translate(-1px, 1px); }
  60% { transform: translate(1px, 1px); }
  80% { transform: translate(-1px, -1px); }
  100% { transform: translate(0, 0); }
}

/* Ukryj przycisk powrotu, gdy otwarty jest modal */
.image-modal.active ~ #backBtn {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* === TERMINAL CAMERA (ulepszona wersja: tekst od góry + mniejsze) === */
.terminal-cam {
  background-color: #000;
  color: #00ff99;
  font-family: "Courier New", monospace;
  font-size: 8px; /* mniejsze litery na PC */
  line-height: 1.25;
  padding: 4px 6px;
  overflow: hidden;
  position: relative;
  text-shadow: 0 0 2px #00ffcc;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* zaczynamy od góry */
}

.terminal-feed {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* linie od góry */
  padding: 4px 6px;
  box-sizing: border-box;
}

.terminal-line {
  opacity: 0;
  animation: appear 0.15s forwards;
  white-space: nowrap; /* nie łamie tekstu */
}

@keyframes appear {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* CRT efekt glitch */
.terminal-cam::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,255,213,0.05) 0px,
    rgba(0,255,213,0.02) 2px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  animation: crtGlitch 2s infinite linear;
  pointer-events: none;
}

@keyframes crtGlitch {
  0%,100% { opacity: 0.2; transform: translateY(0); }
  50% { opacity: 0.3; transform: translateY(-1px); }
}

/* === WERSJA MOBILNA === */
@media (max-width: 768px) {
  .terminal-cam {
    font-size: 6px; /* jeszcze mniejsze litery */
    line-height: 1.15;
    padding: 3px 4px;
  }

  .terminal-feed {
    padding: 3px 4px;
  }

  .terminal-line {
    transform: scale(0.98);
  }

  .terminal-cam::after {
    background: repeating-linear-gradient(
      to bottom,
      rgba(0,255,213,0.04) 0px,
      rgba(0,255,213,0.02) 1.5px,
      transparent 2.5px
    );
  }
}

/* === MIGAJĄCY KURSOR W TERMINALU === */
.terminal-cursor {
  display: inline-block;
  width: 6px;
  color: #00ffcc;
  animation: blinkCursor 1s infinite steps(1);
  text-shadow: 0 0 4px #00ffcc;
  margin-left: 1px;
}

@keyframes blinkCursor {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}


