/*
 * pyothr · druga edycja „na bogato”: grafiki z lokalnych modeli, animacje i efekty.
 * Warstwa nad styl.css (pierwsza edycja zostaje bazą). Grafiki: Z-Image Turbo, FLUX.2 klein 4B, Wan 2.2 (Apache 2.0).
 */

/* ---------- Pasek postępu przewijania ---------- */
.postep { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 30; pointer-events: none; transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--frame), var(--gold), var(--gold-bright)); box-shadow: 0 0 10px rgba(200, 170, 110, 0.6); }

/* ---------- Start: grafika, wideo i iskry ---------- */
.start { overflow: hidden; isolation: isolate; }
.start__tlo { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.start__obraz, .start__wideo { position: absolute; inset: -4% 0 0; width: 100%; height: 104%; object-fit: cover; object-position: 50% 42%; }
.start__obraz { animation: kenburns 28s ease-in-out infinite alternate; transform-origin: 50% 40%; }
.start__wideo { opacity: 0; transition: opacity 1.2s ease; }
.start__wideo.gra { opacity: 1; }
.start__tlo::after { content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 85% 70% at 50% 45%, transparent 35%, rgba(7, 11, 13, 0.55) 70%, var(--bg-deep) 100%),
    linear-gradient(180deg, rgba(7, 11, 13, 0.55) 0%, rgba(7, 11, 13, 0.1) 25%, rgba(7, 11, 13, 0.15) 60%, var(--bg-deep) 100%); }
.js .start__tlo { animation: zmrok 1.6s ease-out both; }
@keyframes zmrok { from { opacity: 0; filter: brightness(0.3); } }
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.1) translateY(-1%); } }
.iskry { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; mix-blend-mode: screen; }
.start .medalion { opacity: 0.35; z-index: 0; }

/* Tytuł: złoto z przelatującym połyskiem */
.pas--start .pas__big {
  background: linear-gradient(100deg, #f3ead6 0%, #f3ead6 38%, #fff8e6 46%, var(--gold) 50%, #fff8e6 54%, #f3ead6 62%, #f3ead6 100%);
  background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; filter: drop-shadow(0 4px 22px rgba(0, 0, 0, 0.7));
}
.pas--start.on .pas__big { animation: pas-track-start 1000ms var(--ease-settle) 250ms both, polysk 7s ease-in-out 2.2s infinite; }
@keyframes polysk { 0% { background-position: 100% 0; } 30%, 100% { background-position: 0% 0; } }

/* ---------- Ornament nad nagłówkami sekcji (złoto na czerni, mieszane „screen”) ---------- */
.pas--sekcja::after {
  content: ''; position: absolute; left: 50%; top: -34px; width: min(520px, 86vw); height: 64px; transform: translateX(-50%);
  background: url('../grafika/ornament.webp') center / contain no-repeat; pointer-events: none; opacity: 0.95; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}
.js .pas--sekcja:not(.on)::after { opacity: 0; }
.pas--sekcja.on::after { animation: pas-fade 900ms ease-out 400ms both; }

/* ---------- Tła sekcji z grafik ---------- */
.sekcja--tlo { position: relative; isolation: isolate; }
.sekcja--tlo::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-position: center; background-size: cover; background-repeat: no-repeat; opacity: var(--tlo-moc, 0.32);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 78%, transparent 100%);
}

#wyzwanie::before { background-image: url('../grafika/zyra-tlo.webp'); }
#quiz::before { background-image: url('../grafika/quiz-tlo.webp'); }
@media (max-width: 720px) {
  #wyzwanie::before { background-image: url('../grafika/zyra-tlo-960.webp'); }
  #quiz::before { background-image: url('../grafika/quiz-tlo-960.webp'); } }

/* ---------- Na żywo: karta planu z ilustracją ---------- */
.karta--plan { position: relative; overflow: hidden; isolation: isolate; }
.karta--plan::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 90% at 100% 0%, rgba(200, 170, 110, 0.16), transparent 60%); opacity: 1;
  -webkit-mask-image: linear-gradient(200deg, #000 20%, transparent 85%); mask-image: linear-gradient(200deg, #000 20%, transparent 85%); }

/* ---------- Zyra 100 ---------- */
.ranga img { transition: filter 0.4s; }
.wyzwanie.on .ranga--cel img { animation: blask 3.2s ease-in-out 1.5s infinite; }
@keyframes blask { 50% { filter: drop-shadow(0 0 14px rgba(150, 120, 255, 0.75)) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6)); } }

/* ---------- Quiz: wybuch przy awansie ---------- */
.quiz { overflow: hidden; isolation: isolate; }
.quiz__iskry { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; mix-blend-mode: screen; }
.wynik { isolation: isolate; }
.wynik::after { content: ''; position: absolute; left: 50%; top: 92px; width: 340px; height: 340px; margin: -170px 0 0 -170px; z-index: -1; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(200, 170, 110, 0.16) 0 6deg, transparent 6deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 10%, transparent 68%); mask-image: radial-gradient(circle, #000 10%, transparent 68%);
  animation: obrot 40s linear infinite; }

/* ---------- Filmy: okładki, przechył i połysk ---------- */
.seria a { padding: 0 0 20px; transform-style: preserve-3d; will-change: transform; }
.seria a > :not(.seria__okladka) { margin-left: 20px; margin-right: 20px; }
.seria__okladka { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; margin-bottom: -26px; transition: transform 0.6s var(--ease-settle), filter 0.6s;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 55%, transparent 100%); filter: saturate(0.9) brightness(0.92); }
.seria__nr { position: relative; }
.seria a::before { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 30%), rgba(240, 230, 210, 0.16), transparent 45%); }
@media (hover: hover) {
  .seria a:hover::before { opacity: 1; }
  .seria a:hover .seria__okladka { transform: scale(1.05); filter: saturate(1.05) brightness(1.02); }
  .seria a.przechyl { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-3px); transition: transform 0.12s linear; }
}

/* ---------- Yuki: splash art z animacją i prawdziwe zdjęcie w rogu ---------- */
.yuki__zdjecie { overflow: visible; }
.yuki__zdjecie > img:first-child, .yuki__zdjecie video { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; display: block;
  border: 1px solid transparent; background: linear-gradient(180deg, var(--gold), var(--frame) 55%, var(--frame-side)) border-box; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55); }
.yuki__zdjecie video { position: absolute; inset: 0; opacity: 0; transition: opacity 1s; }
.yuki__zdjecie video.gra { opacity: 1; }
.yuki__prawdziwa { position: absolute; right: -14px; bottom: 26px; width: 92px !important; height: 92px !important; aspect-ratio: 1 !important; border-radius: 50%; object-fit: cover; object-position: 50% 48%;
  box-shadow: 0 0 0 3px var(--gold), 0 10px 24px rgba(0, 0, 0, 0.6) !important; z-index: 2; border: 0 !important; transform: rotate(-4deg); }
.yuki__irl { position: absolute; right: -6px; bottom: 10px; z-index: 3; padding: 2px 8px; font-size: 11px; font-weight: 800; letter-spacing: 0.14em; color: #17110a; background: var(--gold); transform: rotate(-4deg); }
@media (max-width: 819px) { .yuki__prawdziwa { right: 10px; } .yuki__irl { right: 18px; } }

/* ---------- Final: brama o świcie (animowana), pas pod bramą ---------- */
.final { position: relative; isolation: isolate; min-height: min(100svh, 980px); padding: 0 0 72px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.final__tlo { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.final__tlo img, .final__tlo video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.final__tlo video { opacity: 0; transition: opacity 1.2s; }
.final__tlo video.gra { opacity: 1; }
.final__tlo::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--bg-deep) 0%, rgba(7, 11, 13, 0.25) 22%, rgba(7, 11, 13, 0.1) 45%, rgba(7, 11, 13, 0.7) 72%, var(--bg-deep) 100%); }
.final .pas--sekcja { margin-bottom: 26px; }
.dymek--final { justify-content: center; margin: 26px auto 0; width: min(100% - 2 * var(--gutter), 560px); text-align: left; }

/* ---------- Runda 3: nagłówek, menu na telefon ---------- */
.znak { display: inline-flex; align-items: center; min-height: 40px; }
.pigulka { min-height: 40px; padding: 8px 14px 8px 12px; }
.ukryte-tekst { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.menu-przycisk { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-left: 4px; padding: 0; cursor: pointer;
  background: rgba(8, 14, 17, 0.7); border: 1px solid rgba(200, 170, 110, 0.5); border-radius: 50%; position: relative; z-index: 41; }
.menu-przycisk__kreski, .menu-przycisk__kreski::before, .menu-przycisk__kreski::after { display: block; width: 18px; height: 2px; background: var(--gold-bright); border-radius: 1px; transition: transform 0.3s var(--ease-settle), opacity 0.2s; }
.menu-przycisk__kreski { position: relative; }
.menu-przycisk__kreski::before, .menu-przycisk__kreski::after { content: ''; position: absolute; left: 0; }
.menu-przycisk__kreski::before { top: -6px; } .menu-przycisk__kreski::after { top: 6px; }
.menu-przycisk[aria-expanded="true"] .menu-przycisk__kreski { background: transparent; }
.menu-przycisk[aria-expanded="true"] .menu-przycisk__kreski::before { transform: translateY(6px) rotate(45deg); }
.menu-przycisk[aria-expanded="true"] .menu-przycisk__kreski::after { transform: translateY(-6px) rotate(-45deg); }
@media (min-width: 900px) { .menu-przycisk, .menu-pelne { display: none !important; } }
.menu-pelne { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; justify-content: center; gap: 34px; padding: 90px var(--gutter) 40px;
  background: radial-gradient(120% 80% at 50% 30%, rgba(20, 32, 40, 0.97), rgba(5, 8, 10, 0.98)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.menu-pelne[hidden] { display: none; }
.menu-pelne__lista { display: grid; gap: 4px; }
.menu-pelne__lista a { position: relative; display: flex; align-items: baseline; justify-content: center; gap: 14px; padding: 14px 0; text-decoration: none;
  font-family: var(--display); font-weight: 900; font-size: clamp(28px, 9vw, 40px); letter-spacing: 0.06em; color: var(--text);
  animation: pas-rise 500ms var(--ease-settle) both; }
.menu-pelne__lista a small { font-family: var(--body); font-size: 12px; font-weight: 700; letter-spacing: 0.2em; color: var(--gold); }
.menu-pelne__lista a::after { content: ''; position: absolute; left: 15%; right: 15%; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(200, 170, 110, 0.5), transparent); }
.menu-pelne__lista a:nth-child(2) { animation-delay: 50ms; } .menu-pelne__lista a:nth-child(3) { animation-delay: 100ms; }
.menu-pelne__lista a:nth-child(4) { animation-delay: 150ms; } .menu-pelne__lista a:nth-child(5) { animation-delay: 200ms; }
.menu-pelne__kanaly { display: flex; justify-content: center; gap: 14px; }
.menu-pelne__kanaly a { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: var(--gold-bright); border: 1px solid rgba(200, 170, 110, 0.5); }
.menu-pelne__kanaly svg { width: 22px; height: 22px; fill: currentColor; }
body.menu-otwarte { overflow: hidden; }

/* ---------- Runda 3: odtwarzacz z animowanym pokojem ---------- */
.odtwarzacz__plakat, .odtwarzacz__wideo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.odtwarzacz__wideo { opacity: 0; transition: opacity 1s; }
.odtwarzacz__wideo.gra { opacity: 1; }
.odtwarzacz__fasada { background: radial-gradient(ellipse 42% 50% at 50% 50%, rgba(7, 11, 13, 0.72), rgba(7, 11, 13, 0.18)); transition: background 0.4s; }
.odtwarzacz__fasada:hover { background: radial-gradient(ellipse 42% 50% at 50% 50%, rgba(7, 11, 13, 0.55), rgba(7, 11, 13, 0.1)); }
.odtwarzacz__fasada::before { opacity: 0.18; }
.odtwarzacz__napis { text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9); }
.odtwarzacz__fasada small { color: rgba(244, 241, 234, 0.8); text-shadow: 0 1px 6px #000; }

/* ---------- Runda 3: ikony formatów ---------- */
.format__ikona { width: 64px; height: 64px; margin: -6px 0 8px -6px; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 10px rgba(200, 170, 110, 0.25)); transition: transform 0.4s var(--ease-settle); }
.format:hover .format__ikona { transform: translateY(-2px) scale(1.06); }

/* ---------- Runda 3: Zyra 100 ---------- */
.liczby { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .liczby { grid-template-columns: repeat(4, 1fr); } }
.wyzwanie__forma { margin: 10px 0 0; font-size: 14px; font-weight: 700; color: var(--gold-bright); }
.wyzwanie__forma b { color: var(--gold); }
.ramka { position: relative; display: block; }
.ramka::before, .ramka::after { content: ''; position: absolute; width: 30px; height: 30px; border: 2px solid var(--gold-bright); z-index: 1; pointer-events: none; }
.ramka::before { left: -7px; top: -7px; border-right: 0; border-bottom: 0; }
.ramka::after { right: -7px; bottom: -7px; border-left: 0; border-top: 0; }

/* ---------- Runda 3: rekord w quizie ---------- */
.quiz__rekord { margin: 0 0 14px; font-weight: 700; color: var(--gold); letter-spacing: 0.04em; }
.quiz__rekord b { color: var(--gold-bright); }
.quiz__rekord.nowy { animation: pas-bump 700ms var(--ease-settle) both; }

/* ---------- Mniej ruchu, oszczędzanie danych ---------- */
@media (prefers-reduced-motion: reduce) {
  .start__obraz, .wynik::after { animation: none !important; }
  .iskry, .quiz__iskry, .start__wideo, .yuki__zdjecie video, .odtwarzacz__wideo, .final__tlo video { display: none !important; }
}
body.menu-otwarte .naglowek { z-index: 50; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.start__dalej::after { content: ''; position: absolute; inset: -8px -10px; }

/* ---------- Solo Queue: zaczernione akta ---------- */
.tajne__pasy { display: grid; gap: 6px; margin: 2px 0 10px; }
.tajne__pasy span { display: block; height: 11px; border-radius: 2px; background: linear-gradient(90deg, rgba(200, 170, 110, 0.32), rgba(200, 170, 110, 0.14)); filter: blur(0.4px); }
.tajne__pasy span:nth-child(1) { width: 92%; } .tajne__pasy span:nth-child(2) { width: 74%; } .tajne__pasy span:nth-child(3) { width: 48%; }
.format--wkrotce:hover .tajne__pasy span { animation: pas-pulse 1.2s ease-in-out infinite alternate; }
