/* G4: ci sami goście w 6 stylach AI. Scena przypięta; js/style-ai.js ustawia na sekcji data-krok (0-5 style, 6 licznik) i zmienne --sw1, --sw2, --sw-a aktywnego stylu.
   Barwy przechodzą płynnie dzięki @property. Bez ruchu (prefers-reduced-motion) zamiast sceny jest siatka sześciu zdjęć z nazwami. */

@property --sw1 { syntax: "<color>"; inherits: true; initial-value: #1B0F13; }
@property --sw2 { syntax: "<color>"; inherits: true; initial-value: #5A2535; }
@property --sw-a { syntax: "<color>"; inherits: true; initial-value: #F2C879; }

body.fb .fb-style { position: relative; height: calc(100svh + 7 * 45svh); background: var(--fb-czern); color: var(--fb-biel); transition: --sw1 .35s, --sw2 .35s, --sw-a .35s; }
@media not all and (min-width: 768px) and (hover: hover) { body.fb .fb-style { height: calc(100svh + 7 * 34svh); } }
body.fb .fb-style__scena { position: sticky; top: 0; height: 100svh; min-height: 560px; overflow: clip; isolation: isolate; background: linear-gradient(160deg, var(--sw2), var(--sw1)); }

/* światy: każdy styl ma warstwę, aktywna się odsłania; do czasu grafiki jest gradient i poświata akcentu */
body.fb .fb-style__swiaty, body.fb .fb-style__swiat { position: absolute; inset: 0; }
body.fb .fb-style__swiat { opacity: 0; transition: opacity .35s; background: radial-gradient(ellipse 60% 50% at 70% 45%, color-mix(in srgb, var(--sw-a) 28%, transparent), transparent 70%), linear-gradient(160deg, var(--sw2), var(--sw1)); }
body.fb .fb-style__swiat picture { position: absolute; inset: 0; display: block; }
body.fb .fb-style__swiat img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
body.fb .fb-style[data-styl="glamour"] .fb-style__swiat[data-styl="glamour"], body.fb .fb-style[data-styl="cyberpunk"] .fb-style__swiat[data-styl="cyberpunk"], body.fb .fb-style[data-styl="western"] .fb-style__swiat[data-styl="western"],
body.fb .fb-style[data-styl="viking"] .fb-style__swiat[data-styl="viking"], body.fb .fb-style[data-styl="pod-woda"] .fb-style__swiat[data-styl="pod-woda"], body.fb .fb-style[data-styl="komiks"] .fb-style__swiat[data-styl="komiks"] { opacity: 1; }
body.fb .fb-style__scena::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(0, 0, 0, .6) 0, rgba(0, 0, 0, .15) 46%, transparent 62%), linear-gradient(0deg, rgba(0, 0, 0, .4) 0, transparent 30%); pointer-events: none; }

/* western i komiks: jasny świat w barwie akcentu, więc tekst dostaje mocniejszą przysłonę (kontrast co najmniej 4,5:1) */
body.fb .fb-style[data-styl="western"] .fb-style__scena::after, body.fb .fb-style[data-styl="komiks"] .fb-style__scena::after { background: linear-gradient(90deg, rgba(0, 0, 0, .84) 0, rgba(0, 0, 0, .5) 46%, transparent 64%), linear-gradient(0deg, rgba(0, 0, 0, .5) 0, transparent 30%); }

/* tekst i pigułki */
body.fb .fb-style__tresc { position: absolute; z-index: 4; left: clamp(24px, 4vw, 72px); top: 50%; width: min(34vw, 520px); translate: 0 -50%; display: flex; flex-direction: column; gap: 14px; }
body.fb .fb-style h2 { margin: 0; color: var(--fb-biel); font: 700 clamp(16px, 1.3vw, 20px)/1.3 var(--fb-font-naglowek); text-shadow: 0 1px 14px rgba(0, 0, 0, .7), 0 0 2px rgba(0, 0, 0, .5); }
body.fb .fb-style__nazwa { margin: 0; color: var(--sw-a); font: 700 clamp(56px, 7vw, 120px)/1 var(--fb-font-naglowek); letter-spacing: .01em; text-transform: uppercase; white-space: nowrap; font-variant-numeric: tabular-nums; }
body.fb .fb-style__opis { margin: 0; color: var(--fb-biel); font: 600 clamp(16px, 1.3vw, 20px)/1.4 var(--fb-font); text-shadow: 0 1px 14px rgba(0, 0, 0, .7), 0 0 2px rgba(0, 0, 0, .5); }
body.fb .fb-style__piguly { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
body.fb .fb-style__pigula { min-height: 44px; padding: 0 20px; border: 1.5px solid rgba(255, 255, 255, .55); border-radius: 999px; background: rgba(0, 0, 0, .25); color: var(--fb-biel); font: 700 15px/1 var(--fb-font); cursor: pointer; transition: background-color .25s, border-color .25s, color .25s; }
@media (hover: hover) { body.fb .fb-style__pigula:hover { border-color: var(--sw-a); } }
body.fb .fb-style__pigula[aria-pressed="true"] { border-color: var(--sw-a); background: var(--sw-a); color: var(--fb-czern); }
body.fb .fb-style__pigula:focus-visible { outline: 2px solid var(--fb-biel); outline-offset: 3px; }
body.fb .fb-style__pole { position: relative; }
body.fb .fb-style__licznik { position: absolute; inset: 0 auto auto 0; display: flex; align-items: baseline; gap: 10px; opacity: 0; visibility: hidden; transition: opacity .5s, visibility 0s .5s; }
body.fb .fb-style__licznik b { color: var(--fb-mieta); font: 700 clamp(56px, 7vw, 120px)/1 var(--fb-font-naglowek); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
body.fb .fb-style__licznik span { color: var(--fb-biel); font: 700 clamp(18px, 1.6vw, 26px)/1.1 var(--fb-font); }
/* ostatni krok: licznik zastępuje nazwę, opis i pigułki zostają */
body.fb .fb-style[data-krok="6"] .fb-style__licznik { opacity: 1; visibility: visible; transition-delay: 0s; }
body.fb .fb-style[data-krok="6"] .fb-style__nazwa { opacity: 0; }
body.fb .fb-style__nazwa { transition: opacity .4s; }

/* ekran budki w zbliżeniu; na końcu sceny (data-final) ustępuje całej budce */
body.fb .fb-style__budka { position: absolute; z-index: 3; left: 62%; top: 50%; width: 0; display: flex; flex-direction: column; align-items: center; translate: 0 -50%; transition: opacity .45s, scale .6s; }
body.fb .fb-style[data-final] .fb-style__budka { opacity: 0; scale: .9; }
body.fb .fb-style__oko { position: relative; flex: none; width: clamp(34px, 3.4vw, 56px); aspect-ratio: 1; margin-bottom: -2px; border-radius: 50%; border: 2px solid var(--fb-mieta); background: radial-gradient(circle, #05090A 0 34%, #1b2428 36% 100%); box-shadow: 0 0 24px rgba(198, 239, 235, .5); }
body.fb .fb-style__rama { flex: none; padding: clamp(10px, 1vw, 16px); border-radius: clamp(22px, 2.2vw, 36px); background: linear-gradient(160deg, #1d1d22, #08080a); box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 40px 80px rgba(0, 0, 0, .6), 0 0 100px color-mix(in srgb, var(--sw-a) 30%, transparent); }
body.fb .fb-style__ekran { position: relative; height: min(66svh, 700px); aspect-ratio: 4 / 5; overflow: hidden; border-radius: clamp(12px, 1.2vw, 20px); background: #05090A; }
body.fb .fb-style__kl { position: absolute; inset: 0; opacity: 0; transition: opacity .35s; }
body.fb .fb-style__kl img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
body.fb .fb-style__kl.is-aktywny { opacity: 1; }
/* do czasu grafiki stylu: zdjęcie bazowe w barwach stylu */
body.fb .fb-style__kl.is-zastepcze::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, var(--sw2), var(--sw1)); mix-blend-mode: color; opacity: .85; }
/* błysk na cały ekran, także nagłówek (js/style-ai.js przenosi go do body, żeby wyjść z kontekstu sceny): przy zmianie stylu i przy kliknięciu w pigułkę */
body.fb .fb-style__blysk { position: fixed; inset: 0; z-index: 1100; background: radial-gradient(circle at 62% 45%, #fff 0, #fff 40%, rgba(255, 255, 255, .88) 100%); opacity: 0; pointer-events: none; }
body.fb .fb-style__blysk.is-blysk { animation: fbk-blysk-stylu .6s cubic-bezier(.2, .6, .3, 1); }
@keyframes fbk-blysk-stylu { 0% { opacity: 1; } 100% { opacity: 0; } }

/* finał: budka wraca na scenę, na jej ekranie zdjęcie ostatniego stylu */
body.fb .fb-style__produkt { position: absolute; z-index: 3; left: 62%; bottom: 3svh; width: 0; height: min(90svh, 980px); display: flex; justify-content: center; opacity: 0; visibility: hidden; scale: 1.08; transition: opacity .6s, scale .8s cubic-bezier(.2, .7, .2, 1), visibility 0s .6s; pointer-events: none; }
body.fb .fb-style[data-final] .fb-style__produkt { opacity: 1; visibility: visible; scale: 1; transition-delay: 0s; }
body.fb .fb-style__bryla { position: relative; flex: none; height: 100%; width: fit-content; }
body.fb .fb-style__bryla > img { display: block; height: 100%; width: auto; max-width: none; filter: drop-shadow(0 24px 26px rgba(0, 0, 0, .55)) drop-shadow(0 0 60px color-mix(in srgb, var(--sw-a) 35%, transparent)); }
body.fb .fb-style__oko2 { position: absolute; left: var(--oko-x); top: var(--oko-y); width: var(--oko-d); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; box-shadow: 0 0 0 .18vw rgba(198, 239, 235, .9), 0 0 28px 6px rgba(198, 239, 235, .55), inset 0 0 22px rgba(198, 239, 235, .55); }
body.fb .fb-style[data-final] .fb-style__oko2 { animation: fbk-oko-stylu 1.6s ease-in-out infinite alternate; }
@keyframes fbk-oko-stylu { from { opacity: .65; } to { opacity: 1; } }
body.fb .fb-style__ekran2 { position: absolute; left: var(--ek-x); top: var(--ek-y); width: var(--ek-w); height: var(--ek-h); overflow: hidden; border-radius: 3%; background: #05090A; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
body.fb .fb-style__ekran2 .fb-style__kl { transition: none; }

body.fb .fb-style__siatka { display: none; }

/* ---------- telefon: napis u góry, ekran w środku, pigułki przy kciuku ---------- */
@media not all and (min-width: 768px) and (hover: hover) {
	body.fb .fb-style__scena::after { background: linear-gradient(0deg, rgba(0, 0, 0, .65) 0, transparent 38%), linear-gradient(180deg, rgba(0, 0, 0, .8) 0, rgba(0, 0, 0, .35) 22%, transparent 38%); }
	body.fb .fb-style[data-styl="western"] .fb-style__scena::after, body.fb .fb-style[data-styl="komiks"] .fb-style__scena::after { background: linear-gradient(0deg, rgba(0, 0, 0, .65) 0, transparent 38%), linear-gradient(180deg, rgba(0, 0, 0, .9) 0, rgba(0, 0, 0, .66) 28%, transparent 46%); }
	body.fb .fb-style__tresc { inset: calc(var(--fb-naglowek-h) + 10px) 0 0 0; width: auto; translate: none; padding: 0 16px 20px; gap: 6px; pointer-events: none; }
	body.fb .fb-style h2 { font-size: 15px; }
	body.fb .fb-style__nazwa { font-size: clamp(52px, 17vw, 88px); }
	body.fb .fb-style__opis { font-size: 15px; }
	body.fb .fb-style__licznik span { font-size: 18px; }
	body.fb .fb-style__piguly { position: absolute; inset: auto 0 20px; flex-wrap: nowrap; gap: 8px; margin: 0; padding: 0 16px; overflow-x: auto; scrollbar-width: none; pointer-events: auto; }
	body.fb .fb-style__piguly::-webkit-scrollbar { display: none; }
	body.fb .fb-style__pigula { flex: none; }
	body.fb .fb-style__budka { left: 50%; top: calc(var(--fb-naglowek-h) + 138px); translate: none; }
	body.fb .fb-style__produkt { left: 50%; bottom: 76px; height: calc(100svh - var(--fb-naglowek-h) - 230px); min-height: 220px; }
	body.fb .fb-style__ekran { height: min(46svh, 400px); }
	body.fb .fb-style__oko { width: 30px; }
}

/* ---------- bez przypięcia (ruch ograniczony): siatka sześciu zdjęć ---------- */
@media (prefers-reduced-motion: reduce) {
	body.fb .fb-style { height: auto; padding: 72px 24px; transition: none; background: linear-gradient(160deg, var(--sw2), var(--sw1)); }
	body.fb .fb-style__scena { position: static; height: auto; min-height: 0; background: none; }
	body.fb .fb-style__swiaty, body.fb .fb-style__budka, body.fb .fb-style__produkt, body.fb .fb-style__blysk, body.fb .fb-style__piguly, body.fb .fb-style__licznik, body.fb .fb-style__nazwa, body.fb .fb-style__opis, body.fb .fb-style__scena::after { display: none; }
	body.fb .fb-style__tresc { position: static; width: auto; translate: none; padding: 0; margin-bottom: 24px; }
	body.fb .fb-style h2 { font-size: clamp(28px, 4vw, 48px); }
	body.fb .fb-style__siatka { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
	body.fb .fb-style__siatka li { display: flex; flex-direction: column; gap: 8px; font: 700 16px/1.2 var(--fb-font); }
	body.fb .fb-style__siatka .fb-style__kl { position: relative; aspect-ratio: 4 / 5; opacity: 1; border-radius: 12px; overflow: hidden; }
}
