/* ========================================
   Phrasal Verbs Lab — Name That Verb
   Set 3: Travel & Navigation
   © Cool English 2026
   Theme: Deep Navy + Teal accents
   Grid layout, classroom projection ready
   ======================================== */

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

:root {
    --teal-300: #5eead4;
    --teal-400: #2dd4bf;
    --teal-500: #14b8a6;
    --teal-600: #0d9488;
    --teal-700: #0f766e;
    --teal-800: #115e59;
    --teal-900: #134e4a;

    --cyan-400: #22d3ee;
    --cyan-500: #06b6d4;
    --cyan-600: #0891b2;

    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;

    --amber-400: #fbbf24;
    --amber-500: #f59e0b;

    --rose-400: #fb7185;
    --rose-500: #f43f5e;

    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;

    --neon-teal: #00ffcc;
    --neon-cyan: #00e5ff;
    --neon-orange: #ff8c42;
}

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

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #071a28 0%, #0a2540 30%, #0c2030 60%, #071628 100%);
    background-attachment: fixed;
    color: #f1f5f9;
}

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


/* ========================================
   Floating Animated Shapes
   ======================================== */
.floating-shapes {
    position: fixed; inset: 0;
    z-index: 0; pointer-events: none; overflow: hidden;
}
.shape { position: absolute; border-radius: 50%; opacity: 0.10; filter: blur(1px); }
.shape-1 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, var(--neon-cyan), transparent 70%);
    top: -60px; right: -40px;
    animation: floatA 14s ease-in-out infinite;
}
.shape-2 {
    width: 200px; height: 200px;
    background: radial-gradient(circle, var(--teal-400), transparent 70%);
    bottom: 60px; left: -30px;
    border-radius: 30%; transform: rotate(45deg);
    animation: floatB 18s ease-in-out infinite;
}
.shape-3 {
    width: 120px; height: 120px;
    background: radial-gradient(circle, var(--amber-400), transparent 70%);
    top: 35%; left: 5%;
    animation: floatC 11s ease-in-out infinite;
}
.shape-4 {
    width: 180px; height: 180px;
    border: 3px solid var(--teal-500);
    top: 8%; left: 40%; opacity: 0.07;
    animation: floatD 16s ease-in-out infinite;
}
.shape-5 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, var(--cyan-500), transparent 70%);
    top: 25%; right: -80px; opacity: 0.07;
    animation: floatA 20s ease-in-out infinite reverse;
}
.shape-6 {
    width: 80px; height: 80px;
    background: radial-gradient(circle, var(--neon-orange), transparent 70%);
    bottom: 20%; right: 12%;
    animation: floatC 13s ease-in-out infinite reverse;
}
.shape-7 {
    width: 160px; height: 160px;
    background: radial-gradient(circle, var(--teal-300), transparent 65%);
    top: 5%; left: 10%; border-radius: 40% 60% 50% 70%; opacity: 0.06;
    animation: floatB 15s ease-in-out infinite;
}
.shape-8 {
    width: 260px; height: 260px;
    border: 2px solid var(--neon-cyan);
    bottom: -40px; left: 35%; opacity: 0.05;
    animation: floatD 22s ease-in-out infinite reverse;
}
@keyframes floatA {
    0%, 100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(25px,-30px) scale(1.05); }
    66% { transform: translate(-15px,15px) scale(0.97); }
}
@keyframes floatB {
    0%, 100% { transform: rotate(45deg) translate(0,0); }
    50% { transform: rotate(55deg) translate(30px,-25px) scale(1.08); }
}
@keyframes floatC {
    0%, 100% { transform: translate(0,0); }
    50% { transform: translate(-20px,25px) scale(1.1); }
}
@keyframes floatD {
    0%, 100% { transform: translate(0,0) rotate(0deg); }
    50% { transform: translate(20px,-15px) rotate(45deg) scale(1.05); }
}


/* ========================================
   Header
   ======================================== */
.header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.6rem 1.75rem;
    background: rgba(7, 26, 40, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, #FF6B35, #F59E0B, #22C55E, #06B6D4, #8B5CF6, #EC4899) 1;
    position: relative; z-index: 50;
}

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

.back-btn {
    display: flex; align-items: center; justify-content: center;
    width: 3rem; height: 3rem; border-radius: 0.75rem;
    background: rgba(255,255,255,0.08); color: var(--teal-300);
    text-decoration: none; transition: all 0.2s ease;
    border: 2px solid rgba(255,255,255,0.1);
}
.back-btn:hover { background: var(--teal-600); color: white; border-color: var(--teal-500); }
.back-btn svg { width: 26px; height: 26px; }

.logo {
    display: flex; align-items: center; justify-content: center;
    width: 3.25rem; height: 3.25rem; border-radius: 0.875rem;
    background: linear-gradient(135deg, var(--neon-cyan), var(--teal-500));
    color: white;
    box-shadow: 0 4px 18px rgba(0,229,255,0.25);
}
.logo svg { width: 26px; height: 26px; }

.title-group { display: flex; flex-direction: column; }
.main-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem; font-weight: 800;
    color: white; line-height: 1.1;
}
.theme-badge {
    font-size: 0.95rem; font-weight: 700;
    color: var(--teal-400); letter-spacing: 0.03em;
}

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

.progress-pill {
    display: flex; align-items: center; gap: 0.5rem;
    background: linear-gradient(135deg, var(--teal-600), var(--teal-800));
    color: white; padding: 0.5rem 1.25rem; border-radius: 2rem;
    border: 2px solid var(--teal-400);
    box-shadow: 0 4px 20px rgba(13,148,136,0.35);
}
.progress-count { font-family: 'Poppins', sans-serif; font-size: 1.3rem; font-weight: 800; }
.progress-label { font-size: 0.9rem; font-weight: 600; opacity: 0.8; }

.reset-btn {
    display: flex; align-items: center; gap: 0.5rem;
    background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.15);
    color: var(--teal-300); padding: 0.6rem 1.25rem; border-radius: 0.75rem;
    font-family: 'Poppins', sans-serif; font-size: 1rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s ease;
}
.reset-btn:hover { background: var(--rose-500); color: white; border-color: var(--rose-500); }
.reset-btn span { display: inline; }

.see-results-btn {
    display: none; align-items: center; gap: 0.5rem;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: 2px solid rgba(255,255,255,0.3);
    color: white; padding: 0.6rem 1.25rem; border-radius: 0.75rem;
    font-family: 'Poppins', sans-serif; font-size: 1rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(37,99,235,0.4), 0 0 0 4px rgba(37,99,235,0.2);
    animation: pulse-results 2s ease-in-out infinite;
}
.see-results-btn:hover { transform: scale(1.05); }
.see-results-btn span { display: inline; }

@keyframes pulse-results {
    0%, 100% { box-shadow: 0 4px 16px rgba(37,99,235,0.4), 0 0 0 4px rgba(37,99,235,0.2); }
    50%       { box-shadow: 0 4px 20px rgba(37,99,235,0.6), 0 0 0 8px rgba(37,99,235,0.0); }
}


/* ========================================
   Main Content Layout
   ======================================== */
.main-content {
    flex: 1; display: flex; flex-direction: column;
    position: relative; z-index: 1;
    overflow: hidden; min-height: 0;
}

.content-zone {
    flex: 1; display: flex; flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.25rem 0;
}

.board-area {
    flex-shrink: 0;
    padding: 0 2.5rem;
    display: flex; justify-content: center;
}


/* ========================================
   Game Board — 10 tiles, 5×2 grid
   ======================================== */
.board-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.75rem;
    width: 100%;
    max-width: 1400px;
}

.tile {
    aspect-ratio: 1.25;
    border-radius: 1.25rem;
    cursor: pointer; position: relative;
    perspective: 1000px; min-height: 0;
}

.tile-inner {
    width: 100%; height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 1.25rem;
}
.tile.flipped .tile-inner { transform: rotateY(180deg); }

.tile-front, .tile-back {
    position: absolute; inset: 0;
    border-radius: 1.25rem;
    display: flex; align-items: center; justify-content: center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
}

.tile-front {
    color: white;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
    border: 3px solid rgba(255,255,255,0.25);
    transition: all 0.25s ease;
}
.tile:not(.flipped):not(.completed):hover .tile-front {
    transform: translateY(-4px);
    box-shadow: 0 16px 45px rgba(0,0,0,0.35), 0 0 30px rgba(20,184,166,0.2);
    border-color: rgba(255,255,255,0.5);
}
.tile:not(.flipped):not(.completed):active .tile-front {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.tile-front::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,0.2) 45%, rgba(255,255,255,0.05) 55%, transparent 75%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}
.tile:not(.flipped):not(.completed):hover .tile-front::after { transform: translateX(100%); }

.tile-number {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(3.5rem, 6.5vw, 6rem);
    font-weight: 900; line-height: 1;
    text-shadow: 0 4px 12px rgba(0,0,0,0.3);
    position: relative; z-index: 2;
    transition: transform 0.3s ease;
}
.tile:not(.flipped):not(.completed):hover .tile-number { transform: scale(1.1); }

.tile-back {
    transform: rotateY(180deg);
    background: linear-gradient(145deg, #071a28, #0a2030);
    border: 3px solid var(--teal-600);
    flex-direction: column; gap: 0.4rem;
    box-shadow: 0 8px 30px rgba(13,148,136,0.3);
}
.tile-back-icon { font-size: clamp(2rem, 4vw, 3.5rem); }
.tile-back-label {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(0.75rem, 1.2vw, 1.1rem);
    font-weight: 800; color: var(--teal-300);
    text-transform: uppercase; letter-spacing: 0.08em;
}

/* Active glow */
.tile.active .tile-back {
    border-color: var(--neon-cyan);
    animation: tileGlow 1.5s ease-in-out infinite;
}
@keyframes tileGlow {
    0%, 100% { box-shadow: 0 8px 30px rgba(13,148,136,0.3); }
    50% { box-shadow: 0 8px 40px rgba(0,229,255,0.5), 0 0 25px rgba(0,229,255,0.2); }
}

/* Completed */
.tile.completed .tile-back {
    background: linear-gradient(145deg, #064e3b, #059669);
    border-color: var(--emerald-400);
    animation: none;
    box-shadow: 0 6px 25px rgba(16,185,129,0.3);
}
.tile.completed .tile-back-label { color: #a7f3d0; }
.tile.completed { cursor: pointer; }

/* 10 vivid tile colors */
.tile[data-index="0"] .tile-front { background: linear-gradient(145deg, #ef4444, #b91c1c); }
.tile[data-index="1"] .tile-front { background: linear-gradient(145deg, #8b5cf6, #5b21b6); }
.tile[data-index="2"] .tile-front { background: linear-gradient(145deg, #f97316, #c2410c); }
.tile[data-index="3"] .tile-front { background: linear-gradient(145deg, #14b8a6, #0f766e); }
.tile[data-index="4"] .tile-front { background: linear-gradient(145deg, #3b82f6, #1d4ed8); }
.tile[data-index="5"] .tile-front { background: linear-gradient(145deg, #ec4899, #be185d); }
.tile[data-index="6"] .tile-front { background: linear-gradient(145deg, #6366f1, #3730a3); }
.tile[data-index="7"] .tile-front { background: linear-gradient(145deg, #eab308, #a16207); }
.tile[data-index="8"] .tile-front { background: linear-gradient(145deg, #06b6d4, #0e7490); }
.tile[data-index="9"] .tile-front { background: linear-gradient(145deg, #22c55e, #15803d); }


/* ========================================
   Definition Area
   ======================================== */
.definition-area {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 0 2.5rem;
    gap: 0.875rem;
}

.def-empty {
    display: flex; align-items: center; gap: 1rem;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(8px);
    padding: 1.25rem 2.5rem; border-radius: 1.25rem;
    border: 2px dashed rgba(255,255,255,0.15);
}
.def-empty-icon { font-size: 2.25rem; }
.def-empty-text {
    font-family: 'Nunito', sans-serif;
    font-size: 1.6rem; font-weight: 700;
    color: var(--teal-300);
}

.def-active {
    display: none; flex-direction: column;
    align-items: center; gap: 1rem;
    width: 100%; max-width: 1100px;
}
.def-active.visible { display: flex; }

.def-controls { display: flex; gap: 0.875rem; flex-wrap: wrap; justify-content: center; }

.def-btn {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.85rem 1.75rem; border-radius: 0.875rem; border: none;
    font-family: 'Poppins', sans-serif; font-size: 1.2rem; font-weight: 700;
    cursor: pointer; transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.def-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.def-btn:active { transform: translateY(0); }

.listen-btn {
    background: linear-gradient(135deg, var(--teal-600), var(--teal-800));
    color: white; border: 2px solid var(--teal-400);
}
.listen-btn:hover { box-shadow: 0 10px 30px rgba(13,148,136,0.4); }
.listen-btn.playing { animation: pulseBtn 1s ease-in-out infinite; }
@keyframes pulseBtn {
    0%, 100% { box-shadow: 0 4px 20px rgba(13,148,136,0.3); }
    50% { box-shadow: 0 4px 35px rgba(0,229,255,0.6); border-color: var(--neon-cyan); }
}

.show-def-btn {
    background: linear-gradient(135deg, var(--cyan-500), var(--cyan-600));
    color: white; border: 2px solid var(--cyan-400);
}
.show-def-btn:hover { box-shadow: 0 10px 30px rgba(6,182,212,0.4); }
.show-def-btn.revealed {
    background: linear-gradient(135deg, var(--slate-600), var(--slate-700));
    border-color: var(--slate-500);
}

.reveal-btn {
    background: linear-gradient(135deg, var(--neon-orange), #e85d2a);
    color: white; border: 2px solid rgba(255,140,66,0.5);
}
.reveal-btn:hover { box-shadow: 0 10px 30px rgba(255,140,66,0.4); }
.reveal-btn.revealed {
    background: linear-gradient(135deg, var(--emerald-500), var(--emerald-600));
    border-color: var(--emerald-400);
    pointer-events: none;
}

.def-text-container {
    width: 100%; text-align: center;
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}
.def-text-container.visible { max-height: 150px; opacity: 1; }

.def-text {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(1.75rem, 3vw, 2.75rem); font-weight: 700;
    color: white;
    background: rgba(255,255,255,0.07); backdrop-filter: blur(8px);
    padding: 0.875rem 2.5rem; border-radius: 1.25rem;
    border: 2px solid rgba(255,255,255,0.12);
    display: inline-block; text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.answer-container {
    width: 100%; text-align: center;
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
}
.answer-container.visible { max-height: 320px; opacity: 1; }

.answer-card {
    display: inline-block;
    background: rgba(13,148,136,0.1);
    border: 2px solid rgba(45,212,191,0.35);
    border-radius: 1.5rem;
    padding: 1.25rem 3rem 1.5rem;
    box-shadow: 0 0 40px rgba(13,148,136,0.12), inset 0 1px 0 rgba(255,255,255,0.06);
}

.answer-verb {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(3.5rem, 7vw, 6rem); font-weight: 900;
    color: #ffffff;
    text-transform: uppercase; letter-spacing: 0.06em;
    text-shadow:
        0 0 40px rgba(45,212,191,0.5),
        0 2px 0 rgba(0,0,0,0.5),
        0 4px 16px rgba(0,0,0,0.6);
    animation: answerPop 0.5s cubic-bezier(0.34,1.56,0.64,1);
    line-height: 1.1;
}
@keyframes answerPop {
    0% { transform: scale(0.3); opacity: 0; }
    60% { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}

.answer-example {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(1.5rem, 2.5vw, 2.25rem); font-weight: 700;
    color: var(--teal-200, #99f6e4); margin-top: 0.5rem;
}
.answer-example .highlight {
    color: var(--neon-cyan); font-weight: 800;
    text-decoration: underline;
    text-decoration-color: rgba(0,229,255,0.4);
    text-underline-offset: 4px;
}


/* ========================================
   Teams Section
   ======================================== */
.teams-section {
    background: rgba(7, 26, 40, 0.95);
    backdrop-filter: blur(10px);
    border-top: 2px solid rgba(13,148,136,0.25);
    padding: 0.75rem 2rem 0.875rem;
    position: relative; z-index: 10; flex-shrink: 0;
}
.teams-inner { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.teams-left { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.teams-header { display: flex; align-items: center; }
.teams-title {
    display: flex; align-items: center; gap: 0.5rem;
    font-family: 'Poppins', sans-serif; font-size: 1.2rem; font-weight: 700;
    color: var(--teal-300);
}
.teams-title svg { color: var(--teal-400); }

.add-team-btn {
    display: flex; align-items: center; gap: 0.5rem;
    background: linear-gradient(135deg, var(--teal-600), var(--teal-800));
    color: white; border: 2px solid var(--teal-400);
    padding: 0.7rem 1.4rem; border-radius: 0.75rem;
    font-family: 'Poppins', sans-serif; font-size: 1.05rem; font-weight: 700;
    cursor: pointer; transition: all 0.3s ease; flex-shrink: 0;
}
.add-team-btn:hover { transform: scale(1.05); box-shadow: 0 8px 25px rgba(13,148,136,0.4); }

.teams-grid { display: flex; gap: 1rem; flex-wrap: wrap; }

.team-card {
    background: rgba(255,255,255,0.06); border-radius: 0.875rem;
    padding: 0.75rem 1rem 1rem; min-width: 190px;
    position: relative; border: 2px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); backdrop-filter: blur(8px);
}
.team-card::before {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: var(--team-color);
    border-radius: 0.875rem 0.875rem 0 0;
}
.team-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.625rem; }
.team-name-section { display: flex; align-items: center; gap: 0.5rem; }
.team-color-dot { width: 0.75rem; height: 0.75rem; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
.team-name { font-family: 'Poppins', sans-serif; font-size: 1.2rem; font-weight: 700; color: white; }

.delete-team-btn {
    background: transparent; border: none;
    color: var(--slate-400); cursor: pointer;
    padding: 0.25rem; transition: all 0.2s ease;
    border-radius: 0.25rem; line-height: 0;
}
.delete-team-btn:hover { color: var(--rose-500); background: rgba(244,63,94,0.15); }

.team-score-section { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.score-btn {
    width: 2.75rem; height: 2.75rem; border-radius: 0.5rem;
    border: none; font-size: 1.5rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s ease;
    display: flex; align-items: center; justify-content: center; line-height: 1;
}
.score-btn.minus { background: rgba(244,63,94,0.15); color: var(--rose-400); }
.score-btn.minus:hover { background: var(--rose-500); color: white; transform: scale(1.1); }
.score-btn.plus { background: rgba(16,185,129,0.15); color: var(--emerald-400); }
.score-btn.plus:hover { background: var(--emerald-500); color: white; transform: scale(1.1); }

.team-score {
    display: flex; align-items: baseline; gap: 0.25rem;
    background: rgba(255,255,255,0.06);
    padding: 0.5rem 1.1rem; border-radius: 0.5rem;
    font-family: 'Poppins', sans-serif; font-size: 2.1rem; font-weight: 900;
    color: white; min-width: 5.5rem; justify-content: center;
    border: 1px solid rgba(255,255,255,0.08);
}
.team-score span { font-size: 1rem; font-weight: 600; color: var(--teal-300); margin-left: 0.3rem; }


/* ========================================
   Completion Overlay
   ======================================== */
.completion-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(12px);
    display: flex; align-items: center; justify-content: center; padding: 2rem;
    opacity: 0; visibility: hidden; transition: all 0.4s ease;
}
.completion-overlay.visible { opacity: 1; visibility: visible; }

.completion-content {
    background: linear-gradient(145deg, #071a28, #0a2540);
    border: 2px solid var(--teal-400);
    border-radius: 2rem; padding: 3rem 4rem;
    text-align: center; max-width: 580px; width: 100%;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5), 0 0 60px rgba(13,148,136,0.15);
    animation: completionPop 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes completionPop {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.completion-emoji { font-size: 4.5rem; margin-bottom: 0.75rem; }
.completion-title {
    font-family: 'Poppins', sans-serif; font-size: 2.5rem; font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 25px rgba(0,229,255,0.6), 0 2px 8px rgba(0,0,0,0.4);
    margin-bottom: 0.5rem;
}
.completion-message {
    font-family: 'Nunito', sans-serif; font-size: 1.35rem; font-weight: 600;
    color: var(--teal-300); margin-bottom: 1.5rem;
}
.final-scores { margin-bottom: 1.5rem; }
.final-score-item {
    display: flex; align-items: center; justify-content: center; gap: 0.75rem;
    padding: 0.5rem 0;
}
.final-score-dot { width: 0.875rem; height: 0.875rem; border-radius: 50%; }
.final-score-name { font-family: 'Poppins', sans-serif; font-size: 1.3rem; font-weight: 700; color: white; }
.final-score-pts { font-family: 'Poppins', sans-serif; font-size: 1.3rem; font-weight: 900; color: var(--neon-cyan); }

.completion-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.completion-buttons button,
.completion-buttons a {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 1rem 2.25rem; border-radius: 1rem;
    font-family: 'Poppins', sans-serif; font-size: 1.15rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s ease;
    text-decoration: none; border: none;
}
.retry-btn {
    background: linear-gradient(135deg, var(--teal-600), var(--teal-800));
    color: white; border: 2px solid var(--teal-400) !important;
    box-shadow: 0 6px 25px rgba(13,148,136,0.35);
}
.retry-btn:hover { transform: scale(1.05); box-shadow: 0 10px 35px rgba(13,148,136,0.5); }
.home-btn {
    background: rgba(255,255,255,0.08); color: var(--teal-200, #99f6e4);
    border: 2px solid rgba(255,255,255,0.15) !important;
}
.home-btn:hover { background: rgba(255,255,255,0.15); transform: scale(1.05); }


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


/* ========================================
   All Verbs Overlay
   ======================================== */
.all-verbs-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75); backdrop-filter: blur(12px);
    opacity: 0; pointer-events: none;
    display: flex; align-items: center; justify-content: center;
    z-index: 2000; padding: 1rem;
    transition: opacity 0.3s ease;
}
.all-verbs-overlay.visible { opacity: 1; pointer-events: all; }

.all-verbs-panel {
    background: #0a1a1f;
    border: 1.5px solid rgba(45,212,191,0.25);
    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.7);
    transform: translateY(30px);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.all-verbs-overlay.visible .all-verbs-panel { transform: translateY(0); }

.av-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;
}

.av-title {
    display: flex; align-items: center; gap: 0.75rem;
    font-family: 'Poppins', sans-serif;
    font-size: 2rem; font-weight: 800; color: white;
}
.av-title svg { color: var(--teal-400); flex-shrink: 0; }

.av-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.6); cursor: pointer; transition: all 0.2s ease;
}
.av-close-btn:hover { background: rgba(255,255,255,0.15); color: white; border-color: rgba(255,255,255,0.35); }

.av-list {
    display: flex; gap: 1.5rem;
    padding: 1.75rem 2.5rem 2.5rem;
    overflow-y: auto; flex: 1;
}
.av-list::-webkit-scrollbar { width: 6px; }
.av-list::-webkit-scrollbar-track { background: transparent; }
.av-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.av-column { flex: 1; display: flex; flex-direction: column; gap: 0.875rem; min-width: 0; }

.av-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, background 0.2s ease;
    cursor: pointer;
}
.av-item:hover { border-color: rgba(45,212,191,0.3); background: rgba(255,255,255,0.07); }
.av-item.def-open { border-color: rgba(45,212,191,0.5); }

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

.av-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.35);
}

.av-definition-preview {
    flex: 1;
    font-family: 'Nunito', sans-serif;
    font-size: 1.6rem; font-weight: 700;
    color: rgba(255,255,255,0.88); line-height: 1.35;
}

.av-reveal-hint {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem; font-weight: 700;
    color: rgba(255,255,255,0.3); white-space: nowrap;
    transition: color 0.2s ease;
}
.av-item:hover .av-reveal-hint { color: rgba(255,255,255,0.6); }
.av-item.def-open .av-reveal-hint { display: none; }

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

.av-verb-reveal {
    display: flex; align-items: center; justify-content: center;
    padding: 1rem 1.5rem;
    background: rgba(45,212,191,0.1);
    border-radius: 0.875rem;
    border: 1.5px solid rgba(45,212,191,0.25);
}

.av-verb-word {
    font-family: 'Poppins', sans-serif;
    font-size: 2.25rem; font-weight: 900;
    color: var(--teal-300);
    letter-spacing: 0.02em;
    text-shadow: 0 0 20px rgba(45,212,191,0.4);
}

.av-num-1  { background: linear-gradient(135deg, #ef4444, #dc2626); }
.av-num-2  { background: linear-gradient(135deg, #22c55e, #16a34a); }
.av-num-3  { background: linear-gradient(135deg, #f97316, #ea580c); }
.av-num-4  { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.av-num-5  { background: linear-gradient(135deg, #818cf8, #6366f1); }
.av-num-6  { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.av-num-7  { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.av-num-8  { background: linear-gradient(135deg, #f59e0b, #d97706); }
.av-num-9  { background: linear-gradient(135deg, #2dd4bf, #14b8a6); }
.av-num-10 { background: linear-gradient(135deg, #4ade80, #22c55e); }

@media (max-width: 900px) {
    .av-list { flex-direction: column; }
    .all-verbs-panel { border-radius: 1.25rem; max-height: 92vh; }
    .av-header { padding: 1rem 1.25rem; }
    .av-title { font-size: 1.375rem; }
    .av-list { padding: 1rem 1rem 1.5rem; }
    .av-question-row { flex-wrap: wrap; gap: 0.75rem; padding: 1rem 1.25rem; }
    .av-definition-preview { font-size: 1.2rem; flex-basis: calc(100% - 4.5rem); }
    .av-reveal-hint { flex-basis: 100%; padding-left: calc(3.25rem + 0.75rem); font-size: 0.85rem; }
    .av-verb-word { font-size: 1.75rem; }
}


/* ========================================
   Responsive — Tablet
   ======================================== */
@media (max-width: 1024px) {
    .board-grid { gap: 0.75rem; max-width: 1000px; }
    .tile-number { font-size: clamp(2.5rem, 5vw, 4rem); }
    .def-btn { padding: 0.7rem 1.3rem; font-size: 1.05rem; }
}

/* ========================================
   Responsive — Mobile
   Unlock scroll, compact layout
   ======================================== */
@media (max-width: 768px) {

    /* Unlock scroll for mobile */
    html, body { height: auto; overflow-y: auto; }
    .app { height: auto; min-height: 100dvh; overflow: visible; }
    .main-content { overflow: visible; }
    .content-zone { gap: 0.75rem; padding: 0.5rem 0; flex: unset; }

    /* --- Header compact --- */
    .header { padding: 0.35rem 0.6rem; gap: 0.4rem; }
    .header-left { gap: 0.5rem; }
    .header-right { gap: 0.5rem; }
    .back-btn { width: 2.2rem; height: 2.2rem; border-radius: 0.5rem; }
    .back-btn svg { width: 18px; height: 18px; }
    .logo { display: none; }
    .main-title { font-size: 1rem; white-space: nowrap; }
    .theme-badge { display: none; }
    .progress-pill { padding: 0.3rem 0.75rem; gap: 0.35rem; border-radius: 1.25rem; }
    .progress-count { font-size: 1rem; }
    .progress-label { display: none; }
    .reset-btn { padding: 0.4rem 0.5rem; border-width: 0; background: transparent; }
    .reset-btn span { display: none; }
    .see-results-btn span { display: none; }
    .view-all-verbs-btn span { display: none; }
    .view-all-verbs-btn { padding: 0.5rem; }

    /* --- Board --- */
    .board-area { margin-top: 0; padding: 0.75rem 0.6rem 0.25rem; }
    .board-grid { gap: 0.45rem; }
    .tile { aspect-ratio: 1.15; }
    .tile-front, .tile-back { border-radius: 0.75rem; border-width: 2px; }
    .tile-inner { border-radius: 0.75rem; }
    .tile-number { font-size: 2.25rem; }
    .tile-back-icon { font-size: 1.5rem; }
    .tile-back-label { font-size: 0.65rem; }

    /* --- Definition area --- */
    .definition-area { padding: 0.25rem 0.6rem; margin-bottom: 0; }
    .def-empty { padding: 0.6rem 1rem; }
    .def-empty-icon { font-size: 1.5rem; }
    .def-empty-text { font-size: 1rem; }
    .def-controls { gap: 0.5rem; }
    .def-btn { padding: 0.55rem 0.9rem; font-size: 0.9rem; }
    .listen-btn span { display: none; }
    .listen-btn { padding: 0.55rem 0.9rem; }
    .show-def-btn { padding: 0.55rem 1rem; font-size: 0.88rem; font-weight: 700; }
    .reveal-btn { padding: 0.55rem 1rem; font-size: 0.88rem; font-weight: 700; }
    .def-text { font-size: 1.1rem; padding: 0.5rem 1rem; }
    .answer-verb { font-size: 2.75rem; }
    .answer-example { font-size: 1rem; }

    /* --- Teams: compact strip --- */
    .teams-section { padding: 0.45rem 0.75rem 0.5rem; margin-top: 0; }
    .teams-inner { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
    .teams-left { flex-direction: row; align-items: center; gap: 0.5rem; flex-wrap: wrap; flex: 1; }
    .teams-title { font-size: 0.9rem; }
    .teams-title svg { width: 14px; height: 14px; }
    .teams-grid { gap: 0.4rem; flex-wrap: nowrap; overflow-x: auto; }
    .team-card { min-width: unset; padding: 0.4rem 0.6rem 0.5rem; border-radius: 0.625rem; }
    .team-card-header { margin-bottom: 0.3rem; }
    .team-color-dot { width: 0.55rem; height: 0.55rem; }
    .team-name { font-size: 0.85rem; }
    .delete-team-btn { padding: 0.15rem; }
    .delete-team-btn svg { width: 12px; height: 12px; }
    .team-score-section { gap: 0.4rem; }
    .score-btn { width: 1.9rem; height: 1.9rem; font-size: 1.1rem; border-radius: 0.375rem; }
    .team-score { font-size: 1.3rem; padding: 0.25rem 0.65rem; min-width: 3.5rem; }
    .team-score span { font-size: 0.75rem; }
    .add-team-btn { padding: 0.4rem 0.75rem; font-size: 0.85rem; border-radius: 0.5rem; flex-shrink: 0; }

    .floating-shapes .shape { opacity: 0.05; }
}

/* ========================================
   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;
    }

    .content-zone,
    .board-area,
    .definition-area {
        min-height: 0;
    }

    .content-zone {
        /* Center when it fits, but fall back to top-start if content overflows. */
        justify-content: safe center;
    }

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

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

    .header,
    .teams-section {
        flex-shrink: 0;
    }
}

/* Medium teacher-laptop/projector heights, including responsive test panes around 1058px tall. */
@media (min-width: 900px) and (max-height: 1100px) {
    .header {
        padding-top: clamp(0.4rem, 0.7vh, 0.6rem);
        padding-bottom: clamp(0.4rem, 0.7vh, 0.6rem);
    }

    .content-zone {
        padding-top: clamp(0.6rem, 1vh, 1.1rem);
        padding-bottom: clamp(0.6rem, 1vh, 1.1rem);
        gap: clamp(0.75rem, 1.3vh, 1.25rem);
    }

    .board-area,
    .definition-area {
        padding-left: clamp(1.25rem, 2vw, 2.5rem);
        padding-right: clamp(1.25rem, 2vw, 2.5rem);
    }

    .board-grid {
        gap: clamp(0.8rem, 1.3vw, 1.5rem);
    }

    .tile-number {
        font-size: clamp(2.1rem, 4.6vh, 3.5rem);
        line-height: 1;
    }

    .tile-back-label,
    .tile-back-icon {
        font-size: clamp(1rem, 2vh, 1.35rem);
    }

    .answer-card {
        padding-top: clamp(0.85rem, 1.4vh, 1.2rem);
        padding-bottom: clamp(0.85rem, 1.4vh, 1.2rem);
    }

    .answer-verb {
        font-size: clamp(2rem, 4.3vh, 3.25rem);
        line-height: 1;
    }

    .answer-example {
        font-size: clamp(1.05rem, 2vh, 1.35rem);
        line-height: 1.3;
    }

    .def-text {
        font-size: clamp(1rem, 2vh, 1.35rem);
        line-height: 1.3;
    }

    .teams-section {
        padding-top: clamp(0.45rem, 0.8vh, 0.75rem);
        padding-bottom: clamp(0.45rem, 0.8vh, 0.75rem);
    }
}

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

    .board-grid {
        gap: 0.75rem;
    }

    .answer-card {
        padding: 0.7rem 1.5rem;
    }

    .teams-section {
        padding-top: 0.35rem;
        padding-bottom: 0.4rem;
    }
}

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

    .answer-verb {
        font-size: 2rem;
    }

    .answer-example,
    .def-text {
        font-size: 0.95rem;
    }
}
