/* ========================================
   GALERIA K&P — Kamila & Patryk (Galeria by DNA, wersja kliencka)
   Ten sam DNA co Galeria DNA: ciemno, Playfair + Inter, akcent z config.json.
   ======================================== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --color-bg: #0a0a0a;
    --color-surface: #141414;
    --color-surface-2: #1a1a1a;
    --color-surface-3: #222;
    --color-accent: #c9a962;                 /* nadpisywane z manifestu (config.akcent) */
    --color-accent-glow: color-mix(in srgb, var(--color-accent) 40%, transparent);
    --color-accent-soft: color-mix(in srgb, var(--color-accent) 12%, transparent);
    --color-heart: #e0455a;
    --color-green: #2ecc71;
    --color-text: #f0f0f0;
    --color-text-muted: rgba(255, 255, 255, 0.5);
    --color-border: rgba(255, 255, 255, 0.08);
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --sidebar-width: 260px;
    --tile: 280px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
body.locked { overflow: hidden; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

.highlight { color: var(--color-accent); font-weight: 700; }
.amp { color: var(--color-accent); font-style: italic; font-weight: 400; }

/* ========================================
   BRAMKA (hasło) — zaproszenie leżące na stoliku (tło: butonierka na blacie, config.tloBramki)
   Karta: perspektywa blatu, światło z lewej góry, przechył za kursorem, refleks na papierze,
   wejście „odłożenia” na stół + przybicie pieczęci, wyjście „uniesienia” po zalogowaniu.
   ======================================== */
.gate {
    position: fixed; inset: 0; z-index: 20000; overflow: hidden;
    display: flex; align-items: flex-end; justify-content: center;
    background: var(--color-bg);
    padding: 24px 24px 9vh;
    perspective: 1500px; perspective-origin: 50% 15%;
}
.gate-bg {
    position: absolute; inset: -4%; z-index: 0;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(10,10,10,0) 50%, rgba(10,10,10,0.42) 100%),
        url('media/tlo.jpg') 50% 42% / cover no-repeat;
    animation: gate-bg 46s ease-in-out infinite alternate;
}
@keyframes gate-bg { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.06) translate(-0.8%, 0.6%); } }
.gate.gate-out .gate-bg { transition: opacity 0.9s ease 0.15s, filter 0.9s ease; opacity: 0; filter: blur(6px); }

.gate-card {
    position: relative; z-index: 1; width: 100%; max-width: 430px; text-align: center; color: var(--ink, #2a1a1d);
    padding: 36px 34px 26px; margin-left: 16vw;
    --tx: 0deg; --ty: 0deg; --sx: 22px; --sy: 34px;
    background:
        linear-gradient(118deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0) 38%, rgba(70,45,30,0.10) 100%),
        repeating-linear-gradient(0deg, rgba(0,0,0,0.014) 0 2px, transparent 2px 4px),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.2  0 0 0 0 0.12  0 0 0 0 0.08  0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E"),
        linear-gradient(160deg, #f2ebdf, #e6dccb);
    border: 1px solid rgba(110,31,46,0.22); border-radius: 2px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.6),
        0 1px 0 #d9cfbd, 0 2px 0 #cfc4b1,
        2px 3px 4px rgba(40,25,15,0.35),
        var(--sx) var(--sy) 34px -12px rgba(40,25,15,0.5);
    transform: rotateX(calc(34deg + var(--tx))) rotateZ(-9deg) rotateY(calc(-4deg + var(--ty)));
    transform-origin: 50% 100%;
    transition: transform 0.35s var(--ease-out-expo), box-shadow 0.35s var(--ease-out-expo);
    animation: gate-land 1.1s var(--ease-out-expo) both;
    transform-style: preserve-3d;
}
/* odłożenie na stół: z góry, lekko przekrzywione, cień z szerokiego w ciasny */
@keyframes gate-land {
    0%   { opacity: 0; transform: rotateX(34deg) rotateZ(-14deg) rotateY(-4deg) translateZ(260px) translateY(-40px); box-shadow: 0 0 0 rgba(0,0,0,0), 0 0 0 rgba(0,0,0,0), 0 0 0 rgba(0,0,0,0), 60px 120px 90px -20px rgba(40,25,15,0.25); }
    35%  { opacity: 1; }
    100% { opacity: 1; transform: rotateX(34deg) rotateZ(-9deg) rotateY(-4deg) translateZ(0) translateY(0); box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 1px 0 #d9cfbd, 0 2px 0 #cfc4b1, 2px 3px 4px rgba(40,25,15,0.35), 22px 34px 34px -12px rgba(40,25,15,0.5); }
}
.gate-card.landed { animation: none; }
/* uniesienie po zalogowaniu */
.gate.gate-out .gate-card { animation: none; transition: transform 0.8s cubic-bezier(0.5, 0, 0.8, 0.2), opacity 0.7s ease 0.1s; transform: rotateX(48deg) rotateZ(-6deg) rotateY(-4deg) translateZ(420px) translateY(-120px); opacity: 0; }
.gate-card::before { content: ''; position: absolute; inset: 9px; border: 1px solid rgba(110,31,46,0.22); border-radius: 2px; pointer-events: none; }
.gate-card::after {  /* ornament botaniczny w rogu */
    content: ''; position: absolute; top: 13px; left: 13px; width: 40px; height: 40px; opacity: 0.55; pointer-events: none;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke='%236e1f2e' stroke-width='1.2' stroke-linecap='round'><path d='M3 37c2-14 10-24 24-30'/><path d='M9 27c3-1 6 1 7 4-3 1-6-1-7-4z'/><path d='M15 18c3-1 6 1 7 4-3 1-6-1-7-4z'/><path d='M21 11c3-1 6 1 7 4-3 1-6-1-7-4z'/><path d='M5 31c-1 3 1 6 4 7 1-3-1-6-4-7z'/></svg>") no-repeat center / contain;
}
.gate-corner { position: absolute; width: 14px; height: 14px; border-color: rgba(110,31,46,0.5); border-style: solid; border-width: 0; pointer-events: none; }
.gate-corner.tl { top: 5px; left: 5px; border-top-width: 1px; border-left-width: 1px; }
.gate-corner.tr { top: 5px; right: 5px; border-top-width: 1px; border-right-width: 1px; }
.gate-corner.bl { bottom: 5px; left: 5px; border-bottom-width: 1px; border-left-width: 1px; }
.gate-corner.br { bottom: 5px; right: 5px; border-bottom-width: 1px; border-right-width: 1px; }
/* refleks światła wędrujący za kursorem */
.gate-sheen { position: absolute; inset: 0; pointer-events: none; z-index: 3; border-radius: 2px; --mx: 30%; --my: 20%;
    background: radial-gradient(420px 260px at var(--mx) var(--my), rgba(255,255,255,0.28), rgba(255,255,255,0) 60%); mix-blend-mode: soft-light; transition: opacity 0.4s ease; }

.gate-eyebrow { font-size: 0.58rem; letter-spacing: 0.34em; text-transform: uppercase; color: #6e1f2e; margin-bottom: 8px; }
.gate-title { font-family: var(--font-script, 'Great Vibes', cursive); font-weight: 400; font-size: 3.2rem; line-height: 1.05; letter-spacing: 0.01em; color: #5a1a27; text-shadow: 0 1px 0 rgba(255,255,255,0.5); }
.gate-title .amp { color: var(--color-accent); font-style: normal; font-family: var(--font-display); font-size: 0.55em; vertical-align: 0.18em; margin: 0 0.15em; }
.gate-date { font-family: var(--font-body); font-size: 0.62rem; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(42,26,29,0.65); margin-top: 6px; }
.gate-date:empty { display: none; }
.gate-orn { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 12px 0 10px; color: #6e1f2e; }
.gate-orn span { width: 56px; height: 1px; background: linear-gradient(90deg, transparent, rgba(110,31,46,0.6)); }
.gate-orn span:last-child { background: linear-gradient(90deg, rgba(110,31,46,0.6), transparent); }
.gate-orn i { font-style: normal; font-size: 0.9rem; }
.gate-sub { font-family: var(--font-note, Georgia, serif); font-style: italic; font-size: 1.02rem; color: rgba(42,26,29,0.7); margin: 0 0 18px; }
.gate-form { display: flex; gap: 10px; align-items: flex-end; position: relative; z-index: 4; }
.gate-input {
    flex: 1; min-width: 0; padding: 10px 6px;
    border: none; border-bottom: 1px dashed rgba(110,31,46,0.45); border-radius: 0;
    background: transparent; color: #2a1a1d;
    font-family: var(--font-body); font-size: 1rem; letter-spacing: 0.12em;
}
.gate-input::placeholder { color: rgba(42,26,29,0.4); letter-spacing: 0.04em; }
.gate-input:focus { outline: none; border-bottom: 1px solid #6e1f2e; background: transparent; box-shadow: none; }
.gate-btn {
    padding: 10px 20px; border: none; border-radius: 3px; cursor: pointer; margin-bottom: 2px;
    background: linear-gradient(160deg, #7d2536, #4a1220); color: #f3e9dc; font-family: var(--font-body); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3); transition: filter 0.2s ease, transform 0.15s ease, background 0.3s ease;
}
.gate-btn:hover { filter: brightness(1.15); }
.gate-btn:active { transform: scale(0.97); }
.gate-btn:disabled { opacity: 0.5; cursor: wait; }
.gate-form.ready .gate-btn { background: linear-gradient(160deg, #d9bc74, #a8863a); color: #2a1a1d; }
.gate-error { min-height: 22px; margin-top: 10px; font-family: var(--font-note, Georgia, serif); font-style: italic; font-size: 0.95rem; color: #8a2434; }
.gate-card.shake { animation: shake 0.4s ease; }
@keyframes shake { 0%,100% { transform: rotateX(34deg) rotateZ(-9deg) rotateY(-4deg); } 20%,60% { transform: rotateX(34deg) rotateZ(-9deg) rotateY(-4deg) translateX(-6px); } 40%,80% { transform: rotateX(34deg) rotateZ(-9deg) rotateY(-4deg) translateX(6px); } }
.gate-brand { margin-top: 18px; font-size: 0.56rem; letter-spacing: 0.26em; text-transform: uppercase; color: rgba(42,26,29,0.5); }
.gate-brand .highlight { color: #6e1f2e; }
/* lakowa pieczęć — przybijana po odłożeniu karty */
.gate-seal {
    position: absolute; right: 16px; bottom: 16px; width: 44px; height: 44px; z-index: 5;
    border-radius: 48% 52% 50% 50% / 52% 48% 52% 48%;
    background: radial-gradient(circle at 35% 30%, #9a3446, #6e1f2e 55%, #3a0f18 100%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.35), inset 0 0 0 2px rgba(255,255,255,0.08), inset 0 2px 4px rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center; transform: rotate(-8deg);
    font-family: var(--font-script, cursive); font-size: 1.05rem; color: var(--color-accent);
    animation: seal-stamp 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) 0.9s both;
}
@keyframes seal-stamp { 0% { transform: rotate(-8deg) scale(2.2); opacity: 0; } 60% { opacity: 1; } 100% { transform: rotate(-8deg) scale(1); opacity: 1; } }
@media (max-width: 768px) {
    .gate { align-items: flex-end; padding: 16px 16px 7vh; perspective: 1100px; perspective-origin: 50% 25%; }
    .gate-bg { background-position: 42% 30%; }
    .gate-card { margin-left: 0; max-width: 420px; padding: 30px 22px 22px; transform: rotateX(calc(22deg + var(--tx))) rotateZ(-5deg) rotateY(var(--ty)); }
    @keyframes gate-land { 0% { opacity: 0; transform: rotateX(22deg) rotateZ(-9deg) translateZ(200px) translateY(-30px); } 35% { opacity: 1; } 100% { opacity: 1; transform: rotateX(22deg) rotateZ(-5deg) translateZ(0) translateY(0); } }
    @keyframes shake { 0%,100% { transform: rotateX(22deg) rotateZ(-5deg); } 20%,60% { transform: rotateX(22deg) rotateZ(-5deg) translateX(-6px); } 40%,80% { transform: rotateX(22deg) rotateZ(-5deg) translateX(6px); } }
    .gate.gate-out .gate-card { transform: rotateX(35deg) rotateZ(-3deg) translateZ(360px) translateY(-100px); }
    .gate-title { font-size: 2.6rem; }
}
@media (prefers-reduced-motion: reduce) {
    .gate-bg { animation: none; }
    .gate-card { animation: none; transition: none; }
    .gate-seal { animation: none; }
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-width); height: 100vh; height: 100dvh;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    z-index: 500;
    display: flex; flex-direction: column;
    overflow-y: auto;
    padding-top: var(--safe-top);
    transition: transform 0.3s var(--ease-out-expo);
}
.sidebar-header { padding: 28px 20px 18px; border-bottom: 1px solid var(--color-border); }
.sidebar-header h2 {
    font-family: var(--font-display); font-size: 1.25rem; font-weight: 400;
    letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.3;
}
.sidebar-brand { margin-top: 6px; font-size: 0.6rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--color-text-muted); }
.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-footer { padding: 8px 0 calc(12px + var(--safe-bottom)); border-top: 1px solid var(--color-border); }

.nav-section-label {
    padding: 16px 20px 6px; font-size: 0.65rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.15em; color: var(--color-text-muted);
}
.nav-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 20px; border: none; background: none;
    color: var(--color-text-muted); font-family: var(--font-body); font-size: 0.85rem;
    cursor: pointer; transition: all 0.2s ease; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--color-text); }
.nav-item.active { background: var(--color-accent-soft); color: var(--color-text); border-right: 2px solid var(--color-accent); }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-icon--heart { color: var(--color-heart); }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 0.7rem; background: rgba(255,255,255,0.08); padding: 2px 8px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.nav-item--action { color: var(--color-accent); opacity: 0.8; }
.nav-item--action:hover { opacity: 1; }
.nav-item--small { padding: 8px 20px; font-size: 0.78rem; }
.nav-item:disabled { opacity: 0.35; cursor: not-allowed; }

.sidebar-toggle {
    display: none; position: fixed; top: calc(14px + var(--safe-top)); left: 14px; z-index: 600;
    width: 44px; height: 44px; border: 1px solid var(--color-border); border-radius: 10px;
    background: rgba(20,20,20,0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    color: white; font-size: 20px; cursor: pointer;
}
.sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 450; background: rgba(0,0,0,0.5); }
.sidebar-backdrop.visible { display: block; }

/* ========================================
   MAIN / HERO / HEADER
   ======================================== */
.main-wrapper { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left 0.35s var(--ease-out-expo); }

/* zwijane menu (desktop): zakładka ze strzałką na krawędzi sidebara */
.sidebar-collapse {
    position: fixed; top: 50%; left: var(--sidebar-width); z-index: 520; transform: translateY(-50%);
    width: 30px; height: 84px; border: 1px solid color-mix(in srgb, var(--color-accent) 55%, transparent); border-left: none; border-radius: 0 12px 12px 0;
    background: rgba(16,16,16,0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    color: var(--color-accent); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
    box-shadow: 0 6px 18px rgba(0,0,0,0.55);
    transition: left 0.35s var(--ease-out-expo), background 0.2s ease, transform 0.2s ease;
}
.sidebar-collapse svg { width: 18px; height: 18px; transition: transform 0.35s var(--ease-out-expo); }
.sidebar-collapse:hover { background: var(--color-accent); color: #111; }
body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .main-wrapper { margin-left: 0; }
body.sidebar-collapsed .sidebar-collapse { left: 0; }
body.sidebar-collapsed .sidebar-collapse svg { transform: rotate(180deg); }
body.sidebar-collapsed header { padding-left: 40px; }

.hero {
    position: relative; height: 62vh; min-height: 380px; max-height: 720px;
    overflow: hidden; background: var(--color-surface);
    display: flex; align-items: flex-end;
}
.hero[hidden] { display: none; }
.hero-img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: 50% 35%;
    opacity: 0; transform: scale(1.04);
    transition: opacity 1.2s ease, transform 8s ease-out;
}
.hero-img.loaded { opacity: 1; transform: scale(1); }
.hero-shade {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(10,10,10,0.15) 0%, rgba(10,10,10,0) 30%, rgba(10,10,10,0.45) 60%, rgba(10,10,10,0.9) 88%, var(--color-bg) 100%);
}
/* tytuł na środku, nisko (na zdjęciu grupowym tam są nogi i bruk, nie twarze) + własna „ciemna plama” pod napisem */
.hero-text { position: relative; z-index: 2; padding: 0 24px 6px; max-width: 900px; margin: 0 auto; text-align: center; }
.hero-text::before {
    content: ''; position: absolute; left: 50%; top: 50%; width: 140%; height: 170%; transform: translate(-50%, -42%); z-index: -1; pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(10,10,10,0.72) 0%, rgba(10,10,10,0.45) 40%, rgba(10,10,10,0) 70%);
}
.hero-eyebrow { font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(255,255,255,0.7); margin-bottom: 10px; }
.hero-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1.05; letter-spacing: 0.01em; text-shadow: 0 4px 30px rgba(0,0,0,0.5); }
.hero-date { margin-top: 6px; font-size: 0.95rem; color: rgba(255,255,255,0.75); letter-spacing: 0.05em; }
.hero-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; justify-content: center; }
.hero-btn {
    padding: 11px 20px; border-radius: 999px; cursor: pointer;
    border: 1px solid rgba(255,255,255,0.25); background: rgba(20,20,20,0.5);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    color: white; font-family: var(--font-body); font-size: 0.85rem; font-weight: 500;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.hero-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.4); }
.hero-btn:active { transform: scale(0.97); }
.hero-btn--primary { background: var(--color-accent); border-color: var(--color-accent); color: #111; }
.hero-btn--primary:hover { background: var(--color-accent); filter: brightness(1.1); }

/* cienki pasek: tytuł widoku (na „Wszystkie” schowany) + jedna zębatka z narzędziami */
header {
    padding: 10px 32px 0; position: sticky; top: 0; z-index: 100;
    background: rgba(10,10,10,0.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--color-border); min-height: 46px; }
.header-left { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.header-left h1 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 400; letter-spacing: 0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.view-all .header-left h1 { display: none; }
body.view-all header { padding-top: 4px; }
body.view-all .header-inner { padding-bottom: 6px; min-height: 40px; }
body.view-all .gallery-grid { padding-top: 12px; }
.photo-count { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-muted); }
.header-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; position: relative; }
.btn-gear {
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--color-border); cursor: pointer;
    background: rgba(255,255,255,0.04); color: var(--color-text-muted); display: flex; align-items: center; justify-content: center;
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.4s var(--ease-out-expo);
}
.btn-gear:hover, .btn-gear[aria-expanded="true"] { color: var(--color-accent); border-color: var(--color-accent); transform: rotate(45deg); }
.tools-menu {
    position: absolute; top: 48px; right: 0; z-index: 300; width: 280px; padding: 8px;
    background: rgba(18,18,18,0.96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-border); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,0.6);
    animation: modal-in 0.22s var(--ease-out-expo);
}
.tools-menu[hidden] { display: none; }
.tools-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 9px; font-size: 0.85rem; color: var(--color-text); font-family: var(--font-body); }
.tools-btn { border: none; background: none; cursor: pointer; text-align: left; }
.tools-btn:hover { background: rgba(255,255,255,0.06); }
.tools-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.tools-ico { width: 20px; text-align: center; color: var(--color-accent); flex-shrink: 0; }
.tools-row > span:nth-child(2) { flex: 1; }
.tools-row .sort-select { width: 130px; padding: 6px 8px; font-size: 0.78rem; }
.tools-row .zoom-slider { width: 120px; }
.tools-sep { height: 1px; background: var(--color-border); margin: 6px 4px; }

.sort-select, .lightbox-speed {
    padding: 7px 10px; border: 1px solid var(--color-border); border-radius: 8px;
    background: rgba(255,255,255,0.03); color: var(--color-text);
    font-family: var(--font-body); font-size: 0.8rem; cursor: pointer;
}
.sort-select:focus { outline: none; border-color: var(--color-accent); }
.sort-select option { background: #1a1a1a; }

.zoom-control { display: flex; align-items: center; gap: 8px; color: var(--color-text-muted); }
.zoom-icon--small { font-size: 0.7rem; }
.zoom-icon--large { font-size: 1.1rem; }
.zoom-slider { width: 110px; accent-color: var(--color-accent); cursor: pointer; }

.btn-tool {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border: 1px solid var(--color-border); border-radius: 8px;
    background: rgba(255,255,255,0.03); color: var(--color-text);
    font-family: var(--font-body); font-size: 0.8rem; cursor: pointer;
    transition: all 0.2s ease; white-space: nowrap;
}
.btn-tool:hover { border-color: var(--color-accent); background: var(--color-accent-soft); }
.btn-tool:disabled { opacity: 0.35; cursor: not-allowed; }

/* ========================================
   SIATKA
   ======================================== */
main { flex: 1; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr));
    gap: 10px; padding: 24px 32px;
}
.gallery-item {
    position: relative; overflow: hidden; border-radius: 6px; cursor: pointer;
    aspect-ratio: 3 / 2; background: var(--color-surface);
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
}
.gallery-item.visible { opacity: 1; transform: translateY(0); }
.gallery-item::before {
    content: ''; position: absolute; inset: 0; z-index: 1; border-radius: 6px;
    background: linear-gradient(110deg, var(--color-surface) 30%, #1a1a1a 50%, var(--color-surface) 70%);
    background-size: 200% 100%; animation: shimmer 1.5s infinite; transition: opacity 0.4s ease;
}
.gallery-item.loaded::before { opacity: 0; pointer-events: none; }
.gallery-item img {
    position: relative; z-index: 2; display: block;
    width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%;
    transition: transform 0.6s var(--ease-out-expo), filter 0.5s ease;
    filter: brightness(0.88) saturate(0.92);
}
.gallery-item:hover img { transform: scale(1.05); filter: brightness(1) saturate(1.08); }

.item-heart {
    position: absolute; top: 8px; right: 8px; z-index: 5;
    width: 34px; height: 34px; border: none; border-radius: 50%; cursor: pointer;
    background: rgba(0,0,0,0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    color: rgba(255,255,255,0.85); font-size: 17px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s ease, transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}
.gallery-item:hover .item-heart, .gallery-item:focus-within .item-heart { opacity: 1; }
.item-heart:hover { transform: scale(1.12); background: rgba(0,0,0,0.65); }
.gallery-item.wybrane .item-heart { opacity: 1; color: #fff; background: var(--color-heart); }
.item-heart.pop { animation: heart-pop 0.35s var(--ease-out-expo); }
@keyframes heart-pop { 0% { transform: scale(0.7); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
@media (hover: none) { .item-heart { opacity: 0.85; } }

.gallery-item.wybrane::after {
    content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
    border-radius: 6px; box-shadow: inset 0 0 0 2px var(--color-heart);
}
.item-name {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; pointer-events: none;
    padding: 18px 10px 8px; font-size: 0.68rem; letter-spacing: 0.04em; color: rgba(255,255,255,0.85);
    background: linear-gradient(0deg, rgba(0,0,0,0.65), transparent);
    opacity: 0; transition: opacity 0.25s ease;
    font-variant-numeric: tabular-nums;
}
.gallery-item:hover .item-name { opacity: 1; }

.load-sentinel { grid-column: 1 / -1; height: 1px; }

.empty-state { text-align: center; padding: 80px 20px; color: var(--color-text-muted); }
.empty-icon { font-size: 3.5rem; margin-bottom: 12px; opacity: 0.3; }

footer { padding: 28px 32px calc(28px + var(--safe-bottom)); text-align: center; font-size: 0.72rem; color: var(--color-text-muted); letter-spacing: 0.08em; border-top: 1px solid var(--color-border); }

/* ========================================
   LIGHTBOX (mechanika 1:1 z Galerii DNA)
   ======================================== */
.lightbox { display: none; position: fixed; z-index: 9999; inset: 0; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.4s var(--ease-out-expo); }
.lightbox.active { display: flex; opacity: 1; }
.lightbox-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }

.lightbox-stage { position: relative; z-index: 2; width: 100vw; height: 100vh; height: 100dvh; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-in; touch-action: none; }
.lightbox-stage.zoomed { cursor: grab; }
.lightbox-stage.panning { cursor: grabbing; }

.lightbox-content {
    max-width: 100vw; max-height: 100vh; max-height: 100dvh; object-fit: contain;
    user-select: none; -webkit-user-drag: none;
    image-rendering: high-quality; image-rendering: -webkit-optimize-contrast;
    opacity: 0; transform: scale(0.96);
    transition: opacity 0.4s ease, transform 0.4s var(--ease-out-expo);
}
.lightbox.active .lightbox-content { opacity: 1; transform: scale(1); }
.lightbox-content.switching { opacity: 0; transition: opacity 0.18s ease; }
.lightbox-content.manipulating { transition: none; will-change: transform; }
.lightbox-content.pixelated { image-rendering: pixelated; image-rendering: crisp-edges; }

.lightbox-spinner {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 36px; height: 36px; border: 2px solid rgba(255,255,255,0.1); border-top-color: rgba(255,255,255,0.8);
    border-radius: 50%; animation: spin 0.8s linear infinite; z-index: 1; display: none;
}
.lightbox.loading .lightbox-spinner { display: block; }

.lightbox-topbar {
    position: absolute; top: 0; left: 0; right: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: calc(16px + var(--safe-top)) 20px 16px;
    background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, transparent 100%);
    pointer-events: none; opacity: 1; transition: opacity 0.35s var(--ease-out-expo);
}
.lightbox-topbar > * { pointer-events: auto; }
.lightbox.ui-hidden .lightbox-topbar, .lightbox.ui-hidden .lightbox-nav, .lightbox.ui-hidden .lightbox-caption { opacity: 0; pointer-events: none; }

.lightbox-counter {
    font-size: 0.78rem; letter-spacing: 0.12em; color: rgba(255,255,255,0.65); font-variant-numeric: tabular-nums;
    padding: 6px 12px; border-radius: 20px; background: rgba(255,255,255,0.06);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); white-space: nowrap;
}
.lightbox-topbar-actions {
    display: flex; align-items: center; gap: 4px; padding: 4px;
    background: rgba(255,255,255,0.05); border-radius: 12px;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,0.06);
    max-width: calc(100vw - 140px); overflow-x: auto; scrollbar-width: none;
}
.lightbox-topbar-actions::-webkit-scrollbar { display: none; }
.lightbox-iconbtn {
    width: 34px; height: 34px; border: none; background: transparent; color: rgba(255,255,255,0.7);
    cursor: pointer; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    transition: background 0.2s ease, color 0.2s ease; padding: 0; flex-shrink: 0;
}
.lightbox-iconbtn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.lightbox-iconbtn:active { background: rgba(255,255,255,0.15); }
.lightbox-iconbtn--text { width: auto; min-width: 38px; padding: 0 10px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.lightbox-iconbtn.active { background: rgba(255,255,255,0.15); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15); }
.lightbox-iconbtn:disabled { opacity: 0.25; cursor: not-allowed; }
.lightbox-heart { font-size: 18px; }
.lightbox-heart.active { color: var(--color-heart); background: rgba(224,69,90,0.18); box-shadow: inset 0 0 0 1px rgba(224,69,90,0.4); }
.lightbox-heart.pop { animation: heart-pop 0.35s var(--ease-out-expo); }
.lightbox-zoom-label { font-size: 0.72rem; color: rgba(255,255,255,0.55); font-variant-numeric: tabular-nums; padding: 0 8px; min-width: 46px; text-align: center; letter-spacing: 0.05em; }
.lightbox-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.08); margin: 0 4px; flex-shrink: 0; }
.lightbox-speed { padding: 3px 6px; font-size: 0.7rem; border-radius: 6px; background: transparent; color: rgba(255,255,255,0.7); margin-right: 4px; }
.lightbox-speed option { background: #1a1a1a; }
#lbSlideshow.playing { color: var(--color-green); }

.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
    width: 48px; height: 48px; border-radius: 50%; padding: 0;
    background: rgba(255,255,255,0.05); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.06); color: rgba(255,255,255,0.7); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.35s var(--ease-out-expo), background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.12); color: #fff; }
.lightbox-nav:active { transform: translateY(-50%) scale(0.94); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-caption {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 9; pointer-events: none;
    padding: 40px 24px calc(16px + var(--safe-bottom)); text-align: center;
    font-size: 0.72rem; letter-spacing: 0.08em; color: rgba(255,255,255,0.55);
    background: linear-gradient(0deg, rgba(0,0,0,0.5), transparent);
    transition: opacity 0.35s var(--ease-out-expo); font-variant-numeric: tabular-nums;
}
.lightbox-caption b { color: rgba(255,255,255,0.85); font-weight: 500; }

.lightbox:fullscreen { background: #000; }
.lightbox:fullscreen .lightbox-content { max-width: 100vw; max-height: 100vh; }

/* Panel szczegółów */
.lightbox-info {
    position: absolute; top: 0; right: 0; bottom: 0; z-index: 20; width: 320px; max-width: 90vw;
    background: rgba(14,14,14,0.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--color-border);
    transform: translateX(100%); transition: transform 0.35s var(--ease-out-expo);
    display: flex; flex-direction: column; padding-top: var(--safe-top);
}
.lightbox.info-open .lightbox-info { transform: translateX(0); }
.info-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--color-border); }
.info-title { font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--color-text-muted); }
.info-body { padding: 8px 20px 20px; overflow-y: auto; }
.info-section { padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.info-section:last-child { border-bottom: none; }
.info-section-title { font-size: 0.65rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--color-accent); margin-bottom: 8px; }
.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 0.8rem; }
.info-key { color: var(--color-text-muted); flex-shrink: 0; }
.info-val { text-align: right; word-break: break-word; }
.info-val.mono { font-family: 'SF Mono', Menlo, monospace; font-size: 0.75rem; }
.info-actions { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; }
.info-btn {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer;
    border: 1px solid var(--color-border); background: rgba(255,255,255,0.03); color: var(--color-text);
    font-family: var(--font-body); font-size: 0.8rem; text-align: left; transition: all 0.2s ease;
}
.info-btn:hover { border-color: var(--color-accent); background: var(--color-accent-soft); }

/* ========================================
   MODALE, TOASTY, SCROLL-TOP
   ======================================== */
.modal-overlay {
    position: fixed; inset: 0; z-index: 10500; background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.visible { display: flex; }
.modal {
    width: 100%; max-width: 480px; max-height: 85vh; overflow: hidden;
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6); display: flex; flex-direction: column;
    animation: modal-in 0.3s var(--ease-out-expo);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--color-border); }
.modal-header h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.1rem; }
.modal-close { border: none; background: none; color: var(--color-text-muted); font-size: 22px; cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { color: white; background: rgba(255,255,255,0.06); }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--color-border); }
.modal--confirm { max-width: 400px; }
.confirm-title { font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 8px; }
.confirm-text { font-size: 0.85rem; color: var(--color-text-muted); }

.toolbar-btn {
    padding: 8px 14px; border: 1px solid var(--color-border); border-radius: 8px; cursor: pointer;
    background: rgba(255,255,255,0.03); color: var(--color-text); font-family: var(--font-body); font-size: 0.8rem;
    transition: all 0.2s ease;
}
.toolbar-btn:hover { border-color: rgba(255,255,255,0.25); }
a.toolbar-btn { text-decoration: none; display: inline-flex; align-items: center; }
.toolbar-btn--accent { background: var(--color-accent); border-color: var(--color-accent); color: #111; font-weight: 600; }
.toolbar-btn--accent:hover { filter: brightness(1.1); }

.shortcuts-body { padding: 8px 4px; }
.shortcut-section { margin-bottom: 14px; }
.shortcut-section h4 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-text-muted); padding: 0 16px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--color-border); font-weight: 600; }
.shortcut-row { display: flex; align-items: center; padding: 6px 16px; font-size: 0.82rem; gap: 12px; }
.shortcut-row kbd {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-bottom-width: 2px; border-radius: 5px;
    padding: 2px 8px; font-family: 'SF Mono', Menlo, monospace; font-size: 0.75rem; color: white; min-width: 26px; text-align: center; display: inline-block; flex-shrink: 0;
}
.shortcut-row span { flex: 1; color: var(--color-text-muted); }
.shortcut-row b { color: var(--color-text); font-weight: 500; }

.toast-container { position: fixed; bottom: calc(24px + var(--safe-bottom)); right: 24px; z-index: 11000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; max-width: min(380px, calc(100vw - 32px)); }
.toast {
    background: rgba(20,20,20,0.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 12px 16px;
    color: var(--color-text); font-size: 0.85rem; display: flex; align-items: center; gap: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5); pointer-events: auto; animation: toast-in 0.32s var(--ease-out-expo); min-width: 220px;
}
.toast.leaving { animation: toast-out 0.25s var(--ease-out-expo) forwards; }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-msg { flex: 1; line-height: 1.4; }
.toast--ok .toast-icon { color: var(--color-green); }
.toast--blad .toast-icon { color: #ff6b7a; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

.scroll-top {
    position: fixed; right: 24px; bottom: calc(24px + var(--safe-bottom)); z-index: 400;
    width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--color-border);
    background: rgba(20,20,20,0.85); backdrop-filter: blur(12px); color: white; font-size: 18px; cursor: pointer;
    opacity: 0; pointer-events: none; transform: translateY(10px); transition: all 0.3s var(--ease-out-expo);
}
.scroll-top.visible { opacity: 1; pointer-events: auto; transform: none; }
.scroll-top:hover { border-color: var(--color-accent); }

/* ========================================
   ANIMACJE / RESPONSYWNOŚĆ
   ======================================== */
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) { }
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); box-shadow: 0 0 60px rgba(0,0,0,0.6); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
    .sidebar-collapse { display: none; }
    body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
    body.sidebar-collapsed .sidebar.open { transform: translateX(0); }
    body.sidebar-collapsed header { padding-left: 16px; }
    .main-wrapper { margin-left: 0; }
    .hero { height: 70vh; height: 70dvh; min-height: 320px; }
    .hero-text { padding: 0 16px 6px; }
    header { padding: calc(8px + var(--safe-top)) 16px 0; }
    .header-inner { padding-left: 52px; padding-bottom: 8px; }
    .header-left h1 { font-size: 1.05rem; }
    .tools-menu { width: min(300px, calc(100vw - 32px)); }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 10px 12px; }
    .gallery-item { aspect-ratio: 1 / 1; }
    .lightbox-prev { left: 8px; } .lightbox-next { right: 8px; }
    .lightbox-nav { width: 40px; height: 40px; }
    .lightbox-topbar { padding: calc(10px + var(--safe-top)) 10px 12px; }
    .lightbox-counter { display: none; }
    .lightbox-topbar-actions { max-width: 100%; margin-left: auto; }
    .lightbox-zoom-label, #lbZoomIn, #lbZoomOut, #lbOneToOne, #lbZoomReset, #lbFullscreen { display: none; }
    .lightbox-topbar-actions .lightbox-divider:first-of-type { display: none; }
    .lightbox-speed { display: none; }
    .toast-container { right: 12px; left: 12px; align-items: stretch; }
    .scroll-top { right: 14px; }
}
@media (max-width: 480px) { .header-left { flex-wrap: wrap; gap: 2px 10px; } }
@media (max-width: 420px) {
    .hero-title { font-size: 2.3rem; }
    .gate-title { font-size: 1.8rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    .gallery-item { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}

/* ========================================
   v2: ROLE — para (oceny, ukrywanie, goście), goście z kodami
   ======================================== */
.sidebar-who { margin-top: 10px; font-size: 0.72rem; color: var(--color-text); padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,0.05); border: 1px solid var(--color-border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-who b { color: var(--color-accent); font-weight: 500; }
.nav-icon--star { color: #f1c40f; }

/* kafelki: oko (para), odznaki */
.item-eye {
    position: absolute; top: 8px; right: 48px; z-index: 5;
    width: 34px; height: 34px; border: none; border-radius: 50%; cursor: pointer;
    background: rgba(0,0,0,0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    color: rgba(255,255,255,0.85); display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s ease, transform 0.15s ease, background 0.2s ease;
}
.item-eye svg { width: 17px; height: 17px; }
.gallery-item:hover .item-eye, .gallery-item:focus-within .item-eye { opacity: 1; }
.item-eye:hover { transform: scale(1.12); background: rgba(0,0,0,0.65); }
@media (hover: none) { body.rola-para .item-eye { opacity: 0.85; } }
.eye-slash { display: none; }
.gallery-item.ukryte .item-eye { opacity: 1; background: rgba(255,255,255,0.15); }
.gallery-item.ukryte .eye-slash, .lightbox-eye.active .eye-slash { display: block; }
.gallery-item.ukryte img { filter: brightness(0.35) saturate(0.4) !important; }
.gallery-item.ukryte::before { display: none; }
.item-badge-hidden {
    position: absolute; left: 8px; top: 8px; z-index: 5; pointer-events: none;
    padding: 3px 9px; border-radius: 10px; font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
    background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.8); display: none;
}
.gallery-item.ukryte .item-badge-hidden { display: block; }
.item-stars {
    position: absolute; left: 8px; bottom: 8px; z-index: 5; pointer-events: none;
    padding: 2px 8px; border-radius: 10px; font-size: 11px; letter-spacing: 0.5px; color: #f1c40f;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); display: none;
}
.gallery-item.has-stars .item-stars { display: block; }
.item-likes {
    position: absolute; right: 8px; bottom: 8px; z-index: 5; pointer-events: none;
    padding: 2px 8px; border-radius: 10px; font-size: 11px; color: #fff;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); display: none;
}
.item-likes b { color: var(--color-heart); font-weight: 600; }
.gallery-item.has-likes .item-likes { display: block; }
.gallery-item:hover .item-name { opacity: 0; }

/* lightbox: gwiazdki (jak w Galerii DNA) + oko */
.lightbox-stars { display: flex; align-items: center; gap: 2px; padding: 0 6px; }
.lb-star { background: none; border: none; padding: 4px 2px; color: rgba(255,255,255,0.25); font-size: 16px; cursor: pointer; line-height: 1; transition: color 0.15s ease, transform 0.1s ease; }
.lb-star:hover { transform: scale(1.15); }
.lb-star.active { color: #f1c40f; }
.lightbox-stars:hover .lb-star { color: rgba(255,255,255,0.25); }
.lightbox-stars:hover .lb-star.preview { color: #f1c40f; }
.lightbox-eye.active { color: #fff; background: rgba(255,255,255,0.15); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15); }
.lightbox-caption .ukryte-tag { color: #ffb3b3; }

/* modal Goście */
.modal--goscie { max-width: 720px; }
.goscie-intro { font-size: 0.82rem; color: var(--color-text-muted); margin-bottom: 14px; line-height: 1.5; }
.goscie-intro b { color: var(--color-text); font-weight: 500; }
.goscie-form { display: grid; grid-template-columns: 1.4fr 1.2fr auto auto; gap: 8px; margin-bottom: 16px; }
.goscie-form input, .goscie-form select {
    padding: 9px 12px; border: 1px solid var(--color-border); border-radius: 8px; min-width: 0;
    background: rgba(255,255,255,0.03); color: var(--color-text); font-family: var(--font-body); font-size: 0.82rem;
}
.goscie-form input:focus, .goscie-form select:focus { outline: none; border-color: var(--color-accent); }
.goscie-form select option { background: #1a1a1a; }
.goscie-list { display: flex; flex-direction: column; gap: 8px; }
.gosc { border: 1px solid var(--color-border); border-radius: 10px; padding: 12px 14px; background: rgba(255,255,255,0.02); }
.gosc.off { opacity: 0.55; }
.gosc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.gosc-name { font-weight: 500; font-size: 0.95rem; }
.gosc-name small { color: var(--color-text-muted); font-weight: 400; margin-left: 6px; }
.gosc-code { font-family: 'SF Mono', Menlo, monospace; font-size: 0.95rem; letter-spacing: 0.15em; color: var(--color-accent); padding: 4px 10px; border-radius: 6px; background: rgba(255,255,255,0.05); }
.gosc-stats { font-size: 0.72rem; color: var(--color-text-muted); margin-top: 6px; }
.gosc-stats .on { color: var(--color-green); }
.gosc-stats .warn { color: #ff8a8a; }
.gosc-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.gosc-actions .toolbar-btn, .gosc-actions a.toolbar-btn { padding: 6px 10px; font-size: 0.75rem; }
.gosc-actions .danger { color: #ff8a8a; }
.gosc-actions .send { border-color: color-mix(in srgb, var(--color-accent) 40%, transparent); }
.goscie-empty { text-align: center; color: var(--color-text-muted); padding: 24px 0; font-size: 0.85rem; }

@media (max-width: 640px) {
    .goscie-form { grid-template-columns: 1fr 1fr; }
    .goscie-form button { grid-column: 1 / -1; }
    .item-eye { right: 46px; }
}
@media (max-width: 768px) {
    .lightbox-stars { padding: 0 2px; }
    .lb-star { font-size: 15px; padding: 4px 1px; }
}

/* ========================================
   v3: KSIĘGA GOŚCI — papeteria ślubna (kość słoniowa · bordo · złoto)
   Paleta z sesji pary: białe/kremowe, czarny garnitur, bordowe róże, anturium, amarantus, stare drewno.
   ======================================== */
:root {
    --font-note: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    --font-script: 'Great Vibes', 'Snell Roundhand', 'Brush Script MT', cursive;
    --paper: #f5efe4;
    --paper-2: #ebe2d2;
    --ink: #2a1a1d;
    --wine: #6e1f2e;
    --wine-deep: #3a0f18;
    --wine-soft: rgba(110, 31, 46, 0.22);
}

/* reakcje pod zdjęciem w lightboxie */
.lightbox-reactions {
    position: absolute; left: 50%; bottom: calc(44px + var(--safe-bottom)); transform: translateX(-50%); z-index: 11;
    display: flex; gap: 6px; padding: 5px; border-radius: 999px;
    background: rgba(255,255,255,0.06); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.08); transition: opacity 0.35s var(--ease-out-expo);
}
.lightbox.ui-hidden .lightbox-reactions { opacity: 0; pointer-events: none; }
.reaction {
    position: relative; display: flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 999px; border: none; cursor: pointer;
    background: transparent; color: rgba(255,255,255,0.8); font-size: 1.05rem; line-height: 1; font-family: var(--font-body);
    transition: background 0.2s ease, transform 0.15s ease;
}
.reaction:hover { background: rgba(255,255,255,0.12); }
.reaction:active { transform: scale(0.9); }
.reaction.mine { background: rgba(255,255,255,0.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25); }
.reaction .n { font-size: 0.72rem; font-variant-numeric: tabular-nums; color: rgba(255,255,255,0.75); }
.reaction .n:empty { display: none; }
.fly { position: fixed; z-index: 12000; pointer-events: none; font-size: 1.6rem; line-height: 1; animation: fly 1.3s var(--ease-out-expo) forwards; }
@keyframes fly {
    0% { transform: translate(-50%, 0) scale(0.6); opacity: 0; }
    15% { opacity: 1; transform: translate(-50%, -20px) scale(1.2); }
    100% { transform: translate(calc(-50% + var(--dx, 0px)), -170px) scale(1); opacity: 0; }
}

/* przycisk karteczek w pasku */
.lightbox-notes-btn { gap: 5px; font-size: 1rem; }
.lightbox-notes-btn span { font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.lightbox-notes-btn span:empty { display: none; }
.lightbox-notes-btn.has { color: var(--color-accent); }

/* panel karteczek w lightboxie */
.lightbox-notes { width: 400px; }
.lightbox.notes-open .lightbox-notes { transform: translateX(0); }
.notes-body { flex: 1; overflow-y: auto; padding: 22px 20px 8px; }
.notes-empty { text-align: center; color: var(--color-text-muted); padding: 30px 10px; font-family: var(--font-note); font-style: italic; font-size: 1.15rem; }

/* ---- kartka z księgi ---- */
.note {
    position: relative; padding: 26px 24px 22px; margin: 0 auto 22px; max-width: 340px; color: var(--ink);
    font-family: var(--font-note); font-style: italic; font-weight: 500; font-size: 1.22rem; line-height: 1.35;
    background:
        radial-gradient(circle at 20% 10%, rgba(255,255,255,0.7), transparent 55%),
        repeating-linear-gradient(0deg, rgba(0,0,0,0.012) 0 2px, transparent 2px 4px),
        linear-gradient(160deg, var(--paper), var(--paper-2));
    border: 1px solid var(--wine-soft);
    box-shadow: 0 14px 34px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.6) inset;
    transform: rotate(var(--tilt, -0.8deg)); transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s ease;
    border-radius: 3px; word-wrap: break-word;
}
.note::before { /* wewnętrzna ramka jak na zaproszeniu */
    content: ''; position: absolute; inset: 7px; border: 1px solid var(--wine-soft); border-radius: 2px; pointer-events: none;
}
.note::after { /* ornament w rogu */
    content: ''; position: absolute; top: 10px; left: 10px; width: 34px; height: 34px; pointer-events: none; opacity: 0.55;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke='%236e1f2e' stroke-width='1.2' stroke-linecap='round'><path d='M3 37c2-14 10-24 24-30'/><path d='M9 27c3-1 6 1 7 4-3 1-6-1-7-4z'/><path d='M15 18c3-1 6 1 7 4-3 1-6-1-7-4z'/><path d='M21 11c3-1 6 1 7 4-3 1-6-1-7-4z'/><path d='M5 31c-1 3 1 6 4 7 1-3-1-6-4-7z'/></svg>") no-repeat center / contain;
}
.note:hover { transform: rotate(0deg) translateY(-2px); box-shadow: 0 22px 44px rgba(0,0,0,0.55); z-index: 2; }
.note.p1, .note.p2, .note.p3, .note.p4, .note.p5 { --paper: #f5efe4; }
.note.p2 { --paper-2: #ede3d6; } .note.p3 { --paper-2: #e9e1d4; } .note.p4 { --paper-2: #eee4d3; } .note.p5 { --paper-2: #ebe0d5; }
.note-text { white-space: pre-wrap; position: relative; z-index: 1; }
.note-text::first-letter { font-size: 1.35em; font-weight: 600; color: var(--wine); }
.note-sign { margin-top: 14px; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; position: relative; z-index: 1; }
.note-sign > span { font-family: var(--font-script); font-style: normal; font-weight: 400; font-size: 1.65rem; line-height: 1; color: var(--wine); }
.note-sign > span .zrodlo, .voice-title .zrodlo { font-family: var(--font-body); font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; margin-left: 6px; vertical-align: middle; }
.note-sign small { font-family: var(--font-body); font-style: normal; font-size: 0.58rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(42,26,29,0.55); white-space: nowrap; }
.note-sign { padding-right: 46px; }
.note-del { position: absolute; top: 9px; right: 11px; z-index: 3; border: none; background: none; color: rgba(42,26,29,0.35); font-size: 16px; cursor: pointer; font-family: var(--font-body); line-height: 1; }
.note-del:hover { color: var(--wine); }
.note-photo { display: block; width: 100%; aspect-ratio: 3/2; object-fit: cover; margin: 0 0 14px; border: 6px solid #fbf8f2; box-shadow: 0 3px 10px rgba(0,0,0,0.25); cursor: pointer; position: relative; z-index: 1; }

/* lakowa pieczęć z inicjałami pary */
.seal {
    position: absolute; right: 12px; bottom: 12px; z-index: 2; width: 38px; height: 38px;
    border-radius: 48% 52% 50% 50% / 52% 48% 52% 48%;
    background: radial-gradient(circle at 35% 30%, #9a3446, var(--wine) 55%, var(--wine-deep) 100%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.35), inset 0 0 0 2px rgba(255,255,255,0.08), inset 0 2px 4px rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-script); font-style: normal; font-size: 0.95rem; color: var(--color-accent); transform: rotate(-8deg);
}

/* karta z nagraniem — bordowy aksamit */
.note--voice {
    --tilt: 0.6deg; color: #f3e9dc; font-family: var(--font-body); font-style: normal; font-weight: 400; font-size: 0.85rem;
    background:
        radial-gradient(circle at 25% 15%, rgba(255,255,255,0.12), transparent 50%),
        linear-gradient(160deg, #5a1a27, var(--wine-deep) 70%);
    border: 1px solid color-mix(in srgb, var(--color-accent) 40%, transparent);
    box-shadow: 0 14px 34px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
}
.note--voice::before { border-color: color-mix(in srgb, var(--color-accent) 30%, transparent); }
.note--voice::after { opacity: 0.35; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke='%23c9a962' stroke-width='1.2' stroke-linecap='round'><path d='M3 37c2-14 10-24 24-30'/><path d='M9 27c3-1 6 1 7 4-3 1-6-1-7-4z'/><path d='M15 18c3-1 6 1 7 4-3 1-6-1-7-4z'/><path d='M21 11c3-1 6 1 7 4-3 1-6-1-7-4z'/></svg>"); }
.note--voice .note-del { color: rgba(255,255,255,0.4); }
.note--voice .note-del:hover { color: #fff; }
.note--voice .note-photo { border-color: rgba(255,255,255,0.12); }
.note--voice .seal { background: radial-gradient(circle at 35% 30%, #e5cf93, var(--color-accent) 55%, #8a6d2f 100%); color: var(--wine-deep); }
.voice-row { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; padding-right: 40px; }
.voice-play {
    position: relative; width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer; flex-shrink: 0;
    background: radial-gradient(circle at 35% 30%, #e8d6a4, var(--color-accent) 60%); color: var(--wine-deep); font-size: 15px;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}
.voice-play.playing::after, .voice-play.playing::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 1.5px solid var(--color-accent); opacity: 0; animation: ring 1.4s ease-out infinite; }
.voice-play.playing::before { animation-delay: 0.7s; }
@keyframes ring { 0% { transform: scale(0.8); opacity: 0.8; } 100% { transform: scale(1.5); opacity: 0; } }
.voice-meta { flex: 1; min-width: 0; }
.voice-title { font-family: var(--font-script); font-size: 1.55rem; line-height: 1.05; color: var(--color-accent); }
.voice-bar { height: 3px; border-radius: 2px; background: rgba(255,255,255,0.14); margin: 8px 0 5px; overflow: hidden; }
.voice-bar i { display: block; height: 100%; width: 0; background: var(--color-accent); transition: width 0.25s linear; }
.voice-time { font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.55); font-variant-numeric: tabular-nums; }

/* ---- formularz: kartka do zapisania ---- */
.note-form { margin: 0 auto; max-width: 440px; }
.note-form--panel { padding: 10px 18px calc(16px + var(--safe-bottom)); border-top: 1px solid var(--color-border); background: rgba(14,14,14,0.6); }
.note-write {
    position: relative; padding: 24px 22px 16px; color: var(--ink); border-radius: 3px;
    background: radial-gradient(circle at 20% 10%, rgba(255,255,255,0.7), transparent 55%), linear-gradient(160deg, var(--paper), var(--paper-2));
    border: 1px solid var(--wine-soft); box-shadow: 0 14px 34px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.6) inset;
}
.note-write::before { content: ''; position: absolute; inset: 7px; border: 1px solid var(--wine-soft); pointer-events: none; }
.note-write textarea {
    position: relative; z-index: 1; width: 100%; min-height: 96px; border: none; background: transparent; resize: none; outline: none; color: var(--ink);
    font-family: var(--font-note); font-style: italic; font-weight: 500; font-size: 1.22rem; line-height: 1.7;
    background-image: repeating-linear-gradient(transparent, transparent calc(1.7em - 1px), var(--wine-soft) calc(1.7em - 1px), var(--wine-soft) 1.7em); background-attachment: local;
}
.note-write textarea::placeholder { color: rgba(42,26,29,0.42); }
.note-write-foot { position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 8px; }
.note-write-foot small { font-family: var(--font-body); font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.55; }
.sign-wrap { display: inline-flex; align-items: baseline; gap: 4px; min-width: 0; flex: 1; font-family: var(--font-script); font-size: 1.5rem; color: var(--wine); }
.note-sign-input {
    font-family: var(--font-script); font-size: 1.5rem; color: var(--wine); background: transparent; border: none; border-bottom: 1px dashed var(--wine-soft);
    outline: none; min-width: 0; width: 100%; max-width: 240px; padding: 0 2px; line-height: 1.1;
}
.note-sign-input:focus { border-bottom-color: var(--wine); background: rgba(255,255,255,0.35); }
.note-actions { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; flex-wrap: wrap; }
.note-actions .toolbar-btn { padding: 9px 14px; font-size: 0.78rem; }
.btn-rec { display: inline-flex; align-items: center; gap: 8px; }
.btn-rec .dot { width: 9px; height: 9px; border-radius: 50%; background: #d94356; }
.btn-rec.recording .dot { animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
.rec-box { margin-top: 10px; padding: 12px 14px; border-radius: 10px; background: rgba(255,255,255,0.05); border: 1px solid var(--color-border); font-size: 0.8rem; }
.rec-box .rec-time { font-variant-numeric: tabular-nums; color: var(--color-accent); font-weight: 600; }
.rec-wave { display: flex; align-items: center; gap: 3px; height: 26px; margin: 8px 0; }
.rec-wave i { width: 3px; border-radius: 2px; background: var(--color-accent); height: 30%; animation: wave 0.9s ease-in-out infinite; }
.rec-wave i:nth-child(2n) { animation-delay: 0.15s; } .rec-wave i:nth-child(3n) { animation-delay: 0.3s; } .rec-wave i:nth-child(5n) { animation-delay: 0.45s; }
@keyframes wave { 50% { height: 100%; } }
.rec-box audio { width: 100%; margin: 8px 0 4px; }

/* ---- widok Księga gości: pełna szerokość, dwie kolumny ---- */
.ksiega { padding: 28px 40px 60px; }
.ksiega[hidden] { display: none; }
.ksiega-intro { text-align: center; max-width: 620px; margin: 0 auto 34px; }
.ornament { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 10px; color: var(--color-accent); }
.ornament span { width: 70px; height: 1px; background: linear-gradient(90deg, transparent, var(--color-accent)); }
.ornament span:last-child { background: linear-gradient(90deg, var(--color-accent), transparent); }
.ornament i { font-style: normal; font-size: 1.1rem; }
.ksiega-intro h2 { font-family: var(--font-display); font-weight: 400; font-size: 2.1rem; letter-spacing: 0.01em; }
.ksiega-intro p { color: var(--color-text-muted); font-size: 0.88rem; margin-top: 8px; font-family: var(--font-note); font-style: italic; font-size: 1.1rem; }
.ksiega-grid { display: grid; grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); gap: 44px; align-items: start; }
.ksiega-side { position: sticky; top: 96px; min-width: 0; }
.ksiega-main { min-width: 0; }
.ksiega .note-form { max-width: 100%; }
.ksiega-wall { columns: 280px; column-gap: 24px; }
.ksiega-wall .note { break-inside: avoid; margin: 0 0 24px; max-width: none; display: inline-block; width: 100%; }
.ksiega-empty { text-align: center; color: var(--color-text-muted); padding: 60px 0; font-family: var(--font-note); font-style: italic; font-size: 1.4rem; }
.ksiega-nowe { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px; background: var(--color-heart); color: #fff; font-size: 0.6rem; font-weight: 600; }

/* ---- feed „Ostatnio” jako oś czasu ---- */
.feed { margin: 28px 0 0; }
.feed-title { font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--color-accent); margin-bottom: 10px; }
.feed-list { position: relative; display: flex; flex-direction: column; padding-left: 22px; }
.feed-list::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(180deg, var(--color-accent), transparent); }
.feed-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--color-border); font-size: 0.8rem; }
.feed-row::before { content: ''; position: absolute; left: -19px; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: var(--color-bg); border: 1px solid var(--color-accent); transform: translateY(-50%); }
.feed-row.moj::before { background: var(--color-accent); }
.feed-row:last-child { border-bottom: none; }
.feed-ico { width: 26px; text-align: center; font-size: 1.1rem; flex-shrink: 0; }
.feed-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-txt b { font-weight: 500; }
.feed-txt i { font-style: italic; color: var(--color-text-muted); font-family: var(--font-note); font-size: 0.95rem; }
.feed-emojis { font-size: 0.95rem; letter-spacing: 0.15em; }
.feed-when { font-size: 0.62rem; letter-spacing: 0.06em; color: var(--color-text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.feed-thumb { width: 40px; height: 28px; object-fit: cover; border-radius: 2px; flex-shrink: 0; cursor: pointer; border: 2px solid rgba(255,255,255,0.12); }

/* reakcje w panelu karteczek */
.react-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.react-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--color-border); font-size: 0.75rem; }
.react-chip.moj { border-color: var(--color-accent); }
.react-chip small { color: var(--color-text-muted); font-size: 0.65rem; }
.react-title { font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--color-accent); margin: 0 0 8px; }

/* odznaki na kafelkach */
.item-notes { position: absolute; right: 8px; bottom: 8px; z-index: 5; pointer-events: none; padding: 2px 8px; border-radius: 10px; font-size: 11px; color: #fff; background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); display: none; }
.gallery-item.has-notes .item-notes { display: block; }
.gallery-item.has-notes.has-likes .item-likes { bottom: 34px; }
.item-react { position: absolute; left: 8px; bottom: 8px; z-index: 6; pointer-events: auto; cursor: help; padding: 2px 8px; border-radius: 10px; font-size: 11px; color: #fff; background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); display: none; white-space: nowrap; transition: background 0.2s ease; }
.item-react:hover { background: rgba(0,0,0,0.8); }
.react-pop-sec { margin-top: 6px; }
.react-pop-sec:first-of-type { margin-top: 0; }
.react-pop-sec .react-pop-head { margin-bottom: 4px; }
.item-react b { font-weight: 500; opacity: 0.85; margin-right: 5px; }
.item-react b:last-child { margin-right: 0; }
.gallery-item.has-react .item-react { display: block; }
.gallery-item.has-react.has-stars .item-stars { bottom: 34px; }

@media (max-width: 1180px) {
    .ksiega-grid { grid-template-columns: minmax(0, 1fr); gap: 34px; }
    .ksiega-side { position: static; max-width: 520px; margin: 0 auto; width: 100%; }
    .ksiega-wall { columns: 260px; }
}
@media (max-width: 768px) {
    .lightbox-notes { width: 100vw; max-width: 100vw; }
    .lightbox-reactions { bottom: calc(40px + var(--safe-bottom)); gap: 2px; }
    .reaction { padding: 6px 7px; font-size: 1rem; }
    .ksiega { padding: 16px 14px 40px; }
    .ksiega-wall { columns: 1; }
    .ksiega-intro h2 { font-size: 1.7rem; }
}

/* v3.4: „kto i kiedy” po najechaniu na emotkę (na telefonie: przytrzymanie) */
.react-pop {
    position: fixed; z-index: 12500; min-width: 190px; max-width: 280px; padding: 12px 14px 10px; color: var(--ink);
    background: radial-gradient(circle at 20% 10%, rgba(255,255,255,0.7), transparent 55%), linear-gradient(160deg, var(--paper), var(--paper-2));
    border: 1px solid var(--wine-soft); border-radius: 3px; box-shadow: 0 16px 36px rgba(0,0,0,0.55);
    transform: translate(-50%, -100%) translateY(-14px); animation: pop-in 0.22s var(--ease-out-expo); pointer-events: none;
}
.react-pop::before { content: ''; position: absolute; inset: 5px; border: 1px solid var(--wine-soft); pointer-events: none; }
.react-pop::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; background: var(--paper-2); border-right: 1px solid var(--wine-soft); border-bottom: 1px solid var(--wine-soft); transform: translateX(-50%) rotate(45deg); }
@keyframes pop-in { from { opacity: 0; transform: translate(-50%, -100%) translateY(-6px); } to { opacity: 1; transform: translate(-50%, -100%) translateY(-14px); } }
.react-pop-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--wine-soft); }
.react-pop-head b { font-family: var(--font-body); font-size: 0.58rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--wine); font-weight: 600; }
.react-pop-head span { font-size: 1.1rem; }
.react-pop-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.react-pop-row + .react-pop-row { border-top: 1px solid rgba(110,31,46,0.1); }
.react-pop-e { font-size: 1.05rem; width: 22px; text-align: center; flex-shrink: 0; }
.react-pop-row i { flex: 1; }
.react-pop-row small { margin-left: auto; }
.react-pop-row i { font-family: var(--font-script); font-style: normal; font-size: 1.25rem; line-height: 1; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.react-pop-row.moj i { color: var(--wine); }
.react-pop-row small { font-family: var(--font-body); font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(42,26,29,0.55); white-space: nowrap; }
.react-pop-more { font-family: var(--font-note); font-style: italic; font-size: 0.85rem; color: rgba(42,26,29,0.6); padding-top: 4px; }
.reaction.hold { transform: scale(1.12); background: rgba(255,255,255,0.16); }

.react-pop.below { transform: translate(-50%, 0) translateY(14px); animation-name: pop-in-below; }
.react-pop.below::after { bottom: auto; top: -7px; transform: translateX(-50%) rotate(-135deg); }
@keyframes pop-in-below { from { opacity: 0; transform: translate(-50%, 0) translateY(6px); } to { opacity: 1; transform: translate(-50%, 0) translateY(14px); } }

/* karteczka jako ostatnia „emotka” w pasku reakcji */
.reaction-sep { width: 1px; height: 22px; background: rgba(255,255,255,0.14); margin: 0 3px; align-self: center; }
.reaction--notes { color: rgba(255,255,255,0.85); font-size: 1rem; }
.reaction--notes.has { color: var(--color-accent); }
.reaction--notes.has .n { color: var(--color-accent); }

/* fotograf: wycinanie zdjęć z galerii */
.item-cut {
    position: absolute; top: 8px; right: 88px; z-index: 5;
    width: 34px; height: 34px; border: none; border-radius: 50%; cursor: pointer;
    background: rgba(0,0,0,0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    color: rgba(255,255,255,0.85); font-size: 16px; display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s ease, transform 0.15s ease, background 0.2s ease;
}
.gallery-item:hover .item-cut, .gallery-item:focus-within .item-cut { opacity: 1; }
.item-cut:hover { transform: scale(1.12); background: rgba(160,30,40,0.75); }
.gallery-item.odrzucone .item-cut { opacity: 1; background: rgba(160,30,40,0.85); color: #fff; }
.gallery-item.odrzucone img { filter: brightness(0.3) saturate(0.2) !important; }
.gallery-item.odrzucone::before { display: none; }
.gallery-item.odrzucone::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: 6px; box-shadow: inset 0 0 0 2px rgba(200,40,60,0.8); }
.item-badge-cut {
    position: absolute; left: 8px; top: 8px; z-index: 5; pointer-events: none; display: none;
    padding: 3px 9px; border-radius: 10px; font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
    background: rgba(160,30,40,0.85); border: 1px solid rgba(255,255,255,0.15); color: #fff;
}
.gallery-item.odrzucone .item-badge-cut { display: block; }
.gallery-item.odrzucone .item-badge-hidden { top: 34px; }
.lightbox-cut { font-size: 17px; }
.lightbox-cut.active { color: #fff; background: rgba(160,30,40,0.7); box-shadow: inset 0 0 0 1px rgba(255,120,130,0.5); }
.lightbox-caption .cut-tag { color: #ff9aa5; }

/* ---- karteczki na zdjęciu (nad paskiem emotek), zmieniają się jak slajdy ---- */
.note-slides {
    position: absolute; left: 50%; bottom: calc(100px + var(--safe-bottom)); transform: translateX(-50%); z-index: 10;
    width: min(420px, calc(100vw - 32px)); pointer-events: none;
}
.note-slides[hidden] { display: none; }
.lightbox.notes-open .note-slides, .lightbox.info-open .note-slides, .lightbox-stage.zoomed ~ .note-slides { display: none; }
.note-slide {
    position: relative; pointer-events: auto; cursor: pointer; color: var(--ink);
    padding: 14px 44px 12px 18px; border-radius: 3px;
    background: radial-gradient(circle at 20% 10%, rgba(255,255,255,0.7), transparent 55%), linear-gradient(160deg, var(--paper), var(--paper-2));
    border: 1px solid var(--wine-soft); box-shadow: 0 14px 34px rgba(0,0,0,0.55);
    transform: rotate(-0.6deg); animation: slide-in 0.45s var(--ease-out-expo);
}
.note-slide.out { animation: slide-out 0.3s ease forwards; }
@keyframes slide-in { from { opacity: 0; transform: rotate(-0.6deg) translateY(10px); } to { opacity: 1; transform: rotate(-0.6deg) translateY(0); } }
@keyframes slide-out { to { opacity: 0; transform: rotate(-0.6deg) translateY(-8px); } }
.note-slide::before { content: ''; position: absolute; inset: 5px; border: 1px solid var(--wine-soft); pointer-events: none; }
.note-slide-text { font-family: var(--font-note); font-style: italic; font-weight: 500; font-size: 1.05rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note-slide-text::first-letter { font-size: 1.3em; font-weight: 600; color: var(--wine); }
.note-slide-sign { margin-top: 6px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.note-slide-sign b { font-family: var(--font-script); font-weight: 400; font-size: 1.3rem; line-height: 1; color: var(--wine); }
.note-slide-sign small { font-family: var(--font-body); font-size: 0.56rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(42,26,29,0.55); white-space: nowrap; }
.note-slide-close { position: absolute; top: 6px; right: 8px; border: none; background: none; color: rgba(42,26,29,0.4); font-size: 15px; cursor: pointer; line-height: 1; font-family: var(--font-body); }
.note-slide-close:hover { color: var(--wine); }
.note-slide-voice { display: flex; align-items: center; gap: 10px; }
.note-slide-voice .voice-play { width: 36px; height: 36px; font-size: 12px; }
.note-slide-voice .voice-title { font-size: 1.25rem; color: var(--wine); }
.note-slide.voice { background: radial-gradient(circle at 25% 15%, rgba(255,255,255,0.12), transparent 50%), linear-gradient(160deg, #5a1a27, var(--wine-deep) 70%); color: #f3e9dc; border-color: color-mix(in srgb, var(--color-accent) 40%, transparent); }
.note-slide.voice::before { border-color: color-mix(in srgb, var(--color-accent) 30%, transparent); }
.note-slide.voice .note-slide-close { color: rgba(255,255,255,0.45); }
.note-slide.voice .note-slide-sign small { color: rgba(255,255,255,0.5); }
.note-slide.voice .voice-title { color: var(--color-accent); }
.note-slide-dots { position: absolute; left: 18px; bottom: -14px; display: flex; gap: 4px; }
.note-slide-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.35); }
.note-slide-dots i.on { background: var(--color-accent); }
.notes-onphoto { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; margin-right: 8px; font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-muted); cursor: pointer; }
.notes-onphoto input { accent-color: var(--color-accent); }
@media (max-width: 768px) { .note-slides { bottom: calc(92px + var(--safe-bottom)); } .note-slide-text { -webkit-line-clamp: 2; font-size: 1rem; } }

/* przełącznik pary: goście mogą pobierać */
.goscie-switch { display: flex; align-items: center; gap: 10px; margin: -4px 0 14px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,0.03); border: 1px solid var(--color-border); font-size: 0.82rem; cursor: pointer; user-select: none; }
.goscie-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.goscie-switch .sw { width: 38px; height: 22px; border-radius: 11px; background: rgba(255,255,255,0.15); position: relative; flex-shrink: 0; transition: background 0.2s ease; }
.goscie-switch .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--ease-out-expo); }
.goscie-switch input:checked + .sw { background: var(--color-accent); }
.goscie-switch input:checked + .sw::after { transform: translateX(16px); }
.goscie-switch b { color: var(--color-text); }

/* gość bez prawa pobierania: utrudnienia (prawy przycisk, przeciąganie, „zapisz” po przytrzymaniu na iOS) */
body.bez-pobierania img { -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; user-select: none; }
body.bez-pobierania .lightbox-stage, body.bez-pobierania .gallery-item, body.bez-pobierania .hero { -webkit-touch-callout: none; user-select: none; }

/* ========================================
   UKŁAD v2 „KOLAŻ”: kafelki różnej wielkości (2×1, 1×2, 2×2) w gęstej siatce + delikatny ruch
   ======================================== */
.tools-check { accent-color: var(--color-accent); width: 18px; height: 18px; }
.gallery-grid.kolaz {
    grid-template-columns: repeat(auto-fill, minmax(calc(var(--tile) * 0.62), 1fr));
    grid-auto-rows: calc(var(--tile) * 0.5);
    grid-auto-flow: dense;
    gap: 8px;
}
.gallery-grid.kolaz .gallery-item { aspect-ratio: auto; min-height: 0; }
.gallery-grid.kolaz .gallery-item.s-w { grid-column: span 2; }
.gallery-grid.kolaz .gallery-item.s-h { grid-row: span 2; }
.gallery-grid.kolaz .gallery-item.s-xl { grid-column: span 2; grid-row: span 2; }
.gallery-grid.kolaz .gallery-item.s-xl img { filter: brightness(0.95) saturate(1); }
.gallery-grid.kolaz .gallery-item img { object-position: 50% 30%; }
/* ruch: powolny zoom + dryf, tylko kafelki w kadrze, każdy w innej fazie (ujemne opóźnienie) */
@keyframes kb {
    0%   { transform: scale(1.02) translate(0, 0); }
    100% { transform: scale(1.12) translate(var(--kb-x, 2.5%), var(--kb-y, -2.5%)); }
}
body.ruch .gallery-grid.kolaz .gallery-item.in-view img { animation: kb 11s ease-in-out infinite alternate; animation-delay: var(--kb-d, 0s); will-change: transform; }
body.ruch .gallery-grid.kolaz .gallery-item:hover img { animation-play-state: paused; transform: scale(1.06); }
@media (prefers-reduced-motion: reduce) { body.ruch .gallery-grid.kolaz .gallery-item.in-view img { animation: none; } }
@media (max-width: 768px) {
    .gallery-grid.kolaz { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 30vw; gap: 5px; }
    .gallery-grid.kolaz .gallery-item.s-xl { grid-column: span 2; grid-row: span 2; }
}
