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

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

        .container {
            text-align: center;
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            padding: 40px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        h1 {
            font-size: 2.5rem;
            margin-bottom: 30px;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
        }

        #coin {
            width: 200px;
            height: 200px;
            margin: 30px auto;
            perspective: 1000px;
            position: relative;
        }

        .coin-inner {
            width: 100%;
            height: 100%;
            position: relative;
            transform-style: preserve-3d;
            transition: transform 0.1s ease-out;
            cursor: pointer;
        }

        .coin-inner.spinning {
            animation: coinSpin 4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        .coin-inner.final-flip {
            transition: transform 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }

        @keyframes coinSpin {
            0% { transform: rotateY(0deg) rotateX(0deg); }
            25% { transform: rotateY(900deg) rotateX(180deg); }
            50% { transform: rotateY(1800deg) rotateX(360deg); }
            75% { transform: rotateY(2700deg) rotateX(540deg); }
            100% { transform: rotateY(3600deg) rotateX(720deg); }
        }

        .coin-face {
            position: absolute;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            border: 8px solid #ffd700;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 1.2rem;
            font-weight: bold;
            backface-visibility: hidden;
            box-shadow: 
                0 0 20px rgba(255, 215, 0, 0.5),
                inset 0 0 20px rgba(0, 0, 0, 0.2);
        }

        .heads {
            background: linear-gradient(45deg, #ffd700, #ffed4e);
            color: #8b4513;
            transform: rotateY(0deg);
        }

        .tails {
            background: linear-gradient(45deg, #c0c0c0, #e8e8e8);
            color: #444;
            transform: rotateY(180deg);
        }

        .coin-face::before {
            content: '';
            position: absolute;
            top: 10px;
            left: 10px;
            right: 10px;
            bottom: 10px;
            border-radius: 50%;
            background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), transparent 50%);
        }

        #toss-button {
            background: linear-gradient(45deg, #ff6b6b, #ee5a24);
            color: white;
            border: none;
            padding: 15px 40px;
            font-size: 1.2rem;
            font-weight: bold;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(238, 90, 36, 0.4);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        #toss-button:hover:not(:disabled) {
            background: linear-gradient(45deg, #ee5a24, #ff6b6b);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(238, 90, 36, 0.6);
        }

        #toss-button:disabled {
            background: #666;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        .result {
            margin-top: 30px;
            font-size: 1.8rem;
            font-weight: bold;
            opacity: 0;
            transition: all 0.5s ease;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
            padding: 15px;
            border-radius: 10px;
            background: rgba(255, 255, 255, 0.1);
        }

        .result.show {
            opacity: 1;
            transform: scale(1.05);
        }

        .status {
            margin-top: 15px;
            font-size: 1rem;
            opacity: 0.8;
            font-style: italic;
        }

        .loading {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            border-top-color: #fff;
            animation: spin 1s ease-in-out infinite;
            margin-left: 10px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .confetti {
            position: fixed;
            width: 10px;
            height: 10px;
            background: #f0f0f0;
            animation: confetti-fall 3s linear infinite;
        }

        @keyframes confetti-fall {
            0% {
                transform: translateY(-100vh) rotate(0deg);
                opacity: 1;
            }
            100% {
                transform: translateY(100vh) rotate(720deg);
                opacity: 0;
            }
        }