/* =========================================
   CATEGORY GAME PAGE STYLING
   ========================================= */

/* Progress Header */
.loading-screen {
    align-items: flex-start;
    justify-content: center;
    padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
}

.loading-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.loading-content p {
    margin: 0;
}

.loading-content .loading-spinner {
    width: 24px;
    height: 24px;
    margin: 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin: 15px 20px;
    border-radius: var(--radius);
    gap: 15px;
}

.progress-info {
    flex: 1;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
}

.word-counter {
    color: var(--primary);
}

.overall-progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(108, 92, 231, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.overall-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.4s ease;
}

.set-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-left: 15px;
    border-left: 2px solid rgba(108, 92, 231, 0.2);
}

.score-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.score-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

/* Game Container */
.game-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

/* Word Card */
.word-card {
    width: 100%;
    max-width: 500px;
    padding: 30px;
    border-radius: var(--radius);
    position: relative;
}

.word-number {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 20px;
    font-weight: 600;
}

/* Speak Button */
.speak-btn {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    border-radius: 15px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: all 0.3s ease;
}

.speak-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.speak-btn:active {
    transform: translateY(0);
}

.speaker-icon {
    font-size: 1.5rem;
    animation: speakPulse 2s ease-in-out infinite;
}

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

/* Word Hints */
.word-hints {
    background: rgba(108, 92, 231, 0.05);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(108, 92, 231, 0.1);
}

.hint-item {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.hint-item:last-child {
    margin-bottom: 0;
}

.hint-label {
    font-weight: 600;
    color: var(--primary);
    min-width: 80px;
}

.hint-value {
    color: var(--text-main);
    flex: 1;
}

/* Input Container */
.input-container {
    margin-bottom: 20px;
}

#word-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    border: 2px solid rgba(108, 92, 231, 0.2);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-main);
    font-family: var(--font-main);
    transition: all 0.3s ease;
}

#word-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

#word-input::placeholder {
    color: var(--text-light);
}

/* Feedback */
.feedback {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
    animation: feedbackSlide 0.3s ease;
}

@keyframes feedbackSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback.hidden {
    display: none;
}

.feedback.correct {
    background: var(--success);
    color: white;
}

.feedback.incorrect {
    background: var(--error);
    color: white;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-main);
}

.btn-primary {
    background: linear-gradient(135deg, var(--success) 0%, #55efc4 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.4);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-main);
    border: 2px solid rgba(108, 92, 231, 0.2);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: var(--surface-glass);
}

.btn-primary:active, .btn-secondary:active {
    transform: scale(0.98);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: modalFadeIn 0.3s ease;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    width: 100%;
    max-width: 450px;
    padding: 40px 30px;
    border-radius: var(--radius);
    text-align: center;
    animation: modalSlideUp 0.4s ease;
}

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

.modal-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: modalIconBounce 0.6s ease;
}

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

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--text-main);
}

.modal-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    gap: 15px;
}

.stat-box {
    flex: 1;
    padding: 15px;
    background: rgba(108, 92, 231, 0.1);
    border-radius: 12px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-buttons .btn-primary,
.modal-buttons .btn-secondary {
    width: 100%;
}

/* Responsive Design */
@media (max-width: 480px) {
    .progress-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .set-score {
        flex-direction: row;
        justify-content: space-between;
        padding-left: 0;
        padding-top: 15px;
        border-left: none;
        border-top: 2px solid rgba(108, 92, 231, 0.2);
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .modal-stats {
        flex-direction: column;
    }
}

/* Dark Mode Adjustments */
body.dark-mode .word-hints {
    background: rgba(108, 92, 231, 0.1);
    border-color: rgba(108, 92, 231, 0.2);
}

body.dark-mode .stat-box {
    background: rgba(108, 92, 231, 0.15);
}
