/* typing.css - D:\WEBFILE\StudentEducationPortal\frontend\css\typing.css */

/* ===============================
   CROSS BROWSER FIX (Chrome + Edge)
   =============================== */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: #f8fafc;
    color: #334155;
    min-height: 100vh;
    line-height: 1.6;
    font-size: 14px;
}

.typing-container {
    max-width: 1600px;
    margin: 30px auto;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    min-height: auto;
}

.page-header {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    color: white;
    padding: 30px 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.page-header h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.page-header p {
    font-size: 0.95rem;
    opacity: 0.95;
    max-width: 800px;
    margin: 0;
    color: #e0f2fe;
    font-weight: 400;
    line-height: 1.6;
}

.main-content {
    display: flex;
    flex: 1;
    min-height: auto;
    gap: 0;
}

.sidebar {
    width: 260px;
    padding: 15px;
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.sidebar h3 {
    color: #1e293b;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    padding-bottom: 15px;
    border-bottom: 2px solid #3b82f6;
}

.lesson-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lesson-item {
    padding: 10px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    position: relative;
}

.lesson-item:hover {
    background: #f1f5f9;
    transform: translateX(3px);
    border-color: #cbd5e1;
}

.lesson-item.active {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.lesson-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-radius: 8px;
    margin-right: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.lesson-item.active .lesson-number {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 4px 8px rgba(29, 78, 216, 0.2);
}

.lesson-text {
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
    color: #475569;
}

.lesson-item.active .lesson-text {
    color: #1e293b;
    font-weight: 600;
}

.content-area {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    overflow-y: visible;
    position: relative;
    background: #ffffff;
    max-height: none;
}

.lesson-header {
    margin-bottom: 10px;
}

.lesson-header h2 {
    color: #1e293b;
    font-size: 1.4rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 700;
}

.lesson-header p {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 100%;
}

.finger-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    background: #f8fafc;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.finger-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    min-width: 60px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.finger-label {
    font-weight: 700;
    color: #3b82f6;
    font-size: 1.1rem;
}

.finger-name {
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
    margin-top: 5px;
}

.lesson-info {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 15px;
    border-radius: 14px;
    border: 1px solid #bae6fd;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

.lesson-info h4 {
    color: #0369a1;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

#instruction-text {
    color: #0c4a6e;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 1rem;
}

.char-count {
    margin: 20px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    font-weight: 600;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.progress-container {
    margin: 20px 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #475569;
    font-weight: 500;
    font-size: 0.95rem;
}

.progress-bar {
    height: 12px;
    background: #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.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%);
    }
}

.typing-area {
    background: #ffffff;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.typing-area h3 {
    color: #1e293b;
    margin-bottom: 15px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    gap: 15px;
}

.buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.start-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25);
}

.reset-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.25);
}

.next-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
}

.text-display-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.text-display-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #475569;
    font-weight: 600;
    font-size: 0.9rem;
}

.text-display {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.90rem;
    line-height: 1.6;
    height: 140px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    color: #334155;
    transition: border-color 0.2s;
}

.text-display.active {
    border-color: #3b82f6;
}

.text-to-type {
    color: #334155;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
}

.text-to-type span {
    display: inline;
    white-space: normal;
}

.current-char {
    background-color: rgba(251, 191, 36, 0.3);
    padding: 2px 4px;
    border-radius: 4px;
    position: relative;
    animation: pulse 1s infinite;
    border-bottom: 2px solid #f59e0b;
}

@keyframes pulse {
    0%,
    100% {
        background-color: rgba(251, 191, 36, 0.3);
    }
    50% {
        background-color: rgba(251, 191, 36, 0.6);
    }
}

.correct-char {
    color: #059669;
    font-weight: 500;
    background-color: rgba(16, 185, 129, 0.1);
    padding: 0 2px;
}

.wrong-char {
    color: #dc2626;
    background-color: rgba(239, 68, 68, 0.1);
    text-decoration: line-through;
    padding: 0 2px;
}

.input-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-area label {
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

textarea {
    width: 100%;
    height: 100px;
    padding: 12px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    resize: none;
    transition: all 0.2s;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    color: #1e293b;
    line-height: 1.6;
}

textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: #f8fafc;
}

textarea::placeholder {
    color: #94a3b8;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-box {
    background: white;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s;
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-label {
    color: #64748b;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.time .stat-value {
    color: #8b5cf6;
}

.wpm .stat-value {
    color: #10b981;
}

.accuracy .stat-value {
    color: #3b82f6;
}

.errors .stat-value {
    color: #ef4444;
}

.cpm .stat-value {
    color: #f59e0b;
}

.progress-stat .stat-value {
    color: #ec4899;
}

.game-area {
    display: none;
    flex-direction: column;
    gap: 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 20px;
    border-radius: 16px;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 600px;
    max-height: 700px;
    overflow-y: auto;
}

.game-header {
    background: linear-gradient(to right, #0f3460, #533483);
    padding: 15px;
    text-align: center;
    border-radius: 12px;
    border-bottom: 3px solid #00adb5;
}

.game-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #00fff5;
    text-shadow: 0 0 8px rgba(0, 255, 245, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.game-stats .stat-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 20px;
    border-radius: 10px;
    min-width: 100px;
    border: 2px solid rgba(0, 173, 181, 0.5);
    transition: transform 0.3s, border-color 0.3s;
}

.game-stats .stat-box:hover {
    transform: translateY(-3px);
    border-color: #00fff5;
}

.game-stats .stat-label {
    display: block;
    font-size: 0.8rem;
    color: #a0a0c0;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-stats .stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

#game-lives {
    color: #ff6b6b;
}

#game-combo {
    color: #ffd166;
}

#game-level {
    color: #06d6a0;
}

.game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#typefall-game-area {
    flex: 1;
    width: 100%;
    min-height: 400px;
    background: rgba(10, 10, 20, 0.9);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.falling-word {
    position: absolute;
    font-size: 1.3rem;
    font-weight: bold;
    padding: 10px 18px;
    border-radius: 8px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    transition: all 0.1s linear;
    white-space: nowrap;
    user-select: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.normal-word {
    background: linear-gradient(to bottom right, #4a69bd, #6a89cc);
    border: 2px solid #3c5aa8;
    color: white;
}

.bonus-word {
    background: linear-gradient(to bottom right, #ff9f1a, #ffbf00);
    border: 2px solid #e68a00;
    color: #1a1a2e;
    animation: pulseGame 1.5s infinite;
}

.fast-word {
    background: linear-gradient(to bottom right, #e74c3c, #ff6b6b);
    border: 2px solid #c0392b;
    color: white;
    animation: shakeGame 0.5s infinite;
}

.slow-word {
    background: linear-gradient(to bottom right, #06d6a0, #0cb487);
    border: 2px solid #059669;
    color: white;
    animation: glowGame 2s infinite;
}

@keyframes pulseGame {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shakeGame {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-2px);
    }
    75% {
        transform: translateX(2px);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes glowGame {
    0% {
        box-shadow: 0 0 5px #06d6a0;
    }
    50% {
        box-shadow: 0 0 15px #06d6a0;
    }
    100% {
        box-shadow: 0 0 5px #06d6a0;
    }
}

.input-container {
    display: flex;
    gap: 15px;
    align-items: stretch;
    margin-top: 15px;
    margin-bottom: 10px;
}

#typefall-word-input {
    flex: 1;
    min-width: 200px;
    min-height: 56px;
    font-size: 1.1rem;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    outline: none;
    border: 2px solid rgba(0, 173, 181, 0.5);
    transition: all 0.3s;
}

#typefall-word-input:focus {
    border-color: #00fff5;
    box-shadow: 0 0 12px rgba(0, 255, 245, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.input-container .btn {
    padding: 15px 25px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.input-container .btn i {
    font-size: 1rem;
}

#typefall-start-btn {
    background: linear-gradient(to right, #06d6a0, #0cb487);
    color: white;
}

#typefall-start-btn:hover {
    background: linear-gradient(to right, #05c090, #0aa078);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(6, 214, 160, 0.4);
}

#typefall-pause-btn {
    background: linear-gradient(to right, #ffd166, #ffb347);
    color: #1a1a2e;
}

#typefall-pause-btn:hover {
    background: linear-gradient(to right, #ffc855, #ffa535);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 209, 102, 0.4);
}

.instructions {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
    border-left: 5px solid #00adb5;
    font-size: 0.9rem;
}

.instructions h3 {
    color: #00fff5;
    margin-bottom: 10px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.instructions ul {
    list-style-position: inside;
    padding-left: 5px;
}

.instructions li {
    margin-bottom: 8px;
    color: #c0c0e0;
    line-height: 1.4;
}

.instructions span {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 0 3px;
    font-size: 0.85rem;
}

.game-footer {
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.powerup-indicators {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.powerup-indicator {
    padding: 10px 15px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

#slow-indicator {
    color: #06d6a0;
    border-color: rgba(6, 214, 160, 0.3);
}

#combo-indicator {
    color: #ffd166;
    border-color: rgba(255, 209, 102, 0.3);
}

.game-footer .btn {
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-reset {
    background: linear-gradient(to right, #ef476f, #e63946);
    color: white;
}

.btn-reset:hover {
    background: linear-gradient(to right, #e0355f, #d32f3e);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(239, 71, 111, 0.4);
}

.difficulty {
    display: flex;
    align-items: center;
    gap: 10px;
}

.difficulty select {
    padding: 10px 15px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(0, 173, 181, 0.5);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    min-width: 120px;
}

.difficulty select option {
    background: #1a1a2e;
    color: white;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: linear-gradient(135deg, #0f3460, #533483);
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    max-width: 500px;
    width: 100%;
    border: 3px solid #00adb5;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.modal-content h2 {
    color: #00fff5;
    font-size: 2rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.final-stats {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.final-stats p {
    font-size: 1.2rem;
    margin: 12px 0;
    color: white;
}

.final-stats span {
    color: #ffd166;
    font-weight: bold;
    font-size: 1.4rem;
}

.btn-restart {
    background: linear-gradient(to right, #06d6a0, #0cb487);
    color: white;
    font-size: 1.1rem;
    padding: 15px 30px;
    margin: 0 auto;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-restart:hover {
    background: linear-gradient(to right, #05c090, #0aa078);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(6, 214, 160, 0.5);
}

#game-area {
    display: none;
    height: auto;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    border: 2px solid #cbd5e1;
}
/* ===============================
   TYPEFALL SCREEN HEIGHT FIX
   =============================== */

.toggle-stats {
    background: white;
    color: #3b82f6;
    border: 1px solid #3b82f6;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    align-self: flex-start;
    transition: all 0.2s;
}

.toggle-stats:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.15);
    background: #eff6ff;
}

.detailed-stats {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 25px;
    border-radius: 14px;
    margin-top: 15px;
    display: none;
    border: 1px solid #e2e8f0;
}

.detailed-stats h4 {
    color: #1e293b;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
}

.stat-label-small {
    color: #475569;
    font-weight: 500;
    font-size: 1rem;
}

.stat-number {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.2rem;
}

.paragraph-selector {
    margin-top: 15px;
}

.paragraph-selector label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.paragraph-selector select {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #cbd5e1;
    background: white;
    color: #1e293b;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.paragraph-selector select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.sidebar-tips {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border: 1px solid #bae6fd;
}

.sidebar-tips h4 {
    color: #0369a1;
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tips-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #0c4a6e;
    font-size: 0.9rem;
}

.performance-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
    margin-top: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.performance-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.game-area::-webkit-scrollbar {
    width: 6px;
}

.game-area::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.game-area::-webkit-scrollbar-thumb {
    background: rgba(0, 173, 181, 0.5);
    border-radius: 3px;
}

.game-area::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 245, 0.7);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
        min-height: auto;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        max-height: 300px;
        padding: 20px;
    }
    .lesson-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    .lesson-item {
        min-width: 180px;
        flex: 1;
        max-width: 200px;
    }
    .content-area {
        max-height: none;
        padding: 25px;
    }
    .game-area {
        max-height: 650px;
    }
}

@media (max-width: 992px) {
    .typing-container {
        margin: 20px;
        border-radius: 16px;
    }
    .page-header {
        padding: 20px 30px;
    }
    .page-header h1 {
        font-size: 2rem;
    }
    .lesson-header h2 {
        font-size: 1.6rem;
    }
    .game-header h1 {
        font-size: 1.8rem;
    }
    .stats-container {
        grid-template-columns: repeat(3, 1fr);
    }
    .stat-value {
        font-size: 1.8rem;
    }
    .game-stats .stat-value {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    .typing-container {
        margin: 15px;
        border-radius: 14px;
    }
    .page-header {
        padding: 20px 25px;
    }
    .page-header h1 {
        font-size: 1.8rem;
    }
    .main-content {
        min-height: auto;
    }
    .sidebar {
        max-height: 250px;
        padding: 15px;
    }
    .lesson-list {
        flex-direction: column;
        gap: 6px;
    }
    .lesson-item {
        min-width: 100%;
        max-width: 100%;
    }
    .content-area {
        padding: 20px;
        gap: 20px;
    }
    .lesson-header h2 {
        font-size: 1.4rem;
    }
    .controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .buttons {
        width: 100%;
        justify-content: flex-start;
    }
    button {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .text-display {
        height: 180px;
        padding: 15px;
        font-size: 1rem;
    }
    textarea {
        height: 120px;
        padding: 15px;
        font-size: 1rem;
    }
    .game-area {
        padding: 15px;
        gap: 15px;
        min-height: 550px;
        max-height: 600px;
    }
    #typefall-game-area {
        min-height: 350px;
    }
    .game-stats .stat-box {
        min-width: 80px;
        padding: 10px 15px;
    }
    .input-container {
        flex-direction: column;
        align-items: stretch;
    }
    #typefall-word-input {
        min-width: auto;
        width: 100%;
    }
    .input-container .btn {
        width: 100%;
        justify-content: center;
    }
    .game-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .powerup-indicators {
        justify-content: center;
    }
    .difficulty {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .typing-container {
        margin: 10px;
        border-radius: 12px;
    }
    .page-header {
        padding: 15px 20px;
    }
    .page-header h1 {
        font-size: 1.5rem;
        gap: 10px;
    }
    .page-header p {
        font-size: 0.95rem;
    }
    .sidebar {
        max-height: 220px;
        padding: 12px;
    }
    .lesson-text {
        font-size: 0.85rem;
    }
    .content-area {
        padding: 15px;
        gap: 15px;
    }
    .lesson-header h2 {
        font-size: 1.3rem;
        gap: 10px;
    }
    .finger-hints {
        padding: 12px;
        gap: 8px;
    }
    .finger-hint {
        padding: 8px 12px;
        min-width: 50px;
    }
    .stat-value {
        font-size: 1.6rem;
    }
    .stat-label {
        font-size: 0.75rem;
    }
    .game-header h1 {
        font-size: 1.5rem;
    }
    .falling-word {
        font-size: 1.1rem;
        padding: 8px 14px;
    }
    .modal-content {
        padding: 20px;
    }
    .modal-content h2 {
        font-size: 1.6rem;
    }
    .final-stats p {
        font-size: 1rem;
    }
    .final-stats span {
        font-size: 1.2rem;
    }
}


/* ===== TYPEFALL INPUT FIX (Chrome + Edge) ===== */
#typefall-word-input {
    color: #000 !important;           /* typed text BLACK */
    background: #ffffff !important;   /* pure white bg */
    font-weight: 600;
    caret-color: #000;
}

#typefall-word-input::placeholder {
    color: #64748b; /* grey placeholder */
    opacity: 1;
}

/* ===============================
   TYPEFALL BOTTOM REPORT
   =============================== */
/* ===== TYPEFALL REPORT BAR (FINAL UI) ===== */
.typefall-report {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;

    background: linear-gradient(135deg, #020617, #020617);
    color: #ffffff;

    padding: 14px 30px;
    border-radius: 14px;
    margin-top: 18px;

    font-size: 0.95rem;
    font-weight: 600;

    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 8px 25px rgba(0,0,0,0.35);
}

.typefall-report div {
    flex: 1;
    text-align: center;
}

.typefall-report span {
    color: #38bdf8;
    font-weight: 700;
}

/* ===============================
   TYPEFALL FINAL LAYOUT (KEEP ONLY THIS)
   =============================== */
#game-area.show {
    display: flex !important;
    flex-direction: column;
}

/* ===== TYPEFALL GAME BOX (FINAL) ===== */
#typefall-game-area {
    flex: 1;
    width: 100%;
    min-height: 360px;
    max-height: 420px;
    background: rgba(10, 10, 20, 0.95);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.12);
}


