:root {
    /* Paleta Amor Intenso */
    --clr-gold: #ffd700;
    --clr-crimson: #cc0000;
    --clr-passion: #ff0033;
    --clr-deep-wine: #2a000d;
    --clr-white: #ffffff;

    /* Tipografia */
    --font-display: 'Playfair Display', serif;
    --font-sans: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #050002;
    color: var(--clr-white);
    font-family: var(--font-sans);
    overflow: hidden;
    line-height: 1.6;
}

#app {
    position: relative;
    width: 100vw;
    height: 100vh;
    transition: background-image 2s ease-in-out;
    /* Suavizar troca de bg */
    background-size: cover;
    background-position: center;
}

/* Cinematic Overlays */
#app::after {
    content: "";
    /* Vinheta e Overlay Escuro para leitura sobre fotos */
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.9) 90%);
    mix-blend-mode: multiply;
}

#photo-overlay {
    /* Camada extra para escurecer fotos muito claras */
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10;
}

#grain-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 25;
    /* Acima da vinheta */
    opacity: 0.08;
    /* Um pouco mais visível para textura de foto antiga */
    background-image: url("https://www.transparenttextures.com/patterns/asfalt-light.png");
}

#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 30;
    /* Partículas acima das fotos */
    pointer-events: none;
    opacity: 0.8;
}

#story-container {
    position: relative;
    z-index: 40;
    /* Acima de tudo */
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.phase-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.5s ease;
    pointer-events: auto;
}

.phase-section.active {
    opacity: 1;
    visibility: visible;
}

.content-wrapper {
    max-width: 900px;
    text-align: center;
    position: relative;
    z-index: 100;
    padding: 2rem;
    /* Efeito vidro sutil para destacar texto sobre fotos */
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 215, 0, 0.1);
}

/* Tipografia Romântica Pulsante */
.massive-text {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 10vw, 6rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--clr-gold), #ff4d4d);
    /* Mais legível */
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.8));
    animation: heartbeat 3s infinite ease-in-out;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

.subtitle {
    font-size: 1.2rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--clr-gold);
    margin-bottom: 3rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 1);
}

.narrative-fragment {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 4vw, 2.2rem);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-style: italic;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9);
    /* Sombra forte para leitura */
}

.date-stamp {
    font-family: var(--font-sans);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
    display: block;
    font-size: 0.9rem;
}

/* Botão CORAÇÃO - Ação Principal */
.primary-btn {
    background: linear-gradient(135deg, #b30000, #ff0044);
    border: 2px solid var(--clr-gold);
    color: white;
    padding: 1.5rem 3rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-radius: 50px;
    box-shadow: 0 0 40px rgba(255, 0, 68, 0.5);
    transition: all 0.4s ease;
    z-index: 200;
    pointer-events: auto;
    margin-top: 2rem;
}

.primary-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 0 60px rgba(255, 0, 68, 0.8), 0 0 20px var(--clr-gold);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-25deg);
    animation: shine-anim 4s infinite;
}

@keyframes shine-anim {
    0% {
        left: -100%;
    }

    20% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

.instruction-hint {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.1em;
    text-shadow: 0 1px 3px black;
}

/* Botão Continuar (Cinematic) */
.cinema-btn {
    margin-top: 2rem;
    background: rgba(0, 0, 0, 0.5);
    /* Fundo semi-transparente */
    border: 1px solid rgba(255, 215, 0, 0.5);
    color: var(--clr-gold);
    padding: 1rem 2.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.5s ease;
    opacity: 0;
    pointer-events: auto;
    backdrop-filter: blur(5px);
}

.cinema-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--clr-gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
    transform: scale(1.05);
}

/* Formulário Final */
.final-form textarea {
    width: 100%;
    max-width: 600px;
    height: 150px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    padding: 1rem;
    color: white;
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 2rem;
    resize: none;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.final-form textarea:focus {
    outline: none;
    border-color: var(--clr-gold);
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

/* UI Layer */
#ui-layer {
    position: fixed;
    bottom: 2rem;
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    pointer-events: none;
}

#audio-toggle {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    border: 1px solid var(--clr-gold);
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--clr-gold);
    opacity: 0.8;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#audio-toggle:hover {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

/* --- MOBILE FIRST & RESPONSIVENESS ADJUSTMENTS --- */
@media (max-width: 768px) {
    #app {
        background-position: center top;
        /* Focar rostos em fotos verticais */
    }

    .content-wrapper {
        padding: 1.5rem 1rem;
        background: rgba(0, 0, 0, 0.6);
        /* Mais escuro no mobile para ler melhor */
        border-radius: 15px;
        width: 90%;
        /* Margem lateral */
    }

    .massive-text {
        font-size: clamp(2rem, 12vw, 4rem);
        margin-bottom: 1rem;
        line-height: 1.1;
    }

    .narrative-fragment {
        font-size: 1.15rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }

    .date-stamp {
        font-size: 0.75rem;
        margin-bottom: 1rem;
    }

    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 2rem;
        letter-spacing: 0.2em;
    }

    .primary-btn {
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
        letter-spacing: 0.15em;
    }

    .cinema-btn {
        font-size: 0.8rem;
        padding: 0.8rem 1.5rem;
        width: 100%;
        margin-top: 1.5rem;
    }

    .final-form textarea {
        height: 120px;
        font-size: 1rem;
    }

    #ui-layer {
        padding: 0 1rem;
        bottom: 1rem;
    }

    #audio-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@media (max-height: 600px) {

    /* Ajustes para telas muito curtas */
    .content-wrapper {
        padding: 1rem;
    }

    .massive-text {
        margin-bottom: 0.5rem;
        font-size: 2rem;
    }

    .narrative-fragment {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .image-container {
        display: none;
    }

    /* Ocultar elementos não essenciais */
}