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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a472a 0%, #0d2818 100%);
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 8px;
    transition: background 0.3s;
    z-index: 100;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.game-header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.game-header h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.stat {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    min-width: 120px;
}

.stat-label {
    display: block;
    font-size: 0.9em;
    opacity: 0.8;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
}

.game-area {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 40px 20px;
    min-height: 600px;
    position: relative;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Sapin de Noël */
.tree {
    width: min(280px, 60vw);
    height: auto;
    aspect-ratio: 3 / 4.2;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.tree > div {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.tree-top {
    border-left: 90px solid transparent;
    border-right: 90px solid transparent;
    border-bottom: 140px solid #0f5132;
    top: 0;
}

.tree-middle {
    border-left: 120px solid transparent;
    border-right: 120px solid transparent;
    border-bottom: 170px solid #198754;
    top: 80px;
}

.tree-bottom {
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-bottom: 200px solid #20c997;
    top: 180px;
}

.tree-trunk {
    width: 50px;
    height: 130px;
    background: #6c3428;
    top: 330px;
    border-radius: 4px;
}

/* Boules de Noël */
.ornaments {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.ornament {
    position: absolute;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 
                inset -5px -5px 15px rgba(0, 0, 0, 0.3),
                inset 5px 5px 15px rgba(255, 255, 255, 0.2);
}

.ornament::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: #c0c0c0;
    border-radius: 50% 50% 0 0;
}

.ornament::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 8px;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), transparent 60%);
    border-radius: 50%;
    filter: blur(1px);
}

.ornament:hover {
    transform: scale(1.1);
}

.ornament.lit {
    animation: glow 0.6s ease-in-out infinite alternate;
    transform: scale(1.25);
    border-color: rgba(255,255,255,0.9);
    box-shadow:
        0 0 40px 12px currentColor,    /* Glow puissant */
        0 0 20px 10px rgba(255,255,255,0.7), /* Anneau clair autour */
        inset 0 0 20px rgba(255,255,255,0.5); /* Halo intérieur */
}

@keyframes glow {
    from { filter: brightness(1.4); }
    to   { filter: brightness(2.2); }
}

/* Contrôles du jeu */
.game-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.game-instructions {
    color: white;
    font-size: 1.1em;
    margin-top: 20px;
    line-height: 1.6;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.btn-start, .btn-restart, .btn-share {
    background: linear-gradient(135deg, #c41e3a 0%, #8b1a2a 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.4);
    transition: all 0.3s;
    font-weight: bold;
}

.btn-start:hover, .btn-restart:hover, .btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.6);
}

.btn-start:active, .btn-restart:active, .btn-share:active {
    transform: translateY(0);
}

/* Écran de fin */
.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    z-index: 10;
    color: white;
    min-width: 300px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.game-over h2 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.final-score, .best-streak {
    font-size: 1.3em;
    margin: 15px 0;
}

.final-score span, .best-streak span {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.5em;
}

.game-over-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-share {
    background: linear-gradient(135deg, #1da1f2 0%, #0d8bd9 100%);
    box-shadow: 0 4px 15px rgba(29, 161, 242, 0.4);
}

.btn-share:hover {
    box-shadow: 0 6px 20px rgba(29, 161, 242, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .game-header h1 {
        font-size: 1.8em;
    }

    .game-stats {
        gap: 15px;
    }

    .stat {
        padding: 10px 15px;
        min-width: 90px;
    }

    .stat-value {
        font-size: 1.5em;
    }

    .tree-top, .tree-middle, .tree-bottom {
        border-left-width: 60px;
        border-right-width: 60px;
        border-bottom-width: 100px;
        left: -60px;
    }

    .tree-middle {
        border-left-width: 85px;
        border-right-width: 85px;
        border-bottom-width: 120px;
        left: -85px;
    }

    .tree-bottom {
        border-left-width: 110px;
        border-right-width: 110px;
        border-bottom-width: 145px;
        left: -110px;
    }

    .ornament {
        width: 30px;
        height: 30px;
    }

    .game-instructions {
        font-size: 0.9em;
    }

    .btn-start, .btn-restart, .btn-share {
        padding: 12px 30px;
        font-size: 1em;
    }

    .game-over {
        padding: 30px 20px;
        min-width: 250px;
    }

    .back-btn {
        top: 10px;
        left: 10px;
        padding: 8px 15px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .game-area {
        padding: 20px 10px;
        min-height: 500px;
    }

    .ornament {
        width: 25px;
        height: 25px;
    }
}
