body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 20%);
    pointer-events: none;
}

.container {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.container::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    z-index: -1;
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

h1 {
    color: #333;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.coin {
    width: 180px;
    height: 180px;
    margin: 0 auto 2rem;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    perspective: 1000px;
}

.coin-front, .coin-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    border: 6px solid #fff;
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.5);
    backface-visibility: hidden;
    background: linear-gradient(45deg, #ffd700, #ffa500);
}

.coin-front::before, .coin-back::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.8), rgba(255, 215, 0, 0.3));
    z-index: -1;
}

.coin-back {
    transform: rotateY(180deg);
    background: linear-gradient(45deg, #c0c0c0, #a9a9a9);
}

.coin.flipping {
    animation: flip 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes flip {
    0% {
        transform: rotateY(0) scale(1);
    }
    25% {
        transform: rotateY(450deg) scale(1.1);
    }
    50% {
        transform: rotateY(900deg) scale(1.2);
    }
    75% {
        transform: rotateY(1350deg) scale(1.1);
    }
    100% {
        transform: rotateY(1800deg) scale(1);
    }
}

#flip-button {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.3),
        0 0 0 0 rgba(102, 126, 234, 0.5);
    position: relative;
    overflow: hidden;
    font-weight: bold;
    letter-spacing: 1px;
}

#flip-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
}

#flip-button:hover::before {
    left: 100%;
}

#flip-button:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 12px 25px rgba(0, 0, 0, 0.4),
        0 0 20px 5px rgba(102, 126, 234, 0.6);
}

#flip-button:active {
    transform: translateY(2px);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        0 0 10px 2px rgba(102, 126, 234, 0.4);
}

#flip-button:disabled {
    background: linear-gradient(45deg, #cccccc, #999999);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.result {
    margin-top: 2rem;
    font-size: 2rem;
    font-weight: bold;
    min-height: 3rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.result.show {
    opacity: 1;
    transform: translateY(0);
}

.result.heads {
    color: #667eea;
    text-shadow: 0 0 15px rgba(102, 126, 234, 0.7);
}

.result.tails {
    color: #764ba2;
    text-shadow: 0 0 15px rgba(118, 75, 162, 0.7);
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}