@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: backgroundMove 20s linear infinite;
    opacity: 0.3;
}

@keyframes backgroundMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

.container {
    text-align: center;
    z-index: 1;
    position: relative;
}

.title {
    font-size: 4rem;
    font-weight: 700;
    color: white;
    margin-bottom: 3rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
    animation: titleFloat 3s ease-in-out infinite;
}

@keyframes titleFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.coin-container {
    perspective: 1000px;
    margin-bottom: 2rem;
}

.coin {
    width: 200px;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    cursor: pointer;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.coin:hover:not(.flipping) {
    transform: scale(1.1);
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 8px solid rgba(255, 255, 255, 0.3);
}

.heads {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    transform: rotateY(0deg);
}

.tails {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    transform: rotateY(180deg);
}

.coin-content {
    font-size: 6rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.result {
    font-size: 2.5rem;
    font-weight: 600;
    color: white;
    min-height: 3rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.result.show {
    opacity: 1;
    transform: translateY(0);
}

/* Flip animations */
@keyframes flipHeads {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(1800deg);
    }
}

@keyframes flipTails {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(1980deg);
    }
}

.coin.flip-heads {
    animation: flipHeads 2s ease-in-out forwards;
}

.coin.flip-tails {
    animation: flipTails 2s ease-in-out forwards;
}

/* Responsive design */
@media (max-width: 768px) {
    .title {
        font-size: 3rem;
        margin-bottom: 2rem;
    }
    
    .coin {
        width: 150px;
        height: 150px;
    }
    
    .coin-content {
        font-size: 4.5rem;
    }
    
    .result {
        font-size: 2rem;
    }
}
