.correct-badge {
    background: linear-gradient(135deg, #51cf66 0%, #4facfe 100%);
    padding: 15px 50px;
    min-width: 220px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 20px rgba(81, 207, 102, 0.2);
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    justify-content: center;
    white-space: nowrap;
    margin-top: 15px;
}

.correct-icon {
    font-size: 1.5rem;
    animation: flicker 1.5s ease-in-out infinite;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ffd700;
    --secondary-color: #ff6b6b;
    --success-color: #51cf66;
    --danger-color: #ff6b6b;
    --dark-bg: #1a1a2e;
    --card-bg: #16213e;
    --text-light: #eee;
    --text-dark: #333;
    --shadow: rgba(0, 0, 0, 0.3);
    --glow: rgba(255, 215, 0, 0.5);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.floating-coin {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 30% 30%, var(--primary-color), #b8860b);
    border-radius: 50%;
    opacity: 0.1;
    animation: float 15s infinite ease-in-out;
}

.floating-coin:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-coin:nth-child(2) {
    top: 60%;
    right: 15%;
    animation-delay: 5s;
    animation-duration: 20s;
}

.floating-coin:nth-child(3) {
    bottom: 15%;
    left: 20%;
    animation-delay: 10s;
    animation-duration: 18s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-30px) rotate(90deg);
    }
    50% {
        transform: translateY(-60px) rotate(180deg);
    }
    75% {
        transform: translateY(-30px) rotate(270deg);
    }
}

/* Container */
.container {
    max-width: 800px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 60px var(--shadow);
    position: relative;
    z-index: 1;
    animation: slideIn 0.8s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

.title {
    font-size: 3rem;
    color: var(--dark-bg);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    animation: titlePulse 2s ease-in-out infinite;
}

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

.coin-icon {
    font-size: 2.5rem;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotateY(0deg);
    }
    to {
        transform: rotateY(360deg);
    }
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    font-style: italic;
}

/* Stats Container */
.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--card-bg), #0f3460);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.stat-value {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 0 10px var(--glow);
}

/* Game Section */
.game-section {
    text-align: center;
}

.section-title {
    color: var(--dark-bg);
    font-size: 1.5rem;
    margin-bottom: 20px;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 40px;
}

.choice-btn {
    flex: 1;
    max-width: 200px;
    padding: 20px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.choice-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.choice-btn:hover::before {
    width: 300px;
    height: 300px;
}

.heads-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.tails-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.choice-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.choice-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.choice-btn.selected {
    animation: pulse 0.5s ease;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
}

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

.btn-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 5px;
}

.btn-text {
    display: block;
    position: relative;
    z-index: 1;
}

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

/* Coin Container */
.coin-container {
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    perspective: 1000px;
    position: relative;
}

.coin {
    width: 200px;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.coin-side {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coin-heads {
    background: radial-gradient(circle at 30% 30%, #ffd700, #b8860b);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5),
                inset 0 0 20px rgba(255, 255, 255, 0.3);
}

.coin-tails {
    background: radial-gradient(circle at 30% 30%, #c0c0c0, #808080);
    box-shadow: 0 10px 30px rgba(192, 192, 192, 0.5),
                inset 0 0 20px rgba(255, 255, 255, 0.3);
    transform: rotateY(180deg);
}

.coin-inner {
    width: 85%;
    height: 85%;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.coin-design {
    text-align: center;
}

.crown, .eagle {
    font-size: 4rem;
    margin-bottom: 10px;
}

.coin-text {
    font-size: 1.2rem;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.8);
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.5);
    letter-spacing: 2px;
}

.coin-shadow {
    width: 200px;
    height: 30px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.3), transparent);
    border-radius: 50%;
    position: absolute;
    bottom: 20px;
    filter: blur(10px);
    animation: shadowPulse 2s ease-in-out infinite;
}

@keyframes shadowPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }
}

/* Coin Flip Animations */
.coin.flip-heads {
    animation: flipHeads 2s ease-in-out forwards;
}

.coin.flip-tails {
    animation: flipTails 2s ease-in-out forwards;
}

@keyframes flipHeads {
    0% {
        transform: rotateY(0) rotateX(0) translateY(0);
    }
    25% {
        transform: rotateY(180deg) rotateX(180deg) translateY(-100px);
    }
    50% {
        transform: rotateY(360deg) rotateX(360deg) translateY(0);
    }
    75% {
        transform: rotateY(540deg) rotateX(540deg) translateY(-50px);
    }
    100% {
        transform: rotateY(720deg) rotateX(720deg) translateY(0);
    }
}

@keyframes flipTails {
    0% {
        transform: rotateY(0) rotateX(0) translateY(0);
    }
    25% {
        transform: rotateY(180deg) rotateX(180deg) translateY(-100px);
    }
    50% {
        transform: rotateY(360deg) rotateX(360deg) translateY(0);
    }
    75% {
        transform: rotateY(540deg) rotateX(540deg) translateY(-50px);
    }
    100% {
        transform: rotateY(900deg) rotateX(900deg) translateY(0);
    }
}

/* Result Container */
.result-container {
    min-height: 80px;
    margin-bottom: 20px;
}

.result-message {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 10px;
    animation: fadeInScale 0.5s ease;
}

.result-message.win {
    color: var(--success-color);
    text-shadow: 0 0 20px rgba(81, 207, 102, 0.5);
}

.result-message.lose {
    color: var(--danger-color);
}

.result-detail {
    font-size: 1.2rem;
    color: #666;
    animation: fadeIn 0.5s ease 0.2s backwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Reset Button */
.reset-btn {
    padding: 15px 40px;
    font-size: 1rem;
    font-weight: bold;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.reset-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

.reset-btn:active {
    transform: translateY(-1px);
}

/* Streak Container */

/* Win Streak Badge - outside main box, right of container */

.streak-container {
    position: fixed;
    top: 60px;
    left: calc(50% + 420px);
    z-index: 1000;
    animation: slideInRight 0.5s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

@media (max-width: 1200px) {
    .streak-container {
        left: auto;
        right: 20px;
        top: 20px;
        align-items: flex-end;
    }
}

@media (max-width: 900px) {
    .streak-container {
        position: static;
        margin-left: 0;
        top: auto;
        left: auto;
        right: auto;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 20px;
    }
}

@media (max-width: 900px) {
    .streak-container {
        position: static;
        margin-left: 0;
        top: auto;
        left: auto;
        display: flex;
        justify-content: center;
        margin-top: 20px;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.streak-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 15px 50px;
    min-width: 220px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 20px rgba(240, 147, 251, 0.4);
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    justify-content: center;
    white-space: nowrap;
}

.streak-icon {
    font-size: 1.5rem;
    animation: flicker 1.5s ease-in-out infinite;
}

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

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

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 25px;
    }

    .title {
        font-size: 2rem;
    }

    .stats-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .button-group {
        flex-direction: column;
        gap: 15px;
    }

    .choice-btn {
        max-width: 100%;
    }

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

    .coin-shadow {
        width: 150px;
    }

    .streak-container {
        top: 10px;
        right: 10px;
    }
    .streak-badge {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    /* Reduce heavy animations for mobile */
    .coin, .streak-badge, .correct-badge, .stat-value {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }
    .coin-icon {
        font-size: 1.5rem;
    }
    .subtitle {
        font-size: 1rem;
    }
    .result-message {
        font-size: 1.5rem;
    }
}
