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

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #000;
    color: #fff;
    overflow-x: hidden;
    min-height: 100vh;
    height: 100dvh; /* Better for mobile browsers */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Typography */
.elegant-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #d4af37; /* Gold */
}

.elegant-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #eee;
}

.taquin {
    font-style: italic;
}

/* Buttons & Inputs */
.gold-btn {
    background: linear-gradient(45deg, #d4af37, #f9d976);
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    border-radius: 30px;
    transition: transform 0.3s, box-shadow 0.3s;
    font-family: 'Montserrat', sans-serif;
    margin-top: 20px;
}

.gold-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

input {
    padding: 10px 15px;
    font-size: 1.1rem;
    border-radius: 5px;
    border: 2px solid #d4af37;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-align: center;
    margin-bottom: 10px;
    display: block;
    margin: 0 auto 20px auto;
}

input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
}

.error-msg {
    color: #ff4d4d;
    font-size: 0.9rem;
    height: 20px;
    margin-top: 10px;
}

/* Steps Management */
.step {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    padding: 20px;
    overflow-y: auto; /* Allow scrolling on small screens */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.step.active {
    display: flex;
    opacity: 1;
    z-index: 10;
}

.content {
    max-width: 600px;
    width: 100%;
    z-index: 2;
    position: relative;
}

/* Step 0: Particles */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 1;
}

/* Step 1: Image */
.image-container {
    width: 100%;
    height: 200px;
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #d4af37;
}

.placeholder-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

/* Step 2: Pink Theme */
.pink-theme {
    background-color: #ffe6ea; /* Pink powder */
}

.pink-theme .elegant-text {
    color: #5a3a4a;
}

.pink-theme input {
    color: #d1477e;
    border-color: #d1477e;
    background: rgba(255, 255, 255, 0.5);
}

.pink-theme input::placeholder {
    color: rgba(209, 71, 126, 0.6);
}

.pulsing-heart {
    font-size: 5rem;
    animation: pulse 1.5s infinite;
    margin-bottom: 20px;
    color: #ff4d6d;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Step 3: Cards */
.cards-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #d4af37;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
    min-width: 120px;
    width: auto;
}

.card:hover {
    transform: translateY(-10px);
    background: rgba(212, 175, 55, 0.2);
}

.card.selected {
    background: rgba(212, 175, 55, 0.5);
    transform: scale(0.95);
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Step 4: Letters */
.letters-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    min-height: 60px;
}

.letter-box {
    width: 50px;
    height: 50px;
    background: #333;
    border: 1px solid #d4af37;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

.drop-zone {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    min-height: 60px;
    border: 1px dashed #666;
    padding: 10px;
    border-radius: 10px;
}

/* Step 5: Clues */
.clues-container {
    text-align: left;
    margin-bottom: 20px;
}

.clue {
    margin-bottom: 10px;
    font-size: 1rem;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

.clue:nth-child(1) { animation-delay: 0.5s; }
.clue:nth-child(2) { animation-delay: 1.5s; }
.clue:nth-child(3) { animation-delay: 2.5s; }
.clue:nth-child(4) { animation-delay: 3.5s; }
.clue:nth-child(5) { animation-delay: 4.5s; }

@keyframes fadeIn {
    to { opacity: 1; }
}

.saucisse-pop {
    cursor: pointer;
    transition: transform 0.1s;
    display: inline-block;
}

.saucisse-pop:active {
    transform: scale(1.5) rotate(20deg);
}

/* Step 6: Treasure */
.treasure-reveal {
    width: 300px;
    height: 300px;
    margin: 0 auto 30px auto;
    opacity: 0;
    transform: scale(0.5);
    animation: revealTreasure 3s forwards;
    animation-delay: 1s;
}

.treasure-img {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

@keyframes revealTreasure {
    0% { opacity: 0; transform: scale(0.5) rotate(0deg); }
    50% { opacity: 1; transform: scale(1) rotate(180deg); }
    100% { opacity: 1; transform: scale(1) rotate(360deg); }
}

.gold-glow {
    text-shadow: 0 0 10px #d4af37, 0 0 20px #d4af37;
    opacity: 0;
    animation: fadeIn 2s forwards;
    animation-delay: 4s;
}

/* Petals */
.petal {
    position: absolute;
    background-color: #ff4d6d;
    border-radius: 150% 0 150% 0;
    animation: fall linear forwards;
    z-index: 5;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(720deg);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .elegant-title {
        font-size: 1.8rem;
    }

    .elegant-text {
        font-size: 1rem;
        padding: 0 10px;
    }

    .cards-container {
        flex-wrap: wrap;
        gap: 10px;
    }

    .card {
        width: 45%; /* 2 cards per row */
        min-width: auto;
        padding: 15px;
    }

    .letters-container, .drop-zone {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .letter-box {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .treasure-reveal {
        width: 250px;
        height: 250px;
    }
    
    .gold-btn {
        width: 90%;
        padding: 15px 20px;
    }

    .image-container {
        height: 180px;
    }

    input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}
