/* RESET GENERALE E VARIABILI */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --gold-primary: #d4af37;
    --gold-light: #f3e5ab;
    --gold-dark: #aa771c;
    --gold-gradient: linear-gradient(135deg, #f3e5ab 0%, #d4af37 40%, #aa771c 70%, #f3e5ab 100%);
    --bg-dark: #0d0d0d;
    --bg-card: linear-gradient(145deg, #151515, #222222);
    --cream-envelope: #eae6dd;
}

body {
    background-color: #050505;
    font-family: 'Montserrat', sans-serif;
    color: #ffffff;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

#app-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 412px;
    max-height: 860px;
    background-color: #0b0b0a;
    /* Micro griglia di paillettes in CSS ad alte prestazioni */
    background-image: 
        radial-gradient(circle, rgba(212, 175, 55, 0.15) 0.7px, transparent 0.7px);
    background-size: 5px 5px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.95);
}

@media (min-width: 600px) {
    #app-viewport {
        border: 1px solid rgba(212, 175, 55, 0.25);
        border-radius: 20px;
        height: 94vh;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95), 0 0 30px rgba(212, 175, 55, 0.05);
    }
}

/* SFONDO SPARKLING CANVAS */
#sparkleCanvas {
    position: absolute; /* Rende la griglia contenuta solo nell'invito */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* APPLICAZIONE CONTENITORE */
.app-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

/* GESTIONE SCHERMATE (SCREENS) */
.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* SCHERMATA 1: BUSTA CHIUSA */
#envelopeScreen {
    background-color: transparent;
}

.tap-instruction {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    letter-spacing: 3px;
    line-height: 1.6;
    margin-bottom: 40px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4), 0 0 20px rgba(212, 175, 55, 0.3);
    animation: pulseGlow 2.5s infinite ease-in-out;
}

/* 3D ENVELOPE STRUCT */
.envelope-wrapper {
    position: relative;
    width: 300px;
    height: 214px;
    perspective: 1000px;
}

.envelope {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

/* Pezzi della busta */
.envelope-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #eae6dd;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    z-index: 1;
}

/* Scheda di anteprima interna */
.envelope-card-preview {
    position: absolute;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    background: linear-gradient(135deg, #1a1a1a, #111111);
    border: 1px solid var(--gold-primary);
    border-radius: 4px;
    z-index: 3; /* Portato sopra la linguetta aperta ma sotto i lembi frontali */
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateY(0);
    transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    transition-delay: 0s; /* Scende subito quando viene chiusa */
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.preview-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview-content .p-18 {
    font-family: 'Cinzel', serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--gold-primary);
    text-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}

.preview-content .p-name {
    font-family: 'Pinyon Script', cursive;
    font-size: 28px;
    color: var(--gold-light);
}

/* Lembi frontali */
.envelope-front {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}

/* Lembo superiore (Flap) */
.envelope-top {
    position: absolute;
    width: 100%;
    height: 100px;
    top: 0;
    left: 0;
    transform-origin: top;
    transition: transform 0.6s ease-in-out, z-index 0.3s;
    transition-delay: 0.6s; /* Quando si chiude, aspetta che la card sia rientrata */
    z-index: 5;
}

/* Sigillo in ceralacca */
.wax-seal {
    position: absolute;
    width: 66px;
    height: 66px;
    top: 67px;
    left: 117px;
    z-index: 6;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.4s ease;
    animation: bounceSeal 3s infinite ease-in-out;
}

.wax-seal img {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.wax-seal:hover {
    transform: scale(1.1) rotate(5deg);
    animation-play-state: paused;
}

.wax-seal:active {
    transform: scale(0.92) rotate(-3deg);
    transition: transform 0.1s ease;
}

/* ANIMAZIONI DI APERTURA BUSTA */
.envelope.open .envelope-top {
    transform: rotateX(180deg); /* Si alza verso l'alto e rimane visibile */
    z-index: 2; /* Passa dietro per permettere alla card di scivolare sopra */
    transition-delay: 0s; /* Si apre subito al click del sigillo */
}

.envelope.open .wax-seal {
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

.envelope.open .envelope-card-preview {
    transform: translateY(-90px) scale(0.95);
    z-index: 3;
    transition-delay: 0.6s; /* Aspetta che il lembo superiore si sia aperto prima di salire */
}


/* SCHERMATA 2: INVITO APERTO */
#invitationScreen {
    background-color: transparent;
    padding: 20px;
}

.invitation-card {
    position: relative;
    width: 100%;
    height: 100%;
    background: transparent; /* Rimossa la card scura ed i bordi per andare a tutto schermo */
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 60px 20px 20px 20px; /* Spazio per una visualizzazione ottimale su smartphone */
    display: flex;
    flex-direction: column;
    animation: slideCardUp 1s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 2;
}

/* Bordo interno rimosso */
.card-inner-border {
    flex: 1;
    border: none;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    position: relative;
}

/* Angoli decorativi rimossi */
.card-inner-border::before,
.card-inner-border::after {
    display: none;
}

/* Pulsante Indietro allineato simmetricamente */
.back-btn {
    position: absolute;
    top: 25px;
    left: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s ease;
}

.back-btn:active {
    transform: scale(0.85);
}

.icon-back {
    width: 26px;
    height: 26px;
    fill: rgba(255, 255, 255, 0.6);
    transition: fill 0.3s, transform 0.3s;
}

.back-btn:hover .icon-back {
    fill: var(--gold-primary);
    transform: translateX(-3px);
}

/* CONTROLLO MUSICA */
.music-control {
    position: absolute;
    top: 25px;
    right: 25px;
    z-index: 10;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.music-btn-svg {
    width: 76px;
    height: 76px;
    overflow: visible;
    display: block;
}

.music-btn-text {
    font-family: 'Cinzel', serif;
    font-size: 6.5px;
    font-weight: 700;
    fill: var(--gold-primary);
    letter-spacing: 0.5px;
}

.music-circle {
    fill: rgba(18, 18, 18, 0.75);
    stroke: var(--gold-primary);
    stroke-width: 1.5px;
    transition: all 0.25s ease;
    transform-origin: 40px 46px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.music-icon-path {
    fill: var(--gold-primary);
    transition: fill 0.25s ease;
}

/* Rotazione del disco musicale quando riproduce */
.music-control.playing .music-circle {
    animation: rotateDisk 6s linear infinite;
    stroke: var(--gold-light);
    filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.6));
}

.music-control:hover .music-circle {
    stroke: var(--gold-light);
    transform: scale(1.06);
}

.music-control:active .music-circle {
    transform: scale(0.92);
}

.card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
    position: relative;
    margin-bottom: 5px;
}

.gold-18 {
    font-family: 'Cinzel', serif;
    font-size: 140px; /* Ingrandito a 140px per posizionarsi come centro focale */
    font-weight: 900;
    line-height: 0.95;
    background-image: url('assets/gold_glitter_texture.png'); /* Sfondo glitter reale */
    background-size: cover;
    background-position: center;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.8));
    letter-spacing: -4px; /* Tightly centered */
    animation: goldShine 6s infinite linear;
    background-size: 200% auto;
}

.carmen-title {
    font-family: 'Pinyon Script', cursive;
    font-size: 88px; /* Ingrandito ulteriormente */
    background-image: url('assets/gold_glitter_texture.png'); /* Texture oro glitter reale */
    background-size: cover;
    background-position: center;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.0;
    margin-top: 12px; /* Rimossa la sovrapposizione: posizionato completamente sotto */
    transform: scaleX(1.18); /* Allargato orizzontalmente senza spezzare le lettere corsive */
    transform-origin: center;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.7));
    z-index: 2;
    position: relative;
}

.card-divider-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 170px; /* Ingrandito e allungato a 170px */
    margin: 20px 0;
}

.divider-line {
    flex: 1;
    height: 2px; /* Spessore aumentato a 2px per ottima visibilità */
}

.card-divider-wrapper .divider-line:first-child {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0) 0%, rgba(212, 175, 55, 1) 100%); /* Sfuma a sinistra */
}

.card-divider-wrapper .divider-line:last-child {
    background: linear-gradient(90deg, rgba(212, 175, 55, 1) 0%, rgba(212, 175, 55, 0) 100%); /* Sfuma a destra */
}

.divider-diamond {
    color: #ffd700;
    font-size: 16px; /* Rombo più grande e visibile (16px) */
    margin: 0 8px;
    line-height: 1;
    background: transparent; /* Nessun blocco grigio di sfondo */
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.9);
}

.card-body {
    text-align: center;
    width: 100%;
}

.subtitle {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 15px; /* Ingrandito */
    letter-spacing: 0.5px;
    color: var(--gold-light);
    text-transform: none; /* Rimosso l'uppercase per uno stile più dolce e intimo */
    font-weight: 500;
    margin-bottom: 25px;
    text-shadow: 0 0 10px rgba(243, 229, 171, 0.4);
}

.date-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}

.date-time .date {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 24px; /* Ingrandito */
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff; /* Bianco dolce */
    margin-bottom: 6px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.date-time .time {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 18px; /* Ingrandito */
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--gold-light); /* Oro dolce */
}

.location-details {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.location-details .venue {
    font-family: 'Cinzel', serif;
    font-size: 24px; /* Ingrandito da 20px */
    font-weight: 900;
    letter-spacing: 4.5px;
    color: #ffffff;
    margin-bottom: 4px;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
}

.location-details .venue-sub {
    font-size: 13px; /* Ingrandito da 11px */
    color: #cccccc;
    letter-spacing: 2px;
}

.action-buttons {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    margin-top: 15px;
}

.action-btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    flex: 1;
}

.action-btn-svg {
    width: 108px; /* Ingrandito ulteriormente da 96px */
    height: 108px; /* Ingrandito ulteriormente da 96px */
    max-width: 29vw; /* Impedisce sovrapposizioni su schermi mobile stretti */
    max-height: 29vw;
    cursor: pointer;
    overflow: visible;
    display: block;
}

.btn-text {
    font-family: 'Cinzel', serif;
    font-size: 8.2px; /* Ingrandito ulteriormente per massima leggibilità */
    font-weight: 900;
    fill: var(--gold-primary);
    letter-spacing: 1.8px;
    transition: fill 0.25s ease;
}

.btn-circle {
    fill: rgba(18, 18, 18, 0.75);
    stroke: var(--gold-primary);
    stroke-width: 1.5px;
    transition: all 0.25s ease;
    transform-origin: 50px 56px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.btn-icon-path {
    fill: var(--gold-primary);
    transition: fill 0.25s ease;
}

.btn-hand {
    fill: var(--gold-light);
    transform-origin: 10px 10px; /* relativo alla posizione della mano */
    animation: tapHand 1.6s infinite ease-in-out;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Effetti Hover / Attivi sui tasti SVG (Effetto Immersione Fisica) */
.action-btn-wrapper:hover .btn-circle {
    stroke: var(--gold-light);
    transform: scale(1.06);
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.6));
}

.action-btn-wrapper:hover .btn-icon-path {
    fill: var(--gold-light);
}

.action-btn-wrapper:hover .btn-text {
    fill: var(--gold-light);
}

/* Tocco/Pressione (Immersione Fisica) */
.action-btn-wrapper:active .btn-circle {
    fill: rgba(212, 175, 55, 0.18);
    stroke: var(--gold-light);
    transform: scale(0.92); /* Contrazione */
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.8)); /* Forte bagliore interno */
    transition: all 0.1s ease;
}

.action-btn-wrapper:active .btn-icon-path {
    fill: var(--gold-light);
}

@keyframes tapHand {
    0%, 100% {
        transform: translate(68px, 30px) scale(0.7) rotate(0deg);
    }
    50% {
        transform: translate(66px, 33px) scale(0.62) rotate(-5deg);
    }
}

/* FOOTER CARD */
.card-footer {
    width: 100%;
    text-align: center;
    margin-top: 15px;
}

.rsvp-text {
    font-size: 12px; /* Ingrandito da 9.5px */
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--gold-light);
    text-shadow: 0 0 5px rgba(212, 175, 55, 0.35);
}

/* MODAL PER LA FOTO */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 92%; /* Ingrandito da 85% per occupare più schermo del cellulare */
    max-width: 375px; /* Ingrandito da 320px */
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1001;
    transform: scale(0.85);
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px; /* Posizionato all'interno, sovrapposto all'immagine */
    right: 15px;
    background: rgba(18, 18, 18, 0.75); /* Cerchio scuro semi-trasparente */
    border: 1px solid rgba(212, 175, 55, 0.4);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1010; /* Sempre in primo piano sopra la foto */
    transition: background 0.3s, transform 0.2s, border-color 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.modal-close:hover {
    background: rgba(212, 175, 55, 0.9); /* Sfondo dorato al passaggio */
    border-color: var(--gold-light);
}

.modal-close:active {
    transform: scale(0.9);
}

.icon-close {
    width: 18px; /* Ridotta icona per stare nel cerchio */
    height: 18px;
    fill: #ffffff;
    transition: fill 0.3s;
}

.modal-close:hover .icon-close {
    fill: #121212; /* Contrasto scuro sull'oro */
}

.photo-frame {
    width: 100%;
    border: 2px solid var(--gold-primary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.3);
    background-color: #111;
}

.carmen-photo {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.modal-caption {
    font-family: 'Pinyon Script', cursive;
    font-size: 32px;
    color: var(--gold-light);
    margin-top: 15px;
    text-shadow: 0 0 8px rgba(243, 229, 171, 0.5);
}

/* ANIMAZIONI KEYFRAMES */

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.8;
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(212, 175, 55, 0.2);
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.6), 0 0 30px rgba(212, 175, 55, 0.4);
    }
}

@keyframes pulseText {
    from {
        opacity: 0.7;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes rotateDisk {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideCardUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes goldShine {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* OTTIMIZZAZIONI PER SCHERMI MOLTO PICCOLI */
@media (max-height: 580px) {
    .gold-18 {
        font-size: 65px;
    }
    .carmen-title {
        font-size: 48px;
    }
    .subtitle {
        margin-bottom: 15px;
    }
    .date-time {
        margin-bottom: 15px;
    }
    .action-btn {
        width: 48px;
        height: 48px;
    }
    .btn-icon {
        width: 18px;
        height: 18px;
    }
    .card-inner-border {
        padding: 15px 10px;
    }
}

/* CONTENITORE SPARKLE SUL 18 */
.gold-18-container {
    position: relative;
    display: inline-block;
}

#gold-18-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: visible; /* Permette alle luci di sporgere leggermente dai bordi */
}

.gold-18-star {
    position: absolute;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    animation: starFade 1.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes starFade {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, -50%) scale(1.1) rotate(45deg);
        opacity: 1;
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 1)) drop-shadow(0 0 10px rgba(212, 175, 55, 0.9));
    }
    70% {
        transform: translate(-50%, -50%) scale(0.9) rotate(90deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0) rotate(135deg);
        opacity: 0;
    }
}

/* CONTENITORE SPARKLE SUL TITOLO CARMEN */
.carmen-title-container {
    position: relative;
    display: inline-block;
    width: 100%;
    text-align: center;
}

#carmen-title-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: visible;
}

.carmen-star {
    position: absolute;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    animation: carmenStarFade 1.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes carmenStarFade {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, -50%) scale(1.0) rotate(45deg);
        opacity: 1;
        filter: drop-shadow(0 0 4px rgba(255, 255, 255, 1)) drop-shadow(0 0 8px rgba(243, 229, 171, 0.8));
    }
    70% {
        transform: translate(-50%, -50%) scale(0.85) rotate(90deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0) rotate(135deg);
        opacity: 0;
    }
}

/* COMPARSA SCAGLIONATA (STAGGERED FADE-IN) DALL'ALTO VERSO IL BASSO */
.fade-in-element {
    opacity: 0;
    transform: translateY(22px); /* Slitta leggermente dal basso verso l'alto */
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none; /* Evita tocchi accidentali prima della comparsa */
}

/* Attivazione al caricamento o all'apertura dell'invito */
#invitationScreen.active .fade-in-element {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Ritardi scaglionati dall'alto verso il basso (ogni 150ms per fluidità) */
#invitationScreen.active .fade-in-element.d1 { transition-delay: 0.15s; } /* 18 */
#invitationScreen.active .fade-in-element.d2 { transition-delay: 0.30s; } /* Carmen */
#invitationScreen.active .fade-in-element.d3 { transition-delay: 0.45s; } /* Divisore */
#invitationScreen.active .fade-in-element.d4 { transition-delay: 0.60s; } /* Sottotitolo */
#invitationScreen.active .fade-in-element.d5 { transition-delay: 0.75s; } /* Data/Ora */
#invitationScreen.active .fade-in-element.d6 { transition-delay: 0.90s; } /* Location */
#invitationScreen.active .fade-in-element.d7 { transition-delay: 1.05s; } /* Pulsanti Location/Foto/Conferma */
#invitationScreen.active .fade-in-element.d8 { transition-delay: 1.20s; } /* RSVP scadenza */

/* SCHERMATA DI INTRODUZIONE NARRATIVA */
#introScreen {
    background-color: #121212;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Superiore a tutti per oscurare all'avvio */
    transition: opacity 1.6s ease-in-out; /* Sfumatura d'uscita più lenta */
    padding: 30px;
    box-sizing: border-box;
}

.intro-content {
    text-align: center;
    max-width: 90%;
}

.intro-text {
    font-family: 'Playfair Display', serif;
    font-size: 28px; /* Ingrandito da 20px per massima leggibilità su smartphone */
    font-style: italic;
    color: var(--gold-light);
    line-height: 1.6;
    margin: 25px 0; /* Maggiore respiro tra le righe */
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1.8s ease-in-out, transform 1.8s ease-in-out; /* Comparsa molto più lenta ed elegante */
    text-shadow: 0 0 10px rgba(243, 229, 171, 0.4);
}

.intro-text.visible {
    opacity: 1;
    transform: translateY(0);
}
