/* ========================================
   Phrasal Verbs Lab — Conversation
   Set 3: Travel & Navigation
   © Cool English 2026

   IDENTITY: Dark, cinematic, immersive
   ACCENT:   Teal / Cyan
   ======================================== */

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

:root {
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    --cyan-300:  #67e8f9;
    --cyan-400:  #22d3ee;
    --cyan-500:  #06b6d4;
    --cyan-600:  #0891b2;
    --cyan-700:  #0e7490;

    --teal-400:  #2dd4bf;
    --teal-500:  #14b8a6;
    --teal-600:  #0d9488;

    --amber-400: #fbbf24;

    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -4px rgba(0,0,0,0.2);
    --shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.35), 0 8px 10px -6px rgba(0,0,0,0.2);
    --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.6);
}

/* ── Base ── */
html, body { height: 100%; overflow: hidden; }

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--slate-900);
    color: white;
}

.app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Background image — travel/airport */
.app::before {
    content: '';
    position: fixed; inset: 0;
    background-image: url('https://images.unsplash.com/photo-1436491865332-7a61a109cc05?w=1920&q=80');
    background-size: cover;
    background-position: center;
    filter: blur(8px) brightness(0.4);
    transform: scale(1.1);
    z-index: 0;
}

/* Gradient overlay */
.app::after {
    content: '';
    position: fixed; inset: 0;
    background: linear-gradient(180deg,
        rgba(6,182,212,0.22) 0%,
        rgba(15,23,42,0.5) 40%,
        rgba(15,23,42,0.72) 100%
    );
    z-index: 1;
}

.header, .instruction-banner, .main-content, .footer {
    position: relative;
    z-index: 10;
}


/* ========================================
   Header
   ======================================== */
.header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--cyan-600), var(--cyan-700));
    border-bottom: 4px solid transparent;
    border-image: linear-gradient(90deg,#FF6B35,#F59E0B,#22C55E,#06B6D4,#8B5CF6,#EC4899) 1;
    box-shadow: 0 4px 20px rgba(6,182,212,0.35);
    flex-shrink: 0;
}

.header-left { display: flex; align-items: center; gap: 0.75rem; }

.back-btn {
    display: flex; align-items: center; justify-content: center;
    width: 2.75rem; height: 2.75rem; border-radius: 0.75rem;
    background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.25);
    color: white; text-decoration: none; transition: all 0.25s ease;
}
.back-btn:hover { background: rgba(255,255,255,0.25); border-color: white; transform: translateX(-3px); }

.logo {
    width: 2.75rem; height: 2.75rem; border-radius: 0.75rem;
    background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.3);
    display: flex; align-items: center; justify-content: center; color: white;
}

.title-group { display: flex; align-items: center; gap: 0.75rem; }

.main-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem; font-weight: 800; color: white;
}

.theme-badge {
    font-family: 'Poppins', sans-serif;
    background: var(--amber-400); color: var(--slate-900);
    font-size: 0.875rem; font-weight: 800;
    padding: 0.375rem 1rem; border-radius: 2rem;
}

.header-right { display: flex; align-items: center; gap: 1rem; }

.reset-btn {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem; border-radius: 0.75rem;
    background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.25);
    font-family: 'Poppins', sans-serif; font-size: 0.9rem; font-weight: 700;
    color: white; cursor: pointer; transition: all 0.25s ease;
}
.reset-btn:hover { background: rgba(255,255,255,0.25); border-color: white; }
.reset-btn svg { transition: transform 0.3s ease; }
.reset-btn:hover svg { transform: rotate(-180deg); }

.progress-container {
    display: flex; align-items: center; gap: 0.5rem;
    background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.2);
    padding: 0.5rem 1.25rem; border-radius: 2rem;
}
.progress-count { font-family: 'Poppins', sans-serif; font-size: 1.5rem; font-weight: 900; color: white; }
.progress-label { font-size: 1rem; font-weight: 600; color: rgba(255,255,255,0.8); }


/* ========================================
   Instruction Banner
   ======================================== */
.instruction-banner {
    display: flex; align-items: center; justify-content: center;
    gap: 0.75rem; padding: 0.875rem 2rem;
    background: rgba(255,255,255,0.95);
    border-bottom: 3px solid var(--cyan-400);
    flex-shrink: 0;
}
.banner-icon { color: var(--cyan-600); flex-shrink: 0; }
.instruction-text {
    font-family: 'Nunito', sans-serif;
    font-size: 1.625rem; font-weight: 600; color: var(--slate-700);
}
.instruction-text strong { color: var(--cyan-600); font-weight: 800; }


/* ========================================
   Main Content + Board Grid
   ======================================== */
.main-content {
    flex: 1; display: flex;
    align-items: center; justify-content: center;
    padding: 1.5rem 2rem;
    min-height: 0;
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: repeat(2, auto);
    gap: 1.5rem;
    width: 100%;
    max-width: 1400px;
}

.question-card {
    aspect-ratio: 1 / 1;
    border-radius: 1.5rem; border: none;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 0.875rem; padding: 1.5rem;
    cursor: pointer; color: white;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 8px 28px rgba(0,0,0,0.35);
    position: relative; overflow: hidden;
}

/* Subtle gloss */
.question-card::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 55%);
    border-radius: inherit; pointer-events: none;
}

.question-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 22px 50px rgba(0,0,0,0.45);
}
.question-card:active { transform: translateY(-2px) scale(0.98); }

.card-number {
    font-family: 'Poppins', sans-serif;
    font-size: 7rem; font-weight: 900; line-height: 1;
    text-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.card-topic {
    font-family: 'Poppins', sans-serif;
    font-size: 1.35rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    text-align: center; opacity: 0.92;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Checkmark badge */
.card-check {
    position: absolute; top: 0.75rem; right: 0.75rem;
    width: 2.25rem; height: 2.25rem;
    background: white; border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.4);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transform: scale(0);
    transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.card-check svg { width: 1.25rem; height: 1.25rem; stroke-width: 3; stroke: var(--cyan-600); }

.question-card.discussed { opacity: 0.55; }
.question-card.discussed .card-check { opacity: 1; transform: scale(1); }


/* ========================================
   Expanded Panel — full-screen overlay
   ======================================== */
.expanded-panel {
    position: fixed; inset: 0;
    background: rgba(5, 8, 20, 0.92);
    backdrop-filter: blur(16px);
    display: flex; align-items: center; justify-content: center;
    padding: 2rem;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}
.expanded-panel.visible { opacity: 1; visibility: visible; }


/* ========================================
   Panel Card — the contained box
   ======================================== */
.panel-card {
    width: 100%; max-width: 1100px;
    background: rgba(12,20,40,0.96);
    backdrop-filter: blur(24px);
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 2rem;
    box-shadow: var(--shadow-2xl);
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: cardSlideIn 0.3s cubic-bezier(0.34,1.2,0.64,1);
}
@keyframes cardSlideIn {
    from { transform: scale(0.92) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}


/* Top bar */
.panel-top {
    display: flex; align-items: center; gap: 1.25rem;
    padding: 1.5rem 2rem;
    background: rgba(255,255,255,0.04);
}

.panel-badge {
    width: 3.5rem; height: 3.5rem; border-radius: 0.875rem;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem; font-weight: 900; color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.panel-instruction {
    flex: 1;
    font-family: 'Nunito', sans-serif;
    font-size: 1.5rem; font-weight: 700;
    color: rgba(255,255,255,0.75);
}

.close-btn {
    width: 3rem; height: 3rem; flex-shrink: 0;
    border-radius: 0.75rem;
    background: rgba(255,255,255,0.08); border: 1.5px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
}
.close-btn:hover { background: rgba(6,182,212,0.25); border-color: var(--cyan-500); color: var(--cyan-400); }

.panel-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 0;
}


/* Audio section */
.audio-section {
    display: flex; flex-direction: column;
    align-items: center; gap: 1.25rem;
    padding: 2.5rem 2rem;
}

.audio-wrapper {
    position: relative;
    display: flex; align-items: center; justify-content: center;
}

.audio-glow {
    position: absolute;
    width: 280px; height: 280px; border-radius: 50%;
    background: radial-gradient(circle, rgba(6,182,212,0.3) 0%, rgba(20,184,166,0.15) 45%, transparent 70%);
    animation: pulseGlow 3s ease-in-out infinite;
}
@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50%       { transform: scale(1.2); opacity: 1; }
}

.audio-btn {
    width: 190px; height: 190px; border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan-700), var(--cyan-500), var(--cyan-400));
    border: none; color: white; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 60px rgba(6,182,212,0.5), 0 0 100px rgba(20,184,166,0.2);
    transition: all 0.3s ease;
    position: relative; z-index: 1;
}
.audio-btn:hover { transform: scale(1.06); }
.audio-btn .play-icon { transition: opacity 0.2s; }
.audio-btn.playing .play-icon { display: none; }

.sound-waves { display: none; align-items: center; gap: 8px; }
.audio-btn.playing .sound-waves { display: flex; }

.sound-waves span {
    width: 11px; background: white; border-radius: 6px;
    animation: soundWave 0.8s ease-in-out infinite;
}
.sound-waves span:nth-child(1) { height: 22px; animation-delay: 0s; }
.sound-waves span:nth-child(2) { height: 44px; animation-delay: 0.1s; }
.sound-waves span:nth-child(3) { height: 66px; animation-delay: 0.2s; }
.sound-waves span:nth-child(4) { height: 44px; animation-delay: 0.3s; }
.sound-waves span:nth-child(5) { height: 22px; animation-delay: 0.4s; }

@keyframes soundWave {
    0%, 100% { transform: scaleY(1); }
    50%       { transform: scaleY(0.35); }
}

.audio-label {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem; font-weight: 700; color: white;
    text-shadow: 0 0 28px rgba(6,182,212,0.5);
}


/* Text section */
.text-section {
    display: flex; flex-direction: column;
    align-items: center; gap: 1rem;
    padding: 1.5rem 2.5rem 2.5rem;
}

.show-text-btn {
    display: flex; align-items: center; gap: 0.625rem;
    padding: 0.875rem 2rem; border-radius: 0.875rem;
    background: rgba(255,255,255,0.07); border: 1.5px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.8);
    font-family: 'Poppins', sans-serif; font-size: 1.25rem; font-weight: 600;
    cursor: pointer; transition: all 0.25s ease;
}
.show-text-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.35); color: white; }
.show-text-btn.hidden { display: none; }

.question-text-container { display: none; width: 100%; }
.question-text-container.visible { display: block; }

.question-text {
    font-family: 'Nunito', sans-serif;
    font-size: 2.25rem; font-weight: 700;
    color: white; line-height: 1.5; text-align: center;
    padding: 1.5rem 2.5rem;
    background: rgba(255,255,255,0.06);
    border-radius: 1.1rem;
    border: 1.5px solid rgba(255,255,255,0.1);
}

.verb-highlight {
    color: var(--amber-400);
    font-weight: 900;
    background: rgba(251,191,36,0.18);
    border-radius: 0.25rem; padding: 0 0.15em;
    text-decoration: underline;
    text-decoration-color: var(--amber-400);
}

.model-show-btn {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1.75rem; border-radius: 0.875rem;
    background: rgba(6,182,212,0.1); border: 1.5px solid rgba(6,182,212,0.3);
    color: var(--cyan-400);
    font-family: 'Poppins', sans-serif; font-size: 1.1rem; font-weight: 700;
    cursor: pointer; transition: all 0.25s ease;
}
.model-show-btn:hover { background: rgba(6,182,212,0.2); border-color: var(--cyan-500); color: var(--cyan-300); }

.model-text {
    display: none; width: 100%;
    font-family: 'Nunito', sans-serif;
    font-size: 1.875rem; font-weight: 700;
    color: rgba(255,255,255,0.82); line-height: 1.55; text-align: center;
    padding: 1.5rem 2rem;
    background: rgba(6,182,212,0.07);
    border-radius: 1.1rem;
    border-left: 4px solid var(--cyan-500);
    border-top: 1.5px solid rgba(6,182,212,0.18);
    border-right: 1.5px solid rgba(6,182,212,0.18);
    border-bottom: 1.5px solid rgba(6,182,212,0.18);
}
.model-text.visible { display: block; }


/* ========================================
   Completion Overlay
   ======================================== */
.completion-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center;
    z-index: 2000;
}
.completion-overlay.visible { display: flex; }

.completion-content {
    background: var(--slate-800); border: 2px solid rgba(6,182,212,0.3);
    border-radius: 2rem; padding: 3rem 4rem; text-align: center;
    box-shadow: var(--shadow-2xl);
    animation: bounceIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
    max-width: 90%;
}
@keyframes bounceIn {
    0%   { transform: scale(0.65); opacity: 0; }
    60%  { transform: scale(1.04); }
    100% { transform: scale(1); opacity: 1; }
}
.comp-emoji { font-size: 4.5rem; margin-bottom: 1rem; }
.comp-title { font-family: 'Poppins', sans-serif; font-size: 2.5rem; font-weight: 900; color: var(--cyan-400); margin-bottom: 0.5rem; }
.comp-msg   { font-family: 'Nunito', sans-serif;   font-size: 1.5rem;  font-weight: 700; color: rgba(255,255,255,0.75); margin-bottom: 2rem; }
.comp-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.comp-retry, .comp-home {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.875rem 1.75rem; border-radius: 0.875rem;
    font-family: 'Poppins', sans-serif; font-size: 1.15rem; font-weight: 700;
    cursor: pointer; transition: all 0.25s ease; text-decoration: none;
}
.comp-retry { background: var(--cyan-500); color: white; border: none; box-shadow: var(--shadow-lg); }
.comp-retry:hover { transform: scale(1.04); }
.comp-home  { background: rgba(255,255,255,0.07); color: white; border: 1.5px solid rgba(255,255,255,0.2); }
.comp-home:hover { border-color: var(--cyan-400); color: var(--cyan-400); transform: scale(1.04); }


/* ========================================
   View All Button (header)
   ======================================== */
.view-all-btn {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem; border-radius: 0.75rem;
    background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.25);
    font-family: 'Poppins', sans-serif; font-size: 0.9rem; font-weight: 700;
    color: white; cursor: pointer; transition: all 0.25s ease;
}
.view-all-btn:hover { background: rgba(255,255,255,0.25); border-color: white; }


/* ========================================
   All Questions Overlay
   ======================================== */
.all-questions-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(10px);
    display: none; align-items: center; justify-content: center;
    z-index: 1500; padding: 1rem;
}
.all-questions-overlay.visible { display: flex; }

.all-questions-panel {
    background: #0d1e2e;
    border: 1.5px solid rgba(34,211,238,0.2);
    border-radius: 1.75rem;
    width: 100%; max-width: 1600px;
    max-height: 94vh; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    animation: aqSlideIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes aqSlideIn {
    from { transform: scale(0.92) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

.aq-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.5rem 2.5rem;
    border-bottom: 1.5px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.aq-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem; font-weight: 800; color: white;
}

.aq-close-btn {
    display: flex; align-items: center; justify-content: center;
    width: 3rem; height: 3rem; border-radius: 0.875rem;
    background: rgba(255,255,255,0.08); border: 1.5px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7); cursor: pointer; transition: all 0.2s ease;
}
.aq-close-btn:hover { background: rgba(255,255,255,0.15); color: white; border-color: rgba(255,255,255,0.3); }

.aq-list {
    display: flex; gap: 1.5rem;
    padding: 1.75rem 2.5rem 2.5rem;
    overflow-y: auto; flex: 1;
}

.aq-column { display: flex; flex-direction: column; gap: 0.875rem; flex: 1; }

.aq-item {
    background: rgba(255,255,255,0.04);
    border: 1.5px solid rgba(255,255,255,0.09);
    border-radius: 1rem; overflow: hidden;
    transition: border-color 0.2s ease;
}
.aq-item:hover { border-color: rgba(34,211,238,0.3); }

.aq-question-row {
    display: flex; align-items: center; gap: 1.25rem;
    padding: 1.25rem 1.5rem; cursor: pointer;
}

.aq-num {
    width: 3.25rem; height: 3.25rem; border-radius: 0.75rem;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Poppins', sans-serif; font-size: 1.5rem; font-weight: 900;
    color: white; flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.aq-question-text {
    flex: 1;
    font-family: 'Nunito', sans-serif;
    font-size: 1.75rem; font-weight: 700;
    color: rgba(255,255,255,0.9); line-height: 1.35;
}

.aq-toggle-icon {
    color: rgba(255,255,255,0.35);
    transition: transform 0.25s ease, color 0.2s ease;
    flex-shrink: 0;
}
.aq-item.model-open .aq-toggle-icon {
    transform: rotate(180deg);
    color: var(--cyan-400);
}

.aq-model-row {
    max-height: 0; overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 1.5rem;
}
.aq-item.model-open .aq-model-row {
    max-height: 400px;
    padding: 0 1.5rem 1.5rem;
}

.aq-model-text {
    font-family: 'Nunito', sans-serif;
    font-size: 1.5rem; font-weight: 600;
    color: var(--cyan-300); line-height: 1.5;
    padding: 1.1rem 1.4rem;
    background: rgba(6,182,212,0.07);
    border-radius: 0.75rem;
    border: 1.5px solid rgba(6,182,212,0.2);
}

@media (max-width: 900px) {
    .aq-list { flex-direction: column; }
    .all-questions-panel { border-radius: 1.25rem; max-height: 92vh; }
    .aq-header { padding: 1rem 1.25rem; }
    .aq-title { font-size: 1.375rem; }
    .aq-list { padding: 1rem 1rem 1.5rem; }
    .aq-question-text { font-size: 1.2rem; }
    .aq-model-text { font-size: 1.1rem; }
}


/* ========================================
   Footer
   ======================================== */
.footer { padding: 0.5rem; background: rgba(15,23,42,0.9); text-align: center; flex-shrink: 0; z-index: 10; position: relative; }
.footer p { font-size: 0.875rem; color: var(--slate-400); font-weight: 600; }


/* ========================================
   Responsive — Height
   ======================================== */
@media (max-height: 820px) {
    .board-grid { gap: 1rem; }
    .card-number { font-size: 5.5rem; }
    .main-content { padding: 1rem 2rem; }
    .audio-btn { width: 155px; height: 155px; }
    .audio-glow { width: 220px; height: 220px; }
    .audio-btn .play-icon { width: 56px; height: 56px; }
    .audio-label { font-size: 1.5rem; }
    .audio-section { padding: 1.75rem 2rem; gap: 0.875rem; }
    .question-text { font-size: 1.875rem; }
    .model-text { font-size: 1.5rem; }
}

@media (max-height: 680px) {
    .card-number { font-size: 4rem; }
    .card-topic  { font-size: 1rem; }
    .board-grid  { gap: 0.75rem; }
    .audio-btn   { width: 120px; height: 120px; }
    .audio-glow  { width: 170px; height: 170px; }
}


/* ========================================
   Responsive — Width (desktop)
   ======================================== */
@media (max-width: 1400px) {
    .card-number { font-size: 6rem; }
}

@media (max-width: 1200px) {
    .card-number { font-size: 5rem; }
    .card-topic  { font-size: 1.15rem; }
    .instruction-text { font-size: 1.375rem; }
    .panel-card { max-width: 960px; }
}

@media (max-width: 1024px) {
    .card-number { font-size: 4.25rem; }
    .card-topic  { font-size: 1rem; }
    .panel-card { max-width: 860px; }
}


/* ========================================
   Mobile (< 768px) — unlock scroll
   ======================================== */
@media (max-width: 768px) {
    html, body { height: auto; overflow-y: auto; overflow-x: hidden; }
    .app { height: auto; min-height: 100vh; overflow: visible; }

    .main-content { flex: none; padding: 1rem; align-items: center; justify-content: center; }

    .header { padding: 0.625rem 1rem; }
    .main-title { font-size: 1.375rem; }
    .theme-badge { display: none; }
    .reset-btn span { display: none; }
    .reset-btn { padding: 0.5rem; }
    .view-all-btn span { display: none; }
    .view-all-btn { padding: 0.5rem; }
    .progress-count { font-size: 1.25rem; }
    .progress-label { font-size: 0.875rem; }

    .instruction-banner { padding: 0.75rem 1rem; }
    .instruction-text { font-size: 1.25rem; }

    /* 2×5 on mobile */
    .board-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(5, auto);
        gap: 0.75rem; max-width: 420px;
    }
    .question-card { aspect-ratio: 1.2/1; padding: 1rem; border-radius: 1rem; gap: 0.5rem; }
    .card-number { font-size: 2.75rem; }
    .card-topic  { font-size: 0.875rem; }
    .card-check  { width: 1.75rem; height: 1.75rem; top: 0.5rem; right: 0.5rem; }
    .card-check svg { width: 1rem; height: 1rem; }

    /* Panel */
    .expanded-panel { padding: 1rem; align-items: center; justify-content: center; }
    .panel-card { max-width: 100%; border-radius: 1.5rem 1.5rem 1rem 1rem; }
    .panel-top  { padding: 1rem 1.25rem; }
    .panel-badge { width: 2.5rem; height: 2.5rem; font-size: 1.25rem; border-radius: 0.625rem; }
    .panel-instruction { font-size: 1.05rem; }
    .close-btn  { width: 2.5rem; height: 2.5rem; }
    .audio-section { padding: 1.25rem; gap: 0.75rem; }
    .audio-btn  { width: 110px; height: 110px; }
    .audio-glow { width: 155px; height: 155px; }
    .audio-btn .play-icon { width: 42px; height: 42px; }
    .audio-label { font-size: 1.25rem; }
    .text-section { padding: 1.25rem 1.25rem 1.5rem; gap: 0.75rem; }
    .question-text { font-size: 1.375rem; padding: 1rem 1.25rem; }
    .model-text { font-size: 1.2rem; padding: 1rem 1.25rem; }
    .show-text-btn { font-size: 1rem; padding: 0.625rem 1.25rem; }
    .model-show-btn { font-size: 0.95rem; padding: 0.5rem 1.1rem; }
}

@media (max-width: 480px) {
    .header { padding: 0.5rem 0.75rem; }
    .back-btn, .logo { width: 2.25rem; height: 2.25rem; }
    .main-title { font-size: 1.2rem; }
    .progress-count { font-size: 1.1rem; }
    .progress-label { display: none; }

    .instruction-text { font-size: 1.1rem; }

    .board-grid { gap: 0.5rem; max-width: 100%; }
    .question-card { padding: 0.75rem; border-radius: 0.875rem; }
    .card-number { font-size: 2.25rem; }
    .card-topic  { font-size: 0.75rem; }

    .expanded-panel { padding: 0.5rem; }
    .audio-btn  { width: 90px; height: 90px; }
    .audio-glow { width: 130px; height: 130px; }
    .audio-btn .play-icon { width: 34px; height: 34px; }
    .audio-label { font-size: 1.1rem; }
    .question-text { font-size: 1.2rem; }
    .model-text { font-size: 1.1rem; }

    .completion-content { padding: 2rem 1.25rem; }
    .comp-title { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   V4 RESPONSIVE CLIP/SCROLL SAFETY PATCH
   Same principle as Definitions V4:
   shrink first, then scroll the real content area instead of clipping.
   This patch is intentionally last so it wins the cascade.
   ======================================== */
@media (min-width: 900px) {
    html,
    body,
    .app {
        height: 100dvh;
        overflow: hidden;
    }

    .main-content {
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-gutter: stable;
        overscroll-behavior: contain;
    }

    .board-grid,
    .panel-card,
    .expanded-panel,
    .all-questions-panel {
        min-height: 0;
    }

    .panel-card {
        max-height: calc(100dvh - 2rem);
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-gutter: stable;
    }

    .expanded-panel,
    .all-questions-overlay {
        overflow-y: auto;
    }

    .aq-list {
        min-height: 0;
        overflow-y: auto;
    }

    .audio-section,
    .text-section,
    .footer,
    .instruction-banner {
        flex-shrink: 0;
    }
}

/* Medium teacher-laptop/projector heights. */
@media (min-width: 900px) and (max-height: 1100px) {
    .header {
        padding-top: clamp(0.45rem, 0.75vh, 0.75rem);
        padding-bottom: clamp(0.45rem, 0.75vh, 0.75rem);
    }

    .instruction-banner {
        padding-top: clamp(0.45rem, 0.7vh, 0.75rem);
        padding-bottom: clamp(0.45rem, 0.7vh, 0.75rem);
    }

    .main-content {
        justify-content: flex-start;
        padding-top: clamp(0.75rem, 1.1vh, 1.25rem);
        padding-bottom: clamp(0.75rem, 1.1vh, 1.25rem);
    }

    .board-grid {
        gap: clamp(0.75rem, 1.2vw, 1.25rem);
    }

    .question-card {
        padding: clamp(1rem, 1.6vh, 1.35rem);
    }

    .card-number {
        font-size: clamp(4.25rem, 7.2vh, 6rem);
        line-height: 0.9;
    }

    .card-topic {
        font-size: clamp(1rem, 1.8vh, 1.25rem);
        line-height: 1.15;
    }

    .panel-card {
        max-width: min(1100px, 94vw);
    }

    .audio-section {
        padding-top: clamp(1.25rem, 2vh, 2rem);
        padding-bottom: clamp(1.25rem, 2vh, 2rem);
        gap: clamp(0.75rem, 1vh, 1.1rem);
    }

    .audio-btn {
        width: clamp(125px, 16vh, 165px);
        height: clamp(125px, 16vh, 165px);
    }

    .audio-glow {
        width: clamp(175px, 22vh, 230px);
        height: clamp(175px, 22vh, 230px);
    }

    .question-text {
        font-size: clamp(1.55rem, 3vh, 2.05rem);
        line-height: 1.3;
        padding: clamp(1rem, 1.6vh, 1.35rem) clamp(1.25rem, 2vw, 2rem);
    }

    .model-text {
        font-size: clamp(1.25rem, 2.35vh, 1.55rem);
        line-height: 1.35;
    }
}

@media (min-width: 900px) and (max-height: 820px) {
    .main-content {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .audio-section {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .audio-btn {
        width: 120px;
        height: 120px;
    }

    .audio-glow {
        width: 170px;
        height: 170px;
    }

    .question-text {
        font-size: 1.55rem;
    }
}

@media (min-width: 900px) and (max-height: 720px) {
    .card-number {
        font-size: 3.75rem;
    }

    .card-topic {
        font-size: 0.95rem;
    }

    .board-grid {
        gap: 0.65rem;
    }

    .audio-btn {
        width: 100px;
        height: 100px;
    }

    .audio-glow {
        width: 145px;
        height: 145px;
    }
}
