@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Plus+Jakarta+Sans:wght@200;300;400;500;600&family=Cinzel:wght@400;600;700&display=swap');

:root {
    --primary-pink: #ff80bf;
    --primary-purple: #a680ff;
    --gold-accent: #ffd700;
    --gold-glow: rgba(255, 215, 0, 0.45);
    --pink-glow: rgba(255, 128, 191, 0.4);
    --glass-bg: rgba(12, 8, 22, 0.78);
    --glass-card-bg: rgba(18, 11, 30, 0.82);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-border-gold: rgba(255, 215, 0, 0.35);
    --font-heading: 'Cormorant Garamond', 'Cinzel', serif;
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
    -webkit-tap-highlight-color: transparent;
}

body {
    overflow: hidden;
    background-color: #030206;
    color: #f5f2fc;
    width: 100vw;
    height: 100dvh;
    position: fixed;
    top: 0;
    left: 0;
    user-select: none;
    -webkit-user-select: none;
}

#webgl-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 1;
}

audio { display: none; }

/* ======================================================
   EKRAN POWITALNY (INTRO)
   ====================================================== */
#intro {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(ellipse at center, #1b0d30 0%, #0a0514 60%, #020105 100%);
    z-index: 100;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 1.2s;
    text-align: center;
    padding: 30px;
}

#intro::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 128, 191, 0.16) 0%, rgba(166, 128, 255, 0.08) 45%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: nebulaPulse 10s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes nebulaPulse {
    0% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.4; }
    100% { transform: translate(-50%, -50%) scale(1.25); opacity: 0.85; }
}

.intro-title {
    font-family: var(--font-heading);
    font-size: 3.6rem;
    font-weight: 300;
    letter-spacing: 6px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #ffe0ef 35%, var(--primary-pink) 70%, var(--primary-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 25px rgba(255, 128, 191, 0.4));
    z-index: 2;
}

.intro-subtitle {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: #d8cfea;
    margin-bottom: 45px;
    font-style: italic;
    letter-spacing: 1.5px;
    font-weight: 300;
    z-index: 2;
    max-width: 580px;
    line-height: 1.7;
}

.btn-wrapper {
    position: relative;
    z-index: 2;
    display: inline-block;
}

.btn-glow-ring {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    background: linear-gradient(45deg, var(--primary-pink), var(--primary-purple), var(--gold-accent));
    border-radius: 40px;
    filter: blur(14px);
    opacity: 0.55;
    transition: opacity 0.4s ease;
    animation: rotateGlow 5s linear infinite;
}

@keyframes rotateGlow {
    0% { filter: blur(14px) hue-rotate(0deg); }
    100% { filter: blur(14px) hue-rotate(360deg); }
}

#start-btn {
    position: relative;
    padding: 16px 44px;
    font-size: 0.85rem;
    color: #fff;
    background: rgba(15, 8, 26, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 35px;
    cursor: pointer;
    backdrop-filter: blur(20px);
    transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 500;
}

#start-btn:hover {
    transform: scale(1.04);
    border-color: var(--gold-accent);
    box-shadow: 0 0 30px var(--gold-glow);
}

/* ======================================================
   KONTROLKI TOP
   ====================================================== */
.top-controls {
    position: absolute;
    top: 20px;
    right: 22px;
    z-index: 30;
    display: flex;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.icon-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 9px 18px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.icon-btn:hover {
    border-color: var(--primary-pink);
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 128, 191, 0.25);
}

.icon-btn.gold-btn {
    border-color: var(--glass-border-gold);
    color: var(--gold-accent);
}

.icon-btn.gold-btn:hover {
    background: rgba(255, 215, 0, 0.15);
    border-color: var(--gold-accent);
    box-shadow: 0 0 20px var(--gold-glow);
}

.icon-btn.heart-btn {
    border-color: rgba(255, 128, 191, 0.45);
    color: var(--primary-pink);
    animation: heartPulse 3s ease-in-out infinite;
}

.icon-btn.heart-btn:hover {
    background: rgba(255, 128, 191, 0.2);
    border-color: var(--primary-pink);
    box-shadow: 0 0 20px var(--pink-glow);
}

.icon-btn.heart-btn.active {
    background: linear-gradient(135deg, rgba(255, 128, 191, 0.45), rgba(255, 215, 0, 0.35));
    border-color: var(--gold-accent);
    color: #fff;
    box-shadow: 0 0 25px var(--gold-glow);
}

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

.icon-btn.tour-btn {
    border-color: rgba(166, 128, 255, 0.45);
    color: var(--primary-purple);
}

.icon-btn.tour-btn:hover {
    background: rgba(166, 128, 255, 0.2);
    border-color: var(--primary-purple);
    box-shadow: 0 0 20px rgba(166, 128, 255, 0.4);
}

.icon-btn.tour-btn.active {
    background: linear-gradient(135deg, rgba(166, 128, 255, 0.45), rgba(255, 128, 191, 0.4));
    border-color: #fff;
    color: #fff;
    box-shadow: 0 0 25px rgba(166, 128, 255, 0.6);
    animation: tourPulse 2s ease-in-out infinite alternate;
}

@keyframes tourPulse {
    0% { box-shadow: 0 0 15px rgba(166, 128, 255, 0.4); }
    100% { box-shadow: 0 0 30px rgba(255, 128, 191, 0.8); }
}

/* ======================================================
   WIDGET TIMERÓW (ELEGANCKI I CZYTELNY)
   ====================================================== */
#timer-widget {
    position: absolute;
    top: 20px;
    left: 22px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.timer-row {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 7px 14px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 3px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.timer-row:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.3);
}

.timer-row-title {
    font-size: 0.6rem;
    color: #c4b9db;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 500;
}

.timer-values {
    display: flex;
    gap: 12px;
}

.timer-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer-val {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--primary-purple);
    line-height: 1.1;
}

.timer-row:first-child .timer-val { color: var(--primary-pink); }
.timer-row.gold-row .timer-val { color: var(--gold-accent); }
.timer-row.gold-row { border-color: var(--glass-border-gold); }
.timer-row.xmas-row .timer-val { color: #50e3c2; }
.timer-row.xmas-row { border-color: rgba(80, 227, 194, 0.35); }
.timer-row.xmas-row:hover { border-color: #50e3c2; box-shadow: 0 0 15px rgba(80, 227, 194, 0.3); }

.timer-label {
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #9c91b3;
    font-weight: 500;
}

/* ======================================================
   PASEK NAWIGACJI
   ====================================================== */
#timeline-nav {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    padding: 8px 20px;
    border-radius: 36px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65);
    opacity: 0;
    transition: opacity 0.8s ease;
    width: max-content;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.75rem;
    letter-spacing: 1px;
    font-weight: 500;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-btn:hover {
    background: rgba(255, 128, 191, 0.2);
    border-color: var(--primary-pink);
    color: #fff;
    box-shadow: 0 0 15px var(--pink-glow);
}

#nav-counter {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: #e4dcf4;
    letter-spacing: 2px;
    min-width: 65px;
    text-align: center;
}

/* ======================================================
   KARTA WSPOMNIENIA (LUKSUSOWY GLASSMORPHISM)
   ====================================================== */
#info-panel {
    position: absolute;
    top: 50%;
    right: -550px;
    transform: translateY(-50%);
    width: 440px;
    padding: 30px;
    border-radius: 26px;
    z-index: 35;
    background: var(--glass-card-bg);
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(166, 128, 255, 0.08);
    transition: right 0.65s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.65s ease;
    opacity: 0;
    display: flex;
    flex-direction: column;
    max-height: 82vh;
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: auto;
    touch-action: pan-y;
}

#info-panel.active {
    right: 30px;
    opacity: 1;
}

#info-panel::-webkit-scrollbar { width: 4px; }
#info-panel::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 4px; }

.close-btn {
    position: absolute;
    top: 18px;
    right: 20px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0.8;
    transition: all 0.25s ease;
    z-index: 10;
}

.close-btn:hover {
    color: var(--primary-pink);
    border-color: var(--primary-pink);
    opacity: 1;
    transform: rotate(90deg);
}

/* ======================================================
   KARUZELA ZDJĘĆ
   ====================================================== */
#info-image-container {
    width: 100%;
    display: none;
    margin-bottom: 18px;
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
    background: #080410;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65);
    height: 320px;
}

#info-image-blur-bg {
    position: absolute;
    top: -25px;
    left: -25px;
    right: -25px;
    bottom: -25px;
    background-size: cover;
    background-position: center;
    filter: blur(28px) brightness(0.45);
    transform: scale(1.15);
    z-index: 1;
    opacity: 0.9;
    transition: background-image 0.4s ease;
}

#info-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 2;
    cursor: zoom-in;
    transition: transform 0.35s ease;
    padding: 6px;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,0.6));
}

#info-image:hover {
    transform: scale(1.02);
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(10, 6, 18, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.carousel-arrow:hover {
    background: var(--primary-pink);
    border-color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.carousel-arrow.prev { left: 10px; }
.carousel-arrow.next { right: 10px; }

#carousel-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.68rem;
    letter-spacing: 1px;
    font-weight: 600;
    z-index: 5;
}

#info-date {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--primary-pink);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 6px;
    font-weight: 600;
    flex-shrink: 0;
}

#info-title {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 400;
    margin-bottom: 6px;
    line-height: 1.25;
    flex-shrink: 0;
}

#info-subtitle {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: #c4bcd6;
    margin-bottom: 14px;
    font-style: italic;
    flex-shrink: 0;
}

#info-desc {
    font-size: 0.92rem;
    line-height: 1.7;
    color: #e5def0;
    font-weight: 300;
    white-space: pre-line;
    padding-bottom: 10px;
}

#letter-btn-container {
    display: none;
    margin-top: 10px;
    width: 100%;
    flex-shrink: 0;
}

.letter-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 0.82rem;
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.35) 0%, rgba(255, 128, 191, 0.35) 100%);
    border: 1px solid var(--gold-accent);
    border-radius: 30px;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
    text-align: center;
}

.letter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px var(--gold-glow);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.5) 0%, rgba(255, 128, 191, 0.5) 100%);
}

/* ======================================================
   MODALE (FULLSCREEN IMAGE, LIST, SKARBIEC)
   ====================================================== */
#image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

#fullscreen-image {
    max-width: 95vw;
    max-height: 88dvh;
    border-radius: 14px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
    object-fit: contain;
    transform: scale(0.92);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#image-modal.active { display: flex; opacity: 1; }
#image-modal.active #fullscreen-image { transform: scale(1); }

/* LIST */
#letter-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: rgba(4, 2, 8, 0.92);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 20px;
}

#letter-modal.active { opacity: 1; pointer-events: auto; }

.letter-content {
    background: rgba(22, 14, 34, 0.92);
    border: 1px solid var(--glass-border-gold);
    border-radius: 28px;
    padding: 35px;
    max-width: 640px;
    width: 100%;
    max-height: 82dvh;
    overflow-y: auto;
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.22);
    position: relative;
    touch-action: pan-y;
}

.letter-content::-webkit-scrollbar { width: 4px; }
.letter-content::-webkit-scrollbar-thumb { background: rgba(255, 215, 0, 0.4); border-radius: 2px; }

.letter-header {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 400;
    color: var(--gold-accent);
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 2px;
}

.letter-body {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    line-height: 1.8;
    color: #f3ecfb;
    font-weight: 300;
    white-space: pre-line;
}

.letter-signature {
    margin-top: 25px;
    text-align: right;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.3rem;
    color: var(--primary-pink);
}

.close-modal-btn {
    position: absolute;
    top: 18px;
    right: 20px;
    cursor: pointer;
    font-size: 1.4rem;
    color: #bbb;
    z-index: 10;
    transition: color 0.25s ease;
}

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

/* MODAL PIN */
#vault-pin-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: rgba(3, 2, 7, 0.92);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 150;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    padding: 20px;
}

#vault-pin-modal.active { opacity: 1; pointer-events: auto; }

.pin-card {
    background: var(--glass-card-bg);
    border: 1px solid var(--glass-border-gold);
    border-radius: 30px;
    padding: 35px 28px;
    width: 100%;
    max-width: 370px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 40px rgba(255, 215, 0, 0.15);
    position: relative;
}

.pin-title {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    color: var(--gold-accent);
    font-weight: 400;
    letter-spacing: 3px;
    margin-bottom: 6px;
}

.pin-subtitle {
    font-size: 0.8rem;
    color: #beb4d2;
    margin-bottom: 22px;
}

.pin-display {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 215, 0, 0.35);
    border-radius: 16px;
    padding: 12px;
    font-size: 1.5rem;
    letter-spacing: 8px;
    color: #fff;
    margin-bottom: 22px;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-display.error {
    border-color: #ff4d4d;
    color: #ff4d4d;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.pin-key {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    padding: 14px 0;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 400;
}

.pin-key:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--gold-accent);
    color: var(--gold-accent);
    transform: scale(1.05);
}

.pin-key.clear-key { font-size: 0.9rem; color: #ff80bf; font-family: var(--font-body); }
.pin-key.enter-key { font-size: 1.1rem; color: var(--gold-accent); font-family: var(--font-body); }

/* SKARBIEC FULLSCREEN */
#vault-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: radial-gradient(circle at 50% 30%, #1e0930 0%, #0a0414 60%, #020106 100%);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#vault-modal.active { opacity: 1; pointer-events: auto; }

#falling-photos-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.polaroid-card {
    position: absolute;
    width: 145px;
    background: #fff;
    padding: 8px 8px 24px 8px;
    border-radius: 4px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65), 0 0 20px rgba(255, 215, 0, 0.2);
    pointer-events: auto;
    cursor: pointer;
    transform-origin: center;
    animation: fallAnim 9s linear forwards;
    perspective: 800px;
    transform-style: preserve-3d;
    transition: box-shadow 0.25s ease, z-index 0.25s ease;
    overflow: hidden;
}

.polaroid-glare {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: linear-gradient(125deg, rgba(255, 255, 255, 0.45) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 4px;
    z-index: 10;
}

.polaroid-card img {
    width: 100%;
    height: 115px;
    object-fit: cover;
    border-radius: 2px;
}

.polaroid-caption {
    font-size: 0.6rem;
    color: #2a2438;
    text-align: center;
    margin-top: 8px;
    font-weight: 600;
    font-family: var(--font-heading);
}

@keyframes fallAnim {
    0% { transform: translateY(-170px) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(105dvh) rotate(25deg); opacity: 0; }
}

.vault-content-panel {
    position: relative;
    z-index: 10;
    margin-top: auto;
    margin-bottom: auto;
    background: rgba(18, 10, 30, 0.9);
    border: 1px solid var(--glass-border-gold);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 30px;
    padding: 36px;
    max-width: 600px;
    width: 90vw;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 50px rgba(255, 215, 0, 0.25);
    text-align: center;
    max-height: 82dvh;
    overflow-y: auto;
    touch-action: pan-y;
}

.vault-header {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 400;
    color: var(--gold-accent);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.vault-subheader {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: #d6cced;
    margin-bottom: 24px;
    font-style: italic;
}

.vault-body {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    line-height: 1.8;
    color: #f3ecfb;
    font-weight: 300;
    text-align: left;
    white-space: pre-line;
}

/* ======================================================
   RESPONSYWNOŚĆ (MOBILE - BOTTOM SHEET UX)
   ====================================================== */
@media (max-width: 768px) {
    .intro-title { font-size: 2.3rem; letter-spacing: 3px; }
    .intro-subtitle { font-size: 1rem; padding: 0 10px; }
    
    /* GÓRNY PASEK PRZYCISKÓW: Płynny przewijany pasek u samej góry */
    .top-controls {
        top: calc(env(safe-area-inset-top, 0px) + 8px);
        left: 8px;
        right: 8px;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        gap: 6px;
        padding-bottom: 2px;
        z-index: 45;
        opacity: 0;
    }
    .top-controls::-webkit-scrollbar { display: none; }
    
    .icon-btn {
        flex-shrink: 0;
        padding: 6px 12px;
        font-size: 0.65rem;
        border-radius: 20px;
    }

    /* SIATKA TIMERÓW 2x2 ZNAJDUJE SIĘ DOKŁADNIE POD PRZYCISKAMI */
    #timer-widget {
        top: calc(env(safe-area-inset-top, 0px) + 48px);
        left: 8px;
        right: 8px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px;
        z-index: 30;
    }
    
    .timer-row {
        padding: 4px 6px;
        border-radius: 8px;
        align-items: center;
        gap: 1px;
    }
    
    .timer-row-title { font-size: 0.48rem; letter-spacing: 0.3px; }
    .timer-val { font-size: 0.82rem; }
    .timer-label { font-size: 0.36rem; }

    /* DOLNA NAWIGACJA: ZAWSZE WIDOCZNA I DOSTĘPNA NA SAMYM DOLE */
    #timeline-nav {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
        left: 3vw;
        right: 3vw;
        width: 94vw;
        transform: none;
        justify-content: space-between;
        padding: 7px 14px;
        z-index: 50;
        opacity: 0;
        pointer-events: auto;
    }
    
    .nav-btn { padding: 7px 14px; font-size: 0.72rem; }
    #nav-counter { font-size: 0.82rem; min-width: 45px; }

    /* KARTA WSPOMNIENIA: Pływa nad paskiem dolnym, nie zasłaniając go */
    #info-panel {
        width: 94vw;
        left: 3vw;
        right: 3vw;
        bottom: -100%;
        top: auto;
        transform: none;
        max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 180px);
        padding: 16px 16px;
        border-radius: 22px;
        border: 1px solid var(--glass-border);
        box-shadow: 0 12px 35px rgba(0,0,0,0.85);
        transition: bottom 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
        z-index: 40;
    }
    
    #info-panel.active {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 62px);
        opacity: 1;
    }

    #info-image-container { height: 210px; margin-bottom: 10px; }
    #info-title { font-size: 1.35rem; }
    #info-subtitle { font-size: 0.85rem; margin-bottom: 8px; }
    #info-desc { font-size: 0.84rem; line-height: 1.5; }

    .polaroid-card { width: 115px; padding: 6px 6px 18px 6px; }
    .polaroid-card img { height: 90px; }
    .vault-content-panel { padding: 22px; }
    .vault-header { font-size: 1.5rem; }
    .vault-body { font-size: 0.95rem; }
}
