/* * QMB Spelling Bee - Enhanced Activity Styles
 * File: /qmbportal/quizzes/assets/css/spelling-bee.css
 */

 @import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;900&display=swap');
 @import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap');
 
 /* Import design system components */
 @import url('components/utilities.css');
 @import url('components/header.css');
 @import url('components/modal.css');

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

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #112167 0%, #2c3e50 100%);
    min-height: 100vh;
    padding: var(--spacing-xl);
    line-height: 1.6;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #667eea, #f5576c, #50f179, #ff9a56);
    border-radius: 24px 24px 0 0;
}

.spelling-bee-app {
     padding: var(--spacing-md);
     min-height: 70vh;
     max-width: 1200px;
     margin: 0 auto;
     border-radius: var(--radius-xl);
     box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
 }
 
 /* Setup Screen */
 .setup-container {
     text-align: center;
     display: flex;
     flex-direction: column;
     gap: 1rem;
     background: rgba(255, 255, 255, 0.95);
     border-radius: var(--radius-lg);
     backdrop-filter: blur(10px);
 }
 
 .setup-header h2 {
     font-size: 2.5rem;
     color: var(--dark-gray);
     margin-bottom: 0.5rem;
     font-weight: 700;
     background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
     -webkit-background-clip: text;
     -webkit-text-fill-color: transparent;
     background-clip: text;
 }

/* Option 2: Modern Slider/Tab Level Selection */
.level-selector-modern {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.difficulty-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.difficulty-tab {
    background: none;
    border: none;
    padding: 1rem 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    position: relative;
}

.difficulty-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: all 0.3s ease;
}

.difficulty-tab.active::after {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.difficulty-tab:hover {
    background: rgba(102, 126, 234, 0.1);
}

.difficulty-tab.active {
    background: white;
    color: #495057;
}

.tab-icon {
    font-size: 1.2rem;
}

.tab-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
}

.tab-range {
    font-size: 0.7rem;
    color: #6c757d;
    background: rgba(108, 117, 125, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-full);
}

.difficulty-tab.active .tab-range {
    background: rgba(102, 126, 234, 0.1);
    color: #495057;
}

.level-content-area {
    padding: 2rem;
    min-height: 200px;
    position: relative;
}

.level-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.level-panel.active {
    display: block;
}

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

.level-grid-modern {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    justify-items: center;
}

.level-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid transparent;
    background: #f8f9fa;
    color: #495057;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.level-circle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.2) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.level-circle:hover::before {
    opacity: 1;
}

.level-circle.beginner:hover {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-color: #1e7e34;
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
}

.level-circle.intermediate:hover {
    background: linear-gradient(135deg, #fd7e14 0%, #ffc107 100%);
    color: white;
    border-color: #e8590c;
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(253, 126, 20, 0.4);
}

.level-circle.advanced:hover {
    background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
    color: white;
    border-color: #59359a;
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(111, 66, 193, 0.4);
}

.level-circle.expert:hover {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
    border-color: #bd2130;
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.4);
}

.level-circle.selected {
    transform: scale(1.15);
    z-index: 2;
}

.level-circle.beginner.selected {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-color: #1e7e34;
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
}

.level-circle.intermediate.selected {
    background: linear-gradient(135deg, #fd7e14 0%, #ffc107 100%);
    color: white;
    border-color: #e8590c;
    box-shadow: 0 8px 20px rgba(253, 126, 20, 0.4);
}

.level-circle.advanced.selected {
    background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
    color: white;
    border-color: #59359a;
    box-shadow: 0 8px 20px rgba(111, 66, 193, 0.4);
}

.level-circle.expert.selected {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
    border-color: #bd2130;
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.4);
}

.level-number {
    position: relative;
    z-index: 1;
}

 /* Enhanced Start Button */
 .start-button {
     padding: 1.2rem 3rem;
     font-size: 1.3rem;
     font-weight: 700;
     border: none;
     border-radius: var(--radius-full);
     background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
     color: white;
     cursor: pointer;
     transition: all 0.3s ease;
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 0.75rem;
     box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
     position: relative;
     overflow: hidden;
     margin: 1rem auto 0;
     max-width: 300px;
 }
 
 .start-button::before {
     content: '';
     position: absolute;
     top: 0;
     left: -100%;
     width: 100%;
     height: 100%;
     background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
     transition: left 0.5s;
 }
 
 .start-button.enabled:hover::before {
     left: 100%;
 }
 
 .start-button:disabled { 
     background: var(--medium-gray); 
     cursor: not-allowed; 
     opacity: 0.6; 
     box-shadow: none;
 }
 
 .start-button.enabled:hover { 
     transform: translateY(-2px); 
     box-shadow: 0 12px 30px rgba(102, 126, 234, 0.6); 
 }
 
 .start-icon {
     font-size: 1.2em;
     animation: pulse 2s infinite;
 }
 
 @keyframes pulse {
     0%, 100% { transform: scale(1); }
     50% { transform: scale(1.1); }
 }
 
 .loading-spinner {
     animation: spin 1s linear infinite;
 }
 
 @keyframes spin {
     from { transform: rotate(0deg); }
     to { transform: rotate(360deg); }
 }
 
 /* Game Area Enhancements */
 .game-area-container { 
     display: flex; 
     flex-direction: column; 
     align-items: center; 
     gap: 1.5rem; 
     background: rgba(255, 255, 255, 0.95);
     padding: 0.5rem;
     border-radius: var(--radius-lg);
     backdrop-filter: blur(10px);
 }
 
 .game-header {
     width: 100%;
     display: flex;
     flex-direction: column;
     gap: 1rem;
 }
 
 .level-indicator {
     display: flex;
     justify-content: space-between;
     align-items: center;
     padding: 0.75rem 1.5rem;
     background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
     color: white;
     border-radius: var(--radius-full);
     font-weight: 600;
     box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
 }
 
 #current-level-display {
     font-size: 1.1rem;
 }
 
 #word-counter {
     font-size: 0.9rem;
     opacity: 0.9;
 }
 
 .word-progress-bar { 
     width: 100%; 
     height: 12px; 
     background: rgba(255, 255, 255, 0.3); 
     border-radius: var(--radius-full); 
     overflow: hidden; 
     box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
 }
 
 #word-progress-fill { 
     height: 100%; 
     width: 0%; 
     background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%); 
     transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
     border-radius: var(--radius-full);
     position: relative;
 }
 
 #word-progress-fill::after {
     content: '';
     position: absolute;
     top: 0;
     left: 0;
     right: 0;
     bottom: 0;
     background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
     animation: shimmer 2s infinite;
 }
 
 @keyframes shimmer {
     0% { transform: translateX(-100%); }
     100% { transform: translateX(100%); }
 }

/* Simplified Audio Controls Section */
.audio-controls-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.main-audio-control {
    flex-shrink: 0;
}

.play-word-button {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border: none;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

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

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

.play-word-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 25px rgba(79, 172, 254, 0.6);
}

.play-word-button i {
    font-size: 1.1em;
    animation: soundwave 1.5s ease-in-out infinite;
}

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

/* Context Controls */
.context-controls {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.context-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.context-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.context-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: white;
    padding: 0.6rem;
    border-radius: var(--radius-full);
    width: 2.8rem;
    height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

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

.context-btn:hover::before {
    left: 100%;
}

.context-btn:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.context-btn:active {
    transform: translateY(0) scale(1.05);
}

.context-btn i {
    font-size: 0.9em;
}
 
 /* Enhanced Input Area */
 .spelling-input-area { 
     display: flex; 
     flex-direction: column;
     gap: 1rem; 
     width: 100%; 
     max-width: 600px; 
 }
 
 .input-container {
     display: flex;
     gap: 1rem;
     align-items: stretch;
 }
 
 #spelling-input { 
     flex-grow: 1; 
     padding: 1.2rem 1.5rem; 
     font-size: 1.4rem; 
     text-align: center; 
     border: 2px solid #e0e0e0; 
     border-radius: var(--radius-lg); 
     letter-spacing: 0.1em; 
     font-weight: 600;
     background: white;
     transition: all 0.3s ease;
     box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
 }
 
 #spelling-input:focus { 
     outline: none; 
     border-color: #4facfe; 
     box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2), 0 4px 15px rgba(0, 0, 0, 0.1); 
     transform: translateY(-1px);
 }
 
 .check-button { 
     padding: 1.2rem 2rem; 
     font-size: 1rem; 
     font-weight: 700; 
     border: none; 
     background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%); 
     color: white; 
     border-radius: var(--radius-lg); 
     cursor: pointer; 
     transition: all 0.3s ease; 
     display: flex;
     align-items: center;
     gap: 0.5rem;
     box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
     white-space: nowrap;
 }
 
 .check-button:hover { 
     background: linear-gradient(135deg, #ee5a24 0%, #ff6b6b 100%); 
     transform: translateY(-2px);
     box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
 }
 
 .check-button:disabled {
     background: #ccc;
     cursor: not-allowed;
     transform: none;
     box-shadow: none;
 }
 
 /* Enhanced Answer Display */
 #answer-display { 
     min-height: 3rem; 
     font-size: 2.2rem; 
     font-weight: 900; 
     letter-spacing: 0.15em; 
     padding: 1rem; 
     color: #333; 
     border-bottom: 3px solid #e0e0e0; 
     display: flex;
     justify-content: center;
     align-items: center;
     background: rgba(255, 255, 255, 0.5);
     border-radius: var(--radius-md);
     transition: all 0.3s ease;
 }
 
 #answer-display.correct { 
     color: #27ae60; 
     background: rgba(39, 174, 96, 0.1);
     border-bottom-color: #27ae60;
 }
 
 #answer-display.incorrect { 
     color: #e74c3c; 
     background: rgba(231, 76, 60, 0.1);
     border-bottom-color: #e74c3c;
 }
 
 .correct-letter {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
    padding: 0.1em 0.2em;
    border-radius: 4px;
    margin: 0 1px;
}

.incorrect-letter {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    padding: 0.1em 0.2em;
    border-radius: 4px;
    margin: 0 1px;
}

.empty-letter {
     color: #bdc3c7;
     margin: 0 2px;
 }
 
 /* Enhanced Feedback Area */
 .feedback-area { 
     min-height: 2rem; 
     font-size: 1.2rem; 
     font-weight: 700; 
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 0.5rem;
     padding: 6px;
     border-radius: var(--radius-md);
     transition: all 0.3s ease;
 }
 
 .feedback-area.correct { 
     color: #27ae60; 
     background: rgba(39, 174, 96, 0.1);
     border: 1px solid rgba(39, 174, 96, 0.2);
 }
 
 .feedback-area.incorrect { 
     color: #e74c3c; 
     background: rgba(231, 76, 60, 0.1);
     border: 1px solid rgba(231, 76, 60, 0.2);
 }
 
 .feedback-icon {
     font-size: 1em;
     animation: bounce 0.5s ease;
 }
 
 @keyframes bounce {
     0%, 100% { transform: scale(1); }
     50% { transform: scale(1.2); }
 }
 
 /* Enhanced Virtual Keyboard */
 .virtual-keyboard { 
     display: flex; 
     flex-direction: column; 
     gap: 0.5rem; 
     width: 100%; 
     max-width: 500px;
     margin-top: 1rem;
 }
 
 .keyboard-row { 
     display: flex; 
     justify-content: center; 
     gap: 0.4rem; 
 }
 
 .key { 
     height: 45px; 
     min-width: 35px; 
     padding: 0 0.7rem; 
     font-size: 1rem; 
     font-weight: 600; 
     border: none; 
     border-radius: var(--radius-sm); 
     background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%); 
     box-shadow: 0 3px 0 #d1d5db, 0 1px 3px rgba(0, 0, 0, 0.1); 
     cursor: pointer; 
     transition: all 0.1s ease; 
     color: #374151;
     position: relative;
 }
 
 .key:hover {
     background: linear-gradient(135deg, #f8f9fa 0%, #e5e7eb 100%);
     transform: translateY(-1px);
 }
 
 .key:active { 
     transform: translateY(2px); 
     box-shadow: 0 1px 0 #d1d5db, 0 1px 2px rgba(0, 0, 0, 0.1); 
 }
 
 .special-key {
     background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
     color: white;
     box-shadow: 0 3px 0 #2563eb, 0 1px 3px rgba(0, 0, 0, 0.2);
 }
 
 .special-key:hover {
     background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
 }
 
 .space-key {
     flex-grow: 1;
     max-width: 200px;
     background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
     color: white;
     box-shadow: 0 3px 0 #374151, 0 1px 3px rgba(0, 0, 0, 0.2);
 }
 
 .space-key:hover {
     background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
 }

/* Compact Modal Layout for Spelling Bee Results */
.spelling-results-compact {
    margin-top: 1rem;
    max-width: 100%;
}

.score-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: var(--radius-lg);
    border: 2px solid #e9ecef;
}

.score-percentage {
    font-size: 2.5rem;
    font-weight: 900;
    color: #28a745;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.score-breakdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
}

.divider {
    color: #dee2e6;
    font-weight: 400;
}

/* Compact Word Summary */
.word-summary-compact {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.words-section {
    background: #f8f9fa;
    border-radius: var(--radius-md);
    padding: 0.75rem;
    border-left: 4px solid;
}

.correct-section {
    border-left-color: #28a745;
}

.incorrect-section {
    border-left-color: #dc3545;
}

.section-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.correct-section .section-title {
    color: #155724;
}

.incorrect-section .section-title {
    color: #721c24;
}

/* Correct Words Grid */
.words-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.word-badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    line-height: 1.2;
}

.word-badge.correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Incorrect Words Compact Layout */
.incorrect-words-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.word-comparison-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0.6rem;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid #e9ecef;
    font-size: 0.85rem;
}
.word-comparison-compact .arrow {
    color: #6c757d;
    font-weight: bold;
    font-size: 1rem;
    flex-shrink: 0;
}

.correct-word {
    color: #155724;
    font-weight: 700;
    background: rgba(21, 87, 36, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    text-align: center;
}

.user-word {
    color: #721c24;
    font-weight: 600;
    background: rgba(114, 28, 36, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-style: italic;
    text-align: center;
}

/* Modal Scrolling Optimization */
.modal-container {
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.completion-message {
    flex-grow: 1;
    overflow-y: auto;
}
 
/* Responsive Design */
@media (max-width: 768px) {
    .container {
        border-radius: var(--radius-lg);
    }

    .spelling-bee-app {
        margin: 1rem;
        padding: 1rem;
    }
    
    .difficulty-tabs {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .level-grid-modern {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .level-circle {
        width: 70px;
        height: 70px;
        font-size: 1.2rem;
    }
    
    .level-content-area {
        padding: 1.5rem;
    }
    
    .input-container {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    #spelling-input {
        font-size: 1.2rem;
        padding: 1rem;
    }
    
    .check-button {
        padding: 1rem;
        justify-content: center;
    }
    
    .virtual-keyboard {
        max-width: 100%;
    }
    
    .key {
        min-width: 30px;
        height: 40px;
        font-size: 0.9rem;
        padding: 0 0.5rem;
    }
    
    .audio-controls-section {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.2rem;
    }
    
    .context-controls {
        gap: 2rem;
    }
    
    .play-word-button {
        padding: 0.8rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .context-btn {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.9rem;
    }
    
    .context-label {
        font-size: 0.8rem;
    }
    
    .spelling-results-compact {
        margin-top: 0.75rem;
    }
    
    .score-header {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .score-percentage {
        font-size: 2rem;
    }
    
    .score-breakdown {
        font-size: 0.8rem;
        gap: 0.5rem;
    }
    
    .word-summary-compact {
        max-height: 250px;
    }
    
    .words-section {
        padding: 0.6rem;
    }
    
    .section-title {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    .word-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
    
    .word-comparison-compact {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
        gap: 0.5rem;
    }
    
    .incorrect-words-compact {
        gap: 0.4rem;
    }
}

@media (max-width: 480px) {
    .difficulty-tabs {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .difficulty-tab {
        padding: 0.75rem 0.25rem;
    }
    
    .tab-label {
        font-size: 0.8rem;
    }
    
    .tab-range {
        font-size: 0.65rem;
    }
    
    .level-grid-modern {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .level-circle {
        width: 60px;
        height: 60px;
        font-size: 1rem;
    }
    
    .level-content-area {
        padding: 1rem;
    }
    
    .audio-controls-section {
        gap: 1rem;
        padding: 1rem;
    }
    
    .context-controls {
        flex-direction: row;
        gap: 1.5rem;
    }
    
    .play-word-button {
        padding: 0.7rem 1.2rem;
        font-size: 1rem;
    }
    
    .context-btn {
        width: 2.2rem;
        height: 2.2rem;
    }
    
    .score-percentage {
        font-size: 1.8rem;
    }
    
    .word-summary-compact {
        max-height: 200px;
    }
    
    .word-comparison-compact {
        flex-direction: column;
        gap: 0.4rem;
        text-align: center;
        padding: 0.5rem;
    }
    
    .word-comparison-compact .arrow {
        transform: rotate(90deg);
        font-size: 0.9rem;
    }
}

@media print {
    body {
        background: white;
        color: black;
    }
    
    .game-setup,
    .keypad,
    .btn-submit,
    .btn-restart,
    .btn-parameter {
        display: none !important;
    }
    
    .container {
        box-shadow: none;
        border: 1px solid #000;
    }

    .container::before {
        display: none;
    }
}