/* ═══════════════════════════════════════════════════
   EVELEVEN — Style
   A fun, animal-loving, pink & purple world
   for Evelina's 11+ journey 🦋🐾
   ═══════════════════════════════════════════════════ */

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

:root {
    --pink: #FF6B9D;
    --pink-light: #FFB8D0;
    --pink-pale: #FFF0F5;
    --purple: #9B59B6;
    --purple-light: #C39BD3;
    --purple-dark: #7D3C98;
    --purple-pale: #F3E8F9;
    --lavender: #D7BDE2;
    --gold: #F9C74F;
    --gold-light: #FDE68A;
    --mint: #55EFC4;
    --mint-light: #B2F5E0;
    --coral: #FF7675;
    --sky: #74B9FF;
    --bg: #FDF6FF;
    --card-bg: #FFFFFF;
    --text: #4A2040;
    --text-light: #8E6C88;
    --border: #F0DDF5;
    --shadow: 0 4px 16px rgba(155, 89, 182, 0.1);
    --shadow-hover: 0 8px 28px rgba(155, 89, 182, 0.2);
    --radius: 20px;
    --radius-sm: 14px;
}

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

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── Screens ─────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; }

/* ═══════════════════════════════════════════════════
   LOGIN SCREEN — Magical garden entrance
   ═══════════════════════════════════════════════════ */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background:
        radial-gradient(circle at 20% 80%, rgba(255,107,157,0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(155,89,182,0.3) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(215,189,226,0.2) 0%, transparent 70%),
        linear-gradient(160deg, #7D3C98 0%, #9B59B6 30%, #FF6B9D 70%, #FFB8D0 100%);
    position: relative;
    overflow: hidden;
}

/* Floating paw prints background */
.login-container::before {
    content: '🐾 🦋 🐾 🌸 🐾 🦋 🐾 🌸 🐾 🦋';
    position: absolute;
    top: 0;
    left: -100%;
    font-size: 2rem;
    opacity: 0.12;
    white-space: nowrap;
    animation: floatPaws 25s linear infinite;
    letter-spacing: 2rem;
}

.login-container::after {
    content: '🌸 🐾 🦋 🐾 🌸 🐾 🦋 🐾 🌸 🐾';
    position: absolute;
    bottom: 20%;
    left: -100%;
    font-size: 1.8rem;
    opacity: 0.1;
    white-space: nowrap;
    animation: floatPaws 30s linear infinite 5s;
    letter-spacing: 2.5rem;
}

@keyframes floatPaws {
    0% { transform: translateX(-10%); }
    100% { transform: translateX(110%); }
}

.logo {
    font-size: 4rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -2px;
    margin-bottom: 0.25rem;
    text-shadow: 0 3px 12px rgba(125, 60, 152, 0.3);
    animation: logoIn 0.8s ease-out;
}

.logo .accent {
    color: var(--gold);
    font-size: 4.5rem;
    text-shadow: 0 2px 8px rgba(249, 199, 79, 0.4);
}

@keyframes logoIn {
    0% { transform: scale(0.5) rotate(-5deg); opacity: 0; }
    60% { transform: scale(1.1) rotate(2deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.tagline {
    color: rgba(255,255,255,0.9);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 2.5rem;
    animation: fadeIn 1s ease 0.3s both;
}

.login-buttons {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    animation: fadeIn 1s ease 0.5s both;
}

.login-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 2.5rem;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: var(--radius);
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.login-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.login-avatar {
    font-size: 3rem;
    animation: bounce 2s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* PIN Entry */
#pin-entry {
    text-align: center;
    animation: slideUp 0.4s ease;
}

#pin-greeting {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.pin-dots {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    border: 2px solid rgba(255,255,255,0.4);
    transition: all 0.25s;
}

.dot.filled {
    background: var(--gold);
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(249, 199, 79, 0.5);
    animation: dotPop 0.3s ease;
}

@keyframes dotPop {
    0% { transform: scale(0.5); }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 72px);
    gap: 12px;
    justify-content: center;
}

.pin-pad button {
    width: 72px;
    height: 72px;
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.pin-pad button:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.4);
}

.pin-pad button:active {
    transform: scale(0.92);
    background: rgba(255,255,255,0.35);
}

.pin-blank { visibility: hidden; }

.error {
    color: var(--gold-light);
    font-weight: 700;
    margin-top: 1rem;
    animation: headShake 0.5s ease;
}

@keyframes headShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* ═══════════════════════════════════════════════════
   TOP BAR — Purple with animal flair
   ═══════════════════════════════════════════════════ */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.25rem;
    background: linear-gradient(135deg, var(--purple-dark), var(--purple), var(--pink));
    color: #fff;
    position: relative;
}

#user-greeting {
    font-size: 1.15rem;
    font-weight: 800;
}

.top-right { display: flex; gap: 0.6rem; }

.points-badge, .streak-badge {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.25);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════
   TAB NAVIGATION — Soft pill tabs
   ═══════════════════════════════════════════════════ */
.tab-nav {
    display: flex;
    background: var(--card-bg);
    border-bottom: 2px solid var(--border);
    padding: 0.4rem 0.5rem 0;
    overflow-x: auto;
}

.tab {
    flex: 1;
    padding: 0.75rem 0.5rem 0.65rem;
    border: none;
    background: none;
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    border-radius: 12px 12px 0 0;
}

.tab:hover {
    color: var(--purple);
    background: var(--purple-pale);
}

.tab.active {
    color: var(--purple);
    border-bottom-color: var(--pink);
    background: var(--purple-pale);
}

/* ═══════════════════════════════════════════════════
   TAB CONTENT
   ═══════════════════════════════════════════════════ */
.tab-content { padding: 1.25rem; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }

/* ═══════════════════════════════════════════════════
   DASHBOARD CARDS — Big, colourful, fun
   ═══════════════════════════════════════════════════ */
.dashboard-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.card-points::after { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.card-books::after { background: linear-gradient(90deg, var(--purple), var(--purple-light)); }
.card-words::after { background: linear-gradient(90deg, var(--mint), var(--mint-light)); }
.card-streak::after { background: linear-gradient(90deg, var(--coral), var(--pink)); }

.card-icon { font-size: 2.2rem; margin-bottom: 0.25rem; }

.card-value {
    font-size: 2.2rem;
    font-weight: 900;
}

.card-points .card-value { color: #D4A017; }
.card-books .card-value { color: var(--purple); }
.card-words .card-value { color: #00B894; }
.card-streak .card-value { color: var(--coral); }

.card-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-light);
    margin-top: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════
   REVIEW PROMPT — Eye-catching banner
   ═══════════════════════════════════════════════════ */
.review-prompt {
    background: linear-gradient(135deg, var(--purple), var(--pink));
    color: #fff;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border: 2px solid rgba(255,255,255,0.15);
    box-shadow: 0 4px 16px rgba(155, 89, 182, 0.25);
    animation: pulseGlow 3s ease infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 4px 16px rgba(155, 89, 182, 0.25); }
    50% { box-shadow: 0 4px 24px rgba(255, 107, 157, 0.35); }
}

.review-prompt p { font-weight: 700; font-size: 0.95rem; }

/* ═══════════════════════════════════════════════════
   ACTIVITY LIST
   ═══════════════════════════════════════════════════ */
.recent-activity h3 {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: var(--purple-dark);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    font-size: 0.9rem;
}

.activity-day { color: var(--text-light); font-size: 0.8rem; font-weight: 600; }
.activity-points { font-weight: 800; color: var(--purple); }

/* ═══════════════════════════════════════════════════
   READING — Book cards with genre colours
   ═══════════════════════════════════════════════════ */
.reading-header, .vocab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.reading-header h3, .vocab-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--purple-dark);
}

.book-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.book-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s;
}

.book-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    border-color: var(--lavender);
}

.book-card:active { transform: translateY(0) scale(0.99); }

.book-info h4 {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
    color: var(--text);
}

.book-info .book-author {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 600;
}

.book-info .book-chapter {
    font-size: 0.82rem;
    color: var(--purple);
    font-weight: 700;
    margin-top: 0.3rem;
}

.book-status {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-active { background: var(--mint-light); color: #00875A; }
.status-paused { background: #FFF3E0; color: #E67E22; }
.status-completed { background: #E8F5E9; color: #27AE60; }

.book-genre-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: 0.3rem;
    margin-bottom: 0.3rem;
}

.genre-classic { background: #FFEAA7; color: #856404; }
.genre-modern { background: #DFE6E9; color: #2D3436; }
.genre-fantasy { background: var(--purple-pale); color: var(--purple-dark); }
.genre-historical { background: #FADBD8; color: #922B21; }
.genre-nonfiction { background: #D5F5E3; color: #1E8449; }

/* ═══════════════════════════════════════════════════
   BOOK PICKER — Genre filter + grid
   ═══════════════════════════════════════════════════ */
.genre-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.filter-btn {
    padding: 0.45rem 1rem;
    border: 2px solid var(--border);
    border-radius: 20px;
    background: none;
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s;
}

.filter-btn:hover {
    border-color: var(--lavender);
    background: var(--purple-pale);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--purple), var(--pink));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 10px rgba(155, 89, 182, 0.3);
}

.book-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    max-height: 50vh;
    overflow-y: auto;
}

.book-pick-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    background: var(--purple-pale);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s;
}

.book-pick-card:hover {
    background: linear-gradient(135deg, var(--purple), var(--pink));
    color: #fff;
    border-color: transparent;
    transform: translateX(4px);
}

.book-pick-card:hover .book-genre-tag { color: #fff; background: rgba(255,255,255,0.2); }
.book-pick-card:hover small { color: rgba(255,255,255,0.8); }

.book-pick-card.already-reading { opacity: 0.35; pointer-events: none; }

/* ═══════════════════════════════════════════════════
   VOCABULARY — Word cards
   ═══════════════════════════════════════════════════ */
.word-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.word-card {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    transition: border-color 0.2s;
}

.word-card:hover { border-color: var(--lavender); }

.word-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.word-text { font-weight: 800; font-size: 1.05rem; color: var(--purple); }

.word-mastery {
    font-size: 0.8rem;
    color: var(--pink);
    letter-spacing: 2px;
}

.word-def { font-size: 0.85rem; color: var(--text); margin-top: 0.35rem; font-weight: 600; }
.word-ctx { font-size: 0.8rem; color: var(--text-light); font-style: italic; margin-top: 0.2rem; }
.word-book { font-size: 0.75rem; color: var(--purple-light); margin-top: 0.25rem; font-weight: 700; }

/* ═══════════════════════════════════════════════════
   FLASHCARD REVIEW — Big, flippable, fun
   ═══════════════════════════════════════════════════ */
.flashcard {
    perspective: 1000px;
    margin: 1.25rem 0;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    min-height: 220px;
    cursor: pointer;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

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

.flashcard-front, .flashcard-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-radius: var(--radius);
    border: 3px solid transparent;
}

.flashcard-front {
    background: linear-gradient(145deg, var(--purple), var(--purple-dark), var(--pink));
    color: #fff;
    box-shadow: 0 8px 28px rgba(155, 89, 182, 0.3);
}

.flashcard-back {
    background: var(--card-bg);
    transform: rotateY(180deg);
    border-color: var(--lavender);
    box-shadow: var(--shadow-hover);
}

.flashcard-word { font-size: 2.2rem; font-weight: 900; }
.flashcard-hint { font-size: 0.9rem; opacity: 0.7; margin-top: 1rem; font-weight: 600; }
.flashcard-definition { font-size: 1.25rem; font-weight: 700; text-align: center; color: var(--purple-dark); }
.flashcard-context { font-size: 0.9rem; color: var(--text-light); font-style: italic; margin-top: 0.75rem; text-align: center; }

.review-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.25rem;
}

.review-progress {
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 1rem;
}

/* ═══════════════════════════════════════════════════
   ACHIEVEMENTS — Badges grid
   ═══════════════════════════════════════════════════ */
#tab-achievements h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--purple-dark);
    margin-bottom: 0.75rem;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.badge-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.25rem 0.75rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    transition: all 0.3s;
}

.badge-card:hover {
    transform: translateY(-3px) rotate(2deg);
    box-shadow: var(--shadow-hover);
    border-color: var(--gold);
}

.badge-icon {
    font-size: 2.8rem;
    display: block;
    animation: badgeWiggle 3s ease infinite;
}

@keyframes badgeWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

.badge-name { font-size: 0.82rem; font-weight: 800; margin-top: 0.4rem; color: var(--text); }
.badge-date { font-size: 0.7rem; color: var(--text-light); font-weight: 600; }

.completed-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.completed-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
}

.completed-check { font-size: 1.5rem; }

/* ═══════════════════════════════════════════════════
   MODALS — Slide-up sheets
   ═══════════════════════════════════════════════════ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(74, 32, 64, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 1.5rem;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.35s ease;
    border-top: 4px solid var(--pink);
}

.modal-small { max-height: 70vh; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h3 {
    font-weight: 800;
    color: var(--purple-dark);
}

.modal-close {
    background: var(--purple-pale);
    border: none;
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--purple);
    font-weight: 700;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--pink);
    color: #fff;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════ */
.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--purple);
    margin-bottom: 0.35rem;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    transition: border-color 0.2s;
    background: var(--purple-pale);
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--purple);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(155, 89, 182, 0.1);
}

.form-group input::placeholder { color: var(--lavender); font-weight: 600; }

.chapter-input-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    font-weight: 700;
    color: var(--text);
}

.chapter-input-row input {
    width: 80px;
    padding: 0.6rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    text-align: center;
    color: var(--purple);
    background: var(--purple-pale);
}

.chapter-input-row input:focus {
    border-color: var(--purple);
    background: #fff;
}

/* ═══════════════════════════════════════════════════
   BUTTONS — Rounded, juicy, tactile
   ═══════════════════════════════════════════════════ */
.btn {
    padding: 0.75rem 1.3rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--purple), var(--purple-dark));
    color: #fff;
    box-shadow: 0 3px 10px rgba(155, 89, 182, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 5px 16px rgba(155, 89, 182, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--purple-pale);
    color: var(--purple);
    border: 2px solid var(--border);
}

.btn-secondary:hover { background: var(--lavender); }

.btn-success {
    background: linear-gradient(135deg, #00B894, #55EFC4);
    color: #fff;
    box-shadow: 0 3px 10px rgba(0, 184, 148, 0.3);
}

.btn-success:hover { box-shadow: 0 5px 16px rgba(0, 184, 148, 0.4); }

.btn-danger {
    background: linear-gradient(135deg, var(--coral), var(--pink));
    color: #fff;
    box-shadow: 0 3px 10px rgba(255, 118, 117, 0.3);
}

.btn-danger:hover { box-shadow: 0 5px 16px rgba(255, 118, 117, 0.4); }

.btn-small {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    color: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.3);
}

.btn-small:hover { box-shadow: 0 4px 14px rgba(255, 107, 157, 0.4); }

/* ═══════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════ */
.hidden { display: none !important; }

.empty-state {
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: var(--purple-pale);
    border-radius: var(--radius);
    border: 2px dashed var(--lavender);
}

/* ═══════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ═══════════════════════════════════════════════════
   POINTS TOAST — Big and celebratory
   ═══════════════════════════════════════════════════ */
.points-toast {
    position: fixed;
    top: 18%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--purple), var(--pink));
    color: #fff;
    padding: 0.85rem 1.75rem;
    border-radius: 30px;
    font-size: 1.3rem;
    font-weight: 800;
    z-index: 200;
    animation: toastUp 1.8s ease forwards;
    pointer-events: none;
    box-shadow: 0 6px 24px rgba(155, 89, 182, 0.35);
    border: 2px solid rgba(255,255,255,0.3);
}

@keyframes toastUp {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.8); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.1); }
    25% { transform: translateX(-50%) translateY(0) scale(1); }
    75% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-50px) scale(0.9); }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (min-width: 600px) {
    .dashboard-cards { grid-template-columns: repeat(4, 1fr); }
    .modal-content { border-radius: var(--radius); margin-bottom: 2rem; border-top: 4px solid var(--pink); }
    .modal { align-items: center; }
    .book-grid { grid-template-columns: 1fr 1fr; }
    .badges-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ═══════════════════════════════════════════════════
   PARENT DASHBOARD
   ═══════════════════════════════════════════════════ */
.parent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.parent-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--purple-dark);
}

.parent-child-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--purple-dark);
    margin-bottom: 0.75rem;
    text-align: center;
}

.parent-sections {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.psec-btn {
    flex: 1;
    padding: 0.55rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: none;
    font-family: 'Nunito', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s;
}

.psec-btn:hover {
    border-color: var(--lavender);
    background: var(--purple-pale);
}

.psec-btn.active {
    background: linear-gradient(135deg, var(--purple), var(--pink));
    border-color: transparent;
    color: #fff;
}

.parent-section { display: none; }
.parent-section.active { display: block; animation: fadeIn 0.3s ease; }

.parent-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.parent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
}

.parent-item-info {
    flex: 1;
    min-width: 0;
}

.parent-item-info strong {
    display: block;
    font-size: 0.92rem;
    color: var(--text);
    margin-top: 0.15rem;
}

.parent-item-meta {
    display: block;
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 600;
    margin-top: 0.15rem;
}

.parent-item-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--purple-pale);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--lavender);
    border-color: var(--purple-light);
}

.btn-icon-danger:hover {
    background: var(--coral);
    border-color: var(--coral);
    color: #fff;
}

.parent-item-compact {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.parent-item-compact .score-desc {
    flex: 1;
    font-weight: 600;
    color: var(--text);
}

.score-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.score-points {
    font-weight: 800;
    font-size: 0.85rem;
}

.score-points.positive { color: #00B894; }
.score-points.negative { color: var(--coral); }

.score-date {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 600;
}

.parent-sub-heading {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--purple-dark);
    margin: 1.25rem 0 0.6rem;
}

/* Tools Section */
.tool-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    margin-bottom: 1rem;
}

.tool-card h4 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--purple-dark);
    margin-bottom: 0.25rem;
}

.tool-desc {
    font-size: 0.82rem;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.tool-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.tool-form input {
    flex: 1;
    min-width: 100px;
    padding: 0.6rem 0.85rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    background: var(--purple-pale);
}

.tool-form input:focus {
    outline: none;
    border-color: var(--purple);
    background: #fff;
}

.tool-form input[type="number"] { max-width: 100px; }

.quick-stats {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    font-weight: 600;
}

.stat-row:last-child { border-bottom: none; }
.stat-row span { color: var(--text-light); }
.stat-row strong { color: var(--purple); }

/* Logout Button */
.logout-btn {
    width: 34px;
    height: 34px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--purple-pale);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.logout-btn:hover {
    background: var(--coral);
    border-color: var(--coral);
    transform: scale(1.1);
}

/* ═══════════════════════════════════════════════════
   DISCUSSION — Start Modal
   ═══════════════════════════════════════════════════ */

.discuss-mode-choice {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0 1rem;
    justify-content: center;
}

.discuss-mode-btn {
    flex: 1;
    padding: 1.2rem 1rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-light);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.5rem;
}

.btn-link:hover { color: var(--purple); }

/* Book card discuss button */
.book-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-discuss {
    background: linear-gradient(135deg, var(--purple), var(--pink));
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-discuss:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

/* ═══════════════════════════════════════════════════
   VOICE DISCUSSION SCREEN
   ═══════════════════════════════════════════════════ */

.voice-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: linear-gradient(160deg, #7D3C98 0%, #9B59B6 30%, #FF6B9D 70%, #FFB8D0 100%);
    flex-direction: column;
    align-items: center;
}

.voice-screen.active { display: flex; }

.voice-top {
    width: 100%;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voice-book-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.voice-book-info span:first-child {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
}

.voice-book-info span:last-child {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

.voice-close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
}

.voice-close-btn:hover { background: rgba(255,255,255,0.35); }

/* ─── Animated Orb ─────────────────────────────── */

.voice-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.voice-orb {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orb-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
}

.ring-1 {
    width: 100%;
    height: 100%;
    animation: orbPulse 3s ease-in-out infinite;
}

.ring-2 {
    width: 130%;
    height: 130%;
    animation: orbPulse 3s ease-in-out infinite 0.5s;
}

.ring-3 {
    width: 160%;
    height: 160%;
    animation: orbPulse 3s ease-in-out infinite 1s;
}

@keyframes orbPulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.08); opacity: 0.6; }
}

/* Active speaking state — faster, brighter */
.voice-orb.ai-speaking .orb-ring {
    border-color: rgba(255,255,255,0.4);
    animation-duration: 1s;
}

.voice-orb.user-speaking .orb-ring {
    border-color: var(--gold);
    animation-duration: 0.8s;
}

.orb-core {
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    z-index: 1;
    box-shadow: 0 0 40px rgba(255,255,255,0.2);
}

.voice-status {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

.voice-transcript {
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    text-align: center;
    max-width: 320px;
    min-height: 1.5rem;
    line-height: 1.4;
}

/* ─── Skill Badges (voice + text) ──────────────── */

.voice-skills, .text-skills {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.5rem;
    flex-wrap: wrap;
}

.skill-badge {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.4;
    transition: all 0.3s;
}

.skill-badge.covered {
    opacity: 1;
    background: rgba(255,255,255,0.35);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.text-skills .skill-badge {
    background: var(--purple-pale);
    color: var(--purple-dark);
    opacity: 0.4;
}

.text-skills .skill-badge.covered {
    opacity: 1;
    background: var(--purple);
    color: white;
}

/* ─── Voice Bottom Bar ─────────────────────────── */

.voice-bottom {
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    width: 100%;
    max-width: 400px;
}

.voice-btn {
    border: none;
    border-radius: 30px;
    padding: 0.8rem 1.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-mute {
    background: rgba(255,255,255,0.2);
    color: white;
}

.voice-mute.muted {
    background: var(--coral);
    color: white;
}

.voice-end {
    background: white;
    color: var(--purple-dark);
}

.voice-text {
    background: rgba(255,255,255,0.2);
    color: white;
}

.voice-btn:hover { transform: scale(1.05); }

/* ═══════════════════════════════════════════════════
   TEXT DISCUSSION SCREEN
   ═══════════════════════════════════════════════════ */

.text-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--bg);
    flex-direction: column;
}

.text-screen.active { display: flex; }

.text-top {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--purple-dark), var(--purple));
    flex-shrink: 0;
}

.text-top .voice-close-btn {
    background: rgba(255,255,255,0.2);
}

/* ─── Chat Bubbles ─────────────────────────────── */

.text-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    -webkit-overflow-scrolling: touch;
}

.chat-bubble {
    max-width: 85%;
    padding: 0.8rem 1rem;
    border-radius: 18px;
    font-size: 1rem;
    line-height: 1.5;
    animation: bubbleIn 0.25s ease-out;
}

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

.bubble-ai {
    align-self: flex-start;
    background: white;
    color: var(--text);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow);
}

.bubble-user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    color: white;
    border-bottom-right-radius: 4px;
}

.bubble-typing {
    align-self: flex-start;
    background: white;
    color: var(--text-light);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow);
    font-style: italic;
}

.bubble-typing::after {
    content: '';
    display: inline-block;
    animation: dots 1.2s infinite;
}

@keyframes dots {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

.bubble-func {
    align-self: center;
    background: var(--gold-light);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
}

/* ─── Text Input Bar ───────────────────────────── */

.text-input-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    background: white;
    border-top: 2px solid var(--border);
    flex-shrink: 0;
}

.text-input-bar input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    border-radius: 30px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.text-input-bar input:focus {
    border-color: var(--purple);
}

.text-send-btn {
    background: linear-gradient(135deg, var(--purple), var(--pink));
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.text-send-btn:hover { transform: scale(1.05); }

.text-send-btn:disabled {
    opacity: 0.5;
    transform: none;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════
   SUMMARY SCREEN
   ═══════════════════════════════════════════════════ */

.summary-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: linear-gradient(160deg, var(--purple-pale) 0%, var(--pink-pale) 100%);
    align-items: center;
    justify-content: center;
}

.summary-screen.active { display: flex; }

.summary-container {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-hover);
    animation: bubbleIn 0.4s ease-out;
}

.summary-stars {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: starBounce 0.6s ease-out;
}

@keyframes starBounce {
    0% { transform: scale(0); }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.summary-title {
    color: var(--purple-dark);
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.summary-book {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.summary-score {
    margin: 1rem 0;
}

.score-num {
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-label {
    font-size: 1.5rem;
    color: var(--text-light);
    font-weight: 700;
}

.summary-text {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 1rem 0;
    text-align: left;
    padding: 0.8rem;
    background: var(--purple-pale);
    border-radius: var(--radius-sm);
}

.summary-skills {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.summary-skill-tag {
    background: var(--purple-pale);
    color: var(--purple-dark);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.summary-points {
    font-size: 1.1rem;
    color: var(--text);
    margin: 1rem 0;
}

.summary-back {
    width: 100%;
    margin-top: 0.5rem;
}

/* ═══════════════════════════════════════════════════
   DISCUSSION HISTORY (Chats tab + Parent review)
   ═══════════════════════════════════════════════════ */

.discuss-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 0.6rem;
    box-shadow: var(--shadow);
}

.discuss-card-top {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.discuss-card-top strong {
    font-size: 1rem;
    color: var(--text);
}

.discuss-card-meta {
    font-size: 0.82rem;
    color: var(--text-light);
}

.discuss-card-score {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--purple);
}

.discuss-card-skills {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

.discuss-card-summary {
    font-size: 0.88rem;
    color: var(--text-light);
    margin-top: 0.4rem;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════
   PARENT NOTIFICATIONS (Book Alerts)
   ═══════════════════════════════════════════════════ */

.notify-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 0.6rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--gold);
}

.notify-card.status-approved { border-left-color: var(--mint); }
.notify-card.status-dismissed { border-left-color: var(--text-light); opacity: 0.6; }

.notify-card-top {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.4rem;
}

.notify-reason {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.reason-unsuitable { background: var(--coral); color: white; }
.reason-unrecognised { background: var(--gold); color: var(--text); }
.reason-too_easy { background: var(--sky); color: white; }

.notify-assessment {
    font-size: 0.88rem;
    color: var(--text-light);
    margin: 0.4rem 0;
    line-height: 1.4;
}

.notify-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.notify-actions button {
    flex: 1;
    padding: 0.5rem;
    border-radius: 12px;
    border: none;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-approve {
    background: var(--mint);
    color: var(--text);
}

.btn-dismiss {
    background: var(--border);
    color: var(--text-light);
}

/* ═══ Conversation View Modal ═══ */
.modal-conversation {
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.conversation-body {
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.convo-bubble {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    max-width: 85%;
}

.convo-bubble p {
    margin: 0.25rem 0 0;
    line-height: 1.5;
}

.convo-child {
    background: var(--pink-light);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.convo-ai {
    background: var(--purple-light, #f0edff);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.convo-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.convo-summary {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--mint-light, #e8faf0);
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════
   KENT TEST MODULE — Maths, English, Mock Tests
   ═══════════════════════════════════════════════════ */

.kent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0 1rem;
}

.kent-tier {
    background: linear-gradient(135deg, var(--purple-light), var(--pink-light));
    color: var(--purple-dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.kent-start-card {
    background: linear-gradient(135deg, var(--purple-pale), var(--pink-pale));
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.kent-start-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.kent-start-card h4 {
    font-size: 1.3rem;
    color: var(--purple-dark);
    margin-bottom: 0.5rem;
}

.kent-start-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.btn-big {
    padding: 14px 36px;
    font-size: 1.1rem;
    border-radius: 30px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.mock-card {
    background: linear-gradient(135deg, #FDE68A 0%, #FFB8D0 50%, var(--purple-pale) 100%);
}

.mock-time {
    font-size: 0.9rem;
    color: var(--purple-dark);
    font-weight: 700;
}

.kent-section-title {
    font-size: 1rem;
    color: var(--text-light);
    margin: 1.5rem 0 0.5rem;
}

/* Topic Grid */
.kent-topic-grid {
    margin-top: 1rem;
}

.kent-category {
    margin-bottom: 1rem;
}

.kent-cat-title {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 6px;
    font-weight: 700;
}

.kent-topic-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.kent-topic-pill {
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: default;
    transition: transform 0.15s;
}

.kent-topic-pill:hover {
    transform: scale(1.05);
}

.mastery-new { background: #f0f0f0; color: #888; }
.mastery-learning { background: #E8F5E9; color: #388E3C; }
.mastery-growing { background: #C8E6C9; color: #2E7D32; }
.mastery-strong { background: #FFF3E0; color: #EF6C00; }
.mastery-mastered { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #7C5E00; }

/* History */
.kent-history {
    margin-top: 0.5rem;
}

.kent-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.kent-hist-date { font-size: 0.8rem; color: var(--text-light); }
.kent-hist-score { font-weight: 700; color: var(--purple-dark); }
.kent-hist-pct { font-size: 0.85rem; color: var(--text-light); margin-left: 8px; }

.mock-history-item {
    flex-wrap: wrap;
    gap: 4px;
}

.mock-hist-breakdown {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-left: 8px;
}

/* ═══ Practice Screen ═══ */
.kent-practice-screen,
.mock-test-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--bg);
    display: none;
    flex-direction: column;
    overflow-y: auto;
}

.kent-practice-screen.active,
.mock-test-screen.active {
    display: flex;
}

.kent-practice-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 8px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.kent-practice-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kent-practice-info span:first-child {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--purple-dark);
}

.kent-practice-info span:last-child {
    font-size: 0.8rem;
    color: var(--text-light);
}

.kent-progress-bar {
    height: 6px;
    background: var(--border);
    position: relative;
}

.kent-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple), var(--pink));
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}

/* Question Area */
.kent-question-area {
    flex: 1;
    padding: 1.5rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.kent-topic-badge {
    display: inline-block;
    background: var(--purple-pale);
    color: var(--purple-dark);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 700;
    align-self: flex-start;
}

.kent-question-text {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--text);
    font-weight: 600;
    padding: 0.5rem 0;
}

.kent-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kent-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    text-align: left;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

@media (hover: hover) {
    .kent-option-btn:hover:not(:disabled) {
        border-color: var(--purple-light);
        background: var(--purple-pale);
        transform: translateX(4px);
    }
}

.kent-option-btn:focus {
    outline: none;
}

.kent-option-btn.selected {
    border-color: var(--purple);
    background: var(--purple-pale);
}

.kent-option-btn.correct {
    border-color: #4CAF50;
    background: #E8F5E9;
}

.kent-option-btn.correct .kent-opt-letter {
    background: #4CAF50;
    color: white;
}

.kent-option-btn.wrong {
    border-color: var(--coral);
    background: #FFEBEE;
}

.kent-option-btn.wrong .kent-opt-letter {
    background: var(--coral);
    color: white;
}

.kent-opt-letter {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--border);
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--purple-dark);
    flex-shrink: 0;
    transition: all 0.2s;
}

.kent-opt-text {
    flex: 1;
    line-height: 1.4;
}

/* Feedback */
.kent-feedback {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    gap: 1rem;
}

.kent-feedback.hidden { display: none; }

.kent-feedback-icon {
    font-size: 3.5rem;
}

.kent-feedback-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    max-width: 400px;
}

.kent-explanation {
    font-size: 0.95rem;
    color: var(--text-light);
    max-width: 400px;
    line-height: 1.6;
    background: var(--purple-pale);
    padding: 1rem;
    border-radius: var(--radius-sm);
}

.kent-explanation:empty { display: none; }

/* Teach Me */
.kent-teach-me {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.kent-teach-me.hidden { display: none; }

.teach-me-card {
    background: linear-gradient(135deg, #FFF9C4, #FFF3E0);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.teach-me-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.teach-me-card h4 {
    color: var(--purple-dark);
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.teach-me-card p {
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 1.2rem;
    font-size: 1rem;
}

/* Complete Screen */
.kent-complete {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    gap: 0.8rem;
}

.kent-complete.hidden { display: none; }

.kent-complete-stars {
    font-size: 3rem;
    animation: popIn 0.5s ease;
}

.kent-complete.perfect .kent-complete-stars {
    font-size: 4rem;
    animation: popIn 0.5s ease, sparkle 1.5s ease infinite;
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes sparkle {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.4) drop-shadow(0 0 10px gold); }
}

.kent-complete-score {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.kent-score-num {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--purple-dark);
    animation: popIn 0.6s ease 0.2s both;
}

.kent-score-of { font-size: 1.5rem; color: var(--text-light); }
.kent-score-total { font-size: 2rem; font-weight: 700; color: var(--text-light); }

.kent-complete-percent {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--purple);
}

.kent-complete-feedback {
    font-size: 1.05rem;
    color: var(--text);
    max-width: 350px;
    line-height: 1.5;
}

.kent-complete-points {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gold);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Practice Bottom Bar */
.kent-practice-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: white;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.kent-practice-bottom span {
    font-weight: 700;
    color: var(--purple-dark);
}

/* Mock Timer */
.mock-timer {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--purple-dark);
    background: var(--purple-pale);
    padding: 6px 14px;
    border-radius: 20px;
}

.mock-timer.timer-warning {
    background: #FFEBEE;
    color: var(--coral);
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Mock Results */
.mock-results-screen {
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: var(--bg);
    display: none;
    align-items: center;
    justify-content: center;
}

.mock-results-screen.active { display: flex; }

.mock-results-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 340px;
    margin: 1.5rem auto;
}

.mock-result-paper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.mock-result-paper.mock-result-total {
    background: linear-gradient(135deg, var(--purple-pale), var(--pink-pale));
    font-size: 1.1rem;
}

.mock-result-label { font-weight: 700; color: var(--text); }
.mock-result-score { font-weight: 800; color: var(--purple-dark); font-size: 1.1rem; }

/* Loading spinner */
.kent-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.kent-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.kent-loading p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* btn-success */
.btn-success {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

/* ═══════════════════════════════════════════
   TOPIC PROGRESS BAR
   ═══════════════════════════════════════════ */
.tp-progress {
    margin-bottom: 8px;
}
.tp-bar {
    height: 18px;
    background: #e8e0f0;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
}
.tp-seg {
    height: 100%;
    transition: width 0.5s ease;
    min-width: 4px;
}
.seg-mastered { background: linear-gradient(90deg, #9b59b6, #8e44ad); }
.seg-strong   { background: linear-gradient(90deg, #f1c40f, #f39c12); }
.seg-growing  { background: linear-gradient(90deg, #2ecc71, #27ae60); }
.seg-learning { background: linear-gradient(90deg, #85c1e9, #5dade2); }
.tp-summary {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-top: 6px;
    text-align: center;
}
.tp-toggle {
    display: block;
    margin: 8px auto 4px;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    padding: 4px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}
.tp-toggle:hover { background: #f3edf9; }
.tp-toggle.open { color: var(--text-light); }
.tp-detail {
    margin-top: 8px;
}

/* ═══════════════════════════════════════════
   VISUAL ELEMENTS (bar charts, tables, etc)
   ═══════════════════════════════════════════ */
.vis-container {
    background: #f8f4fc;
    border: 2px solid #e8ddf5;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
}
.vis-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 12px;
    text-align: center;
}

/* Bar Chart */
.vis-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.vis-bar-row:last-child { margin-bottom: 0; }
.vis-bar-label {
    width: 80px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-align: right;
    flex-shrink: 0;
}
.vis-bar-track {
    flex: 1;
    height: 28px;
    background: #ede6f6;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
.vis-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #9b59b6, #8e44ad);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    min-width: 30px;
    transition: width 0.4s ease;
}
.vis-bar-val {
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

/* Table */
.vis-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.vis-table th {
    background: #9b59b6;
    color: white;
    padding: 8px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 0.85rem;
}
.vis-table th:first-child { border-radius: 8px 0 0 0; }
.vis-table th:last-child { border-radius: 0 8px 0 0; }
.vis-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e8ddf5;
    color: var(--text);
}
.vis-table tr:last-child td { border-bottom: none; }
.vis-table tr:nth-child(even) td { background: #f0eaf8; }

/* Pie Chart */
.vis-pie-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}
.vis-pie-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.vis-pie-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.vis-pie-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}
.vis-pie-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Number Line */
.vis-number-line { padding: 24px 16px 16px; }
.vis-nl-track {
    position: relative;
    height: 60px;
    margin: 0 20px;
}
.vis-nl-line {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 3px;
    background: #9b59b6;
    border-radius: 2px;
}
.vis-nl-tick {
    position: absolute;
    top: 12px;
    transform: translateX(-50%);
}
.vis-nl-tick::before {
    content: '';
    display: block;
    width: 2px;
    height: 16px;
    background: #9b59b6;
    margin: 0 auto 4px;
}
.vis-nl-tick span {
    font-size: 0.7rem;
    color: var(--text-light);
    display: block;
    text-align: center;
}
.vis-nl-marker {
    position: absolute;
    top: -4px;
    transform: translateX(-50%);
    background: #e74c3c;
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Shape Sequence */
.vis-shapes {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    flex-wrap: wrap;
}
.vis-shape {
    font-size: 2rem;
    color: #9b59b6;
    line-height: 1;
}
.vis-shape-q {
    font-size: 2.2rem;
    color: #e74c3c;
    font-weight: 700;
    animation: pulse 1.2s ease infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Mobile tweaks */
@media (max-width: 480px) {
    .vis-bar-label { width: 60px; font-size: 0.75rem; }
    .vis-bar-track { height: 22px; }
    .vis-pie-circle { width: 110px; height: 110px; }
    .vis-shape { font-size: 1.5rem; }
    .vis-table th, .vis-table td { padding: 6px 8px; font-size: 0.8rem; }
}
