/* Morse Word Rush - Game Styles */

/* Main game container */
.game-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Score panel */
.score-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid #374151;
}

.score-item {
    text-align: center;
    padding: 1rem;
    background: #374151;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.score-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
}

.score-label {
    font-size: 0.875rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.score-value {
    font-size: 2rem;
    font-weight: bold;
    color: #60a5fa;
    font-family: 'Courier New', monospace;
}

.combo-value {
    color: #f59e0b;
}

.level-value {
    color: #10b981;
}

/* Game display area */
.game-display {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border: 2px solid #374151;
    border-radius: 12px;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #374151;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.word-status {
    font-size: 1.125rem;
    color: #9ca3af;
    margin-bottom: 1rem;
    text-align: center;
}

.current-word-display {
    font-size: 3rem;
    font-weight: bold;
    color: #60a5fa;
    font-family: 'Courier New', monospace;
    margin: 1rem 0;
    letter-spacing: 0.1em;
    text-align: center;
}

/* Input area */
.input-area {
    margin-bottom: 2rem;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
}

.input-label {
    font-size: 1rem;
    color: #9ca3af;
    font-weight: 600;
}

.level-indicator {
    font-size: 0.9rem;
    color: #10b981;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.word-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.25rem;
    font-family: 'Courier New', monospace;
    background: #1f2937;
    border: 2px solid #374151;
    border-radius: 8px;
    color: white;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
}

.word-input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.4);
}

.word-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Control buttons */
.controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}

.btn {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: #374151;
    color: white;
}

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

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
}

.btn-info:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

/* Category selection */
.categories {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border: 2px solid #374151;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.categories h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #60a5fa;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.category-grid-single-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #374151;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-item:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

.category-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.category-label {
    flex: 1;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
}

.category-description {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

/* Feedback animations */
@keyframes correctFlash {
    0% { background: linear-gradient(135deg, #1f2937 0%, #111827 100%); }
    50% { background: linear-gradient(135deg, #065f46, #047857); }
    100% { background: linear-gradient(135deg, #1f2937 0%, #111827 100%); }
}

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

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

.feedback-correct {
    animation: correctFlash 0.6s ease;
}

.feedback-incorrect {
    animation: incorrectShake 0.4s ease;
}

.combo-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: bold;
    color: #f59e0b;
    animation: comboPopup 0.6s ease;
    pointer-events: none;
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
}

/* Game over modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border: 2px solid #60a5fa;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 2rem;
    color: #60a5fa;
    margin-bottom: 0.5rem;
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.modal-stat {
    text-align: center;
    padding: 1rem;
    background: #374151;
    border-radius: 8px;
}

.modal-stat-label {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.modal-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #60a5fa;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Instructions panel */
.instructions {
    background: #374151;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

.instructions.collapsed {
    max-height: 0;
    padding: 0;
    margin-bottom: 0;
    opacity: 0;
}

.instructions h3 {
    color: #60a5fa;
    margin-bottom: 1rem;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.instructions ul {
    list-style: none;
    padding: 0;
}

.instructions li {
    padding: 0.5rem 0;
    color: #d1d5db;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instructions li:before {
    content: "▶";
    color: #60a5fa;
}

/* Responsive design */
@media (max-width: 768px) {
    .instructions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .category-grid-single-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .input-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 640px) {
    .score-panel {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .current-word-display {
        font-size: 2rem;
    }
    
    .word-input {
        font-size: 1.25rem;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading state */
.loading {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
}

.loading:after {
    content: "...";
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}