* {
    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;
    align-items: center;
    justify-content: center;
    color: #333;
}

#fireworks-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 800px;
    width: 90%;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
}

.game-area {
    margin-bottom: 40px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat {
    background: #f8f9fa;
    padding: 15px 25px;
    border-radius: 10px;
    min-width: 120px;
}

.stat .label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.stat span:last-child {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.stat.best-record span:last-child {
    color: #3a5197;
    text-shadow: 0 1px 2px rgba(245, 87, 108, 0.3);
}

.results h2.new-record {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: recordGlow 1s ease-in-out infinite alternate;
}

@keyframes recordGlow {
    0% { text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
    100% { text-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.6); }
}

.letter-display {
    margin: 40px 0;
}

#current-letter {
    font-size: 8rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: letterPulse 2s infinite;
}

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

.instruction {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 30px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn.secondary {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #dee2e6;
}

.btn.secondary:hover:not(:disabled) {
    background: #e9ecef;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.keyboard-hint {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.results {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    z-index: 1001;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.results.hidden {
    display: none;
}

.results::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.results h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

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

.result-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.result-item span:last-child {
    font-size: 1.8rem;
    font-weight: bold;
}

.alphabet-progress {
    margin-top: 20px;
}

.alphabet-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.letter-box {
    display: inline-block;
    width: 45px;
    height: 45px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    background: white;
    transition: all 0.3s ease;
}

.letter-box.current {
    border-color: #667eea;
    background: #667eea;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.letter-box.completed {
    border-color: #28a745;
    background: #28a745;
    color: white;
    animation: completedPop 0.3s ease;
}

@keyframes completedPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    #current-letter {
        font-size: 6rem;
    }
    
    .stats {
        gap: 20px;
    }
    
    .result-stats {
        gap: 20px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 200px;
    }
    
    .letter-box {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}