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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 20px;
}

.title {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    text-align: center;
}

/* Coin container */
.coin-container {
    perspective: 1000px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coin {
    width: 280px;
    height: 280px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 5s ease-out;
    cursor: pointer;
}

.coin:hover {
    filter: brightness(1.1);
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 8px solid rgba(255, 255, 255, 0.3);
}

.coin-heads {
    background: linear-gradient(135deg, #e8e8e8 0%, #c0c0c0 50%, #a8a8a8 100%);
    transform: rotateY(0deg);
}

.coin-tails {
    background: linear-gradient(135deg, #e8e8e8 0%, #c0c0c0 50%, #a8a8a8 100%);
    transform: rotateY(180deg);
}

.coin-image {
    width: 70%;
    height: 70%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Controls */
.controls {
    display: flex;
    gap: 20px;
}

.flip-btn {
    padding: 18px 50px;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}

.flip-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.5);
}

.flip-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.flip-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Status message */
.status {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    text-align: center;
    min-height: 50px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.status.heads-result {
    animation: celebrate 0.5s ease;
    color: #f1c40f;
    font-size: 2.2rem;
}

.status.tails-result {
    animation: celebrate 0.5s ease;
    color: #e67e22;
    font-size: 2.2rem;
}

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

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -20px;
}

@keyframes fall {
    0% {
        transform: translateY(-20px) translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(var(--drift)) rotate(var(--rotation));
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }

    .coin {
        width: 220px;
        height: 220px;
    }

    .coin-inner {
        font-size: 2.2rem;
    }

    .flip-btn {
        padding: 15px 40px;
        font-size: 1.2rem;
    }

    .status {
        font-size: 1.4rem;
    }

    .status.heads-result,
    .status.tails-result {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }

    .coin {
        width: 180px;
        height: 180px;
    }

    .coin-inner {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }

    .flip-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .status {
        font-size: 1.2rem;
    }

    .status.heads-result,
    .status.tails-result {
        font-size: 1.5rem;
    }
}
