/* ============================================
   ALPHASOUND – EYE Brand Theme (Teal Palette)
   Mobile-First Responsive Design
   ============================================ */

:root {
    --brand-900: #0A2929;
    --brand-800: #0F3D3D;
    --brand-700: #145252;
    --brand-600: #1D6666;
    --brand-500: #2B8B8B;
    --brand-400: #3EABAB;
    --brand-300: #5CC5C5;
    --brand-200: #8FD9D9;
    --brand-100: #C5ECEC;

    --bg-primary: #0B1A1D;
    --bg-secondary: #101F22;
    --bg-card: rgba(43, 139, 139, 0.08);
    --bg-card-hover: rgba(43, 139, 139, 0.14);
    --bg-glass: rgba(43, 139, 139, 0.1);
    --border-glass: rgba(62, 171, 171, 0.15);

    --text-primary: #E8F4F4;
    --text-secondary: #9BBFC0;
    --text-muted: #5E8A8B;

    --accent-teal: #2B8B8B;
    --accent-teal-glow: rgba(43, 139, 139, 0.3);
    --accent-light: #4AACAC;
    --accent-light-glow: rgba(74, 172, 172, 0.25);
    --accent-gold: #C49A3C;
    --accent-gold-glow: rgba(196, 154, 60, 0.25);
    --accent-warm: #E8985E;
    --accent-warm-glow: rgba(232, 152, 94, 0.2);

    --success: #2BB58B;
    --error: #E85A6A;
    --warning: #D4A843;

    --gradient-main: linear-gradient(135deg, #1D6666 0%, #4AACAC 100%);
    --gradient-light: linear-gradient(135deg, #2B8B8B 0%, #7ECCCC 100%);
    --gradient-warm: linear-gradient(135deg, #C49A3C 0%, #E8C060 100%);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --space-xs: 4px; --space-sm: 8px; --space-md: 16px;
    --space-lg: 24px; --space-xl: 32px; --space-2xl: 48px;

    --radius-sm: 8px; --radius-md: 12px; --radius-lg: 20px;
    --radius-xl: 28px; --radius-full: 50%;

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);

    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px var(--accent-teal-glow);

    --header-height: 60px;
    --bottom-nav-height: 68px;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    padding-top: var(--header-height);
    padding-bottom: var(--bottom-nav-height);
}

body::before {
    content: '';
    position: fixed; inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(43, 139, 139, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(74, 172, 172, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(29, 102, 102, 0.04) 0%, transparent 50%);
    pointer-events: none; z-index: 0;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; }

button {
    font-family: var(--font-body); cursor: pointer; border: none;
    background: none; color: inherit; font-size: inherit;
    -webkit-tap-highlight-color: transparent;
}

/* ===== HEADER ===== */
#app-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: rgba(11, 26, 29, 0.88);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    z-index: 100; display: flex; align-items: center;
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--space-md);
}
.logo { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.logo-img { height: 28px; width: 28px; object-fit: contain; border-radius: var(--radius-full); flex-shrink: 0; }
.logo-text { font-family: var(--font-heading); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.5px; }
.logo-accent { background: var(--gradient-light); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.header-actions { display: flex; align-items: center; gap: var(--space-sm); }

.btn-french {
    display: flex; align-items: center; gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-glass); border: 1px solid var(--border-glass);
    border-radius: var(--radius-md); font-size: 0.8rem; font-weight: 500; color: var(--text-secondary);
    transition: all var(--transition-normal);
}
.btn-french:hover, .btn-french:active { background: var(--bg-card-hover); color: var(--text-primary); }
.btn-french-label { display: none; }

.btn-progress-header {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; background: var(--bg-glass);
    border: 1px solid var(--border-glass); border-radius: var(--radius-md);
    font-size: 1.1rem; transition: all var(--transition-normal);
}
.btn-progress-header:hover { background: var(--bg-card-hover); }

/* ===== SCREENS ===== */
.screen {
    display: none; position: relative; z-index: 1;
    min-height: calc(100dvh - var(--header-height) - var(--bottom-nav-height));
    padding: var(--space-md); max-width: 800px; margin: 0 auto;
    animation: fadeIn 0.3s ease;
}
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.screen-header { display: flex; align-items: center; gap: var(--space-md); margin-bottom: var(--space-md); }
.screen-title { flex: 1; font-size: 1.2rem; font-weight: 700; }
.screen-instruction { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: var(--space-lg); line-height: 1.5; }

.btn-back, .btn-speed, .btn-reset-progress {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; background: var(--bg-glass);
    border: 1px solid var(--border-glass); border-radius: var(--radius-md);
    font-size: 1.2rem; transition: all var(--transition-normal);
}
.btn-back:hover, .btn-speed:hover { background: var(--bg-card-hover); }
.btn-speed.slow-active { background: var(--accent-teal-glow); border-color: var(--accent-teal); }
.btn-reset-progress { font-size: 1rem; }
.btn-reset-progress:hover { background: rgba(232, 90, 106, 0.15); border-color: var(--error); }

/* ===== HOME SCREEN ===== */
.home-hero { text-align: center; padding: var(--space-2xl) 0 var(--space-lg); position: relative; overflow: hidden; }
.floating-letters { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.floating-letter {
    position: absolute; font-family: var(--font-heading); font-weight: 900;
    opacity: 0.07; animation: floatLetter 8s ease-in-out infinite;
}
@keyframes floatLetter {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(-3deg); }
}
.hero-title { font-size: 2rem; font-weight: 900; margin-bottom: var(--space-md); letter-spacing: -1px; position: relative; z-index: 1; }
.gradient-text { background: var(--gradient-light); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { font-size: 0.95rem; color: var(--text-secondary); max-width: 320px; margin: 0 auto; line-height: 1.6; position: relative; z-index: 1; }

.mode-cards { display: flex; flex-direction: column; gap: var(--space-md); margin-top: var(--space-xl); }
.mode-card {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: var(--space-lg); background: var(--bg-card);
    border: 1px solid var(--border-glass); border-radius: var(--radius-lg);
    transition: all var(--transition-slow); position: relative; overflow: hidden;
}
.mode-card::before { content: ''; position: absolute; inset: 0; background: var(--gradient-main); opacity: 0; transition: opacity var(--transition-slow); }
.mode-card:hover::before, .mode-card:active::before { opacity: 0.1; }
.mode-card:hover, .mode-card:active { transform: translateY(-2px); border-color: rgba(43, 139, 139, 0.4); box-shadow: var(--shadow-glow); }
.mode-card-icon { font-size: 2.5rem; margin-bottom: var(--space-sm); position: relative; z-index: 1; }
.mode-card-title { font-size: 1.2rem; font-weight: 700; margin-bottom: var(--space-xs); position: relative; z-index: 1; }
.mode-card-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; position: relative; z-index: 1; }

/* ===== ALPHABET GRID ===== */
.alphabet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-sm); }
.letter-card {
    aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-md);
    cursor: pointer; transition: all var(--transition-normal); position: relative; overflow: hidden; min-height: 70px;
}
.letter-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; opacity: 0; transition: opacity var(--transition-normal); }
.letter-card:hover::after, .letter-card:active::after { opacity: 1; }
.letter-card:nth-child(5n+1)::after { background: rgba(29, 102, 102, 0.3); }
.letter-card:nth-child(5n+2)::after { background: rgba(43, 139, 139, 0.25); }
.letter-card:nth-child(5n+3)::after { background: rgba(74, 172, 172, 0.2); }
.letter-card:nth-child(5n+4)::after { background: rgba(196, 154, 60, 0.2); }
.letter-card:nth-child(5n+5)::after { background: rgba(92, 197, 197, 0.2); }
.letter-card:hover, .letter-card:active { transform: scale(1.05); border-color: rgba(43, 139, 139, 0.4); }
.letter-card.mastered { border-color: rgba(43, 181, 139, 0.4); }
.letter-card.mastered::before { content: '✓'; position: absolute; top: 4px; right: 6px; font-size: 0.6rem; color: var(--success); z-index: 2; }
.letter-card-upper { font-family: var(--font-heading); font-weight: 800; font-size: 1.6rem; line-height: 1; position: relative; z-index: 1; }
.letter-card-lower { font-family: var(--font-heading); font-weight: 500; font-size: 0.8rem; color: var(--text-secondary); position: relative; z-index: 1; }
.letter-card.pressed { animation: letterPop 0.3s ease; }
@keyframes letterPop { 50% { transform: scale(0.9); } }

/* ===== LETTER DETAIL OVERLAY ===== */
.letter-detail-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    z-index: 200; align-items: center; justify-content: center; padding: var(--space-md);
}
.letter-detail-overlay.active { display: flex; }
.letter-detail-card {
    background: var(--bg-secondary); border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl); padding: var(--space-xl) var(--space-lg);
    max-width: 380px; width: 100%; text-align: center; position: relative;
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes scaleIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.btn-close-detail {
    position: absolute; top: var(--space-md); right: var(--space-md);
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    background: var(--bg-glass); border: 1px solid var(--border-glass);
    border-radius: var(--radius-full); font-size: 1.2rem; color: var(--text-secondary);
    transition: all var(--transition-normal);
}
.btn-close-detail:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.detail-letter { font-family: var(--font-heading); font-weight: 900; font-size: 5rem; line-height: 1; background: var(--gradient-light); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.detail-lowercase { font-family: var(--font-heading); font-weight: 700; font-size: 2.5rem; color: var(--text-secondary); margin-bottom: var(--space-sm); }
.detail-phonetic { display: inline-block; padding: var(--space-xs) var(--space-md); background: var(--accent-teal-glow); border: 1px solid rgba(43, 139, 139, 0.3); border-radius: var(--radius-sm); font-size: 1.1rem; font-weight: 600; color: var(--accent-light); font-family: var(--font-heading); margin-bottom: var(--space-lg); }
.detail-word { display: flex; align-items: center; justify-content: center; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.detail-emoji { font-size: 2rem; }
.detail-word-text { font-weight: 600; font-family: var(--font-heading); font-size: 1.3rem; }

.detail-actions { display: flex; flex-direction: column; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.btn-play-letter, .btn-play-word, .btn-play-slow {
    display: flex; align-items: center; justify-content: center; gap: var(--space-sm);
    padding: var(--space-md); border-radius: var(--radius-md); font-weight: 600; font-size: 0.95rem;
    transition: all var(--transition-normal);
}
.btn-play-letter { background: var(--gradient-main); color: white; }
.btn-play-letter:active { transform: scale(0.97); }
.btn-play-word, .btn-play-slow { background: var(--bg-glass); border: 1px solid var(--border-glass); }
.btn-play-word { color: var(--text-primary); }
.btn-play-slow { color: var(--text-secondary); }
.btn-play-word:active, .btn-play-slow:active { transform: scale(0.97); }

.detail-nav { display: flex; justify-content: space-between; }
.btn-prev-letter, .btn-next-letter {
    padding: var(--space-sm) var(--space-md); background: var(--bg-glass);
    border: 1px solid var(--border-glass); border-radius: var(--radius-md);
    font-size: 0.85rem; font-weight: 600; color: var(--text-secondary);
    transition: all var(--transition-normal);
}
.btn-prev-letter:hover, .btn-next-letter:hover { color: var(--text-primary); background: var(--bg-card-hover); }

/* ===== QUIZ MODE ===== */
.quiz-score-display { display: flex; align-items: center; gap: var(--space-sm); font-size: 0.85rem; }
.score-label { color: var(--text-muted); }
.score-value { font-weight: 700; font-family: var(--font-heading); color: var(--accent-light); }
.streak-badge { padding: 2px var(--space-sm); background: var(--accent-gold-glow); border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 600; color: var(--accent-gold); }

/* Level Selection */
.quiz-levels { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md); margin-top: var(--space-md); }
.level-card {
    padding: var(--space-lg) var(--space-md); background: var(--bg-card);
    border: 1px solid var(--border-glass); border-radius: var(--radius-lg);
    text-align: center; transition: all var(--transition-slow); position: relative; overflow: hidden;
}
.level-card:hover { transform: translateY(-2px); border-color: rgba(43, 139, 139, 0.4); box-shadow: var(--shadow-glow); }
.level-card.completed { border-color: rgba(43, 181, 139, 0.4); }
.level-card.completed::after { content: '✓'; position: absolute; top: 8px; right: 10px; color: var(--success); font-weight: 700; }
.level-number { font-family: var(--font-heading); font-weight: 900; font-size: 1.8rem; background: var(--gradient-light); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.level-name { font-family: var(--font-heading); font-weight: 700; font-size: 0.95rem; margin: var(--space-xs) 0; }
.level-desc { font-size: 0.75rem; color: var(--text-muted); }
.level-best { font-size: 0.7rem; color: var(--accent-gold); margin-top: var(--space-xs); }

.quiz-area { display: flex; flex-direction: column; align-items: center; gap: var(--space-lg); }
.quiz-prompt-container { display: flex; flex-direction: column; align-items: center; gap: var(--space-md); }
.quiz-play-btn {
    width: 140px; height: 140px; border-radius: var(--radius-full);
    background: var(--gradient-main); display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: var(--space-sm);
    color: white; font-weight: 600; box-shadow: var(--shadow-glow);
    transition: all var(--transition-normal); animation: pulsate 2s ease-in-out infinite;
}
@keyframes pulsate {
    0%, 100% { box-shadow: 0 0 30px var(--accent-teal-glow); }
    50% { box-shadow: 0 0 50px var(--accent-teal-glow), 0 0 80px var(--accent-light-glow); }
}
.quiz-play-btn:active { transform: scale(0.95); }
.quiz-play-btn.played { animation: none; opacity: 0.7; }
.quiz-play-icon { font-size: 3rem; }
.quiz-play-text { font-size: 0.8rem; opacity: 0.9; }
.quiz-round-info { font-size: 0.85rem; color: var(--text-muted); }
.quiz-level-badge { display: inline-block; padding: 2px 10px; background: var(--accent-teal-glow); border: 1px solid rgba(43,139,139,0.3); border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 600; color: var(--accent-light); margin-bottom: var(--space-sm); }

.quiz-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md); width: 100%; max-width: 360px; }
.quiz-options.cols-3 { grid-template-columns: repeat(3, 1fr); }
.quiz-option {
    padding: var(--space-lg); background: var(--bg-card); border: 2px solid var(--border-glass);
    border-radius: var(--radius-lg); font-family: var(--font-heading); font-weight: 800;
    font-size: 2rem; text-align: center; transition: all var(--transition-normal);
    min-height: 80px; display: flex; align-items: center; justify-content: center;
}
.quiz-option:hover { border-color: rgba(43, 139, 139, 0.4); background: var(--bg-card-hover); }
.quiz-option:active { transform: scale(0.96); }
.quiz-option.correct { background: rgba(43, 181, 139, 0.15); border-color: var(--success); color: var(--success); animation: correctPulse 0.5s ease; }
.quiz-option.wrong { background: rgba(232, 90, 106, 0.15); border-color: var(--error); color: var(--error); animation: shake 0.4s ease; }
.quiz-option.disabled { pointer-events: none; opacity: 0.5; }
@keyframes correctPulse { 50% { transform: scale(1.08); } }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }

.quiz-feedback { font-size: 1.1rem; font-weight: 600; font-family: var(--font-heading); min-height: 30px; text-align: center; }
.quiz-feedback.correct { color: var(--success); }
.quiz-feedback.wrong { color: var(--error); }

.btn-quiz-next, .btn-spelling-next, .btn-quiz-back-levels {
    display: none; padding: var(--space-md) var(--space-xl);
    background: var(--gradient-main); border-radius: var(--radius-md);
    font-weight: 600; font-size: 1rem; color: white; transition: all var(--transition-normal);
}
.btn-quiz-next.visible, .btn-spelling-next.visible, .btn-quiz-back-levels.visible { display: block; }
.btn-quiz-next:active, .btn-spelling-next:active { transform: scale(0.97); }
.btn-quiz-back-levels { background: var(--bg-glass); border: 1px solid var(--border-glass); color: var(--text-secondary); }

/* Quiz & Spelling Results */
.quiz-results, .spelling-results {
    display: none; position: absolute; inset: 0; z-index: 10;
    background: var(--bg-primary); padding: var(--space-xl) var(--space-md);
    animation: fadeIn 0.4s ease;
}
.quiz-results.active, .spelling-results.active { display: flex; align-items: center; justify-content: center; }
.results-card { text-align: center; max-width: 360px; width: 100%; }
.results-emoji { font-size: 4rem; margin-bottom: var(--space-md); animation: bounceIn 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes bounceIn { 0% { transform: scale(0); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
.results-title { font-size: 1.8rem; font-weight: 800; margin-bottom: var(--space-md); }
.results-score { font-family: var(--font-heading); font-size: 3rem; font-weight: 900; background: var(--gradient-light); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: var(--space-md); }
.results-stars { display: flex; justify-content: center; gap: var(--space-sm); margin-bottom: var(--space-md); font-size: 2rem; }
.results-message { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: var(--space-xl); line-height: 1.5; }
.results-actions { display: flex; flex-direction: column; gap: var(--space-sm); }
.btn-results-retry, .btn-spelling-retry { padding: var(--space-md); background: var(--gradient-main); border-radius: var(--radius-md); font-weight: 600; color: white; font-size: 1rem; transition: all var(--transition-normal); }
.btn-results-retry:active, .btn-spelling-retry:active { transform: scale(0.97); }
.btn-results-home, .btn-spelling-home { padding: var(--space-md); background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: var(--radius-md); font-weight: 600; color: var(--text-secondary); font-size: 1rem; transition: all var(--transition-normal); }

/* ===== SPELLING BEE ===== */
.spelling-area { display: flex; flex-direction: column; align-items: center; gap: var(--space-lg); }
.spelling-prompt {
    display: flex; flex-direction: column; align-items: center; gap: var(--space-md);
    padding: var(--space-xl); background: var(--bg-card);
    border: 1px solid var(--border-glass); border-radius: var(--radius-xl);
    width: 100%; max-width: 300px;
}
.spelling-emoji { font-size: 5rem; }
.spelling-word { font-family: var(--font-heading); font-weight: 700; font-size: 1.5rem; display: none; }
.spelling-word.revealed { display: block; }
.spelling-hear-btn {
    padding: var(--space-sm) var(--space-md); background: var(--bg-glass);
    border: 1px solid var(--border-glass); border-radius: var(--radius-md);
    font-size: 0.85rem; font-weight: 500; color: var(--text-secondary);
    transition: all var(--transition-normal);
}
.spelling-hear-btn:active { transform: scale(0.97); }

.spelling-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-sm); width: 100%; max-width: 360px; }
.spelling-option {
    padding: var(--space-md); background: var(--bg-card); border: 2px solid var(--border-glass);
    border-radius: var(--radius-md); font-family: var(--font-heading); font-weight: 800;
    font-size: 1.5rem; text-align: center; transition: all var(--transition-normal);
    min-height: 60px; display: flex; align-items: center; justify-content: center;
}
.spelling-option:active { transform: scale(0.96); }
.spelling-option.correct { background: rgba(43, 181, 139, 0.15); border-color: var(--success); color: var(--success); animation: correctPulse 0.5s ease; }
.spelling-option.wrong { background: rgba(232, 90, 106, 0.15); border-color: var(--error); color: var(--error); animation: shake 0.4s ease; }
.spelling-option.disabled { pointer-events: none; opacity: 0.5; }
.spelling-feedback { font-size: 1rem; font-weight: 600; font-family: var(--font-heading); min-height: 30px; text-align: center; line-height: 1.4; }
.spelling-feedback.correct { color: var(--success); }
.spelling-feedback.wrong { color: var(--error); }

/* ===== PROGRESS ===== */
.progress-overview { display: flex; flex-direction: column; align-items: center; gap: var(--space-xl); margin-bottom: var(--space-xl); }
.progress-ring-container { position: relative; width: 140px; height: 140px; }
.progress-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring-bg { fill: none; stroke: var(--bg-card); stroke-width: 10; }
.progress-ring-fill { fill: none; stroke: url(#progressGradient); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 377; stroke-dashoffset: 377; transition: stroke-dashoffset 1s cubic-bezier(0.16, 1, 0.3, 1); }
.progress-ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.progress-percent { font-family: var(--font-heading); font-weight: 900; font-size: 1.8rem; background: var(--gradient-light); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.progress-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.progress-stats { display: flex; gap: var(--space-lg); }
.stat-item { text-align: center; }
.stat-value { display: block; font-family: var(--font-heading); font-weight: 800; font-size: 1.5rem; color: var(--accent-light); }
.stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.progress-grid-title { font-size: 1rem; margin-bottom: var(--space-md); color: var(--text-secondary); }
.progress-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-sm); }
.progress-letter { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-sm); font-family: var(--font-heading); font-weight: 700; font-size: 1rem; min-height: 48px; }
.progress-letter .progress-dots { display: flex; gap: 2px; margin-top: 2px; }
.progress-dot { width: 5px; height: 5px; border-radius: var(--radius-full); background: var(--bg-card-hover); }
.progress-dot.filled { background: var(--success); }
.progress-letter.mastered { border-color: rgba(43, 181, 139, 0.4); background: rgba(43, 181, 139, 0.08); }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; height: var(--bottom-nav-height);
    background: rgba(11, 26, 29, 0.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-glass); display: flex; align-items: center;
    justify-content: space-around; z-index: 100; padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--space-sm) var(--space-md); color: var(--text-muted); transition: all var(--transition-normal); border-radius: var(--radius-md); position: relative; }
.nav-item.active { color: var(--accent-light); }
.nav-item.active::before { content: ''; position: absolute; top: -1px; left: 50%; transform: translateX(-50%); width: 24px; height: 3px; background: var(--gradient-main); border-radius: 0 0 3px 3px; }
.nav-icon { font-size: 1.3rem; }
.nav-label { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* ===== MODAL ===== */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); z-index: 300; align-items: center; justify-content: center; padding: var(--space-md); }
.modal-overlay.active { display: flex; }
.modal-content { background: var(--bg-secondary); border: 1px solid var(--border-glass); border-radius: var(--radius-xl); padding: var(--space-xl) var(--space-lg); max-width: 480px; width: 100%; max-height: 80dvh; overflow-y: auto; position: relative; animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.modal-close { position: absolute; top: var(--space-md); right: var(--space-md); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: var(--radius-full); font-size: 1.2rem; color: var(--text-secondary); transition: all var(--transition-normal); }
.modal-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.modal-title { font-size: 1.3rem; margin-bottom: var(--space-lg); padding-right: var(--space-xl); }
.fr-section { margin-bottom: var(--space-lg); }
.fr-section h3 { font-size: 1rem; margin-bottom: var(--space-sm); color: var(--accent-light); }
.fr-section p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; }

/* ===== CONFETTI & TOAST ===== */
#confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 500; width: 100%; height: 100%; }
.toast-container { position: fixed; top: calc(var(--header-height) + var(--space-md)); left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: var(--space-sm); pointer-events: none; width: 90%; max-width: 360px; }
.toast { padding: var(--space-md); background: var(--bg-secondary); border: 1px solid var(--border-glass); border-radius: var(--radius-md); font-size: 0.85rem; font-weight: 500; text-align: center; pointer-events: auto; animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards; box-shadow: var(--shadow-card); }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--error); color: var(--error); }
.toast.info { border-color: var(--accent-light); color: var(--accent-light); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

/* ===== FOOTER ===== */
.app-footer {
    text-align: center;
    padding: var(--space-lg) var(--space-md) calc(var(--space-lg) + 8px);
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border-glass);
    margin-top: var(--space-lg);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.footer-line {
    font-size: 0.6rem;
    color: var(--text-muted);
    line-height: 1.7;
    font-family: var(--font-body);
}
.footer-line:first-child {
    font-weight: 500;
}
.footer-link {
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}
.footer-link:hover {
    color: var(--brand-200);
    text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 600px) {
    .btn-french-label { display: inline; }
    .logo-img { height: 32px; width: 32px; }
    .footer-line { font-size: 0.65rem; }
    .hero-title { font-size: 2.8rem; }
    .hero-subtitle { max-width: 440px; font-size: 1.05rem; }
    .mode-cards { flex-direction: row; }
    .mode-card { flex: 1; padding: var(--space-xl); }
    .alphabet-grid { grid-template-columns: repeat(5, 1fr); gap: var(--space-md); }
    .letter-card { min-height: 90px; }
    .letter-card-upper { font-size: 2rem; }
    .letter-card-lower { font-size: 1rem; }
    .quiz-options { max-width: 420px; }
    .quiz-option { font-size: 2.5rem; padding: var(--space-xl); }
    .progress-grid { grid-template-columns: repeat(9, 1fr); }
    .quiz-levels { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
    .alphabet-grid { grid-template-columns: repeat(7, 1fr); }
    .detail-actions { flex-direction: row; }
    .btn-play-letter, .btn-play-word, .btn-play-slow { flex: 1; }
    .progress-overview { flex-direction: row; justify-content: center; }
}
@media (min-width: 1200px) {
    :root { --bottom-nav-height: 0px; }
    .bottom-nav { display: none; }
    body { padding-bottom: var(--space-xl); }
    .screen { max-width: 960px; }
    .alphabet-grid { grid-template-columns: repeat(9, 1fr); }
    .letter-card:hover { transform: scale(1.08); }
    .mode-card:hover { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-card-hover); border-radius: 3px; }
*:focus-visible { outline: 2px solid var(--accent-teal); outline-offset: 2px; }
button:focus:not(:focus-visible) { outline: none; }
