@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@700;800;900&display=swap');

:root {
    /* Màu pastel cute */
    --primary: #FF8A8A;
    --primary-dark: #FF6B6B;
    --secondary: #A0E4BA;
    --secondary-dark: #6ECB93;
    --accent: #FFD78A;
    --sky-top: #C5E8FF;
    --sky-bottom: #FFF5F5;
    --bg-main: #FFF5F5;
    --text-main: #5D4E6D;
    --border-inactive: #FFE0E0;
    --success: #A9E0A0;
    --warning: #FFE9A0;
}

* { box-sizing: border-box; }

body {
    font-family: 'Nunito', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    margin: 0;
    padding-bottom: 2rem;
    background: linear-gradient(180deg, var(--sky-top) 0%, #DCF3FF 18%, var(--sky-bottom) 42%, #FFF0F5 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Cute Title Font (Baloo 2 hỗ trợ tiếng Việt) */
h1, h2, h3 {
    font-family: 'Baloo 2', cursive;
    color: var(--text-main);
}

.container { padding: 1rem; max-width: 1000px; margin: 0 auto; position: relative; z-index: 1; }

/* ===== Navigation (Mobile-First) ===== */
nav {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}
.logo { font-size: 1.15rem; font-weight: 800; color: var(--primary); text-decoration: none; white-space: nowrap; font-family: 'Baloo 2', cursive; display: flex; align-items: center; gap: 0.35rem; }
.logo .logo-emoji { display: inline-block; animation: logoWiggle 2.5s ease-in-out infinite; }
@keyframes logoWiggle { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg) scale(1.1); } }
.nav-btn { 
    background: white; 
    border: 2px solid var(--border-inactive); 
    padding: 8px 15px; 
    border-radius: 15px; 
    font-weight: 800; 
    text-decoration: none; 
    color: #555; 
    min-height: 40px; 
    min-width: 40px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1rem;
}
.user-info { display: flex; gap: 0.25rem; align-items: center; flex-wrap: nowrap; justify-content: flex-end; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.user-info span { font-size: 0.9rem; }

/* ===== Candy Buttons ===== */
.btn {
    padding: 0.7rem 1.3rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800;
    transition: all 0.25s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 48px;
    box-shadow: 0 5px 0 rgba(0,0,0,0.1), 0 8px 18px rgba(0,0,0,0.06);
    position: relative;
}
.btn:hover { transform: translateY(-4px) scale(1.04); box-shadow: 0 8px 0 rgba(0,0,0,0.08), 0 12px 24px rgba(0,0,0,0.1); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.12); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; }
.btn-secondary { background: linear-gradient(135deg, var(--secondary), var(--secondary-dark)); color: white; }
.btn-big {
    font-size: 1.35rem;
    min-height: 60px;
    padding: 0.8rem 2rem;
    border-radius: 60px;
    box-shadow: 0 7px 0 rgba(0,0,0,0.12), 0 14px 28px rgba(255, 138, 138, 0.35);
    animation: pulseBtn 2s ease-in-out infinite;
}
@keyframes pulseBtn {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

/* ===== Search Form ===== */
.search-form { display: flex; gap: 0.5rem; margin: 1.2rem auto; max-width: 420px; }
.search-input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    border: 3px solid var(--border-inactive);
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    min-height: 48px;
    background: white;
    color: var(--text-main);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255, 138, 138, 0.2); }

/* ===== Mascot Hero (Dino) ===== */
.mascot-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1.5rem 1rem 1rem;
    text-align: center;
    position: relative;
}
.mascot-dino {
    font-size: 6rem;
    line-height: 1;
    filter: drop-shadow(0 12px 18px rgba(90, 140, 200, 0.25));
    animation: dinoBounce 2.4s cubic-bezier(0.5, 0.05, 0.2, 0.9) infinite;
    display: inline-block;
    transform-origin: bottom center;
    cursor: pointer;
    transition: transform 0.3s;
}
.mascot-dino:active { transform: scale(1.25) rotate(10deg); }
@keyframes dinoBounce {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    30% { transform: translateY(-12px) rotate(3deg) scale(1.03); }
    60% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(-4px) rotate(2deg); }
}
/* Speech bubble */
.dino-bubble {
    background: white;
    border: 3px solid var(--border-inactive);
    border-radius: 24px;
    padding: 0.8rem 1.4rem;
    font-family: 'Baloo 2', cursive;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-main);
    position: relative;
    max-width: 320px;
    margin-top: 0.4rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.07);
    animation: bubbleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dino-bubble::after {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    border: 12px solid transparent;
    border-bottom-color: white;
    border-top-width: 0;
}
@keyframes bubbleIn { 0% { transform: scale(0.5) translateY(20px); opacity: 0; } 100% { transform: scale(1) translateY(0); opacity: 1; } }
.hero-title {
    font-size: 2.1rem;
    font-weight: 800;
    margin: 0.6rem 0 0.2rem;
    line-height: 1.2;
    color: var(--text-main);
}
.hero-subtitle { font-size: 1rem; color: #8A7B9E; margin: 0 0 0.8rem; font-weight: 700; }
.adventure-progress {
    background: rgba(255,255,255,0.92);
    border: 3px solid var(--secondary);
    border-radius: 24px;
    padding: 1rem 1.3rem;
    margin: 1.2rem auto;
    max-width: 500px;
    box-shadow: 0 6px 18px rgba(160, 228, 186, 0.25);
}
.adventure-progress-title { font-weight: 800; font-size: 1rem; display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.adventure-progress-title .pct { color: var(--secondary-dark); font-family: 'Baloo 2', cursive; font-size: 1.15rem; }
.adventure-progress-track { background: #E8F7EE; border-radius: 20px; height: 18px; overflow: hidden; position: relative; }
.adventure-progress-bar {
    background: linear-gradient(90deg, var(--secondary), var(--accent), var(--primary));
    height: 100%;
    border-radius: 20px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
.adventure-progress-bar::after {
    content: '🚀';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-60%) rotate(20deg);
    font-size: 1.1rem;
}
.adventure-progress-stars { display: flex; justify-content: space-between; margin-top: 0.5rem; font-size: 0.85rem; color: #999; font-weight: 700; }

/* ===== Lesson Map ===== */
.lesson-map {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.8rem;
    padding: 2.5rem 1rem;
    position: relative;
}
/* Đường line dọc trên mobile */
.lesson-map::before {
    content: '';
    position: absolute;
    top: 3%;
    bottom: 3%;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    background: repeating-linear-gradient(180deg, var(--accent) 0 15px, transparent 15px 30px);
    z-index: 0;
    border-radius: 6px;
}
/* Đồi cỏ dưới map */
.lesson-map::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -20%;
    right: -20%;
    height: 70px;
    background: radial-gradient(ellipse 45% 100% at 20% 0%, var(--secondary) 0%, transparent 60%),
                radial-gradient(ellipse 50% 100% at 70% 0%, var(--secondary) 0%, transparent 55%);
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}

.map-node {
    background: white;
    border: 4px solid var(--secondary);
    border-radius: 50%;
    width: 104px;
    height: 104px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(110, 203, 147, 0.18), 0 4px 0 rgba(110, 203, 147, 0.4);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    position: relative;
    z-index: 1;
}
.map-node:hover { transform: scale(1.12) rotate(-4deg); box-shadow: 0 12px 26px rgba(110, 203, 147, 0.3); }
.map-node.unlocked { border-color: var(--secondary); }
.map-node.locked { cursor: not-allowed; opacity: 0.7; background: #f6f6f6; border-style: dashed; border-color: #ddd; box-shadow: none; }
/* Bài chưa học nhưng đã mở — nhún nhảy kêu gọi chú ý */
.map-node.attention { animation: attentionBounce 1.8s ease-in-out infinite; }
@keyframes attentionBounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-9px) rotate(2deg); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-5px); }
}
.map-node .lesson-emoji { font-size: 2.7rem; }
.map-node h3 { font-size: 0.72rem; margin-top: 0.15rem; font-weight: 800; color: var(--text-main); text-align: center; line-height: 1.1; }
.map-node .node-stars { margin-top: 2px; font-size: 0.75rem; line-height: 1; }

/* Progress ring */
.progress-ring { position: absolute; top: -10px; left: -10px; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring .bg { fill: none; stroke: var(--border-inactive); stroke-width: 6; }
.progress-ring .fg { fill: none; stroke: var(--secondary-dark); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1); }
.progress-ring .text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-weight: bold; font-size: 0.8rem; color: var(--text-main); }

/* ===== Learner Switcher ===== */
.learner-badge { display: inline-flex; align-items: center; gap: 0.4rem; background: rgba(255,255,255,0.9); border: 3px solid var(--accent); border-radius: 40px; padding: 0.5rem 1.1rem; font-weight: 800; margin-top: 0.5rem; box-shadow: 0 4px 10px rgba(255, 215, 138, 0.3); }
.learner-btn { border: 3px solid var(--border-inactive); background: white; padding: 0.6rem 1rem; border-radius: 30px; cursor: pointer; font-size: 0.9rem; font-weight: 800; transition: all 0.2s; color: var(--text-main); }
.learner-btn.active { border-color: var(--primary); background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; transform: scale(1.05); }

/* ===== Daily Goal ===== */
.daily-goal { background: white; border-radius: 24px; padding: 1rem 1.2rem; margin: 1.2rem auto; max-width: 420px; box-shadow: 0 6px 16px rgba(255, 215, 138, 0.35); border: 3px solid var(--accent); position: relative; overflow: hidden; }
.daily-goal::before { content: '🎁'; position: absolute; right: 12px; top: 10px; font-size: 1.4rem; animation: giftShake 3s ease-in-out infinite; }
@keyframes giftShake { 0%, 90%, 100% { transform: rotate(0); } 93%, 97% { transform: rotate(-12deg); } 95% { transform: rotate(12deg); } }
.daily-goal-title { font-weight: 800; font-size: 1rem; color: var(--text-main); margin-bottom: 0.6rem; padding-right: 2rem; }
.daily-goal-progress { background: #FFF0E0; border-radius: 20px; height: 14px; overflow: hidden; }
.daily-goal-bar { background: linear-gradient(90deg, var(--secondary), var(--accent)); height: 100%; border-radius: 20px; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.daily-goal-text { font-size: 0.85rem; color: #888; margin-top: 0.5rem; font-weight: 700; }
.daily-goal.done::after { content: '✅'; position: absolute; right: 12px; top: 40px; font-size: 1.2rem; animation: donePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes donePop { 0% { transform: scale(0); } 100% { transform: scale(1); } }

/* ===== Badge Collection ===== */
.badge-collection { background: rgba(255,255,255,0.92); border-radius: 26px; padding: 1.2rem; margin: 1.2rem auto; max-width: 520px; box-shadow: 0 6px 18px rgba(160, 228, 186, 0.25); border: 3px solid var(--secondary); }
.badge-title { font-weight: 800; font-size: 1.05rem; color: var(--text-main); margin-bottom: 0.8rem; }
.badge-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
.badge-item { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; width: 80px; padding: 0.5rem; border-radius: 16px; background: #fafafa; transition: transform 0.2s; }
.badge-item.earned { background: linear-gradient(135deg, #FFF9E6, #FFF0F0); border: 2px solid var(--accent); animation: badgePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.badge-item.earned:hover { transform: scale(1.15) rotate(5deg); }
@keyframes badgePop { 0% { transform: scale(0) rotate(-20deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.badge-item.locked { opacity: 0.6; border: 2px dashed #e0e0e0; }
.badge-emoji { font-size: 1.8rem; }
.badge-name { font-size: 0.65rem; font-weight: 800; color: var(--text-main); text-align: center; }

/* ===== Floating Decorations ===== */
.deco { position: fixed; pointer-events: none; opacity: 0.25; font-size: 2rem; z-index: 0; animation: float 6s ease-in-out infinite; }
.deco:nth-child(1) { left: 4%; top: 15%; }
.deco:nth-child(2) { animation-delay: 1.2s; left: 8%; top: 30%; }
.deco:nth-child(3) { animation-delay: 2.1s; right: 10%; top: 45%; }
.deco:nth-child(4) { animation-delay: 0.6s; left: 15%; bottom: 20%; }
.deco:nth-child(5) { animation-delay: 3s; right: 5%; bottom: 30%; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-16px) rotate(10deg); } }

.btn-nav { padding: 0.5rem; min-height: 40px; min-width: 40px; }
.user-name { font-size: 0.8rem; margin-right: 0.5rem; }
@media (max-width: 375px) {
    .user-name { display: none; }
    nav { padding: 0.3rem; gap: 0.15rem; }
    .logo { font-size: 0.9rem; }
    .user-info { gap: 0.15rem; }
    .btn { min-height: 35px; padding: 0.4rem 0.7rem; font-size: 0.8rem; }
}
@media (min-width: 600px) {
    .lesson-map { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 3rem; }
    .lesson-map::before {
        top: 50%;
        bottom: auto;
        left: 3%;
        right: 3%;
        width: auto;
        height: 12px;
        transform: none;
        background: repeating-linear-gradient(90deg, var(--accent) 0 15px, transparent 15px 30px);
    }
    .map-node { width: 140px; height: 140px; }
    .map-node .lesson-emoji { font-size: 3.4rem; }
    .map-node h3 { font-size: 0.9rem; }
    .logo { font-size: 1.4rem; }
    .mascot-dino { font-size: 7rem; }
    .hero-title { font-size: 2.6rem; }
    .dino-bubble { font-size: 1.3rem; }
}

/* Reduced motion cho trẻ nhạy cảm */
@media (prefers-reduced-motion: reduce) {
    .mascot-dino, .map-node.attention, .deco, .logo .logo-emoji { animation: none !important; }
}

/* ==============================================================
   LESSON SHOW — REDESIGN 2026
   Hero gọn gàng + Flow 3 bước rõ ràng + Game grid
   ============================================================== */

/* ─── Hero (không bubble, không trùng lặp) ─── */
.lesson-hero-clean {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.6rem 1rem 0.8rem;
    gap: 0.3rem;
}
.lesson-hero-icon {
    font-size: 4.5rem;
    line-height: 1;
    filter: drop-shadow(0 10px 16px rgba(90, 140, 200, 0.25));
    animation: dinoBounce 2.4s cubic-bezier(0.5, 0.05, 0.2, 0.9) infinite;
    display: inline-block;
    transform-origin: bottom center;
}
.lesson-hero-title {
    font-family: 'Baloo 2', cursive;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0.4rem 0 0;
    line-height: 1.2;
}
.lesson-hero-cat {
    font-size: 0.95rem;
    color: #8A7B9E;
    font-weight: 700;
    margin: 0;
}

/* ─── Lesson content box ─── */
.lesson-content-box {
    background: rgba(255,255,255,0.9);
    border-radius: 20px;
    padding: 1.2rem 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    line-height: 1.55;
    color: var(--text-main);
}

/* ─── Flow 3 bước (hành trình học) ─── */
.lesson-flow {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin: 1.6rem 0 2rem;
}
.lesson-flow-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: rgba(255,255,255,0.95);
    border: 3px solid var(--border-inactive);
    border-radius: 22px;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.lesson-flow-card:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.lesson-flow-card.next {
    border-color: var(--primary);
    background: linear-gradient(135deg, #fff, #FFF5F5);
    animation: flowPulse 2s ease-in-out infinite;
}
@keyframes flowPulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(255,138,138,0.15); }
    50% { box-shadow: 0 4px 22px rgba(255,138,138,0.4); }
}
.lesson-flow-card.done {
    border-color: var(--secondary);
    background: linear-gradient(135deg, #fff, #F0FAF3);
}
.lesson-flow-card.locked { opacity: 0.65; }

.flow-num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--border-inactive);
    color: var(--text-main);
    font-weight: 900;
    font-family: 'Baloo 2', cursive;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.lesson-flow-card.next .flow-num { background: var(--primary); color: #fff; }
.lesson-flow-card.done .flow-num { background: var(--secondary); color: #fff; }

.flow-body {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex: 1;
    min-width: 0;
}
.flow-emoji { font-size: 1.9rem; flex-shrink: 0; }
.flow-text { display: flex; flex-direction: column; min-width: 0; }
.flow-text strong { font-size: 1.05rem; font-family: 'Baloo 2', cursive; }
.flow-text span {
    font-size: 0.8rem;
    color: #8A7B9E;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flow-action { flex-shrink: 0; margin-left: auto; }
.flow-badge-done {
    background: var(--secondary);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 900;
    font-family: 'Baloo 2', cursive;
}
.flow-badge-go {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 900;
    font-family: 'Baloo 2', cursive;
    box-shadow: 0 4px 10px rgba(255,107,107,0.35);
}
.flow-badge-lock { font-size: 1.1rem; opacity: 0.6; }

/* ─── Section title ─── */
.section-title {
    text-align: center;
    margin: 2.2rem 0 0.2rem;
    font-size: 1.6rem;
    font-family: 'Baloo 2', cursive;
    font-weight: 800;
}
.section-subtitle {
    text-align: center;
    color: #8A7B9E;
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 1.2rem;
}

/* ─── Game grid (mỗi game 1 thẻ, không trùng) ─── */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.9rem;
    padding: 0 0.5rem;
}
.game-card {
    background: rgba(255,255,255,0.95);
    border: 3px solid var(--secondary);
    border-radius: 20px;
    padding: 1rem 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
    position: relative;
    box-shadow: 0 4px 10px rgba(110,203,147,0.15);
}
.game-card:hover {
    transform: translateY(-5px) rotate(-2deg) scale(1.04);
    box-shadow: 0 10px 22px rgba(110,203,147,0.3);
}
.game-card:active { transform: scale(0.96); }
.game-card-emoji { font-size: 2.4rem; line-height: 1; }
.game-card-name {
    font-family: 'Baloo 2', cursive;
    font-weight: 800;
    font-size: 0.95rem;
}
.game-card-desc { font-size: 0.72rem; color: #8A7B9E; font-weight: 700; text-align: center; }
.game-card-done {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--secondary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
    box-shadow: 0 2px 6px rgba(110,203,147,0.4);
}

/* ─── Footer nav ─── */
.lesson-footer-nav {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin: 2.5rem 0 0.5rem;
}
.lesson-footer-link {
    background: rgba(255,255,255,0.92);
    border: 3px solid var(--border-inactive);
    border-radius: 30px;
    padding: 0.6rem 1.2rem;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-main);
    text-decoration: none;
    transition: transform 0.2s;
}
.lesson-footer-link:hover { transform: scale(1.05); border-color: var(--primary); }

/* ─── Responsive ─── */
@media (min-width: 600px) {
    .lesson-hero-icon { font-size: 6rem; }
    .lesson-hero-title { font-size: 2.6rem; }
    .lesson-flow { max-width: 640px; margin-left: auto; margin-right: auto; }
    .lesson-flow-card { padding: 1rem 1.3rem; }
    .flow-emoji { font-size: 2.4rem; }
    .game-card-emoji { font-size: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
    .lesson-hero-icon, .lesson-flow-card.next { animation: none !important; }
}

/* ===== iPad & Tablet (768px+) — mọi thứ to hơn, dễ chạm ===== */
@media (min-width: 768px) and (max-width: 1024px) {
    .container { max-width: 1100px; padding: 2rem; }
    .lesson-hero-icon { font-size: 6.5rem; }
    .lesson-hero-title { font-size: 3rem; }
    .lesson-flow { max-width: 900px; }
    .flow-num { width: 44px; height: 44px; font-size: 1.3rem; }
    .game-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.2rem; padding: 0 1rem; }
    .game-card { padding: 1.3rem 0.9rem; }
    .game-card-emoji { font-size: 3.2rem; }
    .game-card-name { font-size: 1.15rem; }
    .game-card-desc { font-size: 0.85rem; }
    .lesson-footer-nav { gap: 1.2rem; }
    .lesson-footer-link { padding: 0.8rem 1.5rem; font-size: 1.1rem; }
    .section-title { font-size: 2rem; margin: 2.8rem 0 0.4rem; }
    .section-subtitle { font-size: 1rem; }
}

/* ===== iPad Pro & Desktop (1024px+) ===== */
@media (min-width: 1024px) {
    .container { max-width: 1200px; padding: 2rem; }
    .game-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.2rem; }
}
