/* ============================================
   🎄 Le Site de Mélanie - Styles de Noël 🎄
   ============================================ */

:root {
    /* Couleurs festives */
    --noel-rouge: #c41e3a;
    --noel-rouge-fonce: #8b0000;
    --noel-vert: #228b22;
    --noel-vert-sapin: #0b3d0b;
    --noel-or: #ffd700;
    --noel-or-clair: #ffe55c;
    --noel-creme: #fff8e7;
    --noel-neige: #f0f8ff;
    --noel-chocolat: #3d1c02;
    
    /* Ombres et effets */
    --lueur-or: 0 0 20px rgba(255, 215, 0, 0.4);
    --ombre-douce: 0 4px 15px rgba(0, 0, 0, 0.15);
    --ombre-carte: 0 8px 32px rgba(0, 0, 0, 0.2);
}

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

html, body {
    min-height: 100vh;
    font-family: 'Quicksand', sans-serif;
    background: linear-gradient(135deg, var(--noel-vert-sapin) 0%, #1a472a 50%, var(--noel-rouge-fonce) 100%);
    color: var(--noel-creme);
    overflow-x: hidden;
}

/* ============================================
   Flocons de neige animés
   ============================================ */
#snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: white;
    font-size: 1rem;
    animation: fall linear infinite;
    opacity: 0.8;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

@keyframes fall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ============================================
   Conteneur principal
   ============================================ */
#root {
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Écran de mot de passe
   ============================================ */
.password-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.password-card {
    background: linear-gradient(145deg, rgba(255, 248, 231, 0.95), rgba(240, 248, 255, 0.9));
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--ombre-carte), var(--lueur-or);
    max-width: 450px;
    width: 100%;
    border: 3px solid var(--noel-or);
    position: relative;
    overflow: hidden;
}

.password-card::before {
    content: '🎄';
    position: absolute;
    font-size: 8rem;
    opacity: 0.1;
    top: -20px;
    right: -30px;
    transform: rotate(15deg);
}

.password-card h1 {
    font-family: 'Caveat', cursive;
    font-size: 3rem;
    color: var(--noel-rouge);
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 0 var(--noel-or-clair);
}

.password-card .subtitle {
    font-size: 1.2rem;
    color: var(--noel-vert);
    margin-bottom: 2rem;
}

.password-card .decorations {
    font-size: 2rem;
    margin: 1rem 0;
    animation: bounce 2s ease-in-out infinite;
}

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

.password-input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.password-input {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid var(--noel-vert);
    border-radius: 50px;
    text-align: center;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    color: var(--noel-chocolat);
}

.password-input:focus {
    outline: none;
    border-color: var(--noel-or);
    box-shadow: var(--lueur-or);
}

.password-input::placeholder {
    color: #aaa;
}

.btn-entrer {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: inherit;
    background: linear-gradient(145deg, var(--noel-rouge), var(--noel-rouge-fonce));
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--ombre-douce);
}

.btn-entrer:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(196, 30, 58, 0.4);
}

.btn-entrer:active {
    transform: translateY(-1px);
}

.error-message {
    color: var(--noel-rouge);
    font-weight: 600;
    margin-top: 1rem;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    background: linear-gradient(90deg, var(--noel-rouge-fonce), var(--noel-rouge));
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--ombre-douce);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-family: 'Caveat', cursive;
    font-size: 2rem;
    color: var(--noel-or);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    list-style: none;
}

.nav-link {
    color: var(--noel-creme);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 215, 0, 0.2);
    color: var(--noel-or);
}

.btn-logout {
    background: transparent;
    border: 2px solid var(--noel-or);
    color: var(--noel-or);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: var(--noel-or);
    color: var(--noel-rouge-fonce);
}

/* ============================================
   Contenu principal
   ============================================ */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.page {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Page d'accueil - Noël
   ============================================ */
.christmas-intro {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(145deg, rgba(255, 248, 231, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 24px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    margin-bottom: 2rem;
}

.christmas-intro h1 {
    font-family: 'Caveat', cursive;
    font-size: 3.5rem;
    color: var(--noel-or);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.christmas-intro .big-emoji {
    font-size: 4rem;
    display: block;
    margin: 1rem 0;
    animation: pulse 2s ease-in-out infinite;
}

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

.christmas-intro p {
    font-size: 1.3rem;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto 1rem;
}

.christmas-intro .signature {
    font-family: 'Caveat', cursive;
    font-size: 1.8rem;
    color: var(--noel-or);
    margin-top: 1.5rem;
}

/* ============================================
   Jeu de la Vie de Conway
   ============================================ */
.game-of-life-section {
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.2));
    border-radius: 24px;
    padding: 2rem;
    border: 2px solid rgba(255, 215, 0, 0.2);
}

.game-of-life-section h2 {
    font-family: 'Caveat', cursive;
    font-size: 2.5rem;
    color: var(--noel-or);
    text-align: center;
    margin-bottom: 0.5rem;
}

.game-of-life-section .game-subtitle {
    text-align: center;
    opacity: 0.8;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.game-rules {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.game-rules h3 {
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    color: var(--noel-or);
    margin-bottom: 0.75rem;
    text-align: center;
}

.game-rules ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.game-rules li {
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 0.95rem;
}

.game-rules li strong {
    color: var(--noel-or-clair);
}

.game-rules .rules-note {
    text-align: center;
    margin-top: 0.75rem;
    font-style: italic;
    opacity: 0.85;
    font-size: 0.9rem;
}

.game-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.game-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-btn.primary {
    background: linear-gradient(145deg, var(--noel-vert), var(--noel-vert-sapin));
    color: white;
}

.game-btn.secondary {
    background: linear-gradient(145deg, var(--noel-or), var(--noel-or-clair));
    color: var(--noel-chocolat);
}

.game-btn.danger {
    background: linear-gradient(145deg, var(--noel-rouge), var(--noel-rouge-fonce));
    color: white;
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--ombre-douce);
}

.game-btn:active {
    transform: translateY(0);
}

.presets-section {
    margin-bottom: 1.5rem;
}

.presets-section h3 {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.presets-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.preset-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--noel-creme);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--noel-or);
}

.game-grid-container {
    display: flex;
    justify-content: center;
    overflow: auto;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
}

.game-grid {
    display: grid;
    gap: 1px;
    background: rgba(255, 255, 255, 0.1);
    padding: 1px;
    border-radius: 8px;
}

.game-cell {
    width: 15px;
    height: 15px;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: background 0.1s ease;
    border-radius: 2px;
}

.game-cell.alive {
    background: linear-gradient(145deg, var(--noel-or), var(--noel-or-clair));
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.game-cell:hover {
    background: rgba(255, 215, 0, 0.3);
}

.game-stats {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.95rem;
    opacity: 0.8;
}

.game-instructions {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    opacity: 0.7;
    font-style: italic;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    text-align: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    margin-top: auto;
}

.footer p {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .password-card {
        padding: 2rem;
    }
    
    .password-card h1 {
        font-size: 2.5rem;
    }
    
    .christmas-intro h1 {
        font-size: 2.5rem;
    }
    
    .christmas-intro p {
        font-size: 1.1rem;
    }
    
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .game-cell {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 480px) {
    .game-cell {
        width: 10px;
        height: 10px;
    }
    
    .main-content {
        padding: 1rem;
    }
}

