    * { margin: 0; padding: 0; box-sizing: border-box; }
    body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0a0a1a; color: #ffffff; overflow-x: hidden; }
    @keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
    @keyframes glow { 0%, 100% { text-shadow: 0 0 10px rgba(0, 212, 255, 0.5), 0 0 20px rgba(0, 212, 255, 0.3); } 50% { text-shadow: 0 0 20px rgba(0, 212, 255, 0.8), 0 0 40px rgba(0, 212, 255, 0.5); } }
    @keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
    @keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
    @keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
    @keyframes levelup { 0% { transform: scale(0.5); opacity: 0; } 50% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
    @keyframes slideIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
    @keyframes heartBreak { 0% { transform: scale(1); } 50% { transform: scale(1.2) rotate(20deg); } 100% { transform: scale(0) rotate(-20deg); opacity: 0; } }
    .top-bar { background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 100%); border-bottom: 2px solid #00d4ff; padding: 15px 20px; padding-top: max(15px, env(safe-area-inset-top, 0px)); display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; box-shadow: 0 0 20px rgba(0, 212, 255, 0.2); position: sticky; top: 0; z-index: 100; }
    .logo { font-size: 24px; font-weight: bold; letter-spacing: 2px; animation: glow 2s ease-in-out infinite; white-space: nowrap; }
    .xp-display { text-align: center; flex: 1; min-width: 250px; }
    .level-badge { display: inline-block; background: linear-gradient(135deg, #00d4ff, #00ff88); color: #0a0a1a; padding: 8px 16px; border-radius: 20px; font-weight: bold; margin-bottom: 5px; font-size: 14px; }
    .xp-bar { width: 100%; height: 12px; background: #1a1a3a; border: 2px solid #00d4ff; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 10px rgba(0, 212, 255, 0.2); }
    .xp-fill { height: 100%; background: linear-gradient(90deg, #00d4ff, #00ff88); width: 0%; transition: width 0.3s ease; box-shadow: 0 0 10px rgba(0, 212, 255, 0.8); }
    .total-xp { font-size: 14px; color: #00ff88; font-weight: bold; white-space: nowrap; }
    .nav-tabs { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; padding: 0 10px; }
    .nav-tab { padding: 12px 16px; background: transparent; border: 2px solid #00d4ff; color: #00d4ff; cursor: pointer; font-size: 14px; font-weight: 600; border-radius: 8px; transition: all 0.3s ease; white-space: nowrap; box-shadow: 0 0 10px rgba(0, 212, 255, 0.2); min-height: 44px; }
    @media (hover: hover) { .nav-tab:hover { background: rgba(0, 212, 255, 0.1); box-shadow: 0 0 20px rgba(0, 212, 255, 0.5); } }
    .nav-tab.active { background: linear-gradient(135deg, #00d4ff, #00ff88); color: #0a0a1a; box-shadow: 0 0 30px rgba(0, 212, 255, 0.8); }
    .container { max-width: 1200px; margin: 20px auto; padding: 0 15px; min-height: calc(100vh - 200px); }
    .screen { display: none; animation: slideIn 0.3s ease-in-out; }
    .screen.active { display: block; }
    .category-select { margin-bottom: 20px; }
    .category-select select { padding: 10px 15px; background: #1a1a3a; border: 2px solid #00d4ff; color: #00d4ff; border-radius: 8px; cursor: pointer; font-size: 14px; box-shadow: 0 0 10px rgba(0, 212, 255, 0.3); }
    .timer { font-size: 48px; font-weight: bold; color: #00d4ff; text-align: center; margin: 20px 0; font-family: 'JetBrains Mono', 'Courier New', monospace; animation: glow 0.5s ease-in-out; letter-spacing: 3px; }
    .timer.warning { color: #ff3366; animation: pulse 0.5s ease-in-out infinite; }
    .game-info { display: flex; justify-content: space-around; margin: 20px 0; flex-wrap: wrap; gap: 20px; }
    .info-box { text-align: center; padding: 15px 25px; background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 255, 136, 0.1)); border: 2px solid #00d4ff; border-radius: 10px; box-shadow: 0 0 15px rgba(0, 212, 255, 0.3); flex: 1; min-width: 120px; }
    .info-label { font-size: 12px; color: #00ff88; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
    .info-value { font-size: 28px; font-weight: bold; color: #00d4ff; }
    .combo-counter { font-size: 32px; color: #ffd700; animation: pulse 0.6s ease-in-out; }
    .question-card { background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 255, 136, 0.1)); border: 2px solid #00d4ff; border-radius: 15px; padding: 30px; margin: 20px 0; box-shadow: 0 0 30px rgba(0, 212, 255, 0.3); animation: slideIn 0.3s ease-in-out; will-change: transform, opacity; }
    .question-text { font-size: 20px; font-weight: 600; margin-bottom: 25px; color: #ffffff; line-height: 1.6; max-width: 65ch; }
    .answers { display: grid; grid-template-columns: 1fr; gap: 12px; }
    @media (min-width: 768px) { .answers { grid-template-columns: 1fr 1fr; } }
    .answer-btn { padding: 15px 20px; background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(0, 255, 136, 0.15)); border: 2px solid #00d4ff; color: #ffffff; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 500; transition: all 0.2s ease; box-shadow: 0 0 10px rgba(0, 212, 255, 0.2); text-align: left; line-height: 1.4; min-height: 48px; }
    @media (hover: hover) { .answer-btn:hover { background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(0, 255, 136, 0.3)); box-shadow: 0 0 20px rgba(0, 212, 255, 0.5); transform: translateY(-2px); } }
    .answer-btn.correct { background: linear-gradient(135deg, rgba(0, 255, 136, 0.5), rgba(0, 212, 255, 0.3)); border-color: #00ff88; box-shadow: 0 0 30px rgba(0, 255, 136, 0.6); animation: slideIn 0.3s ease; }
    .answer-btn.wrong { background: linear-gradient(135deg, rgba(255, 51, 102, 0.5), rgba(255, 0, 0, 0.3)); border-color: #ff3366; box-shadow: 0 0 30px rgba(255, 51, 102, 0.6); animation: shake 0.3s ease; }
    .results-screen { text-align: center; padding: 40px 20px; }
    .results-title { font-size: 48px; font-weight: bold; margin-bottom: 20px; color: #00ff88; animation: bounce 1s ease-in-out; }
    .results-stat { font-size: 24px; margin: 15px 0; color: #ffffff; }
    .results-stat-value { color: #00d4ff; font-weight: bold; }
    .star-rating { font-size: 48px; margin: 20px 0; letter-spacing: 10px; }
    .btn-primary { background: linear-gradient(135deg, #00d4ff, #00ff88); color: #0a0a1a; padding: 15px 40px; border: none; border-radius: 10px; font-size: 16px; font-weight: bold; cursor: pointer; margin: 20px auto; display: inline-block; transition: all 0.3s ease-in-out; box-shadow: 0 0 20px rgba(0, 212, 255, 0.4); min-height: 48px; }
    @media (hover: hover) { .btn-primary:hover { transform: scale(1.05); box-shadow: 0 0 40px rgba(0, 212, 255, 0.6); } }
    .matching-container { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 30px; }
    @media (max-width: 768px) { .matching-container { grid-template-columns: 1fr; } }
    .matching-column { display: flex; flex-direction: column; gap: 15px; }
    .match-card { padding: 20px; background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 255, 136, 0.1)); border: 2px solid #00d4ff; border-radius: 10px; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 0 10px rgba(0, 212, 255, 0.2); min-height: 60px; display: flex; align-items: center; font-weight: 500; }
    @media (hover: hover) { .match-card:hover { background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 255, 136, 0.2)); box-shadow: 0 0 20px rgba(0, 212, 255, 0.4); transform: translateY(-3px); } }
    .match-card.selected { background: linear-gradient(135deg, #00d4ff, #00ff88); color: #0a0a1a; box-shadow: 0 0 30px rgba(0, 212, 255, 0.8); }
    .match-card.matched { background: linear-gradient(135deg, rgba(0, 255, 136, 0.4), rgba(0, 212, 255, 0.2)); border-color: #00ff88; opacity: 0.6; cursor: default; }
    .hearts-display { font-size: 48px; text-align: center; margin: 20px 0; letter-spacing: 10px; animation: pulse 0.6s ease-in-out; }
    .flashcard-container { perspective: 1000px; margin: 40px 0; }
    .flashcard { background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 255, 136, 0.1)); border: 2px solid #00d4ff; border-radius: 15px; padding: 40px 30px; min-height: 200px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 24px; font-weight: 600; text-align: center; transition: all 0.3s ease; box-shadow: 0 0 30px rgba(0, 212, 255, 0.3); position: relative; line-height: 1.6; }
    @media (hover: hover) { .flashcard:hover { box-shadow: 0 0 50px rgba(0, 212, 255, 0.6); transform: scale(1.02); } }
    .flashcard.flip { background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 100, 0, 0.1)); border-color: #ffd700; box-shadow: 0 0 30px rgba(255, 215, 0, 0.3); }
    .card-label { position: absolute; top: 10px; right: 15px; font-size: 12px; color: #00ff88; text-transform: uppercase; letter-spacing: 1px; }
    .flashcard-actions { display: flex; gap: 15px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
    .btn-secondary { padding: 12px 30px; background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 255, 136, 0.2)); border: 2px solid #00d4ff; color: #00d4ff; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; transition: all 0.3s ease-in-out; box-shadow: 0 0 10px rgba(0, 212, 255, 0.2); min-height: 48px; }
    @media (hover: hover) { .btn-secondary:hover { background: linear-gradient(135deg, rgba(0, 212, 255, 0.4), rgba(0, 255, 136, 0.4)); box-shadow: 0 0 20px rgba(0, 212, 255, 0.4); } }
    .glossary-container { margin-top: 20px; }
    .glossary-search { margin-bottom: 20px; }
    .glossary-search input { width: 100%; padding: 12px 15px; background: #1a1a3a; border: 2px solid #00d4ff; color: #ffffff; border-radius: 8px; font-size: 14px; box-shadow: 0 0 10px rgba(0, 212, 255, 0.2); }
    .glossary-search input::placeholder { color: #00d4ff; opacity: 0.5; }
    .glossary-items { display: grid; grid-template-columns: 1fr; gap: 15px; }
    .glossary-item { background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 255, 136, 0.1)); border: 2px solid #00d4ff; border-radius: 10px; padding: 20px; box-shadow: 0 0 15px rgba(0, 212, 255, 0.2); }
    .glossary-term { font-size: 16px; font-weight: 700; color: #00d4ff; margin-bottom: 8px; }
    .glossary-def { font-size: 14px; color: #cccccc; line-height: 1.6; }
    .glossary-cat { display: inline-block; padding: 4px 10px; background: rgba(0, 212, 255, 0.2); border-radius: 4px; font-size: 12px; color: #00ff88; margin-top: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
    .game-over-screen { text-align: center; padding: 60px 20px; animation: slideIn 0.5s ease; }
    .game-over-title { font-size: 56px; font-weight: bold; margin-bottom: 30px; color: #ff3366; animation: bounce 1s ease-in-out infinite; }
    .game-over-stats { margin: 40px 0; }
    .stat-line { font-size: 20px; margin: 15px 0; color: #ffffff; }
    .stat-highlight { color: #00d4ff; font-weight: bold; font-size: 28px; }
    .explanation { background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 100, 0, 0.1)); border-left: 4px solid #ffd700; padding: 20px; margin: 20px 0; border-radius: 8px; font-size: 14px; line-height: 1.7; color: #cccccc; }
    .explanation-title { color: #ffd700; font-weight: bold; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
    .dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 30px; margin-top: 30px; }
    @media (min-width: 768px) { .dashboard-grid { grid-template-columns: 1fr 1fr; } }
    .dashboard-card { background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 255, 136, 0.1)); border: 2px solid #00d4ff; border-radius: 15px; padding: 30px; box-shadow: 0 0 30px rgba(0, 212, 255, 0.3); }
    .dashboard-title { font-size: 20px; font-weight: bold; color: #00ff88; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 1px; }
    .dashboard-stat { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid rgba(0, 212, 255, 0.2); font-size: 14px; }
    .dashboard-stat:last-child { border-bottom: none; }
    .dashboard-stat-label { color: #cccccc; }
    .dashboard-stat-value { color: #00d4ff; font-weight: bold; }
    .speed-counter { font-size: 18px; color: #00d4ff; font-weight: bold; margin: 10px 0; }
    .streak-display { font-size: 20px; color: #ffd700; font-weight: bold; margin: 10px 0; animation: pulse 0.6s ease-in-out infinite; }
    @media (max-width: 768px) { .top-bar { flex-direction: column; gap: 15px; } .xp-display { min-width: 100%; } .nav-tabs { gap: 5px; overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; -webkit-overflow-scrolling: touch; scrollbar-width: none; } .nav-tabs::-webkit-scrollbar { display: none; } .nav-tab { padding: 8px 12px; font-size: 12px; flex-shrink: 0; } .question-text { font-size: 18px; } .timer { font-size: 36px; } .info-box { flex: 1; min-width: 100px; } .info-value { font-size: 24px; } }
    /* K1: Responsive grid for daily challenge + drills (< 400px) */
    @media (max-width: 400px) { #dailyChallengeCard, #drillsBanner { grid-column: 1 / -1 !important; } }
    .level-up-animation { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 72px; font-weight: bold; animation: levelup 1s ease-out forwards; pointer-events: none; z-index: 1000; text-shadow: 0 0 20px rgba(0, 255, 136, 0.8); color: #00ff88; }
    .streak-celebration { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 48px; font-weight: bold; animation: levelup 0.8s ease-out forwards; pointer-events: none; z-index: 1000; text-align: center; text-shadow: 0 0 30px rgba(0, 212, 255, 0.8); color: #ffd700; }
    /* === CHANGE 1: Correct-answer reinforcement panel === */
    .speed-hint-panel { background: rgba(0,180,80,0.25); border: 1px solid rgba(0,255,136,0.4); border-radius: 10px; padding: 14px 20px; margin: 14px 0 0 0; color: #ffffff; font-size: 15px; line-height: 1.5; animation: hintFadeIn 0.2s ease-out; transition: opacity 0.3s ease; }
    .speed-hint-panel.fading { opacity: 0; }
    @keyframes hintFadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

    /* === CHANGE 2A: Combo visual escalation === */
    .combo-1x { color: #00d4ff; }
    .combo-2x { color: #ffd700; }
    .combo-3x { color: #ff8c00; animation: comboPulse 0.8s ease-in-out infinite; }
    .combo-4x { color: #ff3366; animation: comboPulse 0.5s ease-in-out infinite; }
    .combo-5x { color: #ff3366; animation: comboPulse 0.3s ease-in-out infinite; text-shadow: 0 0 15px rgba(255,51,102,0.8); }
    @keyframes comboPulse { 0%,100%{transform:scale(1);} 50%{transform:scale(1.15);} }
    .combo-break-desat { animation: desatFlash 0.3s ease-out; }
    @keyframes desatFlash { 0%{filter:saturate(0.2) brightness(0.7);} 100%{filter:saturate(1) brightness(1);} }

    /* === CHANGE 2B: Timer urgency escalation === */
    .timer.timer-yellow { color: #ffd700; animation: timerPulseGentle 1.2s ease-in-out infinite; }
    .timer.timer-orange { color: #ff8c00; animation: timerPulseMed 0.8s ease-in-out infinite; }
    .timer.timer-red { color: #ff3366; animation: timerPulseRapid 0.4s ease-in-out infinite; }
    @keyframes timerPulseGentle { 0%,100%{opacity:1;} 50%{opacity:0.7;} }
    @keyframes timerPulseMed { 0%,100%{opacity:1;transform:scale(1);} 50%{opacity:0.8;transform:scale(1.05);} }
    @keyframes timerPulseRapid { 0%,100%{opacity:1;transform:scale(1);} 50%{opacity:0.7;transform:scale(1.1);} }
    /* === Speed Round slide transition === */
    #speedGame, #survivalGame, #drillsGame, #examGame { position: relative; overflow: hidden; }
    .speed-slide-out { animation: speedSlideOut 200ms ease-in forwards; }
    .speed-slide-in { animation: speedSlideIn 200ms ease-out forwards; }
    @keyframes speedSlideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-100%); opacity: 0; } }
    @keyframes speedSlideIn { from { transform: translateX(60%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

    .speed-vignette { position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:50;box-shadow:inset 0 0 120px 60px rgba(0,0,0,0.6);opacity:0;transition:opacity 0.4s ease; }
    .speed-vignette.active { opacity:1; }

    /* === CHANGE 2C: Mid-round streak acknowledgment === */
    .speed-streak-flash { position:fixed;top:38%;left:50%;transform:translate(-50%,-50%);font-size:36px;font-weight:900;letter-spacing:2px;pointer-events:none;z-index:1001;text-align:center;animation:streakFlash 0.8s ease-out forwards; }
    .speed-streak-flash.big { font-size:44px; animation-duration:1s; }
    @keyframes streakFlash { 0%{opacity:0;transform:translate(-50%,-50%) scale(0.5);} 20%{opacity:1;transform:translate(-50%,-50%) scale(1.15);} 70%{opacity:1;transform:translate(-50%,-50%) scale(1);} 100%{opacity:0;transform:translate(-50%,-50%) scale(0.9);} }

    /* === CHANGE 3C: Particle burst on correct answer === */
    .speed-particle { position:absolute;width:6px;height:6px;border-radius:50%;pointer-events:none;animation:particleBurst 0.6s ease-out forwards; }
    @keyframes particleBurst { 0%{opacity:1;transform:translate(0,0) scale(1);} 100%{opacity:0;transform:translate(var(--px),var(--py)) scale(0);} }

    /* === CHANGE 3D: Repeat-miss explanation indicator === */
    .explanation.repeat-miss { border-left-color:#ff3366; }
    .repeat-miss-label { color:#ff6b6b; font-size:13px; font-weight:600; margin-bottom:8px; letter-spacing:0.3px; }

    /* === CHANGE 2B: Combo 5x question card glow === */
    .question-card.combo-glow { box-shadow: 0 0 30px rgba(255,51,102,0.3), 0 0 60px rgba(255,51,102,0.15); }

    /* === FIX 6: Speed mode selector === */
    .speed-mode-btn.active { background: linear-gradient(135deg, #00d4ff, #00ff88) !important; color: #0a0a1a !important; box-shadow: 0 0 20px rgba(0,212,255,0.4); }
    @media (hover: hover) { .speed-mode-btn:hover:not(.active) { background: rgba(0,212,255,0.1) !important; } }

    /* === FIX 9: Focus Mode === */
    body.focus-mode { background: #1a1f2e; }
    body.focus-mode .top-bar { background: linear-gradient(135deg, #1a1f2e 0%, #252b3d 100%); border-bottom-color: #5a8a9a; box-shadow: none; }
    /* P2: Relabel logo text to "MLO STUDY" in focus mode */
    body.focus-mode .logo { animation: none; color: #8ab4c4; text-shadow: none; font-size: 16px; }
    body.focus-mode .logo::before { content: 'MLO STUDY'; position: absolute; left: 20px; }
    body.focus-mode .logo { visibility: hidden; position: relative; }
    body.focus-mode .logo::before { visibility: visible; }
    body.focus-mode .nav-tab { border-color: #5a8a9a; color: #8ab4c4; box-shadow: none; }
    body.focus-mode .nav-tab.active { background: #5a8a9a; color: #1a1f2e; box-shadow: none; }
    @media (hover: hover) { body.focus-mode .nav-tab:hover { background: rgba(90,138,154,0.15); box-shadow: none; } }
    body.focus-mode .question-card { background: rgba(90,138,154,0.08); border-color: #5a8a9a; box-shadow: 0 2px 10px rgba(0,0,0,0.2); animation: none; }
    body.focus-mode .answer-btn { background: rgba(90,138,154,0.08); border-color: #5a8a9a; box-shadow: none; }
    @media (hover: hover) { body.focus-mode .answer-btn:hover { background: rgba(90,138,154,0.18); box-shadow: none; transform: none; } }
    body.focus-mode .answer-btn.correct { background: rgba(100,180,120,0.3); border-color: #6ab478; box-shadow: none; animation: none; }
    body.focus-mode .answer-btn.wrong { background: rgba(200,100,100,0.3); border-color: #c87070; box-shadow: none; animation: none; }
    body.focus-mode .dashboard-card { background: rgba(90,138,154,0.06); border-color: #3a4a5a; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
    body.focus-mode .timer { color: #8ab4c4; animation: none; }
    body.focus-mode .timer.warning { color: #c87070; animation: none; }
    body.focus-mode .combo-counter { animation: none; }
    body.focus-mode .info-box { background: rgba(90,138,154,0.06); border-color: #3a4a5a; box-shadow: none; }
    body.focus-mode .btn-primary { background: #5a8a9a; color: #ffffff; box-shadow: none; }
    @media (hover: hover) { body.focus-mode .btn-primary:hover { transform: none; box-shadow: 0 2px 8px rgba(0,0,0,0.2); } }
    body.focus-mode .level-badge { background: #5a8a9a; animation: none; }
    body.focus-mode .xp-bar { border-color: #5a8a9a; }
    body.focus-mode .xp-fill { background: #5a8a9a; box-shadow: none; }
    body.focus-mode .flashcard { background: rgba(90,138,154,0.08); border-color: #5a8a9a; box-shadow: 0 2px 10px rgba(0,0,0,0.2); }
    @media (hover: hover) { body.focus-mode .flashcard:hover { box-shadow: 0 4px 15px rgba(0,0,0,0.25); transform: none; } }
    body.focus-mode .speed-vignette { display: none !important; }
    body.focus-mode .level-up-animation, body.focus-mode .streak-celebration, body.focus-mode .speed-streak-flash { display: none !important; }
    body.focus-mode .speed-particle { display: none !important; }
    body.focus-mode .readiness-card { animation: none !important; }
    body.focus-mode #recommendedNextCard { animation: none !important; }
    body.focus-mode .streak-display { animation: none !important; }
    body.focus-mode .speed-slide-out, body.focus-mode .speed-slide-in { animation: none !important; }
    body.focus-mode * { animation-play-state: paused !important; }
    body.focus-mode .xp-fill, body.focus-mode .readiness-meter-fill, body.focus-mode .readiness-progress-fill, body.focus-mode .mastery-bar-fill { animation-play-state: running !important; transition: width 0.3s ease !important; }

    .hidden { display: none !important; }
    /* Post-Exam Recommendation Panel */
    .post-exam-panel { background: linear-gradient(135deg, #0d1b2a 0%, #1b2838 100%); border: 2px solid #00d4ff; border-radius: 15px; padding: 35px 30px; margin: 30px auto; max-width: 600px; text-align: center; animation: slideIn 0.5s ease; box-shadow: 0 0 40px rgba(0, 212, 255, 0.2); }
    .post-exam-panel.urgent { border-color: #ff6b35; box-shadow: 0 0 40px rgba(255, 107, 53, 0.3); }
    .post-exam-panel-title { font-size: 20px; font-weight: bold; color: #00d4ff; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
    .post-exam-panel.urgent .post-exam-panel-title { color: #ff6b35; }
    .post-exam-panel-message { font-size: 15px; color: #cccccc; line-height: 1.7; margin-bottom: 25px; }
    .post-exam-panel-message strong { color: #ffffff; }
    .post-exam-cta { display: inline-block; background: linear-gradient(135deg, #00d4ff, #00ff88); color: #0a0a1a; padding: 14px 36px; border: none; border-radius: 10px; font-size: 16px; font-weight: bold; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 0 20px rgba(0, 212, 255, 0.4); margin: 5px; }
    @media (hover: hover) { .post-exam-cta:hover { transform: scale(1.05); box-shadow: 0 0 40px rgba(0, 212, 255, 0.6); } }
    .post-exam-cta.secondary { background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 255, 136, 0.2)); color: #00d4ff; border: 2px solid #00d4ff; box-shadow: none; padding: 12px 30px; font-size: 14px; }
    @media (hover: hover) { .post-exam-cta.secondary:hover { box-shadow: 0 0 15px rgba(0, 212, 255, 0.3); } }
    .post-exam-dismiss { display: block; margin-top: 15px; color: #555; font-size: 12px; text-decoration: underline; cursor: pointer; transition: color 0.2s; background: none; border: none; }
    @media (hover: hover) { .post-exam-dismiss:hover { color: #888; } }
    .post-exam-panel.urgent .post-exam-cta { background: linear-gradient(135deg, #ff6b35, #ffd700); }
    @media (hover: hover) { .post-exam-panel.urgent .post-exam-cta:hover { box-shadow: 0 0 40px rgba(255, 107, 53, 0.6); } }
    /* Focused drill mini-result */
    .focused-drill-result { background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 212, 255, 0.1)); border: 2px solid #00ff88; border-radius: 12px; padding: 25px; margin: 20px auto; max-width: 500px; text-align: center; }
    .focused-drill-result .score-big { font-size: 42px; font-weight: bold; color: #00ff88; }
    .focused-drill-result .comparison { font-size: 14px; color: #cccccc; margin-top: 10px; }
    .focused-drill-result .comparison strong { color: #00d4ff; }
    /* Dashboard ignored recommendations badge */
    .ignored-badge { display: inline-block; background: rgba(255, 107, 53, 0.2); border: 1px solid #ff6b35; border-radius: 6px; padding: 6px 12px; font-size: 12px; color: #ff6b35; margin-top: 8px; }
    /* ===== READINESS INDICATOR ===== */
    .readiness-card { border: 2px solid #333; transition: all 0.5s ease; }
    .readiness-card.state-just-starting { border-color: #555; background: linear-gradient(135deg, rgba(80,80,80,0.1), rgba(40,40,40,0.1)); }
    .readiness-card.state-building { border-color: #00d4ff; background: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(0,255,136,0.05)); box-shadow: 0 0 20px rgba(0,212,255,0.15); }
    .readiness-card.state-getting-there { border-color: #ffd700; background: linear-gradient(135deg, rgba(255,215,0,0.08), rgba(255,165,0,0.05)); box-shadow: 0 0 25px rgba(255,215,0,0.15); }
    .readiness-card.state-almost-ready { border-color: #00ff88; background: linear-gradient(135deg, rgba(0,255,136,0.1), rgba(0,212,255,0.08)); box-shadow: 0 0 30px rgba(0,255,136,0.2); }
    .readiness-card.state-guarantee-earned { border-color: #00ff88; background: linear-gradient(135deg, rgba(0,255,136,0.15), rgba(0,212,255,0.12)); box-shadow: 0 0 40px rgba(0,255,136,0.35); animation: pulse 3s ease-in-out infinite; }
    .readiness-emoji { font-size: 40px; margin-bottom: 8px; }
    .readiness-title { font-size: 22px; font-weight: bold; margin-bottom: 6px; }
    .readiness-subtitle { font-size: 14px; color: #cccccc; margin-bottom: 16px; line-height: 1.5; }
    .readiness-meter { width: 100%; max-width: 400px; height: 14px; background: #1a1a3a; border-radius: 7px; overflow: hidden; margin: 0 auto 12px; border: 1px solid #333; }
    .readiness-meter-fill { height: 100%; border-radius: 7px; transition: width 0.8s ease, background 0.5s ease; }
    .readiness-pct { font-size: 13px; color: #888; }
    .readiness-next-step { margin-top: 14px; padding: 10px 16px; background: rgba(0,212,255,0.08); border: 1px solid rgba(0,212,255,0.2); border-radius: 8px; font-size: 13px; color: #cccccc; display: inline-block; }
    .readiness-next-step strong { color: #00d4ff; }
    /* ===== READINESS BREAKDOWN ===== */
    .readiness-breakdown { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
    .readiness-breakdown-item { margin-bottom: 14px; }
    .readiness-breakdown-label { font-size: 12px; font-weight: bold; color: #00d4ff; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
    .readiness-breakdown-score { font-size: 13px; font-weight: bold; }
    .readiness-breakdown-score.strong { color: #00ff88; }
    .readiness-breakdown-score.medium { color: #ffd700; }
    .readiness-breakdown-score.weak { color: #ff3366; }
    .readiness-progress-bar { width: 100%; height: 10px; background: #1a1a3a; border-radius: 5px; overflow: hidden; border: 1px solid #333; }
    .readiness-progress-fill { height: 100%; border-radius: 5px; transition: width 0.6s ease, background 0.4s ease; }
    .readiness-coverage-text { font-size: 12px; color: #aaa; margin-top: 6px; }
    .readiness-actionable { margin-top: 16px; padding: 12px 14px; background: rgba(0,212,255,0.12); border: 1px solid rgba(0,212,255,0.3); border-radius: 8px; font-size: 13px; color: #cccccc; line-height: 1.5; }
    .readiness-actionable strong { color: #00ff88; }
    /* ===== CATEGORY MASTERY UPGRADE ===== */
    .mastery-status { font-size: 10px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 6px; border-radius: 3px; flex-shrink: 0; }
    .mastery-status.strong { background: rgba(0,255,136,0.2); color: #00ff88; }
    .mastery-status.developing { background: rgba(255,215,0,0.2); color: #ffd700; }
    .mastery-status.needs-work { background: rgba(255,51,102,0.2); color: #ff3366; }
    .mastery-status.not-started { background: rgba(100,100,100,0.2); color: #666; }
    .mastery-drill-cta { font-size: 11px; color: #00d4ff; cursor: pointer; text-decoration: none; flex-shrink: 0; transition: color 0.2s; white-space: nowrap; background: none; border: none; padding: 0; }
    @media (hover: hover) { .mastery-drill-cta:hover { color: #00ff88; text-decoration: underline; } }
    .mastery-trend { font-size: 13px; flex-shrink: 0; width: 20px; text-align: center; }
    .mastery-trend.up { color: #00ff88; }
    .mastery-trend.flat { color: #ffd700; }
    .mastery-trend.down { color: #ff3366; }
    /* ===== RETURNING STUDENT BANNER ===== */
    .returning-banner { background: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(0,255,136,0.05)); border: 2px solid #00d4ff; border-radius: 12px; padding: 18px 24px; margin-bottom: 20px; display: flex; align-items: center; gap: 16px; animation: slideIn 0.4s ease; }
    .returning-banner-icon { font-size: 28px; flex-shrink: 0; }
    .returning-banner-text { flex: 1; font-size: 14px; color: #cccccc; line-height: 1.5; }
    .returning-banner-text strong { color: #ffffff; }
    .returning-banner-action { flex-shrink: 0; }
    .returning-banner-action button { background: linear-gradient(135deg, #00d4ff, #00ff88); color: #0a0a1a; border: none; padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: bold; cursor: pointer; transition: all 0.3s; }
    @media (hover: hover) { .returning-banner-action button:hover { transform: scale(1.05); box-shadow: 0 0 20px rgba(0,212,255,0.4); } }
    /* Onboarding */
    .onboarding-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #0a0a1a; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
    .ob-container { max-width: 500px; width: 100%; text-align: center; }
    .ob-screen { animation: obFadeIn 0.5s ease; }
    @keyframes obFadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
    @keyframes obFlicker { 0% { opacity: 0; } 10% { opacity: 1; } 12% { opacity: 0.3; } 14% { opacity: 1; } 30% { opacity: 1; } 32% { opacity: 0.6; } 34% { opacity: 1; } 100% { opacity: 1; } }
    .ob-logo { font-size: 42px; font-weight: 900; letter-spacing: 3px; color: #00d4ff; margin-bottom: 20px; animation: obFlicker 1.5s ease-out forwards, glow 2s ease-in-out 1.5s infinite; }
    .ob-cta { font-size: 16px; padding: 16px 32px; }
    .onboarding-progress { display: flex; gap: 8px; margin-bottom: 30px; justify-content: center; }
    .onboarding-dot { width: 12px; height: 12px; border-radius: 50%; background: #1a1a3a; border: 2px solid #00d4ff; transition: all 0.3s; }
    .onboarding-dot.active { background: #00d4ff; box-shadow: 0 0 10px rgba(0, 212, 255, 0.5); }
    .onboarding-dot.done { background: #00ff88; border-color: #00ff88; }
    .ob-cat-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
    .ob-cat-label { width: 100px; text-align: right; font-size: 13px; color: #cccccc; }
    .ob-cat-fill { height: 20px; border-radius: 4px; min-width: 20px; transition: width 0.5s ease; }
    /* Mode locked card overlay */
    .mode-card.locked { opacity: 0.4; filter: grayscale(0.8); pointer-events: none; position: relative; }
    .mode-card-lock { position: absolute; top: 8px; right: 8px; color: #666; }
    .mode-card-unlock-hint { font-size: 11px; color: #666; margin-top: 6px; font-style: italic; }
    /* Unlock celebration overlay */
    .unlock-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10,10,26,0.92); z-index: 1500; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; animation: obFadeIn 0.3s ease; }
    .unlock-title { font-size: 14px; color: #888; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 10px; }
    .unlock-name { font-size: 32px; font-weight: 900; color: #00d4ff; margin-bottom: 15px; animation: glow 1s ease-in-out infinite; }
    /* Streak-at-risk banner */
    .streak-risk-banner { background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(255,140,0,0.08)); border: 2px solid #ffd700; border-radius: 12px; padding: 14px 18px; margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; animation: obFadeIn 0.3s ease; }
    .streak-risk-banner button { background: none; border: none; color: #666; font-size: 18px; cursor: pointer; padding: 4px; }
    /* Category Mastery bars */
    .mastery-bar-bg { width: 100%; height: 10px; background: #1a1a3a; border-radius: 5px; overflow: hidden; }
    .mastery-bar-fill { height: 100%; border-radius: 5px; transition: width 0.5s ease; }
    .mastery-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(0,212,255,0.1); }
    .mastery-row:last-child { border-bottom: none; }
    .mastery-label { width: 80px; font-size: 12px; color: #cccccc; flex-shrink: 0; }
    .mastery-pct { width: 40px; text-align: right; font-size: 12px; font-weight: bold; color: #00d4ff; flex-shrink: 0; }
    /* Definition Duel game */
    .duel-term { font-size: 28px; font-weight: bold; color: #00d4ff; text-align: center; padding: 25px; margin: 20px 0; background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(0,255,136,0.05)); border: 2px solid #00d4ff; border-radius: 15px; animation: slideIn 0.4s ease; }
    .duel-options { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
    .duel-option { padding: 18px 20px; background: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(0,255,136,0.05)); border: 2px solid #444; border-radius: 12px; cursor: pointer; font-size: 15px; line-height: 1.5; color: #ffffff; transition: all 0.3s ease; text-align: left; }
    @media (hover: hover) { .duel-option:hover { border-color: #00d4ff; background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(0,255,136,0.1)); transform: translateY(-2px); box-shadow: 0 0 15px rgba(0,212,255,0.3); } }
    .duel-option.correct { border-color: #00ff88; background: linear-gradient(135deg, rgba(0,255,136,0.3), rgba(0,212,255,0.15)); box-shadow: 0 0 25px rgba(0,255,136,0.5); animation: slideIn 0.3s ease; }
    .duel-option.wrong { border-color: #ff3366; background: linear-gradient(135deg, rgba(255,51,102,0.3), rgba(255,0,0,0.15)); box-shadow: 0 0 25px rgba(255,51,102,0.5); animation: shake 0.3s ease; }
    .duel-option.disabled { pointer-events: none; opacity: 0.5; }
    .duel-option.highlight { border-color: #00ff88; opacity: 1; }
    .duel-progress { display: flex; gap: 6px; justify-content: center; margin: 15px 0; }
    .duel-dot { width: 12px; height: 12px; border-radius: 50%; background: #333; border: 1px solid #555; transition: all 0.3s; }
    .duel-dot.correct { background: #00ff88; border-color: #00ff88; box-shadow: 0 0 8px rgba(0,255,136,0.5); }
    .duel-dot.wrong { background: #ff3366; border-color: #ff3366; box-shadow: 0 0 8px rgba(255,51,102,0.5); }
    .duel-dot.current { border-color: #00d4ff; box-shadow: 0 0 8px rgba(0,212,255,0.5); }
    .duel-streak { text-align: center; font-size: 14px; color: #ffd700; margin: 5px 0; min-height: 20px; }
    @media (max-width: 480px) { .duel-term { font-size: 22px; padding: 18px; } .duel-option { font-size: 14px; padding: 14px 16px; } }
    /* Calculator */
    .calc-toggle { position: fixed; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); right: 20px; width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(135deg, #00d4ff, #00ff88); border: none; color: #0a0a1a; font-size: 22px; font-weight: bold; cursor: pointer; z-index: 250; box-shadow: 0 4px 20px rgba(0,212,255,0.5); display: none; transition: all 0.3s; }
    @media (hover: hover) { .calc-toggle:hover { transform: scale(1.1); } }
    .calc-panel { position: fixed; bottom: 130px; right: 20px; width: 260px; background: #1a1a3a; border: 2px solid #00d4ff; border-radius: 15px; padding: 15px; z-index: 250; display: none; box-shadow: 0 8px 40px rgba(0,0,0,0.6); }
    .calc-display { width: 100%; padding: 12px; background: #0a0a1a; border: 1px solid #333; border-radius: 8px; color: #00ff88; font-size: 22px; font-family: monospace; text-align: right; margin-bottom: 10px; }
    .calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .calc-btn { padding: 12px; background: rgba(0,212,255,0.1); border: 1px solid #444; border-radius: 8px; color: #ffffff; font-size: 16px; cursor: pointer; transition: all 0.2s; font-family: monospace; }
    @media (hover: hover) { .calc-btn:hover { background: rgba(0,212,255,0.25); border-color: #00d4ff; } }
    .calc-btn.op { background: rgba(255,215,0,0.15); color: #ffd700; }
    .calc-btn.eq { background: linear-gradient(135deg, #00d4ff, #00ff88); color: #0a0a1a; font-weight: bold; }
    .calc-btn.clear { background: rgba(255,51,102,0.15); color: #ff3366; }
    @media (max-width: 480px) { .calc-panel { width: 240px; right: 10px; bottom: 130px; } .calc-toggle { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); right: 15px; width: 44px; height: 44px; font-size: 18px; } }
    /* Drills callout banner */
    .drills-banner { background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(255,100,0,0.1)); border: 2px solid #ffd700; border-radius: 15px; padding: 20px; margin-bottom: 20px; text-align: center; cursor: pointer; transition: all 0.3s; }
    @media (hover: hover) { .drills-banner:hover { box-shadow: 0 0 30px rgba(255,215,0,0.3); transform: translateY(-2px); } }
    /* Review screen cards */
    .review-card { background: linear-gradient(135deg, rgba(0,212,255,0.05), rgba(0,255,136,0.05)); border: 2px solid #333; border-radius: 10px; margin: 8px 0; overflow: hidden; }
    .review-card-header { padding: 12px 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
    .review-card-header.correct-header { border-left: 4px solid #00ff88; }
    .review-card-header.wrong-header { border-left: 4px solid #ff3366; background: rgba(255,51,102,0.05); }
    .review-card-body { padding: 0 15px 15px; display: none; }
    .review-card-body.expanded { display: block; }
    /* Mute button */
    .mute-btn { background: transparent; border: none; color: #00d4ff; font-size: 20px; cursor: pointer; padding: 5px; }
    /* Survival timer */
    .survival-timer { font-size: 24px; font-weight: bold; color: #ff3366; text-align: center; margin: 5px 0; font-family: 'Courier New', monospace; }
    .difficulty-badge { display: inline-block; padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }
    .difficulty-badge.easy { background: rgba(0,255,136,0.2); color: #00ff88; }
    .difficulty-badge.medium { background: rgba(255,215,0,0.2); color: #ffd700; }
    .difficulty-badge.hard { background: rgba(255,51,102,0.2); color: #ff3366; }
    button, .answer-btn, .match-card, .flashcard, .nav-tab, .btn-primary, .btn-secondary {
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
    }
    @media (max-width: 480px) {
      .nav-tabs { overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
      .nav-tab { flex-shrink: 0; padding: 8px 14px; font-size: 13px; min-height: 44px; }
      .answer-btn { min-height: 48px; }
      .flashcard { font-size: 16px; padding: 25px 15px; min-height: 150px; }
      .question-text { font-size: 16px; }
      .question-card { padding: 20px 15px; }
      .match-card { font-size: 13px; padding: 12px; min-height: 44px; }
      .matching-container { gap: 10px; }
      .results-title { font-size: 32px; }
      .game-over-title { font-size: 36px; }
      .timer { font-size: 30px; }
      .info-box { padding: 10px 15px; }
      .info-value { font-size: 20px; }
      .container { padding: 0 10px; }
      h1 { font-size: 24px !important; }
      .dashboard-card { padding: 20px; }
      .glossary-item { padding: 15px; }
      .btn-primary { padding: 12px 30px; font-size: 14px; }
    }
    /* FIX 1: Responsive two-column dashboard cards */
    @media (max-width: 600px) {
      #dashboard > div[style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
    }
    .icon { display: inline-block; width: 1em; height: 1em; vertical-align: -0.125em; }
    .icon-lg { width: 1.5em; height: 1.5em; }
    .icon-xl { width: 2em; height: 2em; }
    /* Touch feedback — fires instantly on touch-start */
    .answer-btn:active, .nav-tab:active, .btn-primary:active, .btn-secondary:active, .match-card:active, .flashcard:active, .calc-toggle:active, .calc-btn:active, .duel-option:active, .mode-card:active, .bottom-nav-tab:active { transform: scale(0.97); opacity: 0.9; transition: transform 0ms, opacity 0ms; }

    /* ========== BOTTOM NAV BAR ========== */
    .bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: 60px; background: #0a0a1a; border-top: 2px solid #00d4ff; display: flex; justify-content: space-around; align-items: center; z-index: 200; padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -4px 20px rgba(0, 212, 255, 0.15); }
    .bottom-nav-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: none; border: none; color: #666; cursor: pointer; padding: 6px 0; min-width: 64px; min-height: 48px; font-size: 11px; font-weight: 600; transition: color 0.2s; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
    .bottom-nav-tab svg { width: 24px; height: 24px; }
    .bottom-nav-tab.active { color: #00d4ff; }
    .bottom-nav-tab.active svg { filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.5)); }
    body.focus-mode .bottom-nav { border-top-color: #5a8a9a; box-shadow: none; }
    body.focus-mode .bottom-nav-tab.active { color: #5a8a9a; }

    /* Container padding to clear bottom nav */
    .container { padding-bottom: 80px; }

    /* ========== MODE GRID (Practice/Test screens) ========== */
    .mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .mode-card { background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(0, 255, 136, 0.05)); border: 2px solid rgba(0, 212, 255, 0.3); border-radius: 12px; padding: 20px 15px; cursor: pointer; transition: all 0.2s; text-align: center; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
    @media (hover: hover) { .mode-card:hover { border-color: #00d4ff; box-shadow: 0 0 20px rgba(0, 212, 255, 0.3); transform: translateY(-2px); } }
    .mode-card-icon { margin-bottom: 8px; }
    .mode-card-name { font-size: 15px; font-weight: 700; color: #ffffff; margin-bottom: 4px; }
    .mode-card-desc { font-size: 12px; color: #888; line-height: 1.4; }
    .mode-card-time { font-size: 11px; color: #555; margin-top: 6px; }
    @media (max-width: 480px) { .mode-grid { grid-template-columns: 1fr 1fr; gap: 10px; } .mode-card { padding: 16px 12px; } }

    /* ========== BACK BUTTON (game mode screens) ========== */
    .mode-back-btn { display: inline-flex; align-items: center; gap: 4px; background: none; border: 1px solid #444; color: #888; padding: 10px 14px; border-radius: 6px; font-size: 12px; cursor: pointer; margin-bottom: 10px; transition: all 0.2s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; min-height: 48px; }
    @media (hover: hover) { .mode-back-btn:hover { border-color: #00d4ff; color: #00d4ff; } }

    /* ========== Sprint 4: Toast notification ========== */
    .unlock-toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px); background: linear-gradient(135deg, #0a0a1a, #1a1a3a); border: 2px solid #00d4ff; border-radius: 10px; padding: 12px 24px; font-size: 14px; color: #ffffff; z-index: 1600; opacity: 0; transition: opacity 0.3s, transform 0.3s; box-shadow: 0 4px 20px rgba(0,212,255,0.3); white-space: nowrap; }
    .unlock-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
    /* ========== Sprint 4: Confetti ========== */
    @keyframes confettiFall { 0% { transform: translateY(-10px) rotate(0deg); opacity: 1; } 100% { transform: translateY(100vh) rotate(720deg); opacity: 0; } }
    .confetti-piece { position: fixed; top: -10px; width: 8px; height: 8px; border-radius: 2px; z-index: 1500; pointer-events: none; animation: confettiFall 2.5s ease-in forwards; }
    /* ========== Sprint 4: Keyboard help overlay ========== */
    .kb-help-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10,10,26,0.92); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; animation: obFadeIn 0.2s ease; }
    .kb-help-card { background: #1a1a3a; border: 2px solid #00d4ff; border-radius: 15px; padding: 30px; max-width: 400px; width: 100%; }
    .kb-help-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #222; }
    .kb-help-key { display: inline-block; background: rgba(0,212,255,0.15); border: 1px solid #00d4ff; border-radius: 4px; padding: 2px 8px; font-family: monospace; color: #00d4ff; font-size: 13px; }

    /* Old paywall CSS removed — app is now ad-supported */

    /* ========== Sprint 6 Task 3: Combo milestone visuals ========== */
    @keyframes comboPop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
    .combo-milestone-5 { color: #00ff88; text-shadow: 0 0 8px rgba(0,255,136,0.5); animation: comboPop 0.4s ease-out; }
    .combo-milestone-10 { color: #ffd700; text-shadow: 0 0 12px rgba(255,215,0,0.6); animation: comboPop 0.4s ease-out; }
    .combo-milestone-15 { color: #ff8c00; text-shadow: 0 0 15px rgba(255,140,0,0.7); animation: comboPop 0.4s ease-out; }
    .combo-milestone-25 { color: #ff3366; text-shadow: 0 0 20px rgba(255,51,102,0.8); animation: comboPop 0.4s ease-out; }

    /* ========== Sprint 6 Task 4: Flashcard 3D flip ========== */
    .flashcard-container { perspective: 800px; }
    .flashcard { transform-style: preserve-3d; will-change: transform; transition: transform 0.4s ease-in-out; backface-visibility: hidden; }
    .flashcard.flip { transform: rotateY(180deg); }
    .flashcard.flip > * { transform: rotateY(180deg); }

    /* ========== Sprint 6 Task 5: Exam Sim visual shift ========== */
    .exam-mode-active .container { max-width: 600px; }
    .exam-mode-active .question-card { border-color: #333; box-shadow: 0 0 10px rgba(0,0,0,0.4); background: linear-gradient(135deg, rgba(20,20,40,0.9), rgba(10,10,26,0.95)); }
    .exam-mode-active .timer { font-size: 36px; padding: 10px; background: linear-gradient(90deg, rgba(0,212,255,0.08), transparent); border-radius: 8px; margin: 10px 0; }

    /* ========== Sprint 6 Task 10: Tomorrow preview ========== */
    .tomorrow-preview { background: linear-gradient(135deg, rgba(0,212,255,0.05), rgba(0,255,136,0.03)); border: 1px solid #222; border-radius: 10px; padding: 12px 16px; margin-top: 10px; text-align: center; }
    .tomorrow-preview-label { font-size: 11px; color: #555; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
    .tomorrow-preview-mode { font-size: 14px; color: #00d4ff; font-weight: 600; }

    /* ========== Sprint 7 Task 1: Personal best banner ========== */
    .pb-banner { position: fixed; top: -60px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, #ffd700, #ff8c00); color: #0a0a1a; font-size: 16px; font-weight: 900; padding: 14px 28px; border-radius: 0 0 12px 12px; z-index: 1600; transition: top 0.4s ease-out; white-space: nowrap; box-shadow: 0 4px 20px rgba(255,215,0,0.5); letter-spacing: 1px; }
    .pb-banner.show { top: 0; }
    /* ========== Sprint 7 Task 2: Heart loss upgrade ========== */
    @keyframes heartDie { 0% { transform: scale(1); opacity: 1; color: #ff3366; } 50% { transform: scale(1.2); color: #ff0000; } 100% { transform: scale(0); opacity: 0; } }
    .heart-dying { animation: heartDie 0.5s ease-out forwards; display: inline-block; }
    .danger-vignette { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 999; box-shadow: inset 0 0 80px rgba(255,0,0,0.4); animation: dangerPulse 1s ease-in-out infinite; }
    @keyframes dangerPulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
    @keyframes microShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
    /* ========== Sprint 7 Task 3: Enhanced game over ========== */
    .go-xp-earned { color: #00ff88; font-size: 18px; font-weight: bold; margin: 8px 0; }
    .go-percentile { display: inline-block; padding: 6px 16px; background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(0,255,136,0.1)); border: 1px solid #00d4ff; border-radius: 20px; color: #00d4ff; font-size: 14px; font-weight: 600; margin: 10px 0; }
    /* ========== Sprint 7 Task 4: Exam question navigator ========== */
    .exam-nav-bar { position: sticky; top: 0; z-index: 50; background: #0a0a1a; padding: 8px 0; margin-bottom: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; border-bottom: 1px solid #1a1a3a; }
    .exam-nav-btn { display: inline-block; width: 32px; height: 32px; border: 1px solid #333; background: transparent; color: #666; border-radius: 4px; font-size: 10px; cursor: pointer; margin: 0 2px; vertical-align: middle; position: relative; touch-action: manipulation; }
    .exam-nav-btn.current { border-color: #00d4ff; color: #fff; background: rgba(0,212,255,0.2); }
    .exam-nav-btn.answered { border-color: #00ff88; }
    .exam-nav-btn.answered::after { content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; border-radius: 50%; background: #00ff88; }
    .exam-nav-btn.flagged { border-color: #ffd700; }
    .exam-nav-btn.flagged::after { background: #ffd700; }

    /* ========== Sprint 10: Leaderboard ========== */
    .lb-mode-tab.active { background: linear-gradient(135deg, #ffd700, #ff8c00); color: #0a0a1a; border-color: #ffd700; }
    .lb-row { display: grid; grid-template-columns: 40px 1fr 80px; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #1a1a2a; font-size: 13px; }
    .lb-row.me { background: rgba(0,212,255,0.1); border-left: 3px solid #00d4ff; }
    .lb-rank { font-weight: bold; color: #888; text-align: center; }
    .lb-rank.gold { color: #ffd700; } .lb-rank.silver { color: #c0c0c0; } .lb-rank.bronze { color: #cd7f32; }
    .lb-name { color: #cccccc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .lb-score { color: #00d4ff; font-weight: bold; text-align: right; }
    /* ========== Sprint 10: Share card ========== */
    .share-card { width: 400px; padding: 30px; background: linear-gradient(135deg, #0a0a1a, #1a1a3a); border: 2px solid #00d4ff; border-radius: 16px; text-align: center; font-family: 'Inter', sans-serif; }
    .share-card-logo { font-size: 20px; font-weight: 900; color: #00d4ff; letter-spacing: 2px; margin-bottom: 15px; }
    .share-card-score { font-size: 48px; font-weight: 900; margin: 10px 0; }
    .share-card-mode { font-size: 14px; color: #888; margin-bottom: 8px; }
    .share-card-tagline { font-size: 13px; color: #666; font-style: italic; margin-top: 12px; }
    /* ========== Sprint 10: I Passed celebration ========== */
    .pass-celebration { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10,10,26,0.95); z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; animation: obFadeIn 0.5s ease; }
    .pass-trophy { font-size: 80px; margin-bottom: 10px; animation: bounce 1s ease-in-out infinite; }
    .pass-title { font-size: 28px; font-weight: 900; color: #ffd700; margin-bottom: 8px; text-shadow: 0 0 20px rgba(255,215,0,0.5); }
    .pass-score { font-size: 48px; font-weight: 900; color: #00ff88; margin: 10px 0; }
    .pass-subtitle { font-size: 15px; color: #cccccc; margin-bottom: 20px; }
    /* ========== Reinforcement toggle ========== */
    .reinforce-toggle { position: absolute; top: 8px; right: 8px; z-index: 10; }
    .reinforce-toggle-btn { background: rgba(0,212,255,0.1); border: 1px solid #333; color: #666; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; touch-action: manipulation; }
    @media (hover: hover) { .reinforce-toggle-btn:hover { border-color: #00d4ff; color: #00d4ff; } }
    .reinforce-menu { position: absolute; top: 32px; right: 0; background: #1a1a3a; border: 1px solid #333; border-radius: 8px; padding: 10px; min-width: 160px; box-shadow: 0 4px 20px rgba(0,0,0,0.5); z-index: 20; }
    .reinforce-menu-item { display: block; width: 100%; background: none; border: none; color: #cccccc; padding: 8px 10px; font-size: 12px; text-align: left; cursor: pointer; border-radius: 4px; transition: background 0.2s; }
    @media (hover: hover) { .reinforce-menu-item:hover { background: rgba(0,212,255,0.1); color: #00d4ff; } }
    /* ========== Ad placeholders ========== */
    .ad-placeholder { background: rgba(255,255,255,0.03); border: 1px dashed #333; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #444; font-size: 12px; font-weight: bold; letter-spacing: 1px; }
    .ad-interstitial { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10,10,26,0.95); z-index: 2500; display: flex; align-items: center; justify-content: center; padding: 20px; animation: obFadeIn 0.3s ease; }
