@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
    font-family: 'Press Start 2P', cursive;
    background: #ffffff;
    color: #000000;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-image: 
        linear-gradient(90deg, rgba(255,215,0,0.1) 1px, transparent 1px),
        linear-gradient(rgba(255,215,0,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: backgroundMove 20s linear infinite;
}

@keyframes backgroundMove {
    0% { background-position: 0 0; }
    100% { background-position: 20px 20px; }
}

/* Modal animations */
@keyframes modalFadeIn {
    0% { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes modalBackgroundFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Modal styling */
.modal-background {
    animation: modalBackgroundFadeIn 0.2s ease-out;
}

.modal-content {
    animation: modalFadeIn 0.3s ease-out;
}

.game-container {
    text-align: center;
    max-width: 800px;
    width: 85%;
    margin: 20px auto;
    background: rgba(255, 255, 255, 0.95);
    border: 4px solid #000000;
    border-radius: 0;
    padding: 40px;
    box-shadow: 
        0 0 0 4px #ffffff,
        0 0 0 8px #000000,
        8px 8px 0 8px rgba(255,215,0,0.3);
}

.game-title {
    font-size: 48px;
    margin-bottom: 30px;
    color: #000000;
    text-shadow: 
        4px 4px 0 #FFD700,
        8px 8px 0 rgba(255,215,0,0.5);
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { text-shadow: 4px 4px 0 #FFD700, 8px 8px 0 rgba(255,215,0,0.5); }
    100% { text-shadow: 4px 4px 0 #FFD700, 8px 8px 0 rgba(255,215,0,0.8), 0 0 20px rgba(255,215,0,0.3); }
}

.menu-button {
    display: block;
    width: 300px;
    margin: 20px auto;
    padding: 15px;
    background: #ffffff;
    border: 3px solid #000000;
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    color: #000000;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.menu-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.4), transparent);
    transition: left 0.5s ease;
}

.menu-button:hover {
    background: #FFD700;
    color: #000000;
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 #000000;
}

.menu-button:hover::before {
    left: 100%;
}

.menu-button:active {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0 #000000;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    padding: 20px;
    background: rgba(255,215,0,0.1);
    border: 2px solid #FFD700;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 24px;
    color: #FFD700;
    text-shadow: 2px 2px 0 #000000;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 10px;
    color: #000000;
}

.hearts {
    font-size: 24px;
    color: #ff0000;
    margin: 20px 0;
}

.heart {
    display: inline-block;
    margin: 0 5px;
    animation: heartbeat 1.5s ease-in-out infinite;
}

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

.game-chart {
    width: 100%;
    height: 400px;
    margin: 30px 0;
    border: 3px solid #000000;
    background: #ffffff;
}

.guess-input {
    font-family: 'Press Start 2P', cursive;
    font-size: 16px;
    padding: 15px;
    width: 200px;
    border: 3px solid #000000;
    text-align: center;
    margin: 20px 10px;
    background: #ffffff;
}

.guess-input:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.action-button {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    padding: 15px 30px;
    margin: 10px;
    background: #FFD700;
    border: 3px solid #000000;
    color: #000000;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-button:hover {
    background: #ffffff;
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 #000000;
}

.action-button:active {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0 #000000;
}

.action-button:disabled {
    background: #cccccc;
    color: #666666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.result-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border: 4px solid #000000;
    padding: 30px;
    z-index: 1000;
    text-align: center;
    box-shadow: 8px 8px 0 rgba(0,0,0,0.3);
    animation: popupAppear 0.3s ease-out;
}

@keyframes popupAppear {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.result-correct {
    color: #00ff00;
    font-size: 20px;
    margin: 10px 0;
}

.result-incorrect {
    color: #ff0000;
    font-size: 20px;
    margin: 10px 0;
}

.auth-container {
    max-width: 400px;
    width: 90%;
    background: rgba(255, 255, 255, 0.95);
    border: 4px solid #000000;
    padding: 30px;
    box-shadow: 8px 8px 0 rgba(0,0,0,0.3);
}

.auth-input {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    padding: 15px;
    width: 100%;
    border: 3px solid #000000;
    margin: 15px 0;
    background: #ffffff;
}

.auth-input:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.footer {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #666666;
    text-align: center;
}

.leaderboard {
    margin: 30px 0;
    border: 3px solid #000000;
    background: #ffffff;
}

.leaderboard-header {
    background: #FFD700;
    padding: 15px;
    font-size: 14px;
    border-bottom: 3px solid #000000;
}

.leaderboard-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid #cccccc;
    font-size: 10px;
}

.leaderboard-row:last-child {
    border-bottom: none;
}

.score-animation {
    animation: scoreBoost 0.5s ease-out;
}

@keyframes scoreBoost {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); color: #FFD700; }
    100% { transform: scale(1); }
}

.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over-content {
    background: #ffffff;
    border: 4px solid #000000;
    padding: 40px;
    text-align: center;
    box-shadow: 8px 8px 0 rgba(0,0,0,0.3);
}

.game-over-title {
    font-size: 32px;
    color: #ff0000;
    margin-bottom: 20px;
    animation: gameOverFlash 1s ease-in-out infinite alternate;
}

@keyframes gameOverFlash {
    0% { opacity: 1; }
    100% { opacity: 0.5; }
}

@media (max-width: 600px) {
    .game-title {
        font-size: 24px;
    }
    
    .menu-button {
        width: 250px;
        font-size: 12px;
    }
    
    .game-container {
        padding: 20px;
        width: 90%;
        margin: 10px auto;
    }
    
    .game-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .guess-input {
        width: 150px;
        font-size: 14px;
    }
    
    .action-button {
        font-size: 10px;
        padding: 12px 20px;
    }
}