/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #ffffff; /* Changed to white background */
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 1s ease-out;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333; /* Changed text color for white background */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    color: #555; /* Changed text color for white background */
    font-weight: 300;
}

/* Main game area */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.game-area {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    animation: fadeInUp 1s ease-out 0.2s both;
}

/* Coin container and animation */
.coin-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 250px;
    margin-bottom: 30px;
    perspective: 1000px;
}

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

.coin-side {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 3px solid #d4af37;
}

.coin-side img {
    width: 90%;
    height: 90%;
    object-fit: cover;
    border-radius: 50%;
}

.heads {
    background: linear-gradient(145deg, #f4e4bc, #d4af37);
}

.tails {
    background: linear-gradient(145deg, #f4e4bc, #d4af37);
    transform: rotateY(180deg);
}

/* Coin flip animations */
.coin.flipping {
    animation: coinFlip 2s ease-in-out;
}

.coin.show-heads {
    transform: rotateY(0deg);
}

.coin.show-tails {
    transform: rotateY(180deg);
}

@keyframes coinFlip {
    0% { transform: rotateY(0deg) rotateX(0deg); }
    25% { transform: rotateY(450deg) rotateX(180deg) scale(0.8); }
    50% { transform: rotateY(900deg) rotateX(360deg) scale(0.6); }
    75% { transform: rotateY(1350deg) rotateX(540deg) scale(0.8); }
    100% { transform: rotateY(1800deg) rotateX(720deg); }
}

/* Controls section */
.controls {
    text-align: center;
}

.prediction-section {
    margin-bottom: 25px;
}

.prediction-section h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.prediction-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.prediction-btn {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border: 2px solid #dee2e6;
    border-radius: 15px;
    padding: 15px 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    font-family: 'Poppins', sans-serif;
}

.prediction-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.prediction-btn.selected {
    background: linear-gradient(145deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.prediction-btn span:first-child {
    font-size: 1.5rem;
}

/* Flip button */
.flip-btn {
    background: linear-gradient(145deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
    font-family: 'Poppins', sans-serif;
    opacity: 0.6;
    transform: scale(0.95);
}

.flip-btn.enabled {
    opacity: 1;
    transform: scale(1);
}

.flip-btn:hover.enabled {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.4);
}

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

.flip-btn span {
    font-size: 1.3rem;
}

/* Result section */
.result-section {
    margin-top: 25px;
    padding: 20px;
    border-radius: 15px;
    transition: all 0.5s ease;
    opacity: 0;
}

.result-section.correct {
    background: linear-gradient(145deg, #d4edda, #c3e6cb);
    border: 2px solid #28a745;
}

.result-section.wrong {
    background: linear-gradient(145deg, #f8d7da, #f5c6cb);
    border: 2px solid #dc3545;
}

.result-emoji {
    font-size: 3rem;
    margin-bottom: 10px;
}

.result-message {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.result-details {
    font-size: 1rem;
    opacity: 0.8;
}

/* Stats section */
.stats-section {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    animation: fadeInUp 1s ease-out 0.4s both;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: #667eea;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

/* Reset button */
.reset-btn {
    background: linear-gradient(145deg, #dc3545, #c82333);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    font-family: 'Poppins', sans-serif;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.4);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 30px;
    animation: fadeIn 1s ease-out 0.6s both;
}

footer p {
    color: #555; /* Changed text color for white background */
    font-size: 0.9rem;
    font-weight: 300;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Mobile responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .game-area, .stats-section {
        padding: 20px;
    }
    
    .coin {
        width: 150px;
        height: 150px;
    }
    
    .coin-container {
        height: 200px;
    }
    
    .prediction-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .prediction-btn {
        min-width: 200px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .coin {
        width: 120px;
        height: 120px;
    }
    
    .coin-container {
        height: 150px;
    }
    
    .flip-btn {
        padding: 15px 30px;
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .prediction-btn:hover,
    .flip-btn:hover,
    .reset-btn:hover,
    .stat-card:hover {
        transform: none;
    }
    
    .prediction-btn:active {
        transform: scale(0.95);
    }
    
    .flip-btn:active {
        transform: scale(0.95);
    }
    
    .reset-btn:active {
        transform: scale(0.95);
    }
}

