/* ============================================================
   SEMILLA APP - Estilos principales
   ============================================================ */
:root {
    --primary:       #58a700;
    --primary-dark:  #3d7a00;
    --primary-light: #89e219;
    --secondary:     #ff9600;
    --accent:        #1cb0f6;
    --danger:        #ff4b4b;
    --correct:       #58a700;
    --incorrect:     #ff4b4b;
    --dark:          #1a1a2e;
    --gray-light:    #f7f7f7;
    --gray-medium:   #e5e5e5;
    --gray-dark:     #afafaf;
    --text-dark:     #3c3c3c;
    --text-medium:   #777;
    --heart:         #ff4b4b;
    --xp-color:      #ffd900;
    --coin:          #ffd900;
    --streak:        #ff9600;
    --radius:        16px;
    --radius-sm:     10px;
    --shadow:        0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg:     0 4px 24px rgba(0,0,0,0.14);
    --header-h:      56px;
    --nav-h:         64px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Nunito', sans-serif;
    background: #e5e7eb;
    color: var(--text-dark);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100dvh;
    background: #fff;
    position: relative;
    overflow-x: hidden;
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--header-h);
    background: #fff;
    border-bottom: 2px solid var(--gray-medium);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    gap: 8px;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 90px;
}

.header-right { justify-content: flex-end; }

.header-center {
    flex: 1;
    text-align: center;
}

.app-logo {
    font-size: 18px;
    font-weight: 900;
    color: var(--primary);
}

.streak-badge, .hearts-badge, .coins-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 20px;
    background: var(--gray-light);
}

.streak-badge.active { color: var(--streak); }
.hearts-badge { color: var(--heart); }
.coins-badge { color: #b8900a; }

/* ============================================================
   CONTENT AREA
   ============================================================ */
.content-area {
    padding-top: calc(var(--header-h) + 8px);
    padding-bottom: calc(var(--nav-h) + 16px);
    min-height: 100dvh;
}

.content-area.full-screen {
    padding: 0;
}

/* ============================================================
   BOTTOM NAV
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--nav-h);
    background: #fff;
    border-top: 2px solid var(--gray-medium);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--gray-dark);
    font-size: 11px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    transition: color 0.15s;
}

.nav-item i { font-size: 22px; }

.nav-item.active {
    color: var(--primary);
}

.nav-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* ============================================================
   LANDING SCREEN
   ============================================================ */
.landing-screen {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: 40px 24px 32px;
    background: linear-gradient(160deg, #fff 0%, #f0fde4 100%);
}

.landing-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 0 32px;
}

.landing-logo {
    font-size: 80px;
    line-height: 1;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 16px rgba(88,167,0,0.3));
}

.landing-title {
    font-size: 42px;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -1px;
}

.landing-subtitle {
    font-size: 17px;
    color: var(--text-medium);
    margin-top: 8px;
    line-height: 1.5;
}

.landing-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 32px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: var(--shadow);
}

.feature-icon { font-size: 20px; }

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

.landing-verse {
    text-align: center;
    color: var(--text-medium);
    font-size: 13px;
    font-style: italic;
    margin-top: 24px;
}

/* ============================================================
   AUTH SCREEN
   ============================================================ */
.auth-screen {
    min-height: 100dvh;
    padding: 24px 24px 40px;
    display: flex;
    flex-direction: column;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
    position: relative;
}

.btn-back {
    position: absolute;
    left: 0;
    top: 4px;
    color: var(--text-medium);
    font-size: 20px;
    text-decoration: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gray-light);
}

.auth-logo { font-size: 48px; margin-bottom: 12px; }
.auth-title { font-size: 24px; font-weight: 900; color: var(--dark); }
.auth-subtitle { font-size: 14px; color: var(--text-medium); margin-top: 4px; }

.auth-form { flex: 1; }

.form-group-app { margin-bottom: 16px; }
.form-label-app { display: block; font-size: 13px; font-weight: 800; color: var(--text-dark); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--gray-dark);
    font-size: 18px;
    pointer-events: none;
}

.input-app {
    width: 100%;
    height: 52px;
    padding: 0 44px 0 44px;
    border: 2px solid var(--gray-medium);
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}

.input-app:focus { border-color: var(--primary); }

.btn-toggle-pass {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--gray-dark);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-medium);
}

.link-app { color: var(--primary); font-weight: 800; text-decoration: none; }

.alert-app {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
}

.alert-danger { background: #fff2f2; color: var(--danger); border: 1.5px solid #ffcccc; }
.alert-success { background: #f0fde4; color: var(--primary); border: 1.5px solid #c3e88d; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary-app {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 800;
    padding: 14px 24px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    display: block;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 0 var(--primary-dark);
    letter-spacing: 0.3px;
}

.btn-primary-app:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--primary-dark);
    background: var(--primary-dark);
}

.btn-primary-app:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }

.btn-outline-app {
    background: transparent;
    color: var(--primary);
    border: 2.5px solid var(--primary);
    border-radius: var(--radius);
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 800;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.15s;
    display: block;
    text-align: center;
    text-decoration: none;
}

.btn-outline-app:hover { background: var(--gray-light); color: var(--primary); text-decoration: none; }

/* ============================================================
   SECTION CARDS
   ============================================================ */
.section-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px;
    margin: 0 16px 12px;
    box-shadow: var(--shadow);
    border: 1.5px solid var(--gray-medium);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-title { font-size: 15px; font-weight: 800; color: var(--dark); }

.section-badge {
    font-size: 12px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
}

.badge-primary { background: #e8f5e9; color: var(--primary); }
.badge-success { background: #e8f5e9; color: var(--primary); }
.badge-muted { background: var(--gray-light); color: var(--text-medium); }

.section-link { font-size: 13px; font-weight: 700; color: var(--primary); text-decoration: none; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard-page { padding-bottom: 16px; }

.greeting-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    margin: 0 0 12px;
    padding: 20px 20px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.greeting-time { display: block; font-size: 13px; opacity: 0.85; }
.greeting-name { display: block; font-size: 24px; font-weight: 900; line-height: 1.2; }
.streak-info { margin-top: 8px; font-size: 14px; font-weight: 700; opacity: 0.9; }
.streak-fire { font-size: 18px; }

.level-badge-big {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.2);
    min-width: 72px;
    text-align: center;
}

.level-badge-icon { font-size: 28px; }
.level-badge-name { font-size: 11px; font-weight: 800; margin-top: 2px; opacity: 0.9; }

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    padding: 0 16px;
    margin-bottom: 12px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1.5px solid var(--gray-medium);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stat-icon { font-size: 20px; }
.stat-value { font-size: 20px; font-weight: 900; color: var(--dark); line-height: 1; }
.stat-label { font-size: 10px; font-weight: 700; color: var(--text-medium); text-transform: uppercase; }

/* Goal progress */
.goal-progress { margin-top: 8px; }
.goal-track { height: 12px; background: var(--gray-medium); border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.goal-fill { height: 100%; background: linear-gradient(90deg, var(--xp-color), #ffaa00); border-radius: 6px; transition: width 0.5s ease; }
.goal-fill.goal-completed { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.goal-icons { display: flex; justify-content: space-between; }
.goal-dot { font-size: 18px; opacity: 0.3; }
.goal-dot-done { opacity: 1; }

/* Continue card */
.continue-card { cursor: pointer; transition: transform 0.15s; border-color: var(--primary); }
.continue-card:active { transform: scale(0.98); }
.continue-header { margin-bottom: 6px; }
.continue-label { font-size: 10px; font-weight: 900; color: var(--primary); letter-spacing: 1px; }
.continue-module { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.continue-lesson { font-size: 18px; font-weight: 900; color: var(--dark); margin-bottom: 12px; }
.continue-action { text-align: right; }

/* XP bar */
.xp-bar-wrap { }
.xp-bar-track { height: 14px; background: var(--gray-medium); border-radius: 7px; overflow: hidden; margin-bottom: 6px; }
.xp-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 7px; transition: width 0.5s ease; }
.xp-bar-level { background: linear-gradient(90deg, var(--accent), #5b9bd5); }
.xp-bar-labels { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: var(--text-medium); }

/* Achievements */
.achievements-row { display: flex; flex-wrap: wrap; gap: 8px; }
.achievement-chip { display: flex; align-items: center; gap: 6px; background: var(--gray-light); border-radius: 20px; padding: 6px 12px; font-size: 13px; font-weight: 700; }
.achievement-chip-icon { font-size: 18px; }

/* Verse card */
.verse-card { background: linear-gradient(135deg, #1a1a2e, #16213e); border-color: transparent; }
.verse-text { font-size: 15px; color: #fff; font-style: italic; line-height: 1.6; margin-bottom: 8px; }
.verse-ref { font-size: 13px; color: var(--primary-light); font-weight: 700; text-align: right; }

/* Empty cards */
.empty-card { text-align: center; padding: 32px 16px; }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-text { font-size: 15px; color: var(--text-medium); font-weight: 600; }

/* ============================================================
   LEARN / LESSON PATH
   ============================================================ */
.learn-page { }

.course-tabs-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 12px 4px 16px;
}

.course-tabs { display: flex; gap: 8px; overflow-x: auto; flex: 1; }
.course-tab { white-space: nowrap; padding: 8px 16px; border-radius: 20px; font-size: 14px; font-weight: 800; text-decoration: none; color: var(--text-medium); background: var(--gray-light); transition: all 0.2s; }
.course-tab.active { background: var(--primary); color: #fff; }

.btn-explore-courses {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 18px;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
    box-shadow: 0 2px 8px rgba(88,167,0,0.3);
}

.btn-explore-courses:hover  { background: var(--primary-dark); color: #fff; }
.btn-explore-courses:active { transform: scale(0.92); }

.lesson-path { padding: 8px 0 16px; }

.module-block { margin-bottom: 8px; }

.module-header-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: #fff;
    margin: 0 0 16px;
}

.module-header-icon { font-size: 32px; flex-shrink: 0; }

.module-header-info { flex: 1; }
.module-header-title { font-size: 16px; font-weight: 900; }
.module-header-desc { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.module-header-progress { font-size: 15px; font-weight: 900; opacity: 0.9; }

/* Lesson nodes */
.lesson-nodes { display: flex; flex-direction: column; align-items: center; padding: 0 16px; }

.lesson-node-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 200px;
    position: relative;
    margin-bottom: 8px;
}

.lesson-node-wrap.node-right { align-self: flex-end; }
.lesson-node-wrap.node-left  { align-self: flex-start; }
.lesson-node-wrap.node-center { align-self: center; }

.lesson-node-outer {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.path-connector {
    width: 3px;
    height: 32px;
    background: var(--gray-medium);
    margin-bottom: -2px;
    border-radius: 2px;
}

.lesson-node {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 28px;
    position: relative;
    transition: transform 0.15s;
    cursor: pointer;
    border: 4px solid transparent;
}

.lesson-node:active { transform: scale(0.92); }

.node-available, .node-in_progress {
    background: var(--node-color, var(--primary));
    box-shadow: 0 6px 0 color-mix(in srgb, var(--node-color, var(--primary)) 70%, #000 30%);
    border-color: rgba(255,255,255,0.3);
}

.node-completed {
    background: var(--node-color, var(--primary));
    box-shadow: 0 4px 0 color-mix(in srgb, var(--node-color, var(--primary)) 70%, #000 30%);
    opacity: 0.85;
}

.node-locked {
    background: var(--gray-medium);
    box-shadow: 0 4px 0 #ccc;
    cursor: default;
}

.node-icon { pointer-events: none; }

.lesson-stars {
    display: flex;
    gap: 2px;
    margin-bottom: 4px;
}

.star { font-size: 16px; line-height: 1; }
.star-filled { color: var(--xp-color); }
.star-empty { color: var(--gray-medium); }

.lesson-node-label {
    text-align: center;
    margin-top: 6px;
    max-width: 120px;
}

.node-type-badge {
    display: block;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-medium);
    margin-bottom: 2px;
}

.node-title { font-size: 12px; font-weight: 700; color: var(--text-dark); line-height: 1.3; }

.module-complete-badge {
    text-align: center;
    padding: 10px 20px;
    margin: 0 16px 16px;
    background: #e8f5e9;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
}

/* Toast */
.toast-locked {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--dark);
    color: #fff;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 700;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
    white-space: nowrap;
    z-index: 999;
}

.toast-locked.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   LESSON / EXERCISE SCREEN
   ============================================================ */
.exercise-shell {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    background: #fff;
    position: relative;
}

.exercise-top-bar {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
    border-bottom: 1.5px solid var(--gray-medium);
}

.ex-close {
    color: var(--gray-dark);
    font-size: 20px;
    text-decoration: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--gray-light);
}

.ex-progress-bar {
    flex: 1;
    height: 12px;
    background: var(--gray-medium);
    border-radius: 6px;
    overflow: hidden;
}

.ex-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 6px;
    transition: width 0.4s ease;
}

.ex-hearts {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    font-weight: 900;
    color: var(--heart);
    flex-shrink: 0;
}

.exercise-body {
    flex: 1;
    padding: 24px 20px 16px;
    display: flex;
    flex-direction: column;
}

.ex-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-medium);
}

.ex-loading-icon { font-size: 48px; animation: pulse 1.5s infinite; }

@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.1)} }

/* Question display */
.question-card { flex: 1; display: flex; flex-direction: column; gap: 20px; }
.question-type-label { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: var(--primary); }
.question-text { font-size: 20px; font-weight: 800; color: var(--dark); line-height: 1.4; }
.question-image { width: 100%; max-height: 180px; object-fit: cover; border-radius: var(--radius-sm); }
.question-hint { font-size: 14px; color: var(--text-medium); font-style: italic; margin-top: -8px; }
.question-ref { font-size: 13px; font-weight: 700; color: var(--accent); }

/* Answer options */
.options-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }

.option-btn {
    width: 100%;
    padding: 14px 18px;
    border: 2.5px solid var(--gray-medium);
    border-radius: var(--radius);
    background: #fff;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 0 var(--gray-medium);
    position: relative;
}

.option-btn:active { transform: translateY(2px); box-shadow: none; }

.option-btn.selected {
    border-color: var(--accent);
    background: #e8f4fd;
    color: var(--dark);
    box-shadow: 0 2px 0 #bbd9ed;
}

.option-btn.correct {
    border-color: var(--correct);
    background: #e8f5e9;
    color: var(--correct);
    box-shadow: 0 2px 0 #a5d6a7;
}

.option-btn.incorrect {
    border-color: var(--incorrect);
    background: #fff2f2;
    color: var(--incorrect);
    box-shadow: 0 2px 0 #ffcdd2;
}

.option-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    flex-shrink: 0;
    transition: all 0.15s;
}

.option-btn.selected .option-letter { background: var(--accent); color: #fff; }
.option-btn.correct .option-letter { background: var(--correct); color: #fff; }
.option-btn.incorrect .option-letter { background: var(--incorrect); color: #fff; }

/* Fill blank input */
.fill-blank-wrap { display: flex; flex-direction: column; gap: 10px; }
.fill-blank-sentence { font-size: 18px; font-weight: 700; color: var(--dark); line-height: 1.6; }
.blank-word { display: inline-block; min-width: 100px; border-bottom: 3px solid var(--primary); color: var(--primary); font-weight: 900; padding: 0 8px; }

.fill-blank-input {
    width: 100%;
    padding: 14px 18px;
    border: 2.5px solid var(--gray-medium);
    border-radius: var(--radius);
    font-family: 'Nunito', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    outline: none;
    transition: border-color 0.2s;
}

.fill-blank-input:focus { border-color: var(--accent); }
.fill-blank-input.correct { border-color: var(--correct); background: #e8f5e9; }
.fill-blank-input.incorrect { border-color: var(--incorrect); background: #fff2f2; }

/* ============================================================
   EXERCISE FOOTER
   ============================================================ */
.exercise-footer {
    padding: 12px 20px 20px;
    border-top: 1.5px solid var(--gray-medium);
    background: #fff;
}

.btn-verify {
    width: 100%;
    height: 54px;
    border: none;
    border-radius: var(--radius);
    font-family: 'Nunito', sans-serif;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.3px;
}

.btn-verify:disabled {
    background: var(--gray-medium);
    color: var(--gray-dark);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-verify:not(:disabled) {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 0 var(--primary-dark);
}

.btn-verify:not(:disabled):active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--primary-dark);
}

.btn-verify.btn-correct {
    background: var(--correct);
    box-shadow: 0 4px 0 #3a7a00;
    color: #fff;
}

.btn-verify.btn-incorrect {
    background: var(--incorrect);
    box-shadow: 0 4px 0 #c0392b;
    color: #fff;
}

/* Feedback bar */
.feedback-bar {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    animation: slideUp 0.3s ease;
}

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

.feedback-bar.feedback-correct { background: #e8f5e9; border: 1.5px solid #a5d6a7; }
.feedback-bar.feedback-incorrect { background: #fff2f2; border: 1.5px solid #ffcdd2; }

.feedback-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.feedback-title { font-size: 16px; font-weight: 900; margin-bottom: 4px; }
.feedback-bar.feedback-correct .feedback-title { color: var(--correct); }
.feedback-bar.feedback-incorrect .feedback-title { color: var(--incorrect); }
.feedback-explanation { font-size: 14px; color: var(--text-dark); line-height: 1.5; }
.feedback-ref { font-size: 12px; color: var(--text-medium); margin-top: 4px; font-style: italic; }

/* ============================================================
   COMPLETION SCREEN
   ============================================================ */
.completion-screen {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.completion-content {
    background: #fff;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 32px 24px 40px;
    width: 100%;
    max-width: 480px;
    animation: slideUpModal 0.4s ease;
    text-align: center;
}

@keyframes slideUpModal { from{transform:translateY(100%)} to{transform:translateY(0)} }

.completion-emoji { font-size: 64px; margin-bottom: 8px; }
.completion-title { font-size: 26px; font-weight: 900; color: var(--dark); margin-bottom: 16px; }

.completion-stars { display: flex; justify-content: center; gap: 8px; margin-bottom: 24px; }
.comp-star { font-size: 40px; color: var(--gray-medium); transition: all 0.3s; }
.comp-star.filled { color: var(--xp-color); }

.completion-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
}

.comp-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.comp-stat-icon { font-size: 24px; }
.comp-stat-value { font-size: 22px; font-weight: 900; color: var(--dark); }
.comp-stat-label { font-size: 11px; font-weight: 700; color: var(--text-medium); text-transform: uppercase; }

.completion-achievements { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.comp-achievement { display: flex; align-items: center; gap: 10px; background: #fff9e6; border-radius: var(--radius-sm); padding: 10px 14px; text-align: left; border: 1.5px solid #ffe082; }
.comp-ach-icon { font-size: 24px; }
.comp-ach-title { font-size: 14px; font-weight: 800; color: #b8900a; }
.comp-ach-desc { font-size: 12px; color: var(--text-medium); }

/* ============================================================
   PROFILE
   ============================================================ */
.profile-page { }

.profile-hero {
    padding: 40px 24px 24px;
    text-align: center;
    color: #fff;
    margin-bottom: 4px;
}

.profile-avatar-wrap { position: relative; display: inline-block; margin-bottom: 12px; }
.profile-avatar { width: 88px; height: 88px; border-radius: 50%; border: 4px solid rgba(255,255,255,0.5); object-fit: cover; }
.profile-avatar-placeholder { width: 88px; height: 88px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 900; color: #fff; border: 4px solid rgba(255,255,255,0.5); background: rgba(255,255,255,0.2); }
.profile-level-badge { position: absolute; bottom: 0; right: -4px; font-size: 22px; background: #fff; border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

.profile-name { font-size: 24px; font-weight: 900; margin-bottom: 2px; }
.profile-level-name { font-size: 14px; opacity: 0.85; font-weight: 700; margin-bottom: 16px; }

.profile-xp-bar { height: 10px; background: rgba(255,255,255,0.25); border-radius: 5px; overflow: hidden; margin-bottom: 6px; }
.profile-xp-fill { height: 100%; background: #fff; border-radius: 5px; transition: width 0.5s ease; }
.profile-xp-text { font-size: 12px; opacity: 0.8; font-weight: 700; }

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 16px;
    margin-bottom: 4px;
}

.profile-stat {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1.5px solid var(--gray-medium);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.ps-icon { font-size: 22px; }
.ps-value { font-size: 20px; font-weight: 900; color: var(--dark); }
.ps-label { font-size: 10px; font-weight: 700; color: var(--text-medium); text-transform: uppercase; letter-spacing: 0.3px; }

/* Achievements grid */
.achievements-grid { display: flex; flex-direction: column; gap: 10px; }

.achievement-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-medium);
    transition: all 0.2s;
}

.achievement-card.earned { border-color: var(--xp-color); background: #fffde7; }
.achievement-card.locked { opacity: 0.5; filter: grayscale(50%); }

.ach-icon { font-size: 28px; flex-shrink: 0; }
.ach-title { font-size: 14px; font-weight: 800; color: var(--dark); }
.ach-desc { font-size: 12px; color: var(--text-medium); }
.ach-date { font-size: 11px; color: var(--primary); font-weight: 700; margin-top: 2px; }

/* ============================================================
   RANKING
   ============================================================ */
.ranking-page { }

.ranking-header {
    padding: 20px 20px 12px;
    text-align: center;
}

.ranking-title { font-size: 22px; font-weight: 900; color: var(--dark); }
.my-rank-badge { display: inline-block; margin-top: 8px; background: var(--primary); color: #fff; padding: 6px 16px; border-radius: 20px; font-size: 14px; font-weight: 800; }

.ranking-list { display: flex; flex-direction: column; padding: 0 16px 16px; gap: 8px; }

.ranking-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-medium);
    box-shadow: var(--shadow);
}

.ranking-row.ranking-me { border-color: var(--primary); background: #f0fde4; }

.rank-pos { font-size: 22px; font-weight: 900; min-width: 36px; text-align: center; }
.rank-avatar-wrap { position: relative; flex-shrink: 0; }
.rank-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.rank-avatar-placeholder { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 900; color: #fff; }
.rank-level-badge { position: absolute; bottom: -2px; right: -4px; font-size: 14px; }
.rank-info { flex: 1; }
.rank-name { font-size: 15px; font-weight: 800; color: var(--dark); display: flex; align-items: center; gap: 6px; }
.rank-you { font-size: 11px; background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 10px; }
.rank-level-name { font-size: 12px; color: var(--text-medium); }
.rank-xp { text-align: right; }
.rank-xp-val { display: block; font-size: 18px; font-weight: 900; color: var(--dark); }
.rank-xp-label { font-size: 11px; color: var(--text-medium); font-weight: 700; }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.w-100 { width: 100%; }
.mb-3 { margin-bottom: 16px; }
.me-1 { margin-right: 4px; }
.me-2 { margin-right: 8px; }

/* Fade transition for questions */
.fade-out { animation: fadeOut 0.2s ease forwards; }
.fade-in { animation: fadeInQ 0.3s ease forwards; }

@keyframes fadeOut { to { opacity: 0; transform: translateX(-20px); } }
@keyframes fadeInQ { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* Heart lost animation */
.heart-lost { animation: heartBeat 0.4s ease; }
@keyframes heartBeat { 0%{transform:scale(1)} 25%{transform:scale(1.3)} 50%{transform:scale(0.9)} 100%{transform:scale(1)} }

/* ============================================================
   INSTALL BANNER
   ============================================================ */
.install-banner {
    display: none;                  /* JS lo muestra */
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    position: sticky;
    top: var(--header-h);
    z-index: 90;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.install-banner.visible {
    opacity: 1;
    transform: translateY(0);
}

.install-banner-ios {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.install-banner-body {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.install-banner-logo { font-size: 28px; flex-shrink: 0; }

.install-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.install-banner-text strong {
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
}

.install-banner-text span {
    font-size: 12px;
    opacity: 0.88;
    line-height: 1.3;
}

.install-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.install-btn-yes {
    background: #fff;
    color: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 900;
    padding: 8px 14px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 0 rgba(0,0,0,0.15);
    transition: opacity 0.15s;
}

.install-btn-yes:active { opacity: 0.85; }

.install-btn-no {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 15px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}

.install-btn-no:hover { background: rgba(255,255,255,0.3); }

/* ============================================================
   NOTIFICATION PERMISSION PROMPT
   ============================================================ */
.notif-prompt-card {
    border-color: #ffd900;
    background: linear-gradient(135deg, #fffde7, #fff9c4);
}

.notif-prompt-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.notif-prompt-icon { font-size: 28px; flex-shrink: 0; }

.notif-prompt-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notif-prompt-text strong {
    font-size: 15px;
    font-weight: 900;
    color: var(--dark);
}

.notif-prompt-text span {
    font-size: 13px;
    color: var(--text-medium);
    line-height: 1.4;
}

.notif-prompt-actions {
    display: flex;
    gap: 10px;
}

/* ============================================================
   WORD BANK EXERCISE
   ============================================================ */
.word-bank-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.wb-sentence {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    line-height: 2.2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.wb-text-part {
    white-space: pre-wrap;
}

.wb-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    height: 38px;
    padding: 0 10px;
    border-bottom: 3px solid var(--primary);
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.15s;
    border-radius: 0;
    background: transparent;
    vertical-align: middle;
}

.wb-slot-filled {
    background: #e8f4fd;
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--dark);
    cursor: pointer;
}

.wb-slot-filled:hover {
    background: #d4ecf7;
}

.wb-slot-correct {
    background: #e8f5e9 !important;
    border: 2px solid var(--correct) !important;
    color: var(--correct) !important;
    cursor: default;
}

.wb-slot-incorrect {
    background: #fff2f2 !important;
    border: 2px solid var(--incorrect) !important;
    color: var(--incorrect) !important;
    cursor: default;
}

.wb-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
    background: var(--gray-light);
    border-radius: var(--radius);
    border: 1.5px dashed var(--gray-medium);
    min-height: 64px;
    align-content: flex-start;
}

.wb-chip {
    padding: 8px 16px;
    border: 2.5px solid var(--gray-medium);
    border-radius: 24px;
    background: #fff;
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 0 var(--gray-medium);
    line-height: 1.2;
}

.wb-chip:active {
    transform: translateY(2px);
    box-shadow: none;
}

.wb-chip:not(.wb-chip-used):hover {
    border-color: var(--accent);
    background: #e8f4fd;
    color: var(--dark);
}

.wb-chip-used {
    opacity: 0.3;
    pointer-events: none;
    cursor: default;
    box-shadow: none;
}

/* ============================================================
   CONCLUSION CARD ("Por esto")
   ============================================================ */
.conclusion-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 36px 20px;
    gap: 14px;
    background: linear-gradient(135deg, #f0fde4 0%, #e4f8cc 100%);
    border-radius: var(--radius);
    border: 2px solid var(--primary);
    box-shadow: var(--shadow);
    min-height: 300px;
}

.conclusion-icon {
    font-size: 56px;
    line-height: 1;
    filter: drop-shadow(0 2px 8px rgba(88,167,0,0.25));
}

.conclusion-label {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
    background: rgba(88,167,0,0.12);
    padding: 4px 14px;
    border-radius: 20px;
}

.conclusion-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.55;
    font-style: italic;
    max-width: 320px;
}

.conclusion-ref {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark);
}

/* ============================================================
   IMAGE FLASHCARD
   ============================================================ */
.flashcard-scene {
    perspective: 1000px;
    width: 100%;
    min-height: 280px;
    margin-bottom: 16px;
    cursor: pointer;
}

.flashcard {
    position: relative;
    width: 100%;
    min-height: 280px;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.4, 0.2, 0.2, 1);
    border-radius: var(--radius);
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    gap: 12px;
    box-shadow: var(--shadow);
}

.flashcard-front {
    background: linear-gradient(135deg, #f0fde4 0%, #e4f8cc 100%);
    border: 2px solid var(--primary);
}

.flashcard-back {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid var(--accent);
    transform: rotateY(180deg);
}

.fc-image {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.fc-no-image {
    font-size: 64px;
    line-height: 1;
    filter: drop-shadow(0 2px 8px rgba(88,167,0,0.2));
}

.fc-question {
    font-size: 17px;
    font-weight: 800;
    color: var(--dark);
    text-align: center;
    line-height: 1.5;
}

.fc-tap-hint {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(88,167,0,0.1);
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    margin-top: auto;
}

.fc-label {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    background: rgba(28,176,246,0.1);
    padding: 4px 14px;
    border-radius: 20px;
}

.fc-answer {
    font-size: 19px;
    font-weight: 800;
    color: var(--dark);
    text-align: center;
    line-height: 1.5;
}

.fc-explanation {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-medium);
    text-align: center;
    line-height: 1.55;
}

.fc-ref {
    font-size: 13px;
    font-weight: 700;
    color: #1565c0;
}

.fc-self-eval {
    margin-top: 8px;
    padding: 16px;
    background: rgba(255,255,255,0.7);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0,0,0,0.08);
    width: 100%;
    text-align: center;
}

.fc-eval-question {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.fc-eval-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.fc-eval-btn {
    flex: 1;
    max-width: 140px;
    padding: 10px 0;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.1s;
}

.fc-eval-btn:active { transform: scale(0.96); }

.fc-eval-yes {
    background: var(--correct);
    color: #fff;
}

.fc-eval-no {
    background: var(--incorrect);
    color: #fff;
}

/* ============================================================
   DIALOGUE (Burbujas de diálogo)
   ============================================================ */
.dialogue-bubbles {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding: 8px 0;
}

.dialogue-bubble {
    max-width: 80%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bubble-left {
    align-self: flex-start;
}

.bubble-right {
    align-self: flex-end;
    align-items: flex-end;
}

.bubble-speaker {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 10px;
    color: var(--text-medium);
}

.bubble-left .bubble-speaker {
    color: var(--text-medium);
}

.bubble-right .bubble-speaker {
    color: var(--primary-dark);
}

.bubble-text {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-dark);
}

.bubble-left .bubble-text {
    background: #f0f0f0;
    border-bottom-left-radius: 4px;
    color: var(--text-dark);
}

.bubble-right .bubble-text {
    background: var(--primary);
    border-bottom-right-radius: 4px;
    color: #fff;
}

.bubble-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 18px;
    border-bottom-right-radius: 4px;
    border: 2px solid var(--primary);
    background: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.bubble-input:focus {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(88,167,0,0.15);
}

/* ============================================================
   MATCHING (Empareja)
   ============================================================ */
.matching-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

.matching-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.match-item {
    width: 100%;
    padding: 12px 10px;
    border: 2px solid var(--gray-medium);
    border-radius: var(--radius-sm);
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    cursor: pointer;
    text-align: center;
    line-height: 1.4;
    transition: all 0.18s;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
}

.match-item:active:not([disabled]) {
    transform: scale(0.97);
}

.match-term {
    background: #f7f7f7;
    border-color: var(--gray-medium);
}

.match-def {
    background: #fff;
    border-color: var(--gray-medium);
}

.match-item.match-selected {
    background: #e3f2fd;
    border-color: var(--accent);
    color: #1565c0;
    box-shadow: 0 0 0 3px rgba(28,176,246,0.18);
    transform: scale(1.02);
}

.match-item.match-correct,
.match-item.match-locked {
    background: #e8f5e9;
    border-color: var(--correct);
    color: var(--primary-dark);
    cursor: default;
    opacity: 0.9;
}

.match-item.match-shake {
    animation: matchShake 0.38s ease;
    border-color: var(--danger);
    background: #fff5f5;
    color: var(--danger);
}

@keyframes matchShake {
    0%   { transform: translateX(0); }
    18%  { transform: translateX(-6px); }
    36%  { transform: translateX(6px); }
    54%  { transform: translateX(-4px); }
    72%  { transform: translateX(4px); }
    90%  { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

/* ============================================================
   PWA ONBOARDING - Pantalla de permisos
   ============================================================ */
.pwa-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 9999;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.pwa-overlay.pwa-visible { opacity: 1; }

.pwa-sheet {
    background: #fff;
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 480px;
    padding: 0 0 32px;
    animation: pwaSlideUp 0.4s cubic-bezier(.22,.68,0,1.2) both;
    overflow: hidden;
}

@keyframes pwaSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.pwa-handle-wrap {
    display: flex;
    justify-content: center;
    padding: 12px 0 0;
}

.pwa-handle {
    width: 40px;
    height: 4px;
    background: var(--gray-medium);
    border-radius: 2px;
}

.pwa-icon-wrap {
    width: 88px;
    height: 88px;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto 16px;
    font-size: 44px;
    line-height: 1;
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
    transition: background 0.3s ease;
}

.pwa-title {
    font-size: 22px;
    font-weight: 900;
    color: var(--dark);
    text-align: center;
    padding: 0 24px;
    margin-bottom: 10px;
}

.pwa-body {
    font-size: 15px;
    color: var(--text-medium);
    text-align: center;
    padding: 0 28px;
    line-height: 1.6;
    margin-bottom: 28px;
}

.pwa-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 20px;
}

.pwa-btn-main {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: 'Nunito', sans-serif;
    font-size: 17px;
    font-weight: 900;
    padding: 15px 24px;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--primary-dark);
    transition: all 0.15s;
    letter-spacing: 0.3px;
}

.pwa-btn-main:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--primary-dark);
}

.pwa-btn-skip {
    background: none;
    border: none;
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-medium);
    padding: 10px;
    cursor: pointer;
    text-align: center;
}

.pwa-btn-skip:hover { color: var(--text-dark); }

.pwa-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px 0;
    margin-bottom: -8px;
}

.pwa-step-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-medium);
}

.pwa-dots {
    display: flex;
    gap: 6px;
}

.pwa-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-medium);
    transition: background 0.3s, transform 0.3s;
}

.pwa-dot-active {
    background: var(--primary);
    transform: scale(1.3);
}

/* ============================================================
   CURSOS - Catálogo e inscripción
   ============================================================ */
.courses-page { padding-bottom: 16px; }

.courses-hero {
    padding: 20px 20px 12px;
    text-align: center;
}

.courses-title    { font-size: 22px; font-weight: 900; color: var(--dark); margin-bottom: 4px; }
.courses-subtitle { font-size: 14px; color: var(--text-medium); }

.courses-list { display: flex; flex-direction: column; gap: 16px; padding: 0 16px 16px; }

.course-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1.5px solid var(--gray-medium);
    transition: transform 0.15s;
}

.course-card.course-enrolled { border-color: var(--primary); }

.course-card-top {
    position: relative;
    padding: 24px 20px 20px;
    color: #fff;
    text-align: center;
}

.course-enrolled-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.25);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.course-card-icon  { font-size: 40px; margin-bottom: 8px; line-height: 1; }
.course-card-title { font-size: 18px; font-weight: 900; line-height: 1.3; margin: 0; }

.course-card-body { padding: 16px; }

.course-card-desc {
    font-size: 14px;
    color: var(--text-medium);
    line-height: 1.55;
    margin-bottom: 12px;
}

.course-card-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
}

.course-meta-item {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-medium);
    display: flex;
    align-items: center;
    gap: 5px;
}

.course-meta-item i { color: var(--primary); }

.course-progress-wrap { margin-bottom: 12px; }

.course-progress-bar {
    height: 10px;
    background: var(--gray-medium);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 6px;
}

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

.course-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-medium);
}

/* ============================================================
   MASCOTA - Semillita
   ============================================================ */
.mascot-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Las animaciones del mascot son ahora 60fps via JS (mascot.js).
   Solo necesitamos el contenedor y el overflow visible. */
.mascot-svg { display: block; overflow: visible; }

/* ── Tarjeta mascota en dashboard ── */
.mascot-dash-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f0fde4 0%, #e4f8cc 100%);
    border: 1.5px solid #c3e88d;
    margin: 0 0 12px;
}

.mascot-dash-msg {
    flex: 1;
}

.mascot-dash-msg strong {
    display: block;
    font-size: 15px;
    font-weight: 900;
    color: var(--primary-dark);
    margin-bottom: 3px;
}

.mascot-dash-msg span {
    font-size: 13px;
    color: var(--text-medium);
    line-height: 1.45;
}

/* ── Barra de mascota en lección (siempre visible) ── */
.lesson-mascot-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px 10px 12px;
    background: #f4fde8;
    border-bottom: 2px solid #d4f0a0;
    min-height: 84px;
    position: relative;
    z-index: 5;
}

/* ── Burbuja de diálogo ── */
.mascot-bubble {
    flex: 1;
    background: #fff;
    border: 2.5px solid var(--gray-medium);
    border-radius: 16px 16px 16px 4px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.45;
    position: relative;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Cola izquierda de la burbuja (apunta a la mascota) */
.mascot-bubble::before {
    content: '';
    position: absolute;
    left: -12px;
    bottom: 10px;
    border: 10px solid transparent;
    border-right-color: var(--gray-medium);
    border-left: none;
}
.mascot-bubble::after {
    content: '';
    position: absolute;
    left: -8px;
    bottom: 11px;
    border: 8px solid transparent;
    border-right-color: #fff;
    border-left: none;
    transition: border-right-color 0.3s;
}

/* Estados de la burbuja */
.mascot-bubble.bubble-correct {
    border-color: var(--correct);
    background: #e8f5e9;
    color: var(--primary-dark);
}
.mascot-bubble.bubble-correct::before { border-right-color: var(--correct); }
.mascot-bubble.bubble-correct::after  { border-right-color: #e8f5e9; }

.mascot-bubble.bubble-incorrect {
    border-color: var(--incorrect);
    background: #fff2f2;
    color: #c0392b;
}
.mascot-bubble.bubble-incorrect::before { border-right-color: var(--incorrect); }
.mascot-bubble.bubble-incorrect::after  { border-right-color: #fff2f2; }

/* ── Mascota en lección (ya no vive en el feedback bar) ── */
.feedback-bar .mascot-container { display: none; }

/* ── Mascota en pantalla de completado ── */
.mascot-complete-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

/* ── Botón de sonido ── */
.btn-sound-toggle {
    background: var(--gray-light);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 17px;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
}
.btn-sound-toggle:active  { transform: scale(0.9); }
.btn-sound-toggle.muted   { opacity: 0.45; }

/* ── Botón de revisión de permisos en perfil ── */
.pwa-review-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    background: none;
    border: 1.5px solid var(--gray-medium);
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    text-decoration: none;
}

.pwa-review-btn:hover { background: var(--gray-light); color: var(--text-dark); }
.pwa-review-btn i { font-size: 20px; color: var(--primary); }

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */
@media (min-width: 480px) {
    .app-shell { box-shadow: 0 0 40px rgba(0,0,0,0.15); }
}
