@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Press Start 2P', cursive;
    background: linear-gradient(135deg, #ff69b4 0%, #ff1493 50%, #ff69b4 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.05) 0px,
            rgba(0, 0, 0, 0.05) 2px,
            transparent 2px,
            transparent 4px
        );
    pointer-events: none;
    animation: scanlines 8s linear infinite;
    z-index: 0;
}

@keyframes scanlines {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(10px);
    }
}

/* Contrôle de la musique */
.music-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 12px 15px;
    border-radius: 30px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

#musicToggle {
    background: linear-gradient(135deg, #ff1493 0%, #ff69b4 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 20, 147, 0.4);
}

#musicToggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 20, 147, 0.6);
}

#volumeControl {
    width: 120px;
    height: 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#volumeControl::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff1493 0%, #ff69b4 100%);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(255, 20, 147, 0.4);
}

#volumeControl::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff1493 0%, #ff69b4 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(255, 20, 147, 0.4);
}

/* Particules de fond */
.particles-container {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    pointer-events: none;
    font-size: 2rem;
    opacity: 0.6;
    animation: float-particle 6s ease-in-out infinite;
}

@keyframes float-particle {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(20px, -30px) rotate(90deg);
    }
    50% {
        transform: translate(0, -60px) rotate(180deg);
    }
    75% {
        transform: translate(-20px, -30px) rotate(270deg);
    }
}

/* Page principale */
.container {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
    transition: opacity 0.5s ease-out;
}

.container.hidden {
    opacity: 0;
    pointer-events: none;
}

.content {
    text-align: center;
    animation: pulse 1.5s ease-in-out infinite;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 3;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.title {
    font-size: 3rem;
    color: #fff;
    text-shadow: 
        4px 4px 0px #ff1493,
        8px 8px 0px rgba(0, 0, 0, 0.2),
        -2px -2px 0px rgba(255, 255, 255, 0.5);
    margin-bottom: 1rem;
    letter-spacing: 3px;
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% {
        text-shadow: 
            4px 4px 0px #ff1493,
            8px 8px 0px rgba(0, 0, 0, 0.2),
            -2px -2px 0px rgba(255, 255, 255, 0.5),
            0 0 10px rgba(255, 20, 147, 0.3);
    }
    50% {
        text-shadow: 
            4px 4px 0px #ff1493,
            8px 8px 0px rgba(0, 0, 0, 0.2),
            -2px -2px 0px rgba(255, 255, 255, 0.5),
            0 0 30px rgba(255, 20, 147, 0.8);
    }
}

.subtitle {
    font-size: 1.2rem;
    color: #ffe0f0;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.stats {
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

.stats span {
    color: #ffb6c1;
    font-weight: bold;
    animation: pulse-stats 1s ease-in-out infinite;
}

@keyframes pulse-stats {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.buttons-container {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    height: 150px;
}

.btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    padding: 1.5rem 2rem;
    border: none;
    border-radius: 0;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.1s ease;
    letter-spacing: 2px;
    box-shadow: 
        4px 4px 0px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transition: left 0.3s ease;
    z-index: 1;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    opacity: 0;
    animation: shine 2s infinite;
}

@keyframes shine {
    0% {
        opacity: 0;
        transform: translateX(-100%);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

.btn:hover::before {
    left: 100%;
}

.btn-yes {
    background: linear-gradient(135deg, #ff1493 0%, #ff69b4 100%);
    color: #fff;
    border: 4px solid #fff;
    position: absolute;
    z-index: 10;
    left: 50%;
    top: 50%;
    transform: translate(-80px, -50%);
    box-shadow: 
        4px 4px 0px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(255, 20, 147, 0.5),
        inset 0 0 10px rgba(255, 255, 255, 0.3);
}

.btn-yes:hover {
    background: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%);
    transform: translate(-80px, -50%) scale(1.1);
    box-shadow: 
        6px 6px 0px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(255, 20, 147, 0.8);
}

.btn-yes:active {
    transform: translate(-80px, -50%) scale(0.95);
    box-shadow: 
        2px 2px 0px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 20, 147, 0.5);
}

.btn-no {
    background: rgba(255, 255, 255, 0.9);
    color: #ff1493;
    border: 4px solid #ff1493;
    position: fixed;
    z-index: 999;
    left: 50vw;
    top: 50vh;
    transform: translate(80px, -50%);
    backdrop-filter: blur(5px);
    box-shadow: 
        4px 4px 0px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 255, 255, 0.3),
        inset 0 0 10px rgba(255, 255, 255, 0.5);
}

.btn-no:hover {
    background: rgba(255, 224, 240, 0.95);
    transform: translate(calc(80px + var(--tx)), calc(-50% + var(--ty)));
    box-shadow: 
        6px 6px 0px rgba(0, 0, 0, 0.3),
        0 0 25px rgba(255, 255, 255, 0.5);
}

.btn-no:active {
    transform: translate(80px, -50%) scale(0.95);
    box-shadow: 
        2px 2px 0px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(255, 255, 255, 0.3);
}

/* Confettis */
@keyframes fall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(var(--spread)) rotate(360deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
}

.confetti-piece {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #ff1493;
    border-radius: 50%;
    animation: fall 3s ease-out forwards;
    box-shadow: 0 0 10px rgba(255, 20, 147, 0.8);
}

/* Page de fin */
.end-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff69b4 0%, #ff1493 50%, #ff69b4 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-out;
}

.end-screen.show {
    opacity: 1;
    pointer-events: all;
}

.end-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.end-content {
    text-align: center;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border-radius: 30px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 0 30px rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2;
    max-width: 600px;
    animation: slideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.end-title {
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 
        4px 4px 0px #ff1493,
        8px 8px 0px rgba(0, 0, 0, 0.2);
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.end-message {
    font-size: 1.1rem;
    color: #fff;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.sparkle {
    animation: sparkle 1s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.end-stats {
    font-size: 0.9rem;
    color: #ffe0f0;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.end-stats p {
    margin: 0.5rem 0;
}

.end-stats span {
    color: #ffb6c1;
    font-weight: bold;
    animation: pulse 1s ease-in-out infinite;
}

.end-hearts {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.heart {
    animation: float-hearts 2s ease-in-out infinite;
}

.heart:nth-child(1) { animation-delay: 0s; }
.heart:nth-child(2) { animation-delay: 0.2s; }
.heart:nth-child(3) { animation-delay: 0.4s; }
.heart:nth-child(4) { animation-delay: 0.6s; }
.heart:nth-child(5) { animation-delay: 0.8s; }

@keyframes float-hearts {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.btn-restart {
    background: linear-gradient(135deg, #ff1493 0%, #ff69b4 100%);
    color: #fff;
    border: 4px solid #fff;
    font-size: 1rem;
    padding: 1rem 2rem;
    transition: all 0.3s ease;
}

.btn-restart:hover {
    transform: scale(1.1);
    box-shadow: 
        6px 6px 0px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(255, 20, 147, 0.8);
}

/* Notifications */
.notifications {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.notification {
    background: rgba(255, 255, 255, 0.95);
    color: #ff1493;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    border-left: 5px solid #ff1493;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    font-size: 0.85rem;
    backdrop-filter: blur(5px);
    animation: slideInRight 0.3s ease-out, slideOutRight 0.3s ease-out 2.7s forwards;
    position: relative;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.notification::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff1493, transparent);
    animation: loadingBar 3s linear forwards;
    border-radius: 0 0 0 10px;
}

@keyframes loadingBar {
    from {
        width: 100%;
    }
    to {
        width: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .btn {
        font-size: 0.8rem;
        padding: 1rem 1.5rem;
    }

    .buttons-container {
        gap: 1rem;
    }

    .end-title {
        font-size: 1.5rem;
    }

    .end-message {
        font-size: 0.9rem;
    }

    .music-control {
        top: 10px;
        right: 10px;
        padding: 8px 10px;
    }

    #volumeControl {
        width: 80px;
    }

    .notifications {
        right: 10px;
        top: 70px;
        max-width: 300px;
    }
}

/* Footer */
.footer {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-radius: 30px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.footer p {
    font-size: 0.75rem;
    color: #fff;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
    margin: 0;
    font-weight: bold;
}

.heart-animate {
    display: inline-block;
    animation: heart-beat 0.8s ease-in-out infinite;
    margin: 0 4px;
}

@keyframes heart-beat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(1.2);
    }
}
