:root {
    --primary: #FF6B6B;
    --secondary: #4ECDC4;
    --accent: #FFE66D;
    --purple: #A78BFA;
    --blue: #60A5FA;
    --pink: #F472B6;
    --orange: #FB923C;
    --green: #34D399;
    --dark: #1E293B;
    --light: #F8FAFC;
    --gradient-fun: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-warm: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-cool: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow-soft: 0 10px 40px rgba(0,0,0,0.1);
    --shadow-card: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 30px rgba(78, 205, 196, 0.3);
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(180deg, #E0F7FA 0%, #FFF9C4 50%, #FFCCBC 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.floating-shapes {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.shape:nth-child(1) { width: 200px; height: 200px; background: var(--primary); top: 10%; left: -5%; }
.shape:nth-child(2) { width: 150px; height: 150px; background: var(--secondary); top: 60%; right: -3%; animation-delay: 2s; }
.shape:nth-child(3) { width: 100px; height: 100px; background: var(--accent); top: 30%; right: 10%; animation-delay: 4s; }
.shape:nth-child(4) { width: 180px; height: 180px; background: var(--purple); bottom: 10%; left: 10%; animation-delay: 6s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(5deg); }
}

/* Language Selector */
.language-selector {
    position: fixed;
    top: 20px; left: 20px;
    z-index: 100;
    background: white;
    padding: 15px;
    border-radius: 20px;
    box-shadow: var(--shadow-card);
}

.language-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 14px;
    color: #94A3B8;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.language-option.active {
    color: var(--dark);
    background: #F1F5F9;
}

.language-flag { font-size: 20px; }

.toggle-switch {
    position: relative;
    width: 60px; height: 30px;
    background: linear-gradient(135deg, #DA251D 0%, #FFCD00 100%);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-switch.spanish {
    background: linear-gradient(135deg, #FFC93C 0%, #FF6B6B 100%);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 24px; height: 24px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.toggle-switch.spanish::after { left: 33px; }

.dialect-selector {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #E2E8F0;
}

.dialect-label {
    font-size: 11px;
    color: #94A3B8;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.dialect-options { display: flex; gap: 8px; }

.dialect-btn {
    padding: 8px 14px;
    border: 2px solid #E2E8F0;
    background: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
}

.dialect-btn:hover { border-color: var(--secondary); }

.dialect-btn.active {
    background: var(--gradient-fun);
    color: white;
    border-color: transparent;
}

/* Score bar */
.score-bar {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 100;
    background: white;
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 15px;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.score-icon { font-size: 20px; }
.score-value { font-size: 18px; color: var(--dark); }

.streak-fire { animation: pulse 0.5s infinite alternate; }

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.2); }
}

/* Header */
header {
    position: relative;
    z-index: 10;
    padding: 20px;
    text-align: center;
    padding-top: 100px;
}

.logo-container {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: var(--shadow-card);
}

.logo-icon {
    width: 60px; height: 60px;
    background: var(--gradient-cool);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    animation: bounce 2s infinite;
}

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

.logo-text {
    font-family: 'Baloo 2', cursive;
    font-size: 28px;
    font-weight: 800;
    background: var(--gradient-fun);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-subtitle {
    font-size: 12px;
    color: #64748B;
    font-weight: 600;
}

/* Main container */
.main-container {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 600px;
}

/* Navigation */
.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(255,255,255,0.9);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
}

.nav-tab {
    padding: 12px 24px;
    border: none;
    border-radius: 30px;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #F1F5F9;
    color: #64748B;
}

.nav-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.nav-tab.active {
    background: var(--gradient-fun);
    color: white;
}

/* Category grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.category-card {
    background: white;
    border-radius: 24px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: var(--card-color, var(--gradient-fun));
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.category-card.active {
    border: 3px solid var(--secondary);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.category-icon {
    width: 56px; height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.category-title {
    font-family: 'Baloo 2', cursive;
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.category-title-native {
    font-size: 13px;
    color: #64748B;
    font-weight: 600;
}

.category-progress {
    background: #E2E8F0;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 15px;
}

.category-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.category-count {
    font-size: 12px;
    color: #94A3B8;
    margin-top: 8px;
    font-weight: 600;
}

/* Learning area */
.learning-area {
    background: white;
    border-radius: 32px;
    padding: 40px;
    box-shadow: var(--shadow-card);
    min-height: 400px;
}

.learning-header {
    text-align: center;
    margin-bottom: 30px;
}

.learning-title {
    font-family: 'Baloo 2', cursive;
    font-size: 32px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 10px;
}

.learning-subtitle {
    color: #64748B;
    font-size: 16px;
}

/* Phrase cards */
.phrase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.phrase-card {
    background: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%);
    border: 2px solid #E2E8F0;
    border-radius: 20px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.phrase-card:hover {
    border-color: var(--secondary);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(78, 205, 196, 0.2);
}

.phrase-card.learned {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border-color: var(--green);
}

.phrase-card.learned::after {
    content: '✓';
    position: absolute;
    top: 12px; right: 12px;
    width: 28px; height: 28px;
    background: var(--green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.phrase-english {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.phrase-native {
    font-size: 15px;
    color: #64748B;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255,255,255,0.7);
    border-radius: 10px;
}

.phrase-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.speak-btn {
    background: var(--gradient-cool);
    border: none;
    border-radius: 25px;
    padding: 10px 16px;
    color: white;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
}

.speak-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(79, 172, 254, 0.4);
}

.speak-btn.native { background: var(--gradient-warm); }
.speak-btn.both { background: var(--gradient-fun); }

/* Voice status */
.voice-status {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: var(--shadow-card);
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 100;
}

.voice-status.active { display: flex; }

.sound-wave {
    display: flex;
    align-items: center;
    gap: 3px;
}

.sound-wave span {
    width: 4px;
    height: 16px;
    background: var(--secondary);
    border-radius: 2px;
    animation: wave 0.5s ease-in-out infinite;
}

.sound-wave span:nth-child(2) { animation-delay: 0.1s; }
.sound-wave span:nth-child(3) { animation-delay: 0.2s; }
.sound-wave span:nth-child(4) { animation-delay: 0.3s; }

@keyframes wave {
    0%, 100% { height: 8px; }
    50% { height: 20px; }
}

.voice-status-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark);
}

/* Welcome screen */
.welcome-screen {
    text-align: center;
    padding: 40px 20px;
}

.welcome-mascot {
    font-size: 100px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.welcome-title {
    font-family: 'Baloo 2', cursive;
    font-size: 42px;
    font-weight: 800;
    background: var(--gradient-fun);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}

.welcome-subtitle {
    font-size: 20px;
    color: #64748B;
    margin-bottom: 40px;
}

.age-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.age-btn {
    padding: 12px 24px;
    background: white;
    border: 3px solid #E2E8F0;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
}

.age-btn:hover, .age-btn.active {
    border-color: var(--purple);
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
}

.mode-cards {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.mode-card {
    background: white;
    border-radius: 24px;
    padding: 30px;
    width: 260px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-card);
    border: 3px solid transparent;
}

.mode-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--secondary);
}

.mode-icon { font-size: 50px; margin-bottom: 15px; }

.mode-title {
    font-family: 'Baloo 2', cursive;
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
}

.mode-desc {
    font-size: 14px;
    color: #64748B;
}

/* Practice mode */
.practice-container { display: none; }
.practice-container.active { display: block; }

.practice-card {
    background: white;
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: var(--shadow-card);
}

.practice-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
}

.progress-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #E2E8F0;
    transition: all 0.3s ease;
}

.progress-dot.completed { background: var(--green); }
.progress-dot.current { background: var(--blue); transform: scale(1.3); }
.progress-dot.incorrect-dot { background: var(--primary); }

.practice-question {
    font-size: 18px;
    color: #64748B;
    margin-bottom: 20px;
}

.practice-sentence {
    font-family: 'Baloo 2', cursive;
    font-size: 26px;
    color: var(--dark);
    margin-bottom: 15px;
}

.practice-native-hint {
    font-size: 16px;
    color: #94A3B8;
    margin-bottom: 25px;
    padding: 12px 20px;
    background: #F8FAFC;
    border-radius: 12px;
    display: inline-block;
}

.practice-blank {
    display: inline-block;
    min-width: 120px;
    border-bottom: 4px dashed var(--secondary);
    padding: 5px;
    background: rgba(78, 205, 196, 0.1);
    border-radius: 8px;
}

.practice-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
}

.practice-option {
    padding: 14px 24px;
    background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
    border: 2px solid #E2E8F0;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
}

.practice-option:hover {
    border-color: var(--blue);
    transform: translateY(-2px);
}

.practice-option.correct {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border-color: var(--green);
}

.practice-option.incorrect {
    background: linear-gradient(135deg, #FEF2F2 0%, #FECACA 100%);
    border-color: var(--primary);
    animation: shake 0.5s ease;
}

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

.practice-feedback {
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 18px;
    display: none;
}

.practice-feedback.show { display: block; }
.practice-feedback.correct { background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%); color: #059669; }
.practice-feedback.incorrect { background: linear-gradient(135deg, #FEF2F2 0%, #FECACA 100%); color: #DC2626; }

/* Game mode */
.game-container { display: none; }
.game-container.active { display: block; }

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-radius: 20px;
}

.game-timer {
    font-family: 'Baloo 2', cursive;
    font-size: 28px;
    font-weight: 800;
    color: var(--orange);
}

.game-score {
    font-family: 'Baloo 2', cursive;
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
}

.match-game {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.match-column { display: flex; flex-direction: column; gap: 12px; }

.match-column-title {
    text-align: center;
    font-weight: 800;
    font-size: 16px;
    color: var(--dark);
    margin-bottom: 10px;
    padding: 10px;
    background: #F1F5F9;
    border-radius: 12px;
}

.match-item {
    padding: 16px 18px;
    background: white;
    border: 3px solid #E2E8F0;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.match-item:hover {
    border-color: var(--blue);
    transform: scale(1.02);
}

.match-item.selected {
    border-color: var(--purple);
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
}

.match-item.matched {
    border-color: var(--green);
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    opacity: 0.7;
    pointer-events: none;
}

.match-item.wrong {
    animation: shake 0.5s ease;
    border-color: var(--primary);
}

/* Results */
.results-container { display: none; text-align: center; padding: 40px; }
.results-container.active { display: block; }

.results-icon { font-size: 80px; margin-bottom: 20px; animation: bounce 1s infinite; }

.results-title {
    font-family: 'Baloo 2', cursive;
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 20px;
}

.results-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.stat-item { text-align: center; }

.stat-value {
    font-family: 'Baloo 2', cursive;
    font-size: 48px;
    font-weight: 800;
    background: var(--gradient-fun);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 14px;
    color: #64748B;
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 30px;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: var(--gradient-fun);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--dark);
    border: 2px solid #E2E8F0;
}

/* Confetti */
.confetti {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.confetti-piece {
    position: absolute;
    width: 10px; height: 10px;
    animation: confetti-fall 3s ease-out forwards;
}

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

/* Mobile */
@media (max-width: 768px) {
    .language-selector {
        position: relative;
        top: auto; left: auto;
        margin: 0 auto 20px;
        display: table;
    }

    header { padding-top: 20px; }

    .score-bar {
        top: auto; bottom: 20px;
        right: 50%;
        transform: translateX(50%);
    }

    .phrase-grid { grid-template-columns: 1fr; }
    .match-game { grid-template-columns: 1fr; }
    .category-grid { grid-template-columns: 1fr; }
    .welcome-mascot { font-size: 70px; }
    .welcome-title { font-size: 32px; }
    .mode-card { width: 100%; max-width: 300px; }
}
