/* ============================================
   Krishvik's Tamil Adventure - Styles
   A fun, kid-friendly Tamil learning app
   ============================================ */

/* CSS Variables - Temple-inspired color palette */
:root {
    --primary-saffron: #FF6B35;
    --primary-gold: #FFD93D;
    --primary-emerald: #2E8B57;
    --primary-blue: #4169E1;
    --primary-magenta: #FF1493;
    
    --bg-cream: #FFF8E7;
    --bg-light: #FFFEF5;
    --card-white: #FFFFFF;
    
    --text-dark: #2D3436;
    --text-gray: #636E72;
    --text-light: #95A5A6;
    
    --success-green: #00B894;
    --error-red: #FF6B6B;
    --warning-yellow: #FDCB6E;
    
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-strong: 0 12px 35px rgba(0, 0, 0, 0.2);
    
    --radius-small: 12px;
    --radius-medium: 16px;
    --radius-large: 24px;
    --radius-full: 50px;
    
    --font-main: 'Baloo 2', cursive;
    --font-tamil: 'Noto Sans Tamil', sans-serif;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, var(--bg-cream) 0%, #FFE4C4 100%);
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Screen Management */
.screen {
    min-height: 100vh;
}

.screen:not(.active) {
    display: none !important;
}

#welcome-screen.active {
    display: flex !important;
}

#main-screen.active {
    display: block !important;
}

/* ============================================
   Welcome Screen
   ============================================ */
#welcome-screen {
    background: linear-gradient(180deg, #FF9A56 0%, #FF6B35 50%, #E55A2B 100%);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.welcome-content {
    text-align: center;
    z-index: 10;
}

.elephant-mascot {
    position: relative;
    margin-bottom: 20px;
}

.elephant {
    font-size: 100px;
    animation: bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

.sparkles {
    position: absolute;
    top: -10px;
    right: -20px;
    font-size: 40px;
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.5; transform: scale(1.2) rotate(20deg); }
}

.welcome-title {
    font-family: var(--font-tamil);
    font-size: 3.5rem;
    color: white;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
}

.welcome-subtitle {
    font-size: 1.8rem;
    color: var(--primary-gold);
    font-weight: 700;
    margin-bottom: 10px;
}

.welcome-text {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 25px;
}

.stats-preview {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    backdrop-filter: blur(5px);
}

.stat-item i {
    margin-right: 8px;
}

.stat-item .fa-star {
    color: var(--primary-gold);
}

.stat-item .fa-fire {
    color: #FF4500;
}

.start-btn {
    background: linear-gradient(135deg, var(--primary-gold) 0%, #FFC300 100%);
    color: var(--text-dark);
    border: none;
    padding: 18px 50px;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-main);
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: var(--shadow-strong), inset 0 2px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.start-btn:active {
    transform: scale(0.95);
    box-shadow: var(--shadow-soft);
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: var(--shadow-strong), 0 0 0 0 rgba(255, 217, 61, 0.7); }
    50% { box-shadow: var(--shadow-strong), 0 0 0 20px rgba(255, 217, 61, 0); }
}

/* Temple decoration */
.temple-decoration {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(0deg, rgba(139, 69, 19, 0.3) 0%, transparent 100%);
}

/* ============================================
   Main App Screen
   ============================================ */
#main-screen {
    background: var(--bg-cream);
    padding-bottom: 20px;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--primary-saffron) 0%, #FF8C42 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-soft);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-logo {
    font-size: 2rem;
}

.app-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.points-display,
.streak-display {
    background: rgba(255, 255, 255, 0.25);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
}

.star-icon {
    color: var(--primary-gold);
    margin-right: 5px;
}

.fire-icon {
    color: #FF4500;
    margin-right: 5px;
}

/* Progress Bar */
.progress-container {
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.progress-bar {
    height: 12px;
    background: #E0E0E0;
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-green) 0%, #00D9A5 100%);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-gray);
    font-weight: 600;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    background: white;
    padding: 10px;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 1;
    min-width: 70px;
    background: var(--bg-light);
    border: none;
    padding: 12px 8px;
    border-radius: var(--radius-medium);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-saffron) 0%, #FF8C42 100%);
    color: white;
    box-shadow: var(--shadow-soft);
}

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

.tab-label {
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-main);
}

/* Content Area */
.content-area {
    padding: 20px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

.section-title {
    font-size: 1.6rem;
    color: var(--text-dark);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-icon {
    font-size: 1.8rem;
}

.section-subtitle {
    color: var(--text-gray);
    font-size: 1rem;
    margin-bottom: 20px;
}

/* ============================================
   Numbers Section
   ============================================ */
.numbers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.number-card {
    background: white;
    border-radius: var(--radius-large);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.number-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(255, 217, 61, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.number-card:active {
    transform: scale(0.95);
}

.number-card.tapped {
    border-color: var(--primary-saffron);
    animation: cardPop 0.4s ease;
}

.number-card.tapped::before {
    opacity: 1;
}

.number-card.learned {
    border-color: var(--success-green);
}

.number-card .check-mark {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--success-green);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.number-card.learned .check-mark {
    opacity: 1;
    transform: scale(1);
}

@keyframes cardPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.number-digit {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-saffron);
    margin-bottom: 5px;
}

.number-tamil {
    font-family: var(--font-tamil);
    font-size: 2rem;
    color: var(--primary-emerald);
    margin-bottom: 5px;
}

.number-pronunciation {
    font-size: 1rem;
    color: var(--text-gray);
    font-weight: 600;
}

.number-card .sound-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: var(--text-light);
    font-size: 1rem;
}

/* Fun fact box */
.fun-fact {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    padding: 15px 20px;
    border-radius: var(--radius-medium);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-left: 4px solid var(--primary-emerald);
}

.fact-icon {
    font-size: 1.5rem;
}

.fun-fact p {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.5;
}

/* ============================================
   Phrases Section
   ============================================ */
.phrases-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
}

.category-btn {
    background: white;
    border: 2px solid #E0E0E0;
    padding: 10px 16px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.category-btn.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
}

.phrases-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.phrase-card {
    background: white;
    border-radius: var(--radius-large);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 5px solid var(--primary-blue);
    position: relative;
}

.phrase-card:active {
    transform: scale(0.98);
}

.phrase-card.tapped {
    animation: cardPop 0.4s ease;
}

.phrase-card.learned {
    border-left-color: var(--success-green);
}

.phrase-card .check-mark {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--success-green);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.phrase-card.learned .check-mark {
    opacity: 1;
    transform: scale(1);
}

.phrase-english {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.phrase-tamil {
    font-family: var(--font-tamil);
    font-size: 1.5rem;
    color: var(--primary-emerald);
    margin-bottom: 5px;
}

.phrase-pronunciation {
    font-size: 1rem;
    color: var(--primary-saffron);
    font-weight: 600;
    margin-bottom: 8px;
}

.phrase-usage {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-style: italic;
    background: var(--bg-light);
    padding: 8px 12px;
    border-radius: var(--radius-small);
}

.phrase-card .sound-hint {
    position: absolute;
    bottom: 15px;
    right: 15px;
    color: var(--text-light);
    font-size: 0.8rem;
}

/* ============================================
   Fun Words Section
   ============================================ */
.words-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.word-category-btn {
    background: white;
    border: 2px solid #E0E0E0;
    padding: 10px 16px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.word-category-btn.active {
    background: var(--primary-magenta);
    border-color: var(--primary-magenta);
    color: white;
}

.words-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.word-card {
    background: white;
    border-radius: var(--radius-large);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.word-card:active {
    transform: scale(0.95);
}

.word-card.tapped {
    animation: cardPop 0.4s ease;
}

.word-card.learned {
    border: 3px solid var(--success-green);
}

.word-card .check-mark {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--success-green);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.word-card.learned .check-mark {
    opacity: 1;
    transform: scale(1);
}

.word-emoji {
    font-size: 3rem;
    margin-bottom: 10px;
}

.word-english {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.word-tamil {
    font-family: var(--font-tamil);
    font-size: 1.3rem;
    color: var(--primary-emerald);
    margin-bottom: 3px;
}

.word-pronunciation {
    font-size: 0.9rem;
    color: var(--primary-saffron);
    font-weight: 600;
}

/* Color-specific backgrounds */
.word-card[data-color="red"] { background: linear-gradient(135deg, #FFE5E5 0%, #FFF 100%); }
.word-card[data-color="blue"] { background: linear-gradient(135deg, #E5EEFF 0%, #FFF 100%); }
.word-card[data-color="green"] { background: linear-gradient(135deg, #E5FFE5 0%, #FFF 100%); }
.word-card[data-color="yellow"] { background: linear-gradient(135deg, #FFFDE5 0%, #FFF 100%); }
.word-card[data-color="white"] { background: linear-gradient(135deg, #F5F5F5 0%, #FFF 100%); }
.word-card[data-color="black"] { background: linear-gradient(135deg, #E5E5E5 0%, #FFF 100%); }

/* ============================================
   Quiz Section
   ============================================ */
.quiz-container {
    background: white;
    border-radius: var(--radius-large);
    padding: 25px;
    box-shadow: var(--shadow-medium);
}

.quiz-start {
    text-align: center;
}

.quiz-mascot {
    font-size: 5rem;
    margin-bottom: 15px;
    animation: bounce 2s ease-in-out infinite;
}

.quiz-start h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.quiz-start p {
    color: var(--text-gray);
    margin-bottom: 20px;
}

.difficulty-select {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 25px;
}

.difficulty-btn {
    background: var(--bg-light);
    border: 2px solid #E0E0E0;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-btn.active {
    background: var(--primary-gold);
    border-color: var(--primary-gold);
    color: var(--text-dark);
}

.quiz-start-btn {
    background: linear-gradient(135deg, var(--primary-emerald) 0%, #3CB371 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-main);
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.quiz-start-btn:active {
    transform: scale(0.95);
}

/* Quiz Game */
.quiz-game {
    animation: fadeIn 0.3s ease;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-light);
}

.quiz-progress {
    font-size: 1rem;
    color: var(--text-gray);
    font-weight: 600;
}

.quiz-score {
    background: var(--primary-gold);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-weight: 700;
}

.quiz-question {
    text-align: center;
    margin-bottom: 25px;
}

.question-text {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.question-display {
    font-size: 2.5rem;
    font-family: var(--font-tamil);
    color: var(--primary-emerald);
    padding: 20px;
    background: var(--bg-light);
    border-radius: var(--radius-medium);
}

.question-emoji {
    font-size: 4rem;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quiz-option {
    background: white;
    border: 3px solid #E0E0E0;
    padding: 18px;
    border-radius: var(--radius-medium);
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-option:active {
    transform: scale(0.95);
}

.quiz-option.selected {
    border-color: var(--primary-blue);
    background: #E8F0FF;
}

.quiz-option.correct {
    border-color: var(--success-green);
    background: #E8F8F0;
    animation: correctPulse 0.5s ease;
}

.quiz-option.incorrect {
    border-color: var(--error-red);
    background: #FFE8E8;
    animation: shake 0.5s ease;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.quiz-feedback {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
    border-radius: var(--radius-medium);
    animation: fadeIn 0.3s ease;
}

.quiz-feedback.correct {
    background: #E8F8F0;
}

.quiz-feedback.incorrect {
    background: #FFF5E5;
}

.feedback-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.feedback-text {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.next-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-main);
    border-radius: var(--radius-full);
    cursor: pointer;
}

/* Quiz Result */
.quiz-result {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.result-animation {
    font-size: 5rem;
    margin-bottom: 15px;
}

.quiz-result h3 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.quiz-result p {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 20px;
}

.result-stars {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.result-star {
    font-size: 2.5rem;
    color: #E0E0E0;
    transition: all 0.3s ease;
}

.result-star.earned {
    color: var(--primary-gold);
    animation: starPop 0.5s ease forwards;
}

@keyframes starPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.play-again-btn {
    background: linear-gradient(135deg, var(--primary-saffron) 0%, #FF8C42 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-main);
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}

/* ============================================
   Speak Section (Speech Recognition)
   ============================================ */
.speak-container {
    background: white;
    border-radius: var(--radius-large);
    padding: 25px;
    box-shadow: var(--shadow-medium);
}

.speak-not-supported {
    text-align: center;
    padding: 30px;
}

.not-supported-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.speak-not-supported h3 {
    color: var(--text-dark);
    margin-bottom: 10px;
}

.speak-not-supported p {
    color: var(--text-gray);
}

.speak-start {
    text-align: center;
}

.speak-mascot {
    font-size: 4rem;
    margin-bottom: 15px;
}

.speak-start h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.speak-start p {
    color: var(--text-gray);
    margin-bottom: 20px;
    line-height: 1.5;
}

.speak-category-select {
    margin-bottom: 25px;
}

.speak-category-select label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.speak-category-select select {
    width: 100%;
    max-width: 250px;
    padding: 12px 15px;
    font-size: 1.1rem;
    font-family: var(--font-main);
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-medium);
    background: white;
    cursor: pointer;
}

.speak-language-select {
    margin-bottom: 25px;
}

.speak-language-select label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.lang-toggle {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 8px;
}

.lang-btn {
    background: var(--bg-light);
    border: 2px solid #E0E0E0;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn.active {
    background: #9B59B6;
    border-color: #9B59B6;
    color: white;
}

.lang-hint {
    font-size: 0.8rem;
    color: var(--text-gray);
    text-align: center;
    font-style: italic;
}

.speak-start-btn {
    background: linear-gradient(135deg, #9B59B6 0%, #8E44AD 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-main);
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.speak-start-btn:active {
    transform: scale(0.95);
}

/* Speak Game */
.speak-game {
    animation: fadeIn 0.3s ease;
}

.speak-progress {
    text-align: center;
    font-size: 1rem;
    color: var(--text-gray);
    margin-bottom: 20px;
    font-weight: 600;
}

.speak-card {
    background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%);
    border-radius: var(--radius-large);
    padding: 25px;
    text-align: center;
    margin-bottom: 25px;
}

.speak-prompt {
    font-size: 1rem;
    color: var(--text-gray);
    margin-bottom: 10px;
}

.speak-word {
    font-size: 2rem;
    font-weight: 800;
    color: #7B1FA2;
    margin-bottom: 8px;
}

.speak-tamil {
    font-family: var(--font-tamil);
    font-size: 1.8rem;
    color: var(--primary-emerald);
    margin-bottom: 15px;
}

.hear-btn {
    background: white;
    color: #7B1FA2;
    border: 2px solid #7B1FA2;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hear-btn:active {
    background: #7B1FA2;
    color: white;
}

/* Microphone Area */
.speak-mic-area {
    text-align: center;
    margin-bottom: 20px;
}

.mic-btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9B59B6 0%, #8E44AD 100%);
    color: white;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.mic-btn:active {
    transform: scale(0.95);
}

.mic-btn.listening {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    animation: pulse-mic 1s ease-in-out infinite;
}

@keyframes pulse-mic {
    0%, 100% { box-shadow: var(--shadow-medium), 0 0 0 0 rgba(231, 76, 60, 0.7); }
    50% { box-shadow: var(--shadow-medium), 0 0 0 20px rgba(231, 76, 60, 0); }
}

.mic-hint {
    color: var(--text-gray);
    font-size: 1rem;
}

.mic-hint.listening {
    color: #E74C3C;
    font-weight: 600;
}

/* Speak Result */
.speak-result {
    text-align: center;
    padding: 20px;
    border-radius: var(--radius-medium);
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

.speak-result.success {
    background: #E8F8F0;
}

.speak-result.trying {
    background: #FFF8E5;
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.result-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.heard-text {
    font-size: 0.95rem;
    color: var(--text-gray);
}

.heard-text span {
    font-weight: 600;
    color: var(--primary-blue);
}

.speak-attempts {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 15px;
}

/* Speak Buttons */
.speak-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 15px;
}

.try-again-btn {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 2px solid #E0E0E0;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}

.next-word-btn {
    background: linear-gradient(135deg, var(--success-green) 0%, #00D9A5 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}

.skip-word-btn {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: var(--text-gray);
    font-family: var(--font-main);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 10px;
    text-decoration: underline;
}

/* Speak Complete */
.speak-complete {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.complete-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.speak-complete h3 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.speak-complete p {
    color: var(--text-gray);
    margin-bottom: 20px;
}

.speak-score {
    background: var(--bg-light);
    padding: 15px 25px;
    border-radius: var(--radius-medium);
    margin-bottom: 25px;
    display: inline-block;
}

.score-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 5px;
}

.score-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--success-green);
}

.speak-again-btn {
    background: linear-gradient(135deg, #9B59B6 0%, #8E44AD 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-main);
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}

/* ============================================
   Achievement Popup
   ============================================ */
.achievement-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.achievement-popup.hidden {
    display: none;
}

.achievement-content {
    background: white;
    padding: 40px;
    border-radius: var(--radius-large);
    text-align: center;
    max-width: 320px;
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.achievement-icon {
    font-size: 5rem;
    margin-bottom: 15px;
}

.achievement-content h3 {
    font-size: 1.5rem;
    color: var(--primary-saffron);
    margin-bottom: 10px;
}

.achievement-content p {
    color: var(--text-gray);
    margin-bottom: 25px;
}

.achievement-close {
    background: var(--primary-gold);
    color: var(--text-dark);
    border: none;
    padding: 14px 35px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-main);
    border-radius: var(--radius-full);
    cursor: pointer;
}

/* ============================================
   Confetti Animation
   ============================================ */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: fall linear forwards;
}

@keyframes fall {
    0% { 
        transform: translateY(-100%) rotate(0deg); 
        opacity: 1;
    }
    100% { 
        transform: translateY(100vh) rotate(720deg); 
        opacity: 0;
    }
}

/* ============================================
   Settings Button & Panel
   ============================================ */
.settings-btn {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.4);
}

.settings-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 500;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 60px;
    animation: fadeIn 0.2s ease;
}

.settings-panel.hidden {
    display: none !important;
}

.settings-content {
    background: white;
    border-radius: var(--radius-large);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-strong);
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

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

.settings-header {
    background: linear-gradient(135deg, var(--primary-saffron) 0%, #FF8C42 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-header h3 {
    color: white;
    font-size: 1.3rem;
    margin: 0;
}

.settings-close-btn {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-body {
    padding: 20px;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-light);
    border-radius: var(--radius-medium);
    margin-bottom: 20px;
}

.settings-info {
    flex: 1;
}

.settings-label {
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.settings-desc {
    display: block;
    font-size: 0.85rem;
    color: var(--text-gray);
}

.reset-btn {
    background: var(--error-red);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    margin-left: 15px;
    transition: all 0.3s ease;
}

.reset-btn:active {
    transform: scale(0.95);
}

.settings-stats {
    background: #F0F8FF;
    border-radius: var(--radius-medium);
    padding: 15px;
    border: 2px solid #E0E8F0;
}

.settings-stats h4 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    color: var(--text-dark);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #E0E8F0;
    font-size: 0.95rem;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span:last-child {
    font-weight: 700;
    color: var(--primary-saffron);
}

/* Confirmation Modal */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.confirm-modal.hidden {
    display: none !important;
}

.confirm-content {
    background: white;
    border-radius: var(--radius-large);
    padding: 30px;
    text-align: center;
    max-width: 320px;
    animation: popIn 0.3s ease;
}

.confirm-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.confirm-content h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.confirm-content p {
    color: var(--text-gray);
    margin-bottom: 25px;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-cancel {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 2px solid #E0E0E0;
    padding: 12px 20px;
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.confirm-yes {
    background: var(--error-red);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

/* Toast notification */
@keyframes toastIn {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (min-width: 480px) {
    .numbers-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .words-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .numbers-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .words-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .quiz-options {
        grid-template-columns: repeat(4, 1fr);
    }
}
