/* ========================================
   Phrasal Verbs Lab - Definitions Activity
   Travel & Navigation Theme
   Â© Cool English 2026
   VIBRANT & ANIMATED VERSION
   ======================================== */

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    
    /* Primary - Teal */
    --teal-50: #f0fdfa;
    --teal-100: #ccfbf1;
    --teal-200: #99f6e4;
    --teal-400: #2dd4bf;
    --teal-500: #14b8a6;
    --teal-600: #0d9488;
    --teal-700: #0f766e;
    
    /* Accent - Amber */
    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-200: #fde68a;
    --amber-300: #fcd34d;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --amber-600: #d97706;
    
    /* Success */
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    
    /* Fun accents */
    --sky-400: #38bdf8;
    --rose-400: #fb7185;
    --violet-400: #a78bfa;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.25);
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #e0f2fe 0%, #f0fdfa 50%, #fef3c7 100%);
    background-attachment: fixed;
    color: var(--slate-800);
}

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

/* Animated background shapes */
.app::before,
.app::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    z-index: 0;
    opacity: 0.5;
    pointer-events: none;
}

.app::before {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--teal-200), var(--sky-400));
    top: -100px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}

.app::after {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--amber-200), var(--amber-400));
    bottom: -50px;
    left: -50px;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.05); }
}

/* ========================================
   Header
   ======================================== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2.5rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 4px solid transparent;
    border-image: linear-gradient(90deg, #FF6B35, #F59E0B, #22C55E, #06B6D4, #8B5CF6, #EC4899) 1;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

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

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--slate-100), var(--slate-200));
    color: var(--slate-600);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--slate-200);
}

.back-btn:hover {
    background: linear-gradient(135deg, var(--teal-400), var(--teal-500));
    border-color: var(--teal-400);
    color: white;
    transform: translateX(-5px);
    box-shadow: var(--shadow-lg);
}

.logo {
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--amber-400), var(--amber-600));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-lg), 0 0 20px rgba(251, 191, 36, 0.3);
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: var(--shadow-lg), 0 0 20px rgba(251, 191, 36, 0.3); }
    50% { box-shadow: var(--shadow-lg), 0 0 35px rgba(251, 191, 36, 0.5); }
}

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

.main-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--slate-800);
}

.theme-badge {
    background: linear-gradient(135deg, var(--teal-500), var(--teal-600));
    color: white;
    font-size: 1.125rem;
    font-weight: 700;
    padding: 0.625rem 1.25rem;
    border-radius: 2rem;
    letter-spacing: 0.01em;
    box-shadow: var(--shadow-md), 0 0 15px rgba(20, 184, 166, 0.3);
    animation: badgePulse 4s ease-in-out infinite;
}

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

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

/* Progress */
.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 0.875rem 1.5rem;
    border-radius: 1.25rem;
    border: 2px solid var(--teal-200);
    box-shadow: var(--shadow-md);
}

.progress-dots {
    display: flex;
    gap: 0.5rem;
}

.progress-dot {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--slate-300);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
}

.progress-dot:hover {
    background: var(--slate-400);
    transform: scale(1.2);
}

.progress-dot.active {
    background: linear-gradient(135deg, var(--amber-400), var(--amber-500));
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.progress-dot.completed {
    background: linear-gradient(135deg, var(--emerald-400), var(--emerald-500));
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.progress-dot.completed:hover {
    transform: scale(1.2);
}

.progress-count {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--teal-600);
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    flex: 1;
    padding: 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    z-index: 5;
    min-height: 0;
    overflow: auto;
}

/* Card Container */
.card-container {
    flex: 1;
    display: flex;
    gap: 3rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 2rem;
    padding: 2rem;
    box-shadow: var(--shadow-xl), 0 0 40px rgba(20, 184, 166, 0.1);
    border: 3px solid var(--teal-200);
    animation: cardEnter 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 0;
    overflow: hidden;
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Image Section - MUCH BIGGER */
.image-section {
    flex: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.image-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 1.5rem;
    overflow: hidden;
    background: linear-gradient(135deg, var(--amber-100), var(--teal-100));
    border: 4px solid var(--amber-300);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-2xl), 0 0 30px rgba(251, 191, 36, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-height: 0;
}

.image-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.3) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.image-wrapper:hover::before {
    transform: translateX(100%);
}

.image-wrapper:hover {
    transform: scale(1.02);
    border-color: var(--teal-400);
    box-shadow: var(--shadow-2xl), 0 0 50px rgba(20, 184, 166, 0.3);
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content Section - Three Clear Containers */
.content-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
    padding: 0;
    min-height: 0;
    overflow: visible;
}

/* Word Box Container - HIGH CONTRAST */
.word-box {
    background: linear-gradient(135deg, #fff9e6 0%, #fff 100%);
    border-radius: 1.25rem;
    padding: 1.25rem 1.5rem;
    border: 4px solid var(--amber-500);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md), 0 0 15px rgba(245, 158, 11, 0.15);
}

.word-label {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: var(--amber-600);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.word-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
}

.word-hidden {
    display: flex;
    justify-content: center;
    width: 100%;
}

.reveal-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 1rem;
    font-size: 1.375rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg), 0 6px 20px rgba(217, 119, 6, 0.4);
    position: relative;
    overflow: hidden;
}

.reveal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.reveal-btn:hover::before {
    left: 100%;
}

.reveal-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: var(--shadow-xl), 0 10px 30px rgba(217, 119, 6, 0.5);
    background: linear-gradient(135deg, var(--amber-600), #c2410c);
}

.reveal-btn:active {
    transform: scale(1.02);
}

.word-revealed {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.word-revealed.visible {
    display: flex;
    animation: wordReveal 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.word-revealed-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

@keyframes wordReveal {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    50% {
        transform: translateY(-5px) scale(1.03);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Phrasal Verb - MASSIVE FOR CLASSROOM */
.phrasal-verb {
    font-size: 6.5rem;
    font-weight: 900;
    color: var(--slate-800);
    letter-spacing: -0.02em;
}

.audio-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-500), var(--teal-600));
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md), 0 0 15px rgba(20, 184, 166, 0.25);
    flex-shrink: 0;
}

.audio-btn svg {
    width: 2rem;
    height: 2rem;
}

.audio-btn:hover {
    background: linear-gradient(135deg, var(--teal-400), var(--teal-500));
    transform: scale(1.1);
    box-shadow: var(--shadow-lg), 0 0 25px rgba(20, 184, 166, 0.4);
}

.audio-btn.playing {
    animation: audioPulse 0.6s ease infinite;
}

@keyframes audioPulse {
    0%, 100% { transform: scale(1); box-shadow: var(--shadow-md), 0 0 15px rgba(20, 184, 166, 0.25); }
    50% { transform: scale(1.15); box-shadow: var(--shadow-lg), 0 0 30px rgba(20, 184, 166, 0.5); }
}

/* Verb Forms Chips */
.verb-forms {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.form-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 2px solid var(--teal-200);
    border-radius: 2rem;
    padding: 0.5rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.form-label {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--teal-600);
}

.form-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--slate-700);
}

/* Definition Box */
.definition-box {
    background: linear-gradient(135deg, #f0fdfa 0%, #fff 100%);
    border-radius: 1.25rem;
    padding: 1.5rem 2rem;
    border: 3px solid var(--teal-200);
    border-left: 6px solid var(--teal-500);
    transition: all 0.3s ease;
    position: relative;
    box-shadow: var(--shadow-md), 0 0 15px rgba(20, 184, 166, 0.1);
}

.definition-box:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-lg);
}

.definition-label {
    display: block;
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--teal-600);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.definition-text {
    font-size: 3.25rem;
    font-weight: 600;
    color: var(--slate-800);
    line-height: 1.25;
}

/* Example Box */
.example-box {
    background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
    border-radius: 1.25rem;
    padding: 1.25rem 1.75rem;
    border: 3px solid var(--amber-300);
    border-left: 6px solid var(--amber-500);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md), 0 0 12px rgba(245, 158, 11, 0.1);
}

.example-box.visible {
    opacity: 1;
    transform: translateY(0);
}

.example-label {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: var(--amber-600);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.375rem;
}

.example-text {
    font-size: 2.75rem;
    font-weight: 500;
    color: var(--slate-700);
    font-style: italic;
    line-height: 1.35;
}

/* Highlighted phrasal verb in example */
.example-text .highlight {
    color: var(--teal-700);
    font-weight: 700;
    font-style: normal;
    background: linear-gradient(135deg, #ccfbf1, #99f6e4);
    padding: 0.1em 0.35em;
    border-radius: 0.3em;
    border-bottom: 3px solid var(--teal-500);
    box-shadow: 0 2px 4px rgba(13, 148, 136, 0.2);
}

/* ========================================
   Navigation - LARGE BUTTONS for Teachers
   ======================================== */
.navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--teal-200);
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--teal-500), var(--teal-600));
    color: white;
    border: 3px solid var(--teal-600);
    padding: 1.25rem 2.5rem;
    border-radius: 1.25rem;
    font-size: 1.5rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg), 0 4px 15px rgba(20, 184, 166, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.nav-btn svg {
    width: 28px;
    height: 28px;
    stroke-width: 3;
}

.nav-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--teal-400), var(--teal-500));
    border-color: var(--teal-500);
    transform: scale(1.05);
    box-shadow: var(--shadow-xl), 0 6px 25px rgba(20, 184, 166, 0.4);
}

.nav-prev:hover:not(:disabled) {
    transform: scale(1.05) translateX(-5px);
}

.nav-next:hover:not(:disabled) {
    transform: scale(1.05) translateX(5px);
}

.nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: var(--slate-300);
    border-color: var(--slate-300);
    box-shadow: none;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    padding: 0.875rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--teal-200);
    text-align: center;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.footer p {
    font-size: 1.125rem;
    color: var(--slate-500);
    font-weight: 600;
}

/* ========================================
   Completion Overlay
   ======================================== */
.completion-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.completion-overlay.visible {
    display: flex;
    opacity: 1;
}

.completion-content {
    background: white;
    border-radius: 2rem;
    padding: 3rem 4rem;
    text-align: center;
    box-shadow: var(--shadow-2xl);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    max-width: 90%;
}

.completion-overlay.visible .completion-content {
    transform: scale(1);
    animation: completionBounceIn 0.5s ease;
}

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

.completion-emoji {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.completion-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--slate-800);
    margin-bottom: 1rem;
}

.completion-message {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--slate-600);
    margin-bottom: 2rem;
}

.completion-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.completion-buttons .retry-btn,
.completion-buttons .home-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.completion-buttons .retry-btn {
    background: linear-gradient(135deg, var(--amber-400), var(--amber-600));
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
}

.completion-buttons .retry-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.completion-buttons .home-btn {
    background: white;
    color: var(--slate-700);
    border: 3px solid var(--slate-300);
}

.completion-buttons .home-btn:hover {
    border-color: var(--teal-400);
    color: var(--teal-600);
    transform: scale(1.05);
}

/* ========================================
   Responsive Design
   ======================================== */

/* Height-based query for short viewports (teacher laptops 768p) */
/* 1280×800 / Nest Hub Max */
@media (max-height: 820px) {
    .header      { padding: 0.625rem 2rem; }
    .logo        { width: 3rem; height: 3rem; }
    .main-content { padding: 0.5rem 2rem; gap: 0.375rem; }
    /* Allow card-container to scroll rather than clip */
    .card-container { padding: 1.25rem; gap: 1.5rem; overflow: auto; }
    /* Anchor content to top */
    .content-section { gap: 0.625rem; justify-content: flex-start; overflow: visible; }
    .word-box    { padding: 0.5rem 1rem; }
    .word-label  { font-size: 0.75rem; margin-bottom: 0.125rem; }
    .word-content { min-height: 40px; gap: 0.375rem; }
    .phrasal-verb { font-size: 3.75rem; }
    .audio-btn   { width: 2.75rem; height: 2.75rem; }
    .audio-btn svg { width: 1.375rem; height: 1.375rem; }
    .verb-forms  { gap: 0.375rem; }
    .form-chip   { padding: 0.25rem 0.75rem; }
    .form-value  { font-size: 0.9rem; }
    .form-label  { font-size: 0.75rem; }
    .definition-box { padding: 0.625rem 1rem; }
    .definition-label { font-size: 0.75rem; margin-bottom: 0.125rem; }
    .definition-text { font-size: 1.875rem; line-height: 1.2; }
    .example-box { padding: 0.5rem 1rem; }
    .example-label { font-size: 0.625rem; margin-bottom: 0.125rem; }
    .example-text { font-size: 1.5rem; line-height: 1.3; }
    .navigation  { padding: 0.375rem 1.5rem; }
    .nav-btn     { padding: 0.75rem 1.75rem; font-size: 1.125rem; }
    .footer      { padding: 0.25rem; }
    .footer p    { font-size: 0.75rem; }
}

/* Very short viewports */
@media (max-height: 750px) {
    .header {
        padding: 0.625rem 2rem;
    }
    
    .main-content {
        padding: 0.75rem 2rem;
        gap: 0.5rem;
    }
    
    .card-container {
        padding: 1.25rem;
        gap: 2rem;
    }
    
    .content-section {
        gap: 1rem;
    }
    
    .word-box {
        padding: 0.75rem 1.25rem;
    }
    
    .word-content {
        min-height: 55px;
    }
    
    .phrasal-verb {
        font-size: 5rem;
    }
    
    .definition-box {
        padding: 0.875rem 1.5rem;
    }
    
    .definition-text {
        font-size: 2.5rem;
    }
    
    .example-box {
        padding: 0.75rem 1.25rem;
    }
    
    .example-text {
        font-size: 2rem;
    }
    
    .navigation {
        padding: 0.5rem 1.5rem;
    }
    
    .nav-btn {
        padding: 0.875rem 2rem;
        font-size: 1.25rem;
    }
    
    .footer {
        padding: 0.5rem;
    }
    
    .footer p {
        font-size: 0.875rem;
    }
}

@media (max-width: 1200px) {
    .card-container {
        gap: 2rem;
        padding: 1.5rem;
    }
    
    .phrasal-verb {
        font-size: 5.5rem;
    }
    
    .definition-text {
        font-size: 2.75rem;
    }
    
    .example-text {
        font-size: 2.25rem;
    }
    
    .image-wrapper {
        min-height: 350px;
    }
    
    .word-box {
        padding: 1rem 1.5rem;
    }
    
    .definition-box {
        padding: 1.25rem 1.75rem;
    }
    
    .audio-btn {
        width: 3.5rem;
        height: 3.5rem;
    }
}

@media (max-width: 1024px) {
    .main-content {
        padding: 1rem 1.5rem;
    }
    
    .card-container {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .image-section {
        flex: none;
    }
    
    .image-wrapper {
        max-height: 300px;
        min-height: 250px;
    }
    
    .content-section {
        gap: 1.25rem;
    }
    
    .word-box {
        padding: 0.875rem 1.25rem;
    }
    
    .word-label {
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
    }
    
    .word-content {
        min-height: 60px;
    }
    
    .phrasal-verb {
        font-size: 4.5rem;
    }
    
    .audio-btn {
        width: 3rem;
        height: 3rem;
    }
    
    .audio-btn svg {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    .definition-box {
        padding: 1rem 1.25rem;
    }
    
    .definition-label {
        font-size: 0.875rem;
    }
    
    .definition-text {
        font-size: 2.25rem;
    }
    
    .example-box {
        padding: 1rem 1.25rem;
    }
    
    .example-label {
        font-size: 0.75rem;
    }
    
    .example-text {
        font-size: 1.5rem;
    }
    
    .reveal-btn {
        font-size: 1.25rem;
        padding: 0.875rem 1.75rem;
    }
    
    .nav-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1.125rem;
    }
}

@media (max-width: 768px) {
    /* Unlock scroll for smaller screens */
    html, body {
        height: auto;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .app {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
        display: flex;
        flex-direction: column;
    }
    
    /* Header stays in ONE ROW */
    .header {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        flex-shrink: 0;
        position: sticky;
        top: 0;
    }
    
    .header-left {
        flex: 1;
        min-width: 0;
    }
    
    .header-right {
        flex-shrink: 0;
    }
    
    .back-btn {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 0.625rem;
    }
    
    .back-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .logo {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 0.625rem;
    }
    
    .logo svg {
        width: 20px;
        height: 20px;
    }
    
    .title-group {
        gap: 0.5rem;
    }
    
    .main-title {
        font-size: 1.25rem;
    }
    
    /* Hide theme badge on mobile */
    .theme-badge {
        display: none;
    }
    
    /* Simplified progress - just the count */
    .progress-container {
        padding: 0.5rem 1rem;
        border-radius: 2rem;
    }
    
    .progress-dots {
        display: none;
    }
    
    .progress-count {
        font-size: 1.25rem;
    }
    
    /* Main content - flex column, scrollable */
    .main-content {
        padding: 0.5rem;
        gap: 0.5rem;
        overflow-y: auto;
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
    
    /* Card scrolls internally - takes remaining space */
    .card-container {
        padding: 0.75rem;
        border-radius: 1rem;
        gap: 0.75rem;
        border-width: 2px;
        flex-direction: column;
        overflow-y: auto;
        flex: 1;
        min-height: 0;
    }
    
    .image-section {
        flex: 0 0 auto;
    }
    
    .image-wrapper {
        height: 150px;
        border-width: 3px;
        border-radius: 1rem;
    }
    
    .content-section {
        gap: 0.75rem;
        flex: 0 0 auto;
        overflow: visible;
    }
    
    /* Navigation - ALWAYS visible at bottom */
    .navigation {
        flex-shrink: 0;
        padding: 0.625rem 1rem;
        background: rgba(255, 255, 255, 0.98);
        border-top: 2px solid var(--teal-200);
        position: sticky;
        bottom: 0;
        z-index: 10;
    }
    
    .nav-btn {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        border-radius: 1rem;
        border-width: 2px;
        gap: 0.5rem;
    }
    
    .nav-btn svg {
        width: 22px;
        height: 22px;
    }
    
    .nav-btn span {
        display: inline;
    }
    
    /* Footer - stays at very bottom */
    .footer {
        flex-shrink: 0;
        padding: 0.375rem;
    }
    
    .footer p {
        font-size: 0.75rem;
    }
    
    /* Hide background decorations */
    .app::before,
    .app::after {
        display: none;
    }
    
    /* Word Box */
    .word-box {
        padding: 0.625rem 0.875rem;
        border-radius: 0.875rem;
        border-width: 3px;
    }
    
    .word-label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .word-content {
        min-height: 45px;
    }
    
    .reveal-btn {
        font-size: 1rem;
        padding: 0.5rem 1rem;
        border-radius: 0.75rem;
        gap: 0.5rem;
    }
    
    .reveal-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .phrasal-verb {
        font-size: 2rem;
    }
    
    .audio-btn {
        width: 2.25rem;
        height: 2.25rem;
    }
    
    .audio-btn svg {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .word-revealed {
        gap: 0.5rem;
    }
    
    /* Definition Box */
    .definition-box {
        padding: 0.625rem 0.875rem;
        border-radius: 0.875rem;
        border-width: 3px;
        border-left-width: 5px;
    }
    
    .definition-label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .definition-text {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    /* Example Box */
    .example-box {
        padding: 0.5rem 0.875rem;
        border-radius: 0.875rem;
        border-width: 3px;
        border-left-width: 5px;
    }
    
    .example-label {
        font-size: 0.625rem;
        margin-bottom: 0.25rem;
    }
    
    .example-text {
        font-size: 1.375rem;
    }
    
    /* Navigation - ALWAYS visible at bottom */
    .navigation {
        padding: 0.625rem 1rem;
        flex-shrink: 0;
        background: rgba(255, 255, 255, 0.95);
        border-top: 2px solid var(--teal-200);
        position: sticky;
        bottom: 0;
        z-index: 10;
    }
    
    .nav-btn {
        padding: 1rem 1.75rem;
        font-size: 1.125rem;
        border-radius: 1rem;
        border-width: 2px;
        gap: 0.5rem;
    }
    
    .nav-btn svg {
        width: 24px;
        height: 24px;
    }
    
    .nav-btn span {
        display: inline;
    }
    
    /* Footer */
    .footer {
        padding: 0.375rem;
        flex-shrink: 0;
    }
    
    .footer p {
        font-size: 0.75rem;
    }
    
    /* Hide background decorations */
    .app::before,
    .app::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }
    
    .back-btn {
        width: 2rem;
        height: 2rem;
    }
    
    .logo {
        width: 2rem;
        height: 2rem;
    }
    
    .main-title {
        font-size: 1rem;
    }
    
    .progress-container {
        padding: 0.25rem 0.625rem;
    }
    
    .progress-count {
        font-size: 1rem;
    }
    
    .main-content {
        padding: 0.375rem;
        gap: 0.25rem;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        flex: 1;
        min-height: 0;
    }
    
    .card-container {
        padding: 0.5rem;
        gap: 0.5rem;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }
    
    .image-wrapper {
        height: 120px;
    }
    
    .content-section {
        gap: 0.5rem;
    }
    
    .word-box {
        padding: 0.5rem 0.625rem;
        border-radius: 0.625rem;
    }
    
    .word-label {
        font-size: 0.625rem;
    }
    
    .word-content {
        min-height: 35px;
    }
    
    .reveal-btn {
        font-size: 0.875rem;
        padding: 0.4rem 0.875rem;
    }
    
    .phrasal-verb {
        font-size: 1.75rem;
    }
    
    .audio-btn {
        width: 2rem;
        height: 2rem;
    }
    
    .audio-btn svg {
        width: 1rem;
        height: 1rem;
    }
    
    .definition-box {
        padding: 0.5rem 0.625rem;
    }
    
    .definition-label {
        font-size: 0.625rem;
    }
    
    .definition-text {
        font-size: 1.125rem;
    }
    
    .example-box {
        padding: 0.375rem 0.625rem;
    }
    
    .example-label {
        font-size: 0.5rem;
    }
    
    .example-text {
        font-size: 1.125rem;
    }
    
    .navigation {
        padding: 0.5rem 0.75rem;
    }
    
    .nav-btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
        border-radius: 0.875rem;
    }
    
    .nav-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .nav-btn span {
        display: inline;
    }
    
    .footer {
        padding: 0.25rem;
    }
    
    .footer p {
        font-size: 0.625rem;
    }
}
/* ========================================
   V3 HYBRID FIX: Desktop height ladder + final cascade override
   Keep this block at the VERY END of definitions.css.

   Why:
   - The original 750px height rule accidentally made the layout larger.
   - Width queries below the height rules can re-enlarge text or switch to column layout.
   - This final block wins the cascade and uses a smooth height ladder for teacher laptops,
     projectors, browser zoom, and wide-but-short screens.
   ======================================== */

/* Tier 1: medium-height classroom/laptop viewports, including many 1440×900 / 1600×900 windows */
@media (min-width: 900px) and (max-height: 1100px) {
    html,
    body,
    .app {
        height: 100dvh;
        overflow: hidden;
    }

    .header {
        padding: clamp(0.6rem, 1vh, 0.8rem) 2rem;
    }

    .back-btn {
        width: clamp(2.75rem, 5vh, 3.25rem);
        height: clamp(2.75rem, 5vh, 3.25rem);
    }

    .logo {
        width: clamp(2.9rem, 5.4vh, 3.35rem);
        height: clamp(2.9rem, 5.4vh, 3.35rem);
    }

    .logo svg {
        width: clamp(1.35rem, 2.7vh, 1.65rem);
        height: clamp(1.35rem, 2.7vh, 1.65rem);
    }

    .main-title {
        font-size: clamp(2rem, 4.2vh, 2.5rem);
        line-height: 1;
    }

    .theme-badge {
        font-size: clamp(0.95rem, 1.9vh, 1.1rem);
        padding: 0.5rem 1.1rem;
    }

    .progress-container {
        padding: clamp(0.55rem, 1.1vh, 0.75rem) 1.15rem;
        gap: 0.7rem;
    }

    .progress-dots {
        gap: 0.4rem;
    }

    .progress-dot {
        width: clamp(1.05rem, 2.25vh, 1.35rem);
        height: clamp(1.05rem, 2.25vh, 1.35rem);
    }

    .progress-count {
        font-size: clamp(1.35rem, 2.8vh, 1.7rem);
        line-height: 1;
    }

    .main-content {
        flex: 1 1 auto;
        min-height: 0;
        padding: clamp(0.55rem, 1.1vh, 1rem) 2rem;
        gap: clamp(0.35rem, 0.8vh, 0.6rem);
        overflow: hidden;
    }

    .card-container {
        flex-direction: row;
        align-items: stretch;
        flex: 1 1 auto;
        min-height: 0;
        padding: clamp(0.9rem, 1.6vh, 1.25rem);
        gap: clamp(1.25rem, 2vw, 2rem);
        overflow: auto;
    }

    .image-section {
        flex: 1.12 1 0;
        min-width: 0;
        min-height: 0;
    }

    .image-wrapper {
        width: 100%;
        height: 100%;
        min-height: 0;
        max-height: none;
        border-width: 3px;
    }

    .content-section {
        flex: 1 1 0;
        min-width: 0;
        min-height: 0;
        justify-content: flex-start;
        gap: clamp(0.65rem, 1.2vh, 1rem);
        overflow: visible;
    }

    .word-box,
    .definition-box,
    .example-box {
        flex-shrink: 0;
    }

    .word-box {
        padding: clamp(0.65rem, 1.15vh, 0.9rem) 1.15rem;
        border-width: 3px;
    }

    .word-label {
        font-size: clamp(0.75rem, 1.45vh, 0.9rem);
        margin-bottom: 0.18rem;
        line-height: 1;
    }

    .word-content {
        min-height: 0;
        gap: clamp(0.3rem, 0.7vh, 0.5rem);
    }

    .word-revealed {
        gap: clamp(0.35rem, 0.75vh, 0.55rem);
    }

    .word-revealed-top {
        gap: clamp(0.6rem, 1.2vh, 0.9rem);
    }

    .phrasal-verb {
        font-size: clamp(4rem, 8vh, 5rem);
        line-height: 0.92;
        white-space: nowrap;
    }

    .audio-btn {
        width: clamp(2.6rem, 5.2vh, 3.25rem);
        height: clamp(2.6rem, 5.2vh, 3.25rem);
    }

    .audio-btn svg {
        width: clamp(1.25rem, 2.6vh, 1.6rem);
        height: clamp(1.25rem, 2.6vh, 1.6rem);
    }

    .verb-forms {
        gap: clamp(0.35rem, 0.75vh, 0.55rem);
    }

    .form-chip {
        padding: clamp(0.25rem, 0.55vh, 0.38rem) clamp(0.7rem, 1.4vh, 1rem);
        gap: 0.35rem;
    }

    .form-label {
        font-size: clamp(0.68rem, 1.3vh, 0.8rem);
    }

    .form-value {
        font-size: clamp(0.92rem, 1.8vh, 1.12rem);
    }

    .definition-box {
        padding: clamp(0.75rem, 1.25vh, 1rem) clamp(1rem, 1.7vh, 1.5rem);
        border-width: 2px;
        border-left-width: 5px;
    }

    .definition-label {
        font-size: clamp(0.75rem, 1.55vh, 1rem);
        margin-bottom: 0.2rem;
        line-height: 1;
    }

    .definition-text {
        font-size: clamp(2rem, 4vh, 2.5rem);
        line-height: 1.16;
    }

    .example-box {
        padding: clamp(0.6rem, 1.05vh, 0.9rem) clamp(1rem, 1.7vh, 1.5rem);
        border-width: 2px;
        border-left-width: 5px;
    }

    .example-label {
        font-size: clamp(0.65rem, 1.3vh, 0.85rem);
        margin-bottom: 0.15rem;
        line-height: 1;
    }

    .example-text {
        font-size: clamp(1.55rem, 3.2vh, 2rem);
        line-height: 1.24;
    }

    .example-text .highlight {
        padding: 0.05em 0.28em;
        border-bottom-width: 2px;
    }

    .navigation {
        position: relative;
        flex-shrink: 0;
        padding: clamp(0.35rem, 0.8vh, 0.55rem) 1.5rem;
    }

    .nav-btn {
        padding: clamp(0.65rem, 1.35vh, 1rem) clamp(1.4rem, 2.7vh, 2rem);
        font-size: clamp(1rem, 2.2vh, 1.25rem);
        border-radius: 1rem;
        border-width: 2px;
    }

    .nav-btn svg {
        width: clamp(1.15rem, 2.5vh, 1.45rem);
        height: clamp(1.15rem, 2.5vh, 1.45rem);
    }

    .footer {
        padding: clamp(0.15rem, 0.5vh, 0.5rem);
    }

    .footer p {
        font-size: clamp(0.65rem, 1.4vh, 0.875rem);
        line-height: 1.1;
    }
}

/* Tier 2: short laptops / projectors / 1366×768 class screens */
@media (min-width: 900px) and (max-height: 820px) {
    .main-content {
        padding-top: clamp(0.35rem, 0.8vh, 0.6rem);
        padding-bottom: clamp(0.35rem, 0.8vh, 0.6rem);
        gap: clamp(0.25rem, 0.6vh, 0.45rem);
    }

    .card-container {
        padding: clamp(0.7rem, 1.35vh, 1rem);
        gap: clamp(1rem, 1.7vw, 1.6rem);
    }

    .content-section {
        gap: clamp(0.45rem, 0.9vh, 0.7rem);
    }

    .word-box {
        padding: clamp(0.45rem, 0.9vh, 0.65rem) 1rem;
    }

    .phrasal-verb {
        font-size: clamp(3rem, 7.4vh, 4rem);
    }

    .audio-btn {
        width: clamp(2.3rem, 5.2vh, 2.8rem);
        height: clamp(2.3rem, 5.2vh, 2.8rem);
    }

    .form-chip {
        padding: clamp(0.18rem, 0.45vh, 0.3rem) clamp(0.58rem, 1.2vh, 0.85rem);
    }

    .form-value {
        font-size: clamp(0.82rem, 1.75vh, 1rem);
    }

    .form-label {
        font-size: clamp(0.62rem, 1.25vh, 0.75rem);
    }

    .definition-box {
        padding: clamp(0.55rem, 1vh, 0.75rem) clamp(0.85rem, 1.5vh, 1.25rem);
    }

    .definition-text {
        font-size: clamp(1.45rem, 4.3vh, 2rem);
        line-height: 1.14;
    }

    .example-box {
        padding: clamp(0.45rem, 0.85vh, 0.65rem) clamp(0.85rem, 1.5vh, 1.25rem);
    }

    .example-text {
        font-size: clamp(1.12rem, 3.4vh, 1.625rem);
        line-height: 1.22;
    }

    .navigation {
        padding-top: clamp(0.25rem, 0.65vh, 0.4rem);
        padding-bottom: clamp(0.25rem, 0.65vh, 0.4rem);
    }

    .nav-btn {
        padding-top: clamp(0.5rem, 1.25vh, 0.75rem);
        padding-bottom: clamp(0.5rem, 1.25vh, 0.75rem);
    }
}

/* Tier 3: very short viewports, browser zoom, split screens */
@media (min-width: 900px) and (max-height: 720px) {
    .header {
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }

    .logo {
        width: 2.55rem;
        height: 2.55rem;
    }

    .main-title {
        font-size: 2rem;
    }

    .theme-badge {
        font-size: 0.95rem;
        padding: 0.45rem 0.9rem;
    }

    .main-content {
        padding-top: 0.3rem;
        padding-bottom: 0.3rem;
    }

    .card-container {
        padding: 0.65rem;
        gap: 0.9rem;
    }

    .content-section {
        gap: 0.35rem;
    }

    .word-box {
        padding-top: 0.35rem;
        padding-bottom: 0.4rem;
    }

    .word-label,
    .definition-label,
    .example-label {
        margin-bottom: 0.1rem;
    }

    .phrasal-verb {
        font-size: clamp(2.25rem, 7vh, 3.25rem);
    }

    .definition-text {
        font-size: clamp(1.25rem, 4.1vh, 1.625rem);
    }

    .example-text {
        font-size: clamp(1rem, 3.25vh, 1.375rem);
    }

    .navigation {
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }

    .nav-btn {
        padding-top: 0.48rem;
        padding-bottom: 0.48rem;
        font-size: 1rem;
    }

    .footer {
        padding-top: 0.15rem;
        padding-bottom: 0.15rem;
    }

    .footer p {
        font-size: 0.7rem;
    }
}

/* Narrow-but-not-mobile: avoid forcing a squeezed two-column layout; allow natural page scrolling instead of clipping. */
@media (min-width: 769px) and (max-width: 899px) and (max-height: 1100px) {
    html,
    body {
        height: auto;
        min-height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .app {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

    .main-content {
        flex: 1 0 auto;
        min-height: auto;
        overflow: visible;
        padding: 0.75rem 1rem;
    }

    .card-container {
        flex: 0 0 auto;
        min-height: auto;
        overflow: visible;
    }

    .navigation {
        position: sticky;
        bottom: 0;
    }
}


/* ========================================
   V4 SCROLL SAFETY NET
   If any revealed content is still taller than the available card area,
   it must scroll instead of clipping behind the navigation.
   This 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: hidden;
    }

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

    .content-section {
        min-height: 0;
        justify-content: flex-start;
    }

    .word-box,
    .definition-box,
    .example-box {
        flex-shrink: 0;
    }
}

/* The teacher screenshot was 1665×1058 in responsive mode.
   Treat this as a classroom laptop/projector height, not a giant monitor. */
@media (min-width: 900px) and (min-height: 821px) and (max-height: 1100px) {
    .main-content {
        padding-top: clamp(0.45rem, 0.9vh, 0.85rem);
        padding-bottom: clamp(0.45rem, 0.9vh, 0.85rem);
        gap: clamp(0.25rem, 0.7vh, 0.55rem);
    }

    .card-container {
        padding: clamp(0.85rem, 1.45vh, 1.2rem);
        gap: clamp(1.1rem, 1.8vw, 1.9rem);
    }

    .content-section {
        gap: clamp(0.55rem, 1vh, 0.9rem);
    }

    .phrasal-verb {
        font-size: clamp(3.75rem, 7.2vh, 5rem);
        line-height: 0.92;
    }

    .definition-text {
        font-size: clamp(1.85rem, 3.8vh, 2.45rem);
        line-height: 1.15;
    }

    .example-text {
        font-size: clamp(1.4rem, 3vh, 1.95rem);
        line-height: 1.22;
    }

    .word-box {
        padding-top: clamp(0.55rem, 1vh, 0.85rem);
        padding-bottom: clamp(0.55rem, 1vh, 0.85rem);
    }

    .definition-box {
        padding-top: clamp(0.65rem, 1.1vh, 0.95rem);
        padding-bottom: clamp(0.65rem, 1.1vh, 0.95rem);
    }

    .example-box {
        padding-top: clamp(0.5rem, 0.9vh, 0.8rem);
        padding-bottom: clamp(0.5rem, 0.9vh, 0.8rem);
    }

    .navigation {
        padding-top: clamp(0.3rem, 0.7vh, 0.5rem);
        padding-bottom: clamp(0.3rem, 0.7vh, 0.5rem);
    }

    .nav-btn {
        padding-top: clamp(0.65rem, 1.2vh, 0.9rem);
        padding-bottom: clamp(0.65rem, 1.2vh, 0.9rem);
    }
}
