/* ========================================
   IMPORT ELEGANCKICH CZCIONEK
   ======================================== */

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

/* ========================================
   PALETA — BIEL I BŁĘKIT
   (chcesz inny odcień? zmień tylko te 8 wartości)
   ======================================== */

:root {
    --tlo:            #f4f8fc;   /* chłodna biel — tło strony */
    --tlo-ciemne:     #e6eef7;   /* drugi kolor gradientu */
    --granat:         #1f3a5f;   /* nagłówki, tekst */
    --blekit:         #5b8ac4;   /* główny akcent */
    --blekit-jasny:   #a9c8e8;   /* delikatne obramowania */
    --blekit-mocny:   #3d6ba8;   /* hover, przyciski */
    --srebro:         #c3ced9;   /* cienkie linie */
    --biel:           #ffffff;
}

/* ========================================
   PODSTAWOWE STYLE
   ======================================== */

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

html {
    /* iOS (Safari, ale zwłaszcza WebView w Messengerze i Facebooku) samo
       powiększa tekst w wąskich kolumnach. Przez to przyciski na kartach
       puchły i licznik robił się szerszy, niż wynika z CSS. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--tlo);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 1s ease;
    color: var(--granat);
}

body.envelope-opened {
    background: linear-gradient(160deg, var(--biel) 0%, var(--tlo) 45%, var(--tlo-ciemne) 100%);
    background-attachment: fixed;
}

/* ========================================
   EKRAN Z KOPERTĄ
   ======================================== */

.envelope-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(160deg, var(--biel) 0%, var(--tlo) 50%, var(--tlo-ciemne) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.8s ease;
    padding: 1rem;
}

.envelope-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Promienie „witrażowego" światła padające z góry — czysty CSS */
.light-rays {
    position: absolute;
    top: -20%;
    left: 50%;
    width: 160%;
    height: 130%;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0.55;
    background:
        linear-gradient(178deg, rgba(169, 200, 232, 0.55) 0%, transparent 55%),
        repeating-conic-gradient(from 200deg at 50% -10%,
            rgba(255, 255, 255, 0.85) 0deg 3deg,
            transparent 3deg 11deg);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 75%);
    mask-image: linear-gradient(to bottom, #000 0%, transparent 75%);
    animation: rays-drift 14s ease-in-out infinite alternate;
}

@keyframes rays-drift {
    from { transform: translateX(-50%) rotate(-1.2deg); opacity: 0.4; }
    to   { transform: translateX(-50%) rotate(1.2deg);  opacity: 0.65; }
}

.envelope-intro {
    position: relative;
    z-index: 1;
    text-align: center;
}

.communion-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 4rem;
    color: var(--granat);
    margin-bottom: 0.3rem;
    font-style: italic;
    font-weight: 500;
    letter-spacing: 3px;
    text-shadow: 0 4px 24px rgba(91, 138, 196, 0.25);
}

.communion-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    color: var(--blekit-mocny);
    margin-bottom: 0.8rem;
    font-weight: 400;
    letter-spacing: 2px;
}

.communion-date {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.05rem;
    color: var(--blekit-mocny);
    margin-bottom: 3.5rem;
    letter-spacing: 4px;
    font-weight: 300;
    opacity: 0.85;
}

/* ========================================
   KOPERTA
   ======================================== */

.envelope-wrapper {
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.envelope-wrapper:hover {
    transform: scale(1.05);
}

.envelope-image {
    position: relative;
    width: 440px;
    max-width: 88vw;
    height: auto;
    transition: all 0.4s ease;
}

.envelope-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: all 0.6s ease;

    /* TYMCZASOWE — do czasu wgrania koperty z przezroczystym tłem.
       Obecny plik to zdjęcie na kremowym tle, którego NIE DA SIĘ wyciąć
       automatycznie: tło (235-243) i sama koperta (232-237) mają praktycznie
       ten sam kolor, więc każdy algorytm albo zostawia tło, albo zjada kopertę.
       Miękka maska rozpuszcza brzegi kadru, żeby zamiast twardego prostokąta
       została łagodna poświata.

       Po wgraniu wersji z alfą: skasuj te trzy linie i odkomentuj filter niżej. */
    -webkit-mask-image: radial-gradient(ellipse 52% 52% at 50% 50%, #000 72%, transparent 100%);
    mask-image: radial-gradient(ellipse 52% 52% at 50% 50%, #000 72%, transparent 100%);
    mask-repeat: no-repeat;

    /* filter: drop-shadow(0 18px 30px rgba(31, 58, 95, 0.22)); */
}

.envelope-wrapper.clicked .envelope-image {
    transform: scale(1.1);
    opacity: 0;
}

.tap-text {
    position: relative;
    z-index: 1;
    margin-top: 3rem;
    color: var(--blekit-mocny);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 2px;
    animation: pulse 2s infinite;
    text-align: center;
}

@keyframes pulse {
    0%, 100% { opacity: 0.45; }
    50%      { opacity: 1; }
}

/* ========================================
   GŁÓWNA ZAWARTOŚĆ
   ======================================== */

.main-content {
    visibility: hidden;
    padding: 3rem 2rem 4rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    overflow: visible;
}

.main-content.visible {
    visibility: visible;
}

/* ========================================
   PIĘTRO Z KARTAMI
   ======================================== */

.card-tier {
    position: relative;
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.card-tier:first-child {
    margin-top: 0;
    margin-bottom: 2rem;
}

.main-content.visible .card-tier {
    opacity: 1;
    transform: translateY(0);
}

.card-tier:nth-child(1) { transition-delay: 0s; }
.card-tier:nth-child(2) { transition-delay: 0.4s; }

/* ========================================
   DEKORACJE PRZY KARTACH
   ======================================== */

.decoration-image {
    position: absolute;
    width: 220px;
    height: auto;
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}

/* PIĘTRO 1 */
.decoration-tier1-left {
    left: 90px;
    top: 80%;
    transform: translateY(-50%);
}

.decoration-tier1-right {
    right: 90px;
    top: 80%;
    transform: translateY(-50%) scaleX(-1);
}

/* PIĘTRO 2 */
.decoration-tier2-left {
    left: -58px;
    top: 40%;
    transform: translateY(-50%) rotate(-30deg);
}

.decoration-tier2-right {
    right: -58px;
    top: 60%;
    transform: translateY(-50%) rotate(30deg) scaleX(-1);
}

/* PIĘTRO 3 */
.decoration-tier3-left {
    left: -45px;
    top: 40%;
    transform: translateY(-50%) rotate(-30deg);
}

.decoration-tier3-right {
    right: -45px;
    top: 60%;
    transform: translateY(-50%) rotate(30deg) scaleX(-1);
}

/* PIĘTRO 4 */
.decoration-tier4-left {
    left: -50px;
    top: 55%;
    transform: translateY(-50%) rotate(-18deg);
}

.decoration-tier4-right {
    right: -50px;
    top: 45%;
    transform: translateY(-50%) rotate(18deg) scaleX(-1);
}

/* PIĘTRO 5 */
.decoration-tier5-left {
    left: 60px;
    top: 78%;
    transform: translateY(-50%) rotate(-12deg);
}

.decoration-tier5-right {
    right: 60px;
    top: 78%;
    transform: translateY(-50%) rotate(12deg) scaleX(-1);
}

/* ========================================
   POZYCJONOWANIE KART W PIĘTRZE
   ======================================== */

.card-wrapper {
    position: relative;
    z-index: 1;
}

.center-single { margin: 0 auto; }
.left-side     { flex: 0 0 auto; }
.right-side    { flex: 0 0 auto; }

/* ========================================
   OBRAZY KART
   ======================================== */

.card-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 12px;
    box-shadow:
        0 18px 45px rgba(31, 58, 95, 0.14),
        0 2px 10px rgba(31, 58, 95, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
    display: block;
    position: relative;
    z-index: 1;
    border: 2px solid transparent;
}

.card-image.clickable {
    cursor: pointer;
}

.card-image.clickable:hover,
.card-wrapper:hover .card-image {
    transform: translateY(-10px) scale(1.03);
    box-shadow:
        0 25px 55px rgba(31, 58, 95, 0.2),
        0 0 30px rgba(91, 138, 196, 0.25);
    border: 2px solid var(--blekit-jasny);
}

/* ========================================
   KARTA Z PRZYCISKAMI NA WIERZCHU
   ======================================== */

.card-with-buttons {
    position: relative;
    display: inline-block;
}

/* --- duży przycisk na karcie (zdjęcia, księga życzeń) --- */

/* Pozycje w % wysokości karty, nie w px — dzięki temu przyciski trzymają się
   tej samej wysokości niezależnie od tego, jak duża jest karta na danym ekranie. */
.card-button {
    position: absolute;
    bottom: 11%;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--blekit-mocny);
    color: var(--biel);
    text-decoration: none;
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    /* Wysokość przycisku ma wynikać z tekstu w środku (.button-text) i paddingu,
       a nie z font-size samego przycisku — inaczej na mobile puchnie. */
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: 0 8px 22px rgba(61, 107, 168, 0.4);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    z-index: 10;
}

.card-button:hover {
    transform: translateX(-50%) translateY(-3px);
    background: var(--blekit);
    box-shadow: 0 12px 30px rgba(61, 107, 168, 0.55);
}

.button-text {
    font-size: 0.95rem;
    font-weight: 600;
}

/* --- przyciski map i RSVP --- */

.map-buttons,
.rsvp-buttons {
    position: absolute;
    bottom: 9%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.map-button,
.rsvp-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--biel);
    color: var(--granat);
    text-decoration: none;
    border: 1.5px solid var(--blekit);
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(31, 58, 95, 0.16);
    transition: all 0.3s ease;
}

.map-button:hover,
.rsvp-button:hover {
    background: var(--blekit-mocny);
    border-color: var(--blekit-mocny);
    color: var(--biel);
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(61, 107, 168, 0.4);
}

.map-button svg,
.rsvp-button svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* ========================================
   DYMEK "KLIKNIJ" PRZY KARCIE ROZWIJAJĄCEJ
   (znika po pierwszym kliknięciu)
   ======================================== */

.expand-hint {
    position: absolute;
    bottom: 7%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 14px 4px 14px;
    background: var(--biel);
    border: 1.5px solid var(--blekit);
    border-radius: 50px;
    color: var(--blekit-mocny);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 6px 18px rgba(31, 58, 95, 0.18);
    pointer-events: none;
    z-index: 5;
    animation: hint-bounce 2s ease-in-out infinite;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.expand-hint.hidden {
    opacity: 0;
    animation: none;
    transform: translateX(-50%) translateY(10px);
}

.expand-hint-arrow {
    width: 14px;
    height: 14px;
}

@keyframes hint-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(6px); }
}

/* ========================================
   SEKCJA ROZWIJANA
   ======================================== */

.expandable-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 1s ease;
}

.expandable-section.expanded {
    max-height: 5000px;
    overflow: visible;
}

.expandable-tier {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    margin: 2rem 0;
}

.expandable-section.expanded .expandable-tier {
    opacity: 1;
    transform: translateY(0);
}

.expandable-section.expanded .expandable-tier:nth-child(1) { transition-delay: 0.2s; }
.expandable-section.expanded .expandable-tier:nth-child(2) { transition-delay: 0.5s; }

/* ========================================
   WERSET NA ZAKOŃCZENIE
   ======================================== */

.closing-verse {
    max-width: 620px;
    margin: 4rem auto 1rem auto;
    padding: 0 1.5rem;
    text-align: center;
    position: relative;
}

/* Ozdobnik z dwiema kreskami po bokach — nie zależy od koloru tła */
.verse-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.2rem;
    color: var(--blekit);
    font-size: 1.1rem;
    line-height: 1;
}

.verse-ornament::before,
.verse-ornament::after {
    content: '';
    width: 70px;
    height: 1px;
    background: var(--srebro);
}

.verse-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-style: italic;
    font-weight: 400;
    line-height: 1.6;
    color: var(--granat);
}

.verse-source {
    margin-top: 0.7rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--blekit-mocny);
    opacity: 0.8;
}

.verse-signature {
    margin-top: 2rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem;
    font-style: italic;
    color: var(--blekit-mocny);
}

@media (max-width: 768px) {
    .closing-verse {
        margin-top: 2.5rem;
    }

    .verse-ornament {
        margin-bottom: 1.6rem;
        gap: 0.7rem;
    }

    .verse-ornament::before,
    .verse-ornament::after {
        width: 45px;
    }

    .verse-text { font-size: 1.15rem; }

    .verse-signature {
        margin-top: 1.5rem;
        font-size: 1.3rem;
    }
}

/* ========================================
   LICZNIK ODLICZANIA
   ======================================== */

.countdown-container {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1.2rem 1.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(31, 58, 95, 0.15);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease 1.5s, visibility 1s ease 1.5s, transform 0.35s ease;
    border: 1.5px solid var(--blekit-jasny);
}

body.envelope-opened .countdown-container {
    opacity: 1;
    visibility: visible;
}

/* na mobile licznik chowa się przy scrollowaniu w dół */
.countdown-container.countdown-hidden {
    transform: translateY(-140%);
}

.countdown-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--granat);
    text-align: center;
    margin-bottom: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.countdown-display {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 45px;
}

.countdown-item span:first-child {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--blekit-mocny);
    line-height: 1;
}

.countdown-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.65rem;
    color: var(--granat);
    margin-top: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.65;
}

/* ========================================
   PRZYCISK MUZYKI
   ======================================== */

.music-toggle {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid var(--blekit);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(31, 58, 95, 0.15);
    transition: all 0.3s ease;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
}

body.envelope-opened .music-toggle {
    opacity: 1;
    visibility: visible;
    transition: opacity 1s ease 2.5s, visibility 1s ease 2.5s;
}

.music-toggle:hover {
    transform: scale(1.1);
    background: var(--blekit-mocny);
    box-shadow: 0 6px 20px rgba(61, 107, 168, 0.4);
}

.music-toggle:hover svg {
    color: var(--biel);
}

.music-toggle svg {
    width: 24px;
    height: 24px;
    color: var(--blekit-mocny);
    transition: color 0.3s ease;
}

.music-toggle .music-off      { display: none; }
.music-toggle.muted .music-on { display: none; }
.music-toggle.muted .music-off{ display: block; }

/* ========================================
   CANVAS NA KONFETTI
   ======================================== */

#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* Unoszące się pyłki światła — warstwa pod treścią, włącza się po otwarciu koperty.
   z-index: -1 trzyma je pod kartami i dekoracjami, ale nad tłem strony. */
#ambient-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    transition: opacity 2s ease 1s;
}

body.envelope-opened #ambient-canvas {
    opacity: 1;
}

/* Kto woli mniej ruchu na ekranie — wyłączamy animacje tła */
@media (prefers-reduced-motion: reduce) {
    #ambient-canvas,
    .light-rays,
    .expand-hint {
        animation: none !important;
    }

    #ambient-canvas { display: none; }
}

/* ========================================
   RESPONSYWNOŚĆ
   ======================================== */

@media (max-width: 968px) {
    .card-tier {
        gap: 1rem;
        margin: 1.5rem 0;
    }

    .expandable-tier { margin: 1.5rem 0; }

    .card-image { max-width: 280px; }

    .decoration-image { width: 180px; }

    .decoration-tier1-left  { left: -50px; }
    .decoration-tier1-right { right: -50px; }
    .decoration-tier2-left  { left: -48px; }
    .decoration-tier2-right { right: -48px; }
    .decoration-tier3-left  { left: -38px; }
    .decoration-tier3-right { right: -38px; }
    .decoration-tier4-left  { left: -40px; }
    .decoration-tier4-right { right: -40px; }

    .card-button {
        padding: 9px 16px;
    }

    .button-text { font-size: 0.78rem; }

    .map-button,
    .rsvp-button {
        padding: 8px 12px;
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .communion-title {
        font-size: 2.4rem;
        letter-spacing: 2px;
    }

    .communion-subtitle {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }

    .communion-date {
        font-size: 0.85rem;
        letter-spacing: 3px;
        margin-bottom: 2.5rem;
    }

    .envelope-image { width: 260px; }

    .tap-text {
        font-size: 0.8rem;
        margin-top: 2.5rem;
    }

    /* Górny odstęp musi przepuścić licznik, który wisi w prawym górnym rogu —
       inaczej nachodzi na kartę główną. */
    .main-content {
        padding: 5.5rem 0.5rem 2rem 0.5rem;
        max-width: 100%;
    }

    .card-tier {
        gap: 0.8rem;
        margin: 1.2rem 0;
    }

    .card-tier:first-child { margin-bottom: 1.2rem; }

    .expandable-tier { margin: 1.2rem 0; }

    .card-image {
        max-width: 160px;
        width: 100%;
    }

    .countdown-container {
        top: 8px;
        right: 8px;
        max-width: 150px;
        padding: 0.5rem 0.6rem;
    }

    /* PRZYCISKI NA KARTACH — karty mają tu tylko 160 px, więc muszą zjechać
       wyraźnie w dół. Wcześniej brakowało tego bloku i przyciski trzymały
       rozmiar z szerszego ekranu, przez co dominowały kartę. */
    .card-button {
        padding: 5px 9px;
        box-shadow: 0 4px 12px rgba(61, 107, 168, 0.35);
    }

    .button-text {
        font-size: 0.54rem;
    }

    .map-buttons,
    .rsvp-buttons {
        gap: 4px;
    }

    .map-button,
    .rsvp-button {
        padding: 4px 7px;
        font-size: 0.48rem;
        gap: 3px;
        border-width: 1px;
        box-shadow: 0 3px 10px rgba(31, 58, 95, 0.14);
    }

    .map-button svg,
    .rsvp-button svg {
        width: 9px;
        height: 9px;
    }

    .expand-hint {
        padding: 3px 9px 2px 9px;
        font-size: 0.5rem;
        letter-spacing: 0.5px;
        border-width: 1px;
        box-shadow: 0 4px 12px rgba(31, 58, 95, 0.16);
    }

    .expand-hint-arrow {
        width: 10px;
        height: 10px;
    }

    .countdown-title {
        font-size: 0.62rem;
        margin-bottom: 0.4rem;
    }

    .countdown-display { gap: 0.4rem; }

    .countdown-item { min-width: 26px; }

    .countdown-item span:first-child { font-size: 1rem; }

    .countdown-label { font-size: 0.48rem; }

    .music-toggle {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }

    .music-toggle svg {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 480px) {
    .communion-title {
        font-size: 2rem;
        letter-spacing: 1px;
    }

    .communion-subtitle { font-size: 0.95rem; }

    .communion-date {
        font-size: 0.7rem;
        letter-spacing: 2px;
    }

    .envelope-image { width: 220px; }

    .tap-text { font-size: 0.7rem; }

    .main-content { padding: 5rem 0.3rem 1.5rem 0.3rem; }

    .card-tier {
        gap: 0.6rem;
        margin: 1rem 0;
    }

    .card-image { max-width: 145px; }

    .decoration-image {
        width: 80px;
        opacity: 0.3;
    }

    .decoration-tier1-left  { left: 40px; }
    .decoration-tier1-right { right: 40px; }
    .decoration-tier2-left  { left: -18px; top: 25%; }
    .decoration-tier2-right { right: -18px; top: 75%; }
    .decoration-tier3-left  { left: -15px; top: 35%; }
    .decoration-tier3-right { right: -15px; top: 65%; }
    .decoration-tier4-left  { left: -15px; top: 60%; }
    .decoration-tier4-right { right: -15px; top: 40%; }

    .countdown-container {
        padding: 0.4rem 0.5rem;
        max-width: 132px;
        top: 3px;
        right: 3px;
    }

    .countdown-title {
        font-size: 0.55rem;
        margin-bottom: 0.2rem;
    }

    .countdown-display { gap: 0.3rem; }

    .countdown-item { min-width: 22px; }

    .countdown-item span:first-child { font-size: 0.85rem; }

    .countdown-label { font-size: 0.4rem; }

    /* Karta ma 145 px — przyciski schodzą do minimum, ale zostaje ~24 px
       wysokości, żeby dało się w nie trafić palcem. */
    .card-button {
        padding: 5px 8px;
        gap: 3px;
    }

    .button-text { font-size: 0.5rem; }

    .map-buttons,
    .rsvp-buttons {
        gap: 3px;
    }

    .map-button,
    .rsvp-button {
        padding: 4px 6px;
        font-size: 0.44rem;
        gap: 2px;
    }

    .map-button svg,
    .rsvp-button svg {
        width: 8px;
        height: 8px;
    }

    .expand-hint {
        padding: 3px 8px 2px 8px;
        font-size: 0.45rem;
        letter-spacing: 0.3px;
    }

    .expand-hint-arrow {
        width: 9px;
        height: 9px;
    }
}

/* ========================================
   MODAL PODGLĄDU KARTY (tylko mobile)
   ======================================== */

.card-preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(31, 58, 95, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.card-preview-modal.show {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.card-preview-modal img {
    max-width: 95%;
    max-height: 85vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    animation: cardZoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardZoomIn {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.card-preview-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--biel);
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    color: var(--granat);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    z-index: 3001;
    line-height: 1;
    padding: 0;
}

.card-preview-close:hover {
    transform: scale(1.1) rotate(90deg);
    background: var(--blekit-mocny);
    color: var(--biel);
}

.card-preview-close:active {
    transform: scale(0.95);
}

/* Na desktopie modal nie jest potrzebny — karty i tak są duże */
@media (min-width: 769px) {
    .card-preview-modal {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .card-preview-modal { padding: 15px; }

    .card-preview-modal img {
        max-height: 80vh;
        max-width: 92%;
    }

    .card-preview-close {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .card-preview-modal img { max-width: 90%; }

    .card-preview-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.6rem;
    }
}

/* ========================================
   MODAL WRZUCANIA ZDJĘĆ
   ======================================== */

.upload-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(31, 58, 95, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 4000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.upload-modal.show {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

.upload-panel {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(160deg, var(--biel) 0%, var(--tlo) 100%);
    border: 1.5px solid var(--blekit-jasny);
    border-radius: 18px;
    box-shadow: 0 25px 70px rgba(31, 58, 95, 0.35);
    animation: cardZoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.upload-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    background: rgba(91, 138, 196, 0.1);
    border: 1px solid var(--blekit-jasny);
    border-radius: 50%;
    color: var(--blekit-mocny);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    z-index: 2;
}

.upload-close:hover {
    background: var(--blekit-mocny);
    color: var(--biel);
    transform: rotate(90deg);
}

.upload-header {
    padding: 2rem 2rem 1.2rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--srebro);
}

.upload-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-style: italic;
    font-weight: 500;
    color: var(--granat);
    letter-spacing: 1px;
}

.upload-subtitle {
    margin-top: 0.5rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--blekit-mocny);
    text-transform: uppercase;
}

.upload-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1 1 auto;
}

.upload-body::-webkit-scrollbar {
    width: 6px;
}

.upload-body::-webkit-scrollbar-thumb {
    background: var(--blekit-jasny);
    border-radius: 3px;
}

.upload-field {
    display: block;
    margin-bottom: 1.2rem;
}

.upload-field-label {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--blekit-mocny);
    margin-bottom: 0.5rem;
}

.upload-field-label em {
    font-style: normal;
    opacity: 0.6;
    text-transform: none;
    letter-spacing: 0.5px;
}

.upload-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--biel);
    border: 1px solid var(--blekit-jasny);
    border-radius: 10px;
    color: var(--granat);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.upload-input::placeholder {
    color: rgba(31, 58, 95, 0.35);
}

.upload-input:focus {
    outline: none;
    border-color: var(--blekit-mocny);
    box-shadow: 0 0 0 3px rgba(91, 138, 196, 0.18);
}

.upload-dropzone {
    border: 2px dashed var(--blekit-jasny);
    border-radius: 14px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    background: rgba(91, 138, 196, 0.04);
    transition: all 0.3s ease;
}

.upload-dropzone:hover,
.upload-dropzone:focus-visible,
.upload-dropzone.dragover {
    outline: none;
    border-color: var(--blekit-mocny);
    background: rgba(91, 138, 196, 0.1);
}

.upload-dropzone-icon {
    width: 42px;
    height: 42px;
    color: var(--blekit-mocny);
    margin-bottom: 0.8rem;
}

.upload-dropzone-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--granat);
    letter-spacing: 0.5px;
}

.upload-dropzone-hint {
    margin-top: 0.35rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 300;
    color: rgba(31, 58, 95, 0.55);
    letter-spacing: 0.5px;
}

.upload-list {
    margin-top: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem;
    background: var(--biel);
    border: 1px solid var(--srebro);
    border-radius: 10px;
    animation: modalFadeIn 0.3s ease;
}

.upload-item.done {
    border-color: var(--blekit);
    background: rgba(91, 138, 196, 0.08);
}

.upload-item.error {
    border-color: #d98a8a;
    background: rgba(217, 138, 138, 0.09);
}

.upload-thumb {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--tlo-ciemne);
    border: 1px solid var(--srebro);
}

.upload-item-info {
    flex: 1 1 auto;
    min-width: 0;
}

.upload-item-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    color: var(--granat);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-item-meta {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.68rem;
    font-weight: 300;
    color: var(--blekit-mocny);
    margin-top: 0.2rem;
}

.upload-item.error .upload-item-meta {
    color: #b95050;
}

.upload-progress {
    margin-top: 0.4rem;
    height: 4px;
    border-radius: 2px;
    background: var(--tlo-ciemne);
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--blekit-mocny), var(--blekit-jasny));
    transition: width 0.25s ease;
}

.upload-item-remove {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--blekit-jasny);
    border-radius: 50%;
    color: var(--blekit-mocny);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0;
}

.upload-item-remove:hover {
    background: var(--blekit-mocny);
    color: var(--biel);
}

.upload-status {
    margin-top: 1rem;
    min-height: 1.2rem;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: var(--blekit-mocny);
}

.upload-status.error   { color: #b95050; }
.upload-status.success { color: var(--blekit-mocny); font-weight: 600; }

/* ---- GALERIA WRZUCONYCH ZDJĘĆ ---- */

.upload-gallery {
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--srebro);
}

.upload-gallery-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}

.upload-gallery-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.25rem;
    font-style: italic;
    font-weight: 600;
    color: var(--granat);
}

.upload-gallery-count {
    min-width: 26px;
    padding: 0.1rem 0.5rem;
    border: 1px solid var(--blekit-jasny);
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--blekit-mocny);
    text-align: center;
}

.upload-gallery-empty {
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 300;
    color: rgba(31, 58, 95, 0.45);
    padding: 0.8rem 0;
}

.upload-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 0.5rem;
}

.upload-gallery-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--srebro);
    background: var(--tlo-ciemne);
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    animation: cardZoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.upload-gallery-tile:hover {
    border-color: var(--blekit-mocny);
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(31, 58, 95, 0.2);
}

.upload-gallery-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.upload-gallery-tile.is-video {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.upload-gallery-tile.is-video svg {
    width: 26px;
    height: 26px;
    color: var(--blekit-mocny);
}

.upload-gallery-author {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.5rem 0.35rem 0.25rem 0.35rem;
    background: linear-gradient(to top, rgba(31, 58, 95, 0.85), transparent);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.5px;
    color: var(--biel);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- POWIĘKSZENIE ZDJĘCIA Z GALERII ---- */

.gallery-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(31, 58, 95, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 5000;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.gallery-lightbox.show {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

.gallery-lightbox img {
    max-width: 92%;
    max-height: 85vh;
    border-radius: 12px;
    border: 2px solid var(--biel);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45);
    animation: cardZoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gallery-lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 46px;
    height: 46px;
    background: var(--biel);
    border: none;
    border-radius: 50%;
    font-size: 1.9rem;
    line-height: 1;
    color: var(--granat);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 5001;
    padding: 0;
}

.gallery-lightbox-close:hover {
    transform: scale(1.1) rotate(90deg);
    background: var(--blekit-mocny);
    color: var(--biel);
}

.upload-footer {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
    padding: 1.2rem 2rem 1.6rem 2rem;
    border-top: 1px solid var(--srebro);
}

.upload-btn {
    padding: 0.75rem 1.6rem;
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn-ghost {
    background: transparent;
    border: 1px solid var(--blekit-jasny);
    color: var(--blekit-mocny);
}

.upload-btn-ghost:hover {
    background: rgba(91, 138, 196, 0.12);
    border-color: var(--blekit-mocny);
}

.upload-btn-primary {
    background: var(--blekit-mocny);
    border: none;
    color: var(--biel);
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(61, 107, 168, 0.35);
}

.upload-btn-primary:hover:not(:disabled) {
    background: var(--blekit);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(61, 107, 168, 0.5);
}

.upload-btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

@media (max-width: 768px) {
    .upload-modal { padding: 12px; }

    .upload-panel { max-height: 92vh; }

    .upload-header { padding: 1.5rem 1.2rem 1rem 1.2rem; }

    .upload-title { font-size: 1.5rem; }

    .upload-subtitle {
        font-size: 0.65rem;
        letter-spacing: 1.5px;
    }

    .upload-body { padding: 1.2rem; }

    .upload-dropzone { padding: 1.5rem 0.8rem; }

    .upload-footer { padding: 1rem 1.2rem 1.3rem 1.2rem; }

    .upload-btn {
        flex: 1 1 auto;
        padding: 0.7rem 1rem;
        font-size: 0.8rem;
    }

    .upload-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
        gap: 0.4rem;
    }

    .upload-gallery-title { font-size: 1.05rem; }

    .gallery-lightbox { padding: 15px; }

    .gallery-lightbox-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 1.6rem;
    }
}

/* ========================================
   KSIĘGA ŻYCZEŃ
   (korzysta z tych samych stylów okna co wrzucanie zdjęć)
   ======================================== */

.upload-textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.6;
    font-family: 'Montserrat', sans-serif;
}

.upload-counter {
    display: block;
    margin-top: 0.35rem;
    text-align: right;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.65rem;
    color: rgba(31, 58, 95, 0.45);
}

.wish-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.wish-entry {
    position: relative;
    padding: 1rem 1.1rem 1rem 1.4rem;
    background: var(--biel);
    border: 1px solid var(--srebro);
    border-left: 3px solid var(--blekit);
    border-radius: 10px;
    animation: modalFadeIn 0.35s ease;
}

.wish-entry-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-style: italic;
    line-height: 1.55;
    color: var(--granat);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.wish-entry-author {
    display: block;
    margin-top: 0.6rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--blekit-mocny);
}

.wish-entry-date {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.62rem;
    font-weight: 300;
    letter-spacing: 0.5px;
    text-transform: none;
    color: rgba(31, 58, 95, 0.45);
    margin-left: 0.5rem;
}

@media (max-width: 768px) {
    .wish-entry {
        padding: 0.85rem 0.9rem 0.85rem 1.1rem;
    }

    .wish-entry-text { font-size: 1rem; }
}
