/* Typing Game Styles */
:root {
    --primary: #4361ee;
    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f39c12;
    --dark: #2c3e50;
    --light: #f8f9fa;
}

.typing-game {
    max-width: 500px;
    margin: 0 auto;
    padding: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.game-header {
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light);
}

.game-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 5px;
}

.game-subtitle {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
}

/* Stats */
.stats-container {
    background: var(--light);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.stat-card {
    padding: 10px;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 5px;
    line-height: 1;
}

#score { color: var(--success); }
#lives { color: var(--danger); }
#level { color: var(--warning); }

.stat-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Game Area */
.game-area {
    height: 250px;
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.05);
}

/* Falling Words */
.falling-word {
    position: absolute;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 16px;
    color: white;
    white-space: nowrap;
    user-select: none;
    z-index: 10;
    transition: transform 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.falling-word:hover {
    transform: scale(1.05);
}

.falling-word.easy {
    background: linear-gradient(135deg, var(--success), #27ae60);
}

.falling-word.medium {
    background: linear-gradient(135deg, var(--warning), #e67e22);
}

.falling-word.hard {
    background: linear-gradient(135deg, var(--danger), #c0392b);
}

.falling-word.typed {
    animation: explode 0.4s forwards;
}

@keyframes explode {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Typed Word Display */
.typed-word-container {
    background: var(--light);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.typed-word-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.typed-word-display {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary);
    min-height: 36px;
    padding: 5px 0;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* Controls */
.btn {
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-icon {
    font-size: 16px;
    margin-right: 5px;
}

.btn-text {
    font-size: 14px;
}

/* Instructions */
.instructions {
    background: var(--light);
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
}

.instructions p {
    margin: 0;
    line-height: 1.4;
}

/* Modal */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 20px;
}

.modal-body {
    padding: 30px 20px;
}

/* Responsive */
@media (max-width: 576px) {
    .typing-game {
        padding: 10px;
    }
    
    .game-area {
        height: 200px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .falling-word {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .typed-word-display {
        font-size: 20px;
    }
    
    .btn {
        padding: 8px;
    }
    
    .btn-icon {
        font-size: 14px;
    }
    
    .btn-text {
        font-size: 12px;
    }
}

@media (max-width: 380px) {
    .game-area {
        height: 180px;
    }
    
    .falling-word {
        font-size: 13px;
        padding: 5px 10px;
    }
    
    .stat-value {
        font-size: 20px;
    }
}