:root {
    --bg-color: #1a1518;
    --primary: #d4af37;
    --accent: #f4b4b4;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-color: #fcebeb;
}

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

body {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

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

.hidden {
    display: none !important;
}

/* ENVELOPE SCREEN */
.envelope-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, #2e1e23, #1a1518);
    z-index: 100;
    transition: opacity 1s ease-in-out;
}

.envelope {
    position: relative;
    width: 300px;
    height: 200px;
    background: #c2957b;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.3s;
}

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

.envelope-flap {
    position: absolute;
    top: 0; left: 0;
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-top: 100px solid #d4a387;
    z-index: 3;
    transition: transform 0.6s ease-in-out;
    transform-origin: top;
}

.envelope.open .envelope-flap {
    transform: rotateX(180deg);
}

.envelope-paper {
    position: absolute;
    bottom: 0; left: 0;
    border-left: 150px solid #b8866a;
    border-right: 150px solid #b8866a;
    border-bottom: 100px solid #a6765b;
    z-index: 2;
}

.wax-seal {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 50px; height: 50px;
    background: #902923;
    border-radius: 50%;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px #5c1814, 0 5px 10px rgba(0,0,0,0.3);
    color: #fcd5d5;
    font-size: 24px;
    transition: opacity 0.3s;
}

.envelope.open .wax-seal {
    opacity: 0;
}

.instruction-text {
    margin-top: 30px;
    font-size: 1.2rem;
    color: var(--accent);
    opacity: 0.8;
    animation: pulse 2s infinite;
}

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

/* MAIN CONTENT */
.main-content {
    position: relative;
    z-index: 10;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
    opacity: 0;
    animation: fadeIn 2s forwards;
}

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

.hero-section {
    text-align: center;
    margin-bottom: 3rem;
    margin-top: 2rem;
}

.glow-text {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: #fff;
    text-shadow: 0 0 10px var(--accent), 0 0 20px var(--primary);
    line-height: 1.2;
}

.name-highlight {
    font-family: 'Great Vibes', cursive;
    font-size: 5rem;
    color: var(--primary);
}

/* GLASS PANEL */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 4rem;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.typewriter-container {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    line-height: 1.6;
    min-height: 150px;
}

.cursor {
    font-weight: bold;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* POLAROID GALLERY */
.polaroid-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 4rem;
    width: 100%;
}

.polaroid-stack {
    position: relative;
    width: 300px;
    height: 350px;
    perspective: 1000px;
}

.polaroid {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: white;
    padding: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    border-radius: 3px;
    transform: rotate(var(--rot));
    transition: transform 0.5s ease, opacity 0.5s ease;
    cursor: pointer;
    user-select: none;
}

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

.polaroid .caption {
    font-family: 'Great Vibes', cursive;
    color: #333;
    font-size: 1.8rem;
    text-align: center;
    margin-top: 15px;
}

.swipe-hint {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--accent);
    opacity: 0.7;
}

/* HUG BUTTON */
.interaction-section {
    text-align: center;
    margin-bottom: 5rem;
}

.hug-button {
    background: linear-gradient(135deg, #f4b4b4, #d4af37);
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-family: 'Outfit', sans-serif;
    color: #1a1518;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(244, 180, 180, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.hug-button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(244, 180, 180, 0.6);
}

.hug-message {
    margin-top: 1rem;
    font-size: 1.2rem;
    color: var(--accent);
    font-family: 'Great Vibes', cursive;
    font-size: 2rem;
}

/* LOVE COUNTER */
.counter-section {
    text-align: center;
    padding: 2rem;
}

.counter-section h2 {
    font-family: 'Great Vibes', cursive;
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.love-counter {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.time-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 10px 15px;
    min-width: 80px;
}

.time-box span {
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    display: block;
}

.time-box p {
    font-size: 0.9rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* MUSIC TOGGLE */
.music-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    font-size: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.music-toggle.playing .music-icon {
    animation: spin 3s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

/* FIREWORKS SECTION */
.fireworks-section {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 5rem;
    position: relative;
}

.fireworks-btn {
    background: linear-gradient(135deg, #d4af37, #f4b4b4);
    border: none;
    padding: 20px 40px;
    border-radius: 50px;
    font-size: 1.5rem;
    font-family: 'Outfit', sans-serif;
    color: #1a1518;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 25px rgba(212, 175, 55, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.fireworks-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.8);
}

.final-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Great Vibes', cursive;
    font-size: 4rem;
    color: #fff;
    text-shadow: 0 0 20px #f4b4b4, 0 0 40px #d4af37;
    z-index: 2000;
    text-align: center;
    width: 90%;
    animation: fadeInScale 2s ease-out;
}

@keyframes fadeInScale {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* STAR MAP SECTION */
.star-map-section {
    text-align: center;
    margin-bottom: 4rem;
}

.star-caption {
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 2rem;
}

.star-map-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    border-radius: 50%;
    background: radial-gradient(circle at center, #0a1128 0%, #000 100%);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.2), inset 0 0 50px #000;
    overflow: hidden;
    border: 2px solid var(--glass-border);
}

.stars-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 20px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 40px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 90px 40px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 160px 120px, #ddd, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 250px 90px, #eee, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 200px 200px, #fff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 100px 250px, #ddd, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 260px 260px, #fff, rgba(0,0,0,0));
    opacity: 0.8;
}

.star-point {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px #fff, 0 0 20px #d4af37;
    animation: twinkle 2s infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.5); }
}

.constellation-lines {
    position: absolute;
    top: 0; left: 0;
    z-index: 1;
}

/* SECRET CODE */
#secret-code-container {
    max-width: 500px;
    margin: 0 auto 3rem auto;
    text-align: center;
}

#secret-code-container h3 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

#secret-code-container .question {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

#secret-input {
    width: 80%;
    padding: 15px;
    font-size: 1.2rem;
    border-radius: 25px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-align: center;
    margin-bottom: 15px;
    outline: none;
    font-family: 'Outfit', sans-serif;
}

#secret-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.unlock-btn {
    background: var(--primary);
    color: #1a1518;
    border: none;
    padding: 10px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s;
}

.unlock-btn:hover {
    transform: scale(1.05);
}

.error-msg {
    color: #f4b4b4;
    margin-top: 15px;
    font-weight: bold;
}

/* RESPONSIVE DESIGN (Téléphones et Tablettes) */
@media (max-width: 768px) {
    /* Typographie */
    .glow-text { font-size: 2.2rem; }
    .name-highlight { font-size: 3.5rem; }
    .typewriter-container { font-size: 1rem; min-height: 120px; }
    .counter-section h2 { font-size: 2rem; }
    
    /* Espacements et Conteneurs */
    .main-content { padding: 1rem; }
    .glass-panel { padding: 1.5rem; }
    
    /* Galerie Polaroïd */
    .polaroid-stack { width: 260px; height: 300px; }
    .polaroid img { height: 200px; }
    .polaroid .caption { font-size: 1.5rem; }
    
    /* Compteur d'Amour */
    .love-counter { gap: 10px; }
    .time-box { padding: 8px 10px; min-width: 70px; }
    .time-box span { font-size: 1.5rem; }
    .time-box p { font-size: 0.75rem; }
    
    /* Bouton Câlin */
    .hug-button { font-size: 1rem; padding: 12px 24px; }
    .hug-message { font-size: 1.5rem; }
}

@media (max-width: 360px) {
    /* Ajustements pour les très petits écrans */
    .polaroid-stack { width: 220px; height: 260px; }
    .polaroid img { height: 170px; }
    .glow-text { font-size: 1.8rem; }
    .name-highlight { font-size: 3rem; }
    .time-box { min-width: 60px; padding: 5px; }
    .time-box span { font-size: 1.2rem; }
}
