/* ============================================================
   SATs Star! – Main Stylesheet
   Fun, responsive, mobile-first design
   ============================================================ */

:root {
    --primary:      #667eea;
    --secondary:    #764ba2;
    --correct:      #43e97b;
    --wrong:        #f5576c;
    --star-gold:    #ffd700;
    --dark-bg:      #1a1a2e;
    --card-bg:      #ffffff;
    --text-dark:    #2d3748;
    --radius:       16px;
    --shadow:       0 8px 32px rgba(0,0,0,0.15);
    --font:         'Nunito', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html {
    /* Reserve scrollbar gutter at all times so the layout never shifts
       when a scrollbar appears or disappears during Blazor re-renders. */
    overflow-y: scroll;
    overflow-x: hidden;
}

body {
    font-family: var(--font);
    background: var(--dark-bg);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* ── Blazor Error UI ─────────────────────────────────────── */
#blazor-error-ui {
    background: #ffcc44;
    bottom: 0; left: 0; right: 0;
    padding: 0.75rem 1rem;
    position: fixed;
    z-index: 1000;
    display: none;
    font-size: 0.9rem;
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* ── Loading Screen ──────────────────────────────────────── */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: #fff;
    font-size: 1.2rem;
    gap: 1rem;
}
.loading-rocket {
    font-size: 3rem;
    animation: float 1.5s ease-in-out infinite;
}

/* ============================================================
   HOME PAGE
   ============================================================ */
.home-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.home-header {
    text-align: center;
    padding: 2rem 1rem 1rem;
    color: #fff;
}
.logo-stars {
    font-size: 2rem;
    animation: twinkle 2s ease-in-out infinite;
}
.logo-title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 900;
    background: linear-gradient(90deg, #ffd700, #ff6b6b, #ffd700);
    background-size: 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
    margin: 0.25rem 0;
}
.logo-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    margin: 0;
}

.section-title {
    color: rgba(255,255,255,0.9);
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    margin: 1rem 0;
}

/* Player Grid */
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
    padding: 0.5rem;
    max-width: 700px;
    margin: 0 auto;
}

.player-card {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius);
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-user-select: none;
    user-select: none;
}
.player-card:hover, .player-card:active {
    transform: translateY(-4px) scale(1.02);
    background: rgba(255,255,255,0.15);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.player-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    flex-shrink: 0;
}
/* Edit-icon button overlaid on the player card */
.player-card { position: relative; }
.avatar-edit-btn {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
}
.player-card:hover .avatar-edit-btn,
.player-card:focus-within .avatar-edit-btn {
    opacity: 1;
}
.avatar-edit-btn:hover { background: rgba(255,255,255,0.32); }
/* Always show on touch devices (no hover) */
@media (hover: none) {
    .avatar-edit-btn { opacity: 0.7; }
}
/* Live preview in edit modal */
.avatar-preview-row {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}
.avatar-preview {
    width: 80px !important;
    height: 80px !important;
    font-size: 2.4rem !important;
    transition: background 0.2s;
}
.add-avatar {
    background: rgba(255,255,255,0.2);
    font-size: 2.5rem;
    color: rgba(255,255,255,0.7);
    font-weight: 300;
}
.add-player-card { border: 2px dashed rgba(255,255,255,0.3); }

.player-name {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    min-height: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.player-level-badge {
    min-height: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.player-stars {
    font-size: 0.85rem;
    min-height: 1.2rem;
    display: flex;
    align-items: center;
}
.player-xp {
    min-height: 1.2rem;
    display: flex;
    align-items: center;
}

/* Stars */
.star-filled  { color: var(--star-gold); text-shadow: 0 0 6px rgba(255,215,0,0.6); }
.star-empty   { color: rgba(255,255,255,0.25); }
.star-filled-sm { color: var(--star-gold); font-size: 0.75rem; }
.star-empty-sm  { color: rgba(100,100,100,0.4); font-size: 0.75rem; }

.parent-btn-row {
    display: flex;
    justify-content: center;
    padding: 1.5rem 0 0.5rem;
}
.parent-btn {
    border-color: rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.7);
}
.parent-btn:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,0.1); }

/* ============================================================
   TOPIC PAGE
   ============================================================ */
.topic-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.topic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}
.back-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font);
    font-weight: 600;
    transition: background 0.2s;
}
.back-btn:hover { background: rgba(255,255,255,0.2); }

.child-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
}
.child-badge-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.child-badge-name { color: #fff; font-weight: 700; font-size: 0.95rem; }

.child-xp-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
}
.xp-level  { color: #fff; font-weight: 700; font-size: 1rem; }
.xp-amount { color: #f6d365; font-weight: 800; font-size: 1rem; }

.child-stars-badge {
    background: #f6a800;
    color: #1a1a2e;
    font-weight: 800;
    font-size: 1rem;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
}

/* ── Topic header — mobile responsive ── */
@media (max-width: 640px) {
    .topic-header {
        flex-wrap: wrap;
        gap: 0.4rem;
        padding: 0.6rem 0.75rem;
        justify-content: flex-start;
    }
    /* Back button always first, full-width context on its own line */
    .topic-header .back-btn { order: 0; }
    /* Name badge stretches to fill the first row alongside back */
    .topic-header .child-badge { order: 1; flex: 1; min-width: 0; }
    .topic-header .child-badge-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 120px;
    }
    /* Compact the pill badges */
    .child-xp-badge { padding: 0.25rem 0.55rem; order: 2; }
    .xp-level, .xp-amount { font-size: 0.82rem; }
    .child-stars-badge { font-size: 0.82rem; padding: 0.25rem 0.55rem; order: 3; }
    /* Buttons small and icon-only text trimmed */
    .mute-btn { order: 4; padding: 0.3rem 0.5rem; font-size: 1rem; }
    .rewards-nav-btn { order: 5; font-size: 0.78rem; padding: 0.3rem 0.55rem; }
}

.free-tier-banner {
    background: rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    text-align: left;
}
.free-tier-banner strong { color: #f6d365; }
.upgrade-link { color: #a0c4ff; font-weight: 700; text-decoration: none; }
.upgrade-link:hover { text-decoration: underline; }

/* Subject Tabs */
.subject-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 0.5rem 0;
    max-width: 800px;
    margin: 0 auto;
}
.subject-tab {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.subject-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 15px rgba(102,126,234,0.4);
}
.subject-tab.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Topic Grid */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 0.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.topic-card {
    background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
    border-radius: var(--radius);
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    -webkit-user-select: none;
    user-select: none;
}
.topic-card:hover, .topic-card:active {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.topic-emoji { font-size: 2rem; }
.topic-name  { color: #fff; font-weight: 800; font-size: 0.95rem; text-align: center; }
.topic-desc  { color: rgba(255,255,255,0.8); font-size: 0.72rem; text-align: center; line-height: 1.3; }
.topic-best  { margin-top: 0.35rem; display: flex; flex-direction: column; align-items: center; gap: 0.1rem; }
.topic-score { color: rgba(255,255,255,0.9); font-size: 0.75rem; font-weight: 700; }
.topic-score-new { color: #fff; font-size: 0.75rem; background: rgba(255,255,255,0.25); padding: 1px 6px; border-radius: 50px; }

/* Topic intro card (modal) */
.topic-intro-card {
    background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
    border-radius: 20px;
    padding: 2rem 1.5rem;
    max-width: 420px;
    width: 92%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    animation: bounceIn 0.35s cubic-bezier(0.68,-0.55,0.265,1.55);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.topic-intro-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0,0,0,0.25);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.topic-intro-emoji { font-size: 3.5rem; }
.topic-intro-name  { color: #fff; font-size: 1.6rem; font-weight: 900; text-align: center; }
.topic-intro-desc  { color: rgba(255,255,255,0.85); font-size: 0.9rem; text-align: center; }

.topic-intro-tip {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    color: rgba(255,255,255,0.9);
    font-size: 0.82rem;
    text-align: center;
    line-height: 1.4;
    width: 100%;
}

.topic-intro-stars {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.intro-star { font-size: 1.5rem; }

.topic-intro-best {
    color: rgba(255,255,255,0.75);
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: 0.4rem;
}

.topic-intro-locked-msg {
    color: rgba(255,255,255,0.9);
    font-size: 0.88rem;
    text-align: center;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    width: 100%;
}

.topic-intro-btn {
    width: 100% !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    font-family: var(--font) !important;
    padding: 0.8rem 1rem !important;
    border-radius: 50px !important;
}

/* ============================================================
   QUIZ PAGE
   ============================================================ */
.quiz-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(160deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    position: relative;
    overflow: hidden;
}

.quiz-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(0,0,0,0.25);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}
.quiz-topic-name { font-size: 1rem; }
.quiz-progress-text { font-size: 1.1rem; color: rgba(255,255,255,0.9); }
.quiz-score-live {
    background: var(--correct);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.9rem;
}
.mute-btn {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    border-radius: 50%;
    line-height: 1;
    opacity: 0.85;
    transition: opacity 0.15s;
}
.mute-btn:hover { opacity: 1; }
.oral-hear-row {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}
.hear-again-btn {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.5);
    color: #fff;
    border-radius: 50px;
    padding: 0.45rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.hear-again-btn:hover { background: rgba(255,255,255,0.28); }

/* ── Passage panel (Reading Comprehension) ───────────────────────────────── */
.passage-panel {
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.25);
    border-left: 4px solid rgba(255,255,255,0.55);
    border-radius: var(--radius);
    padding: 1rem 1.25rem 1.2rem;
    width: 100%;
    max-height: 42vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}
.passage-label {
    color: rgba(255,255,255,0.65);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.5rem;
}
.passage-title-text {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 0.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}
.passage-text {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* ── Reading Comprehension layout overrides ──────────────────────────────── */
/* Three-class specificity beats the base .question-text rule */
.reading-layout .question-card .question-text {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: left;
}
.reading-layout .question-card {
    text-align: left;
}
.reading-layout .question-number {
    font-size: 0.75rem;
}

/* Desktop: CSS Grid — passage fills remaining space, question column fixed-width */
@media (min-width: 860px) {
    .reading-layout .quiz-body {
        display: grid;
        grid-template-columns: 1fr 420px;
        grid-auto-rows: auto;
        align-items: start;
        gap: 1.5rem 2rem;
        max-width: none;
        padding: 1.5rem 2rem;
        width: 100%;
    }
    .reading-layout .quiz-body .passage-panel {
        grid-column: 1;
        grid-row: 1 / span 20; /* span all rows so it stays left */
        max-height: 78vh;
        position: sticky;
        top: 0.5rem;
        margin-bottom: 0;
        overflow-y: auto;
    }
    .reading-layout .quiz-body > :not(.passage-panel) {
        grid-column: 2;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
}

/* ── Clock panel (Clocks topic) — always stacked, clock above question ── */
.clock-panel {
    display: flex; justify-content: center; align-items: center;
    margin-bottom: 0.75rem; width: 100%;
}
.clock-panel .clock-svg {
    width: 180px; height: 180px; max-width: 50vw;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}
.clock-panel .digital-clock-svg {
    width: 220px; height: auto; max-width: 65vw;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}
.clock-layout .question-card .question-text {
    font-size: clamp(1rem, 4vw, 1.4rem); font-weight: 700; line-height: 1.5;
}
.review-clock { margin-bottom: 0.5rem; }
.review-clock .clock-svg { width: 130px; height: 130px; }
.review-clock .digital-clock-svg { width: 160px; }

.quiz-progress-bar-track {
    height: 8px;
    background: rgba(255,255,255,0.15);
}
.quiz-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #43e97b, #38f9d7);
    transition: width 0.4s ease;
    border-radius: 0 4px 4px 0;
}

.streak-banner {
    text-align: center;
    background: linear-gradient(90deg, #f6d365, #fda085);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    padding: 0.35rem;
    animation: pulse 0.8s ease-in-out;
}

.retry-badge {
    text-align: center;
    background: rgba(161,140,209,0.3);
    color: #d8b4fe;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-bottom: 1px solid rgba(161,140,209,0.2);
}

.quiz-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    gap: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* Question Card */
.question-card {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    width: 100%;
    box-shadow: var(--shadow);
}
.question-number {
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}
.question-text {
    color: #fff;
    font-size: clamp(2rem, 7vw, 3.5rem);
    font-weight: 900;
    line-height: 1.2;
}

/* Answer Input */
.answer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}
.answer-input {
    width: 100%;
    max-width: 300px;
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font);
    text-align: center;
    border: 3px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-radius: var(--radius);
    padding: 0.75rem;
    outline: none;
    transition: border-color 0.2s;
}
.answer-input:focus { border-color: #667eea; }
.answer-input::placeholder { color: rgba(255,255,255,0.3); }

.submit-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
    font-family: var(--font);
    padding: 0.75rem 2.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(102,126,234,0.4);
}
.submit-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(102,126,234,0.6);
}
.submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Multiple-Choice Buttons */
.mc-choices {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}
.mc-btn {
    width: 100%;
    background: rgba(255,255,255,0.10);
    border: 2px solid rgba(255,255,255,0.20);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font);
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    line-height: 1.4;
}
.mc-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.45);
    transform: scale(1.015);
}
.mc-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Number Pad */
.numpad {
    width: 100%;
    max-width: 320px;
}
.numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}
.numpad-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font);
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    -webkit-user-select: none;
    user-select: none;
    min-height: 52px; /* comfortable tap target */
}
@media (max-width: 380px) {
    .numpad { max-width: 100%; }
    .numpad-btn { font-size: 1.2rem; padding: 0.6rem 0.4rem; min-height: 48px; }
}
.numpad-btn:hover, .numpad-btn:active {
    background: rgba(255,255,255,0.25);
    transform: scale(0.95);
}
.numpad-del { background: rgba(245,87,108,0.3); }
.numpad-ok  { background: linear-gradient(135deg, #43e97b, #38f9d7); color: #1a1a2e; font-weight: 900; }

/* Result Feedback */
.result-feedback {
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    width: 100%;
    border: 2px solid transparent;
}
.feedback-correct {
    border-color: var(--correct);
    background: rgba(67,233,123,0.1);
}
.feedback-wrong {
    border-color: var(--wrong);
    background: rgba(245,87,108,0.1);
}
.feedback-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.feedback-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 0.5rem;
}
.feedback-answer {
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}
.user-ans-badge {
    background: rgba(245,87,108,0.3);
    color: #ffb3bd;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
}
.correct-ans-badge {
    background: rgba(67,233,123,0.3);
    color: #a7f3d0;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
}
.feedback-explanation {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 0.5rem;
    background: rgba(255,255,255,0.05);
    padding: 0.75rem;
    border-radius: 10px;
}

.next-btn {
    background: linear-gradient(135deg, #f6d365, #fda085);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 800;
    font-family: var(--font);
    padding: 0.85rem 2.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(246,211,101,0.4);
    width: 100%;
}
.next-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 28px rgba(246,211,101,0.5);
}

/* ============================================================
   RESULTS PAGE
   ============================================================ */
.results-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 2rem 1rem;
    overflow-y: auto;
}

.results-container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.results-stars-row {
    display: flex;
    gap: 0.5rem;
    font-size: 3rem;
}
.results-star { transition: all 0.3s; }
.star-earned  { color: var(--star-gold); text-shadow: 0 0 20px rgba(255,215,0,0.8); }
.star-unearned { color: rgba(255,255,255,0.15); }

.star-pop-1 { animation: star-pop 0.4s 0.1s both; }
.star-pop-2 { animation: star-pop 0.4s 0.2s both; }
.star-pop-3 { animation: star-pop 0.4s 0.3s both; }
.star-pop-4 { animation: star-pop 0.4s 0.4s both; }
.star-pop-5 { animation: star-pop 0.4s 0.5s both; }

.results-score {
    color: #fff;
    font-size: clamp(3rem, 12vw, 5rem);
    font-weight: 900;
    line-height: 1;
}
.results-topic {
    color: rgba(255,255,255,0.6);
    font-size: 1.1rem;
    font-weight: 600;
}
.results-encouragement {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    animation: fade-in 0.6s ease both;
}

.new-best-badge {
    background: linear-gradient(135deg, #ffd700, #ff9500);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 900;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(255,215,0,0.5);
    animation: bounceIn 0.6s cubic-bezier(0.68,-0.55,0.265,1.55);
}

.treat-reveal {
    background: linear-gradient(135deg, rgba(102,126,234,0.3), rgba(118,75,162,0.3));
    border: 2px solid rgba(102,126,234,0.6);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    width: 100%;
    animation: bounceIn 0.8s 0.3s both;
}
.treat-icon  { font-size: 3rem; }
.treat-title { color: #fff; font-size: 1.2rem; font-weight: 800; margin: 0.5rem 0; }
.treat-text  { color: rgba(255,255,255,0.9); font-size: 1rem; font-style: italic; }

.all-correct-msg {
    color: var(--star-gold);
    font-size: 1.2rem;
    font-weight: 800;
    text-align: center;
    animation: bounceIn 0.6s 0.3s both;
}

/* Wrong Review */
.wrong-review {
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius);
    padding: 1rem;
    width: 100%;
}
.wrong-review h4 {
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}
.wrong-item {
    background: rgba(245,87,108,0.1);
    border: 1px solid rgba(245,87,108,0.25);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}
.wrong-question   { color: #fff; font-weight: 700; font-size: 1rem; }
.wrong-your-answer { color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.wrong-val        { color: #ff8a9b; font-weight: 700; }
.wrong-correct    { color: rgba(255,255,255,0.7); font-size: 0.85rem; }
.correct-val      { color: #a7f3d0; font-weight: 700; }
.wrong-explanation { color: rgba(255,255,255,0.65); font-size: 0.82rem; margin-top: 0.35rem; line-height: 1.4; }

.results-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}
.btn-xl {
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    font-family: var(--font) !important;
    padding: 0.9rem 1.5rem !important;
    border-radius: 50px !important;
}

/* ============================================================
   REVIEW SCREEN
   ============================================================ */

.review-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.review-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.review-counter {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    font-weight: 700;
    margin-left: auto;
}

.review-topic-name {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
}

.review-dots {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: center;
}

.review-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s;
    border: 2px solid transparent;
}
.review-dot:hover { transform: scale(1.3); }
.dot-correct { background: #4ade80; }
.dot-wrong   { background: #f87171; }
.dot-active  { border-color: #fff; transform: scale(1.25); }

.review-card-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
}

.review-passage {
    font-size: 0.9rem;
    max-height: 220px;
    overflow-y: auto;
}

.review-card {
    border-radius: var(--radius);
    padding: 1.5rem;
    border-left: 5px solid transparent;
}

.review-card-correct {
    background: rgba(74,222,128,0.1);
    border-left-color: #4ade80;
}

.review-card-wrong {
    background: rgba(248,113,113,0.1);
    border-left-color: #f87171;
}

.review-q-number {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
}

.review-q-text {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.review-answers {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.review-answer-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.review-label {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    min-width: 110px;
}

.review-badge {
    padding: 0.3rem 0.9rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
}

.badge-correct {
    background: rgba(74,222,128,0.2);
    color: #4ade80;
    border: 1px solid rgba(74,222,128,0.4);
}

.badge-wrong {
    background: rgba(248,113,113,0.2);
    color: #f87171;
    border: 1px solid rgba(248,113,113,0.4);
}

.review-explanation {
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    line-height: 1.5;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
}

.review-nav {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
}

.review-nav .btn-xl {
    flex: 1;
}

/* ============================================================
   PARENT PAGES
   ============================================================ */

/* Parent Login */
.parent-login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f3460 0%, #1a1a2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.parent-login-card {
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    max-width: 360px;
    width: 100%;
    color: #fff;
    box-shadow: var(--shadow);
}
.parent-logo { font-size: 3rem; margin-bottom: 0.5rem; }
.parent-login-card h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 0.25rem; }

/* Text elements inside the dark auth card — inputs stay white/dark as normal */
.parent-login-card .form-label {
    color: rgba(255,255,255,0.9);
    font-weight: 600;
    text-align: left;
    display: block;
}
.parent-login-card .text-muted {
    color: rgba(255,255,255,0.6) !important;
}
.parent-login-card a:not(.btn) {
    color: #93c5fd;
}
.parent-login-card a:not(.btn):hover {
    color: #bfdbfe;
}
.parent-login-card .form-check-label {
    color: rgba(255,255,255,0.8);
}

.pin-entry {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.25rem 0 0.75rem;
}
.pin-dot {
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 50%;
    transition: background 0.2s;
}
.pin-dot-filled { background: #fff; border-color: #fff; }
.pin-error { color: #ff8a9b; font-size: 0.9rem; margin-bottom: 0.5rem; }

.pin-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
}
.pin-key {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font);
    padding: 0.85rem;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.pin-key:hover, .pin-key:active { background: rgba(255,255,255,0.2); transform: scale(0.95); }
.pin-key-ok { background: linear-gradient(135deg, #43e97b, #38f9d7); color: #1a1a2e; }
.pin-key-del { background: rgba(245,87,108,0.3); }
.pin-key:disabled { opacity: 0.3; cursor: not-allowed; }

/* Parent Dashboard */
.parent-dashboard {
    min-height: 100vh;
    background: #f0f4f8;
}
.parent-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.parent-header h1 { font-size: 1.4rem; font-weight: 900; margin: 0; }

.parent-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 0.5rem 0;
    overflow-x: auto;
}
.parent-tab {
    background: #fff;
    border: 2px solid #e2e8f0;
    color: #64748b;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.2s;
}
.parent-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: #fff;
}

/* Child Progress Card */
.child-progress-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin: 0.75rem 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.child-progress-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.child-progress-header h4 { font-size: 1.2rem; font-weight: 800; color: var(--text-dark); margin: 0; }
.player-avatar-sm {
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* Topic Scores Grid */
.topic-scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
}
.topic-score-pill {
    background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
    border-radius: 12px;
    padding: 0.6rem 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}
.tsp-emoji { font-size: 1.3rem; }
.tsp-name  { color: rgba(255,255,255,0.9); font-size: 0.7rem; font-weight: 700; }
.tsp-score { color: #fff; font-size: 0.85rem; font-weight: 800; }
.tsp-score-none { color: rgba(255,255,255,0.5); font-size: 0.7rem; font-weight: 600; }

/* Recent Sessions */
.recent-sessions-list { display: flex; flex-direction: column; gap: 0.4rem; }
.session-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    flex-wrap: wrap;
}
.session-topic { color: var(--text-dark); font-weight: 600; flex: 1; min-width: 100px; }
.session-score { font-weight: 800; padding: 2px 8px; border-radius: 6px; }
.score-good { background: rgba(67,233,123,0.2); color: #15803d; }
.score-ok   { background: rgba(246,211,101,0.2); color: #b45309; }
.score-low  { background: rgba(245,87,108,0.15); color: #be123c; }
.session-date { color: #94a3b8; font-size: 0.78rem; }

/* Treat Card */
.treat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.treat-card-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.treat-card-header h4 { font-size: 1.1rem; font-weight: 800; color: var(--text-dark); margin: 0; }
.treat-display { }
.treat-threshold { font-size: 0.95rem; color: var(--text-dark); margin-bottom: 0.25rem; }
.treat-desc { font-size: 0.95rem; color: #475569; }

/* Settings Card */
.settings-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 0.75rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.no-children { text-align: center; color: #94a3b8; padding: 2rem; font-size: 1rem; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    backdrop-filter: blur(4px);
}
.modal-card {
    background: #fff;
    border-radius: 20px;
    padding: 1.75rem;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-card h3 { color: var(--text-dark); font-weight: 800; margin-bottom: 1rem; }

/* Emoji grid */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.35rem;
}
.emoji-btn {
    background: #f1f5f9;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 1.4rem;
    padding: 0.35rem;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
    text-align: center;
}
.emoji-btn:hover   { background: #e2e8f0; transform: scale(1.1); }
.emoji-selected    { border-color: var(--primary); background: rgba(102,126,234,0.1); transform: scale(1.15); }

/* Color grid */
.color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.color-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.color-btn:hover { transform: scale(1.15); }
.color-selected  { border-color: #1a1a2e; transform: scale(1.2); }

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes twinkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.7; transform: scale(1.1); }
}

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

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

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes bounceIn {
    0%   { opacity: 0; transform: scale(0.5); }
    70%  { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes star-pop {
    0%   { opacity: 0; transform: scale(0) rotate(-30deg); }
    70%  { transform: scale(1.3) rotate(5deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.bounce-in { animation: bounceIn 0.4s ease; }

.shake { animation: shake 0.4s ease; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-8px); }
    30%, 60%, 90% { transform: translateX(8px); }
}

/* ============================================================
   RESPONSIVE TWEAKS
   ============================================================ */

@media (max-width: 400px) {
    .topic-grid { grid-template-columns: repeat(2, 1fr); }
    .player-grid { grid-template-columns: repeat(2, 1fr); }
    .emoji-grid  { grid-template-columns: repeat(6, 1fr); }
}

@media (min-width: 600px) {
    .quiz-body { padding: 2rem; }
    .answer-input { font-size: 2.5rem; }
    .numpad { display: none !important; } /* hide on desktop */
    .answer-section { flex-direction: row; justify-content: center; }
    .answer-input { max-width: 200px; }
}

@media (min-width: 900px) {
    .topic-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Bootstrap overrides */
.btn { font-family: var(--font); font-weight: 700; }
.form-control { font-family: var(--font); }
.form-label   { font-weight: 700; color: var(--text-dark); }

/* ============================================================
   SPEED ROUND
   ============================================================ */

/* Intro */
.speed-intro {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    padding: 2rem 1rem;
}
.speed-intro-card {
    max-width: 420px; width: 100%; text-align: center;
    background: rgba(255,255,255,0.07); backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius);
    padding: 2.5rem 2rem;
}
.speed-topic-emoji { font-size: 3rem; margin-bottom: 0.5rem; }
.speed-title { color: #fff; font-size: 2rem; font-weight: 900; margin-bottom: 0.25rem; }
.speed-topic-name { color: rgba(255,255,255,0.7); font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }
.speed-desc { color: rgba(255,255,255,0.7); font-size: 0.95rem; line-height: 1.5; margin-bottom: 1.25rem; }
.speed-pb-badge {
    background: linear-gradient(135deg, #ffd700, #ff9500); color: #1a1a2e;
    font-weight: 800; padding: 0.5rem 1.25rem; border-radius: 50px;
    display: inline-block; margin-bottom: 1.25rem; font-size: 0.95rem;
}
.speed-start-btn {
    display: block; width: 100%; padding: 1rem; border: none; border-radius: 50px;
    background: linear-gradient(135deg, #f6d365, #fda085);
    color: #fff; font-size: 1.3rem; font-weight: 900; font-family: var(--font);
    cursor: pointer; box-shadow: 0 6px 24px rgba(253,160,133,0.5);
    transition: transform 0.15s; margin-bottom: 0.75rem;
}
.speed-start-btn:hover { transform: scale(1.04); }
.speed-back-btn {
    background: transparent; border: none; color: rgba(255,255,255,0.5);
    font-size: 0.9rem; cursor: pointer; padding: 0.5rem;
}
.speed-back-btn:hover { color: #fff; }

/* Playing */
.speed-page {
    min-height: 100vh; display: flex; flex-direction: column;
    background: linear-gradient(160deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    position: relative; overflow: hidden;
}
.speed-timer-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 1rem; color: #fff; font-weight: 700;
}
.speed-timer { font-size: 1.2rem; }
.timer-urgent { color: var(--wrong); animation: pulse 0.5s ease-in-out infinite; }
.speed-score-live {
    background: var(--correct); color: #fff; padding: 0.2rem 0.75rem;
    border-radius: 50px; font-size: 0.95rem;
}
.speed-timer-track { height: 6px; background: rgba(255,255,255,0.15); }
.speed-timer-fill {
    height: 100%; background: linear-gradient(90deg, #43e97b, #38f9d7);
    transition: width 1s linear; border-radius: 0 3px 3px 0;
}

/* Flash feedback */
.speed-flash {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 5rem; font-weight: 900; pointer-events: none; z-index: 100;
    animation: speed-flash-pop 0.3s ease-out forwards;
}
.flash-correct { color: var(--correct); }
.flash-wrong   { color: var(--wrong); }
@keyframes speed-flash-pop {
    0%   { transform: translate(-50%,-50%) scale(0.5); opacity: 1; }
    100% { transform: translate(-50%,-50%) scale(1.5); opacity: 0; }
}

/* Question area */
.speed-quiz-body {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 1rem; gap: 1.25rem;
    max-width: 600px; margin: 0 auto; width: 100%;
}
.speed-question-card {
    background: rgba(255,255,255,0.08); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius);
    padding: 2rem 1.5rem; text-align: center; width: 100%;
}
.speed-q-count { color: rgba(255,255,255,0.5); font-size: 0.8rem; font-weight: 600; margin-bottom: 0.5rem; }
.speed-q-text {
    color: #fff; font-size: clamp(1.8rem, 6vw, 3rem); font-weight: 900; line-height: 1.2;
}

/* Choices */
.speed-choices { display: flex; flex-direction: column; gap: 0.6rem; width: 100%; }
.speed-choice-btn {
    width: 100%; background: rgba(255,255,255,0.10); border: 2px solid rgba(255,255,255,0.20);
    color: #fff; font-size: 1.05rem; font-weight: 700; font-family: var(--font);
    padding: 0.85rem 1.25rem; border-radius: var(--radius); cursor: pointer;
    text-align: left; transition: background 0.15s, transform 0.1s;
}
.speed-choice-btn:hover { background: rgba(255,255,255,0.22); transform: scale(1.01); }

/* Input */
.speed-input-row { display: flex; gap: 0.5rem; width: 100%; max-width: 320px; }
.speed-input {
    flex: 1; font-size: 1.8rem; font-weight: 800; text-align: center;
    border: 3px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.08);
    color: #fff; border-radius: var(--radius); padding: 0.6rem; outline: none;
}
.speed-input:focus { border-color: var(--primary); }
.speed-input::placeholder { color: rgba(255,255,255,0.3); }
.speed-submit-btn {
    background: linear-gradient(135deg, #43e97b, #38f9d7); border: none;
    color: #1a1a2e; font-size: 1.5rem; font-weight: 900; padding: 0 1.25rem;
    border-radius: var(--radius); cursor: pointer; transition: transform 0.15s;
}
.speed-submit-btn:hover:not(:disabled) { transform: scale(1.05); }
.speed-submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.speed-numpad { width: 100%; max-width: 320px; margin-top: 0.5rem; }

/* Results */
.speed-results {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 2rem 1rem;
}
.speed-results-card {
    max-width: 420px; width: 100%; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
}
.speed-results-icon { font-size: 3rem; }
.speed-results-score {
    color: #fff; font-size: clamp(4rem, 15vw, 6rem); font-weight: 900; line-height: 1;
}
.speed-results-label { color: rgba(255,255,255,0.7); font-size: 1.1rem; font-weight: 600; }
.speed-pb-compare { padding: 0.5rem 1rem; border-radius: 50px; font-weight: 700; font-size: 0.9rem; }
.pb-match { background: rgba(67,233,123,0.15); color: var(--correct); }
.pb-under { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.speed-results-breakdown {
    display: flex; gap: 1.5rem; color: rgba(255,255,255,0.6); font-size: 0.9rem;
    font-weight: 600; margin-bottom: 0.5rem;
}

/* ============================================================
   SCRATCHPAD
   ============================================================ */
.scratchpad-toggle-row {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.scratchpad-toggle-btn {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.4);
    color: white;
    border-radius: 999px;
    padding: 0.45rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.scratchpad-toggle-btn:hover { background: rgba(255,255,255,0.28); }

.scratchpad-panel {
    margin: 1rem auto 0;
    max-width: 600px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.scratchpad-toolbar {
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.scratchpad-tool {
    border: 2px solid #cbd5e1;
    background: white;
    border-radius: 8px;
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: #475569;
    transition: all 0.15s;
}
.scratchpad-tool:hover { background: #e2e8f0; }
.scratchpad-tool.tool-active {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}
.scratchpad-clear { margin-left: auto; }
.scratchpad-clear:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }

.scratchpad-canvas {
    display: block;
    width: 100%;
    height: 300px;
    cursor: crosshair;
    touch-action: none;
    background: white;
}

/* ── Quiz content area: stacked on mobile, side-by-side on larger screens ── */
.quiz-content-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

@media (min-width: 900px) {
    .quiz-content-area {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
        gap: 1.5rem;
        padding: 0 1.5rem;
        max-width: 1100px;
        margin: 0 auto;
    }
    .quiz-content-area .quiz-body {
        flex: 0 0 480px;
        max-width: 480px;
        margin: 0;
    }
    .quiz-content-area .scratchpad-panel {
        flex: 1;
        max-width: 520px;
        min-width: 280px;
        margin-top: 0;
    }
    .quiz-content-area .scratchpad-canvas {
        height: 420px;
    }
}

/* ── Reading Comprehension: lift the 480px quiz-body cap on wide screens ───── */
/* The passage needs room to breathe; the question column stays at 420px (set   */
/* by the grid-template-columns rule above). This overrides the flex constraints */
/* from the generic .quiz-content-area rule above.                               */
@media (min-width: 900px) {
    .reading-layout .quiz-content-area {
        max-width: min(1440px, 94vw);
        padding: 0 1rem;
    }
    .reading-layout .quiz-content-area .quiz-body {
        flex: 1 1 auto;
        max-width: none;
    }
}

/* ============================================================
   SPACEMAN CHARACTERS
   ============================================================ */
.spaceman-svg {
    width: auto;
    display: block;
}

/* Jet flames always flicker */
.jet-flame {
    animation: flame-flicker 0.35s ease-in-out infinite alternate;
    transform-origin: center top;
}

@keyframes flame-flicker {
    0%   { transform: scaleY(0.8) scaleX(0.9); opacity: 0.85; }
    100% { transform: scaleY(1.15) scaleX(1.1); opacity: 1; }
}

/* ── Character state animations ── */

/* Idle: gentle float bob */
.char-idle .spaceman-svg {
    animation: spaceman-float 2.4s ease-in-out infinite;
}
@keyframes spaceman-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%       { transform: translateY(-10px) rotate(2deg); }
}

/* Celebrate: spin and scale up */
.char-celebrate .spaceman-svg {
    animation: spaceman-celebrate 0.7s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes spaceman-celebrate {
    0%   { transform: scale(1) rotate(0deg); }
    25%  { transform: scale(1.3) rotate(-15deg); }
    50%  { transform: scale(1.4) rotate(20deg) translateY(-12px); }
    75%  { transform: scale(1.25) rotate(-8deg) translateY(-6px); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Sad: droop and tilt */
.char-sad .spaceman-svg {
    animation: spaceman-sad 1.5s ease-in-out;
}
@keyframes spaceman-sad {
    0%   { transform: rotate(0deg) translateY(0); }
    15%  { transform: rotate(-12deg) translateY(4px); }
    85%  { transform: rotate(-10deg) translateY(4px); }
    100% { transform: rotate(0deg) translateY(0); }
}

/* Walk: sway side to side */
.char-walk .spaceman-svg {
    animation: spaceman-walk 1.0s ease-in-out infinite;
}
@keyframes spaceman-walk {
    0%, 100% { transform: translateX(0) rotate(-4deg); }
    50%       { transform: translateX(8px) rotate(4deg); }
}

/* Pep talk: excited bounce */
.char-pep .spaceman-svg {
    animation: spaceman-pep 0.5s ease-in-out infinite alternate;
}
@keyframes spaceman-pep {
    0%   { transform: translateY(0) scale(1); }
    100% { transform: translateY(-14px) scale(1.06); }
}

/* ── Pep Talk Screen ── */
.pep-screen {
    min-height: 100vh;
    background: linear-gradient(160deg, #0f0c29 0%, #302b63 50%, #1a0533 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

/* Twinkling background stars */
.pep-screen::before {
    content: '✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    padding: 2rem;
    color: rgba(255,255,255,0.12);
    font-size: 1.5rem;
    letter-spacing: 2rem;
    pointer-events: none;
    animation: twinkle 3s ease-in-out infinite;
}

.pep-topic-badge {
    background: rgba(255,255,255,0.12);
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 999px;
    padding: 0.5rem 1.5rem;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.pep-characters-row {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    max-width: 480px;
}

.pep-spaceman .spaceman-svg {
    height: 160px;
}

.pep-bubble {
    flex: 1;
    background: white;
    border-radius: 1.2rem;
    padding: 1.2rem 1rem;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    min-width: 0;
}

.pep-bubble::before {
    content: '';
    position: absolute;
    bottom: 28px;
    left: -14px;
    border: 10px solid transparent;
    border-right-color: white;
    border-left: 0;
}

.pep-bubble::after {
    content: '';
    position: absolute;
    bottom: 28px;
    right: -14px;
    border: 10px solid transparent;
    border-left-color: white;
    border-right: 0;
}

.pep-text {
    font-size: clamp(0.9rem, 3vw, 1.15rem);
    font-weight: 800;
    color: #1e293b;
    text-align: center;
    line-height: 1.45;
    margin: 0;
}

.pep-go-btn {
    background: linear-gradient(135deg, #f6d365, #fda085);
    border: none;
    border-radius: 999px;
    color: #fff;
    font-family: var(--font);
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    font-weight: 900;
    padding: 0.9rem 3rem;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(253,160,133,0.5);
    transition: transform 0.15s, box-shadow 0.15s;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}
.pep-go-btn:hover { transform: scale(1.06); box-shadow: 0 10px 30px rgba(253,160,133,0.6); }
.pep-go-btn:active { transform: scale(0.97); }

/* ── Character strip during quiz ── */
.quiz-char-strip {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2rem;
    padding: 0.25rem 1rem 0;
    position: relative;
}

.quiz-char-strip .spaceman-svg {
    height: 80px;
}

/* ── Star burst on correct answer ── */
.star-burst {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.6rem;
    pointer-events: none;
    animation: stars-fly 0.9s ease-out forwards;
    white-space: nowrap;
    letter-spacing: 0.2rem;
}
@keyframes stars-fly {
    0%   { opacity: 1; transform: translateX(-50%) translateY(0) scale(0.6); }
    60%  { opacity: 1; transform: translateX(-50%) translateY(-40px) scale(1.2); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-70px) scale(0.9); }
}

/* ============================================================
   POINTS & STREAK – RESULTS SCREEN
   ============================================================ */

.points-earned-badge {
    background: linear-gradient(135deg, #f6d365, #fda085);
    color: #fff;
    font-size: clamp(1.1rem, 4vw, 1.4rem);
    font-weight: 900;
    padding: 0.6rem 1.6rem;
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(253,160,133,0.5);
    text-align: center;
    animation: bounceIn 0.4s ease;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.points-total {
    font-size: 0.8em;
    opacity: 0.85;
    font-weight: 700;
}

.streak-info-badge {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
    font-size: clamp(1rem, 3.5vw, 1.2rem);
    font-weight: 800;
    padding: 0.5rem 1.4rem;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(239,68,68,0.4);
    text-align: center;
    animation: bounceIn 0.4s ease;
}

.streak-reward-reveal {
    background: linear-gradient(135deg, #f97316, #dc2626);
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(220,38,38,0.4);
    animation: bounceIn 0.5s ease;
}
.streak-reward-icon { font-size: 2.5rem; margin-bottom: 0.25rem; }
.streak-reward-title {
    color: #fff;
    font-size: clamp(1rem, 4vw, 1.3rem);
    font-weight: 800;
    margin-bottom: 0.4rem;
}
.streak-reward-text {
    color: rgba(255,255,255,0.92);
    font-size: clamp(1rem, 3.5vw, 1.2rem);
    font-weight: 700;
    font-style: italic;
}

/* ============================================================
   POINTS & STREAK – PLAYER CARDS (Home)
   ============================================================ */

.player-badges-row {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    min-height: 2rem;
    margin-top: 0.3rem;
}

.player-points-badge {
    background: linear-gradient(135deg, #f6d365, #fda085);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.18rem 0.7rem;
    border-radius: 999px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 2px 6px rgba(253,160,133,0.4);
}

.player-streak-badge {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.18rem 0.7rem;
    border-radius: 999px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 2px 6px rgba(239,68,68,0.35);
}

/* ============================================================
   POINTS & STREAK – PARENT DASHBOARD
   ============================================================ */

.child-stat-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}
.child-stat-badge-points {
    background: linear-gradient(135deg, #f6d365, #fda085);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.child-stat-badge-streak {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.treat-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0.75rem 0 0.25rem;
}

.treat-divider {
    margin: 1rem 0;
    border-color: #e2e8f0;
}

/* ============================================================
   ARCADE SHORTCUT BUTTON (TopicSelect header)
   ============================================================ */
.arcade-shortcut-btn {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 3px 10px rgba(239,68,68,0.4);
}
.arcade-shortcut-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(239,68,68,0.5);
}

/* ============================================================
   ARCADE PAGE
   ============================================================ */
.arcade-page {
    min-height: 100vh;
    background: linear-gradient(145deg, #0d0d1e 0%, #111827 50%, #0f1e3a 100%);
    color: #fff;
    font-family: var(--font);
}

.arcade-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-wrap: wrap;
}

.arcade-title {
    flex: 1;
    font-size: 1.25rem;
    font-weight: 900;
    background: linear-gradient(90deg, #fbbf24, #f87171, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.arcade-pts-badge {
    background: rgba(251,191,36,0.18);
    border: 1px solid #fbbf24;
    color: #fbbf24;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

.arcade-intro-text {
    text-align: center;
    padding: 1.25rem 1rem 0;
    color: rgba(255,255,255,0.8);
}
.arcade-intro-text p { margin: 0.25rem 0; }
.arcade-pts-info { font-size: 0.95rem; }

.arcade-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 16px;
    max-width: 640px;
    margin: 0 auto;
}

.arcade-card {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 18px;
    padding: 18px 14px 16px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.18s, background 0.18s, box-shadow 0.18s;
    user-select: none;
}
.arcade-card:hover, .arcade-card:active {
    background: rgba(255,255,255,0.14);
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}

.arcade-card-icon {
    font-size: 2.8rem;
    margin-bottom: 0.4rem;
    line-height: 1;
}

.arcade-card-name {
    font-weight: 800;
    font-size: 0.95rem;
    color: #fff;
    margin-bottom: 0.3rem;
}

.arcade-card-desc {
    font-size: 0.76rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 0.75rem;
    line-height: 1.35;
}

.arcade-card-cost {
    display: inline-block;
    background: rgba(251,191,36,0.15);
    border: 1px solid #fbbf24;
    color: #fbbf24;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
}

.arcade-card-best {
    margin-top: 0.4rem;
    font-size: 0.72rem;
    color: #a3e635;
    font-weight: 700;
}

/* Premium gate */
.arcade-gate {
    text-align: center;
    padding: 3rem 1.5rem;
    color: rgba(255,255,255,0.85);
}
.arcade-gate-icon { font-size: 4rem; margin-bottom: 1rem; }
.arcade-gate h2 { color: #fff; }
.btn-arcade-upgrade {
    display: inline-block;
    margin-top: 1rem;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 0.65rem 1.5rem;
    font-weight: 800;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 0.15s;
}
.btn-arcade-upgrade:hover { transform: translateY(-2px); }

.arcade-no-pts {
    background: rgba(239,68,68,0.15);
    border: 1px solid #ef4444;
    border-radius: 12px;
    padding: 0.75rem;
    color: #fca5a5;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* ============================================================
   SHARED GAME PAGE
   ============================================================ */
.game-page {
    min-height: 100vh;
    background: linear-gradient(145deg, #0d0d1e 0%, #111827 50%, #0f1e3a 100%);
    color: #fff;
    font-family: var(--font);
    display: flex;
    flex-direction: column;
}

.game-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.game-header-title {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}

.game-pts-badge {
    background: rgba(251,191,36,0.18);
    border: 1px solid #fbbf24;
    color: #fbbf24;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

/* Intro screen */
.game-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    text-align: center;
    flex: 1;
    gap: 0.6rem;
}
.game-intro h2 { color: #fff; font-size: 1.8rem; margin: 0; }
.game-intro p { color: rgba(255,255,255,0.75); margin: 0; max-width: 380px; }
.game-intro-icon { font-size: 4rem; line-height: 1; }
.game-intro-hint {
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem !important;
    line-height: 1.5;
}

.game-best-info {
    color: rgba(163,230,53,0.9) !important;
    font-size: 0.9rem !important;
}

.game-no-pts {
    background: rgba(239,68,68,0.15);
    border: 1px solid #ef4444;
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    color: #fca5a5;
    font-size: 0.9rem;
}

.btn-play-game {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 16px rgba(239,68,68,0.4);
}
.btn-play-game:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(239,68,68,0.5); }

.btn-back-arcade {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 24px;
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-back-arcade:hover { background: rgba(255,255,255,0.18); }

/* Result screen */
.game-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    text-align: center;
    flex: 1;
    gap: 0.75rem;
}
.game-result h2 { color: #fff; font-size: 1.8rem; margin: 0; }
.game-result-icon { font-size: 4rem; line-height: 1; }
.game-result-stat { color: rgba(255,255,255,0.85); font-size: 1rem; margin: 0; }

.game-new-best {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1a1a2e;
    border-radius: 999px;
    padding: 0.4rem 1.25rem;
    font-weight: 800;
    font-size: 0.95rem;
}

.game-result-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
    max-width: 280px;
    margin-top: 0.5rem;
}

/* Canvas */
.game-canvas {
    display: block;
    width: 100%;
    flex: 1;
    min-height: 0;
    touch-action: none;
}

/* ============================================================
   MEMORY MATCH
   ============================================================ */
.memory-stats-bar {
    display: flex;
    justify-content: space-around;
    padding: 0.6rem 1rem;
    background: rgba(255,255,255,0.05);
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(8px, 2vw, 14px);
    padding: clamp(12px, 3vw, 24px);
    max-width: min(680px, 98vw);
    width: 100%;
    margin: 0 auto;
    flex: 1;
    align-content: center;
}

.memory-card {
    aspect-ratio: 1;
    perspective: 700px;
    cursor: pointer;
}

.memory-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.38s ease;
    border-radius: 12px;
}

.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-back,
.memory-card-front {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    backface-visibility: hidden;
    font-size: clamp(2rem, 7vw, 3.2rem);
    user-select: none;
}

.memory-card-back {
    background: linear-gradient(135deg, #1e3a5f, #0f1e3a);
    border: 2px solid rgba(99,179,237,0.4);
    color: rgba(255,255,255,0.5);
    font-size: clamp(1.4rem, 5vw, 2.2rem);
}

.memory-card-front {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: 2px solid rgba(167,139,250,0.5);
    transform: rotateY(180deg);
}

.memory-card.matched .memory-card-front {
    background: linear-gradient(135deg, #059669, #10b981);
    border-color: #6ee7b7;
}

/* ============================================================
   NUMBER PUZZLE
   ============================================================ */
.puzzle-moves-bar {
    text-align: center;
    padding: 0.6rem;
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
}
.puzzle-best-inline { color: #a3e635; }

.puzzle-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 14px;
    max-width: 380px;
    margin: 0 auto;
    flex: 1;
    align-content: center;
}

.puzzle-tile {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: 2px solid rgba(167,139,250,0.45);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, 4.5vw, 1.6rem);
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    transition: transform 0.1s, background 0.15s;
    user-select: none;
}

.puzzle-tile-movable {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    border-color: #93c5fd;
    box-shadow: 0 0 12px rgba(99,179,237,0.4);
}

.puzzle-tile:not(.puzzle-tile-empty):active {
    transform: scale(0.93);
}

.puzzle-tile-empty {
    background: transparent;
    border: 2px dashed rgba(255,255,255,0.12);
    cursor: default;
    box-shadow: none;
}

/* ── Rewards Page ────────────────────────────────────────── */
.rewards-page { min-height: 100vh; background: var(--dark-bg); }

.rewards-nav-btn {
    background: rgba(255,215,0,0.15);
    border: 1px solid rgba(255,215,0,0.4);
    color: #ffd700;
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.rewards-nav-btn:hover { background: rgba(255,215,0,0.25); }

.reward-card {
    background: rgba(255,255,255,0.07);
    border-radius: var(--radius);
    padding: 1.25rem 1.25rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255,255,255,0.1);
}
.reward-card-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
}

/* Progress bar */
.reward-progress-track {
    background: rgba(255,255,255,0.12);
    border-radius: 99px;
    height: 14px;
    overflow: hidden;
    margin: 0.5rem 0;
}
.reward-progress-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s ease;
}
.reward-progress-streak { background: linear-gradient(90deg, #f6d365, #f093fb); }
.reward-progress-score  { background: linear-gradient(90deg, #43e97b, #38f9d7); }
.reward-progress-xp     { background: linear-gradient(90deg, #4facfe, #667eea); }
.reward-progress-label  { font-size: 0.8rem; color: rgba(255,255,255,0.6); text-align: center; }

/* Streak flames */
.streak-flames { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 0.5rem; }
.streak-flame  { font-size: 1.4rem; }
.flame-unlit   { filter: grayscale(1) opacity(0.3); }

/* Status pill */
.reward-status-pill {
    display: inline-block;
    border-radius: 99px;
    padding: 0.25rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 700;
    margin: 0.5rem 0;
}
.streak-status-safe    { background: rgba(67,233,123,0.2);  color: #43e97b; }
.streak-status-warning { background: rgba(255,193,7,0.2);   color: #ffc107; }
.streak-status-new     { background: rgba(79,172,254,0.2);  color: #4facfe; }

/* Prize box */
.reward-prize-box {
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 0.65rem 1rem;
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.reward-prize-label   { font-size: 0.75rem; color: rgba(255,255,255,0.5); }
.reward-prize-text    { color: rgba(255,255,255,0.75); font-size: 0.95rem; }
.reward-prize-unlocked { color: #ffd700; font-weight: 700; }

/* Achieved banner */
.reward-achieved-banner {
    background: linear-gradient(90deg, #f6d365, #fda085);
    color: #1a1a2e;
    font-weight: 800;
    text-align: center;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

/* Not set */
.reward-not-set      { color: rgba(255,255,255,0.45); font-size: 0.95rem; padding: 0.5rem 0; }
.reward-not-set-hint { font-size: 0.8rem; }

/* Hint text */
.reward-hint { font-size: 0.82rem; color: rgba(255,255,255,0.5); margin-top: 0.6rem; line-height: 1.5; }

/* Score reward comparison */
.reward-score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 0.75rem 0;
}
.reward-score-current, .reward-score-target {
    text-align: center;
}
.reward-score-num  { font-size: 2.2rem; font-weight: 900; color: #fff; line-height: 1; }
.reward-score-sub  { font-size: 0.72rem; color: rgba(255,255,255,0.5); margin-top: 2px; }
.reward-score-arrow { font-size: 1.5rem; color: rgba(255,255,255,0.3); }
.score-achieved .reward-score-num { color: #43e97b; }

/* Level display */
.level-display     { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
.level-badge-big   { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; font-weight: 900; font-size: 1.4rem; border-radius: 12px; padding: 0.4rem 0.9rem; }
.level-title-big   { font-size: 1.1rem; font-weight: 700; color: #fff; }

/* Stars balance */
.stars-balance-display { display: flex; align-items: baseline; gap: 0.4rem; margin-bottom: 0.5rem; }
.stars-balance-num     { font-size: 3rem; font-weight: 900; color: #ffd700; line-height: 1; }
.stars-balance-label   { font-size: 1rem; color: rgba(255,255,255,0.6); }

/* child-stars-badge in topic header */
.child-stars-badge {
    background: rgba(255,215,0,0.15);
    border: 1px solid rgba(255,215,0,0.35);
    color: #ffd700;
    border-radius: 20px;
    padding: 0.25rem 0.7rem;
    font-size: 0.85rem;
    font-weight: 700;
}

/* ── Cookie Banner ─────────────────────────────────────────────────── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.9rem 1.5rem;
    background: rgba(26, 26, 46, 0.97);
    border-top: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
}

.cookie-banner-text { flex: 1; min-width: 200px; }

.cookie-banner-link {
    color: #a0c4ff;
    text-decoration: underline;
    margin-left: 0.4rem;
}

.cookie-banner-btn {
    white-space: nowrap;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 0.5rem 1.25rem;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
}

.cookie-banner-btn:hover { opacity: 0.85; }

/* ── Landing Page ──────────────────────────────────────────────────── */
.landing-page {
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    min-height: 100vh;
    color: #fff;
    font-family: var(--font);
}

/* Nav */
.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.landing-nav-brand { display: flex; align-items: center; gap: 0.5rem; }
.landing-nav-stars { font-size: 1.4rem; }
.landing-nav-title { font-size: 1.3rem; font-weight: 900; letter-spacing: -0.5px; }
.landing-nav-links { display: flex; gap: 0.75rem; align-items: center; }

/* Promo banner */
.promo-banner {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 50%, #f6d365 100%);
    background-size: 200% 200%;
    animation: promo-shimmer 4s ease infinite;
    padding: 1.5rem 1.5rem;
    text-align: center;
    color: #1a1a2e;
}
@keyframes promo-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.promo-banner-inner {
    display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
    max-width: 640px; margin: 0 auto;
}
.promo-banner-headline {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: -0.3px;
}
.promo-banner-sub {
    font-size: 0.9rem;
    font-weight: 600;
    max-width: 560px;
    line-height: 1.5;
}
.promo-code {
    background: rgba(0,0,0,0.15);
    padding: 0.2rem 0.6rem;
    border-radius: 5px;
    font-weight: 900;
    font-size: 1.05rem;
    letter-spacing: 1px;
}
.promo-banner-btn {
    margin-top: 0.25rem;
    padding: 0.5rem 2rem;
    font-size: 1rem;
    border-radius: 2rem;
}
@media (max-width: 480px) {
    .promo-banner-headline { font-size: 1.1rem; }
    .promo-banner-sub { font-size: 0.85rem; }
}

/* Hero */
.landing-hero {
    padding: 3rem 2rem 3rem;
    text-align: center;
}
.landing-hero-inner { max-width: 680px; margin: 0 auto; }
.landing-hero-badge {
    display: inline-block;
    background: rgba(255,215,0,0.15);
    border: 1px solid rgba(255,215,0,0.4);
    color: #ffd700;
    padding: 0.3rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.landing-countdown {
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}
.landing-countdown strong {
    color: #ffd700;
    font-weight: 800;
}
.landing-hero-h1 {
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}
.landing-hero-highlight {
    background: linear-gradient(90deg, #ffd700, #fa709a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.landing-hero-sub {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.6;
    margin-bottom: 2rem;
}
.landing-cta-row { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.landing-hero-note {
    margin-top: 1.5rem;
    margin-bottom: 0;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

/* Sections */
.landing-section { padding: 4rem 2rem; }
.landing-section-alt { background: rgba(255,255,255,0.03); }
.landing-cta-section { padding: 4rem 2rem; background: rgba(255,215,0,0.05); border-top: 1px solid rgba(255,215,0,0.15); }
.landing-container { max-width: 960px; margin: 0 auto; }
.landing-section-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 900;
    text-align: center;
    margin-bottom: 0.75rem;
}
.landing-section-sub {
    text-align: center;
    color: rgba(255,255,255,0.6);
    margin-bottom: 2.5rem;
    font-size: 1rem;
}

/* Subjects */
.landing-subjects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.landing-subject-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    padding: 2rem;
}
.landing-subject-card h3 { font-size: 1.2rem; font-weight: 800; margin: 0.5rem 0 1rem; }
.landing-subject-icon { font-size: 2.5rem; }
.landing-topic-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.landing-topic-list li { color: rgba(255,255,255,0.75); font-size: 0.95rem; }
.landing-topic-list li::before { content: "✓ "; color: #43e97b; font-weight: 700; }

/* Steps */
.landing-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    text-align: center;
}
.landing-step { padding: 1rem; }
.landing-step-num {
    width: 3rem; height: 3rem;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
}
.landing-step h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.5rem; }
.landing-step p { color: rgba(255,255,255,0.65); font-size: 0.95rem; }

/* Features */
.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}
.landing-feature {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.landing-feature-icon { font-size: 2rem; display: block; margin-bottom: 0.75rem; }
.landing-feature h3 { font-size: 1rem; font-weight: 800; margin-bottom: 0.4rem; }
.landing-feature p { color: rgba(255,255,255,0.65); font-size: 0.9rem; line-height: 1.5; margin: 0; }

/* Footer */
.landing-footer {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 1.5rem 2rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
}
.landing-footer .landing-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.landing-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.landing-footer a { color: rgba(255,255,255,0.5); text-decoration: none; }
.landing-footer a:hover { color: #fff; }

/* ===================== Demo Quiz (Landing Page) ===================== */
/* Reuses the real quiz CSS classes (quiz-topbar, question-card, mc-btn,
   result-feedback, results-*, wrong-*, etc.) so the demo looks identical
   to the in-app quiz. Only demo-specific wrappers and the intro/CTA are
   styled here. */

.demo-section { background: rgba(102,126,234,0.08); border-top: 1px solid rgba(102,126,234,0.15); }

/* ── Intro ── */
.demo-intro { text-align: center; padding: 1.5rem 0; }
.demo-intro h3 { color: #fff; font-size: 1.5rem; margin-bottom: 0.25rem; }
.demo-intro p  { color: rgba(255,255,255,0.7); margin-bottom: 1.25rem; }

.demo-topic-grid {
    display: grid; grid-template-columns: repeat(3, minmax(130px, 160px)); gap: 1rem;
    justify-content: center; margin: 0 auto;
}
.demo-topic-grid .topic-card {
    aspect-ratio: 1; justify-content: center;
}
@media (max-width: 480px) { .demo-topic-grid { grid-template-columns: repeat(2, minmax(130px, 150px)); } }

/* ── Pep talk (embedded on landing page — same as .pep-screen but inline) ── */
.demo-pep-screen {
    background: linear-gradient(160deg, #0f0c29 0%, #302b63 50%, #1a0533 100%);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 2rem 1.5rem; gap: 1rem; border-radius: var(--radius);
    position: relative; overflow: hidden;
}
.demo-pep-screen::before {
    content: '✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧ ✦ ✧';
    position: absolute; inset: 0; display: flex; align-items: flex-start; padding: 2rem;
    color: rgba(255,255,255,0.12); font-size: 1.5rem; letter-spacing: 2rem;
    pointer-events: none; animation: twinkle 3s ease-in-out infinite;
}

/* ── Quiz wrapper (embedded on landing page) ── */
.demo-quiz-wrapper {
    max-width: 600px; margin: 0 auto;
    background: linear-gradient(160deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    border-radius: var(--radius); overflow: hidden;
}

/* ── Results wrapper ── */
.demo-results-wrapper {
    max-width: 600px; margin: 0 auto;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: var(--radius); padding: 2rem 1rem;
}

/* ── CTA box (demo-only) ── */
.demo-cta-box {
    background: linear-gradient(135deg, rgba(102,126,234,0.15), rgba(118,75,162,0.15));
    border: 1px solid rgba(102,126,234,0.25); border-radius: 16px;
    padding: 1.5rem; text-align: center;
}
.demo-cta-box h3 { color: #fff; margin-bottom: 0.25rem; }
.demo-cta-box > p  { color: rgba(255,255,255,0.7); margin-bottom: 1rem; }
.demo-cta-buttons { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.demo-cta-note { color: rgba(255,255,255,0.45); font-size: 0.8rem; margin-top: 0.75rem; margin-bottom: 0; }

.demo-social-proof {
    background: rgba(67,233,123,0.1); border: 1px solid rgba(67,233,123,0.25);
    border-radius: 50px; padding: 0.4rem 1rem; margin-bottom: 1rem;
    color: rgba(255,255,255,0.85); font-size: 0.9rem; display: inline-block;
}
.demo-social-proof strong { color: var(--correct); }

/* Tier comparison mini-cards */
.demo-tier-compare {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
    margin-bottom: 1.25rem; text-align: left;
}
@media (max-width: 480px) {
    .demo-tier-compare { grid-template-columns: 1fr; }
}
.demo-tier {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px; padding: 1rem; position: relative;
}
.demo-tier-premium {
    border-color: rgba(255,215,0,0.35);
    background: rgba(255,215,0,0.06);
}
.demo-tier-badge {
    position: absolute; top: -10px; right: 12px;
    background: linear-gradient(135deg, #ffd700, #ff9500); color: #1a1a2e;
    font-size: 0.7rem; font-weight: 800; padding: 2px 10px;
    border-radius: 50px; text-transform: uppercase; letter-spacing: 0.5px;
}
.demo-tier-label { color: #fff; font-size: 1rem; font-weight: 800; }
.demo-tier-price { color: #fff; font-size: 1.5rem; font-weight: 900; margin-bottom: 0.5rem; }
.demo-tier-price span { font-size: 0.8rem; font-weight: 400; color: rgba(255,255,255,0.5); }
.demo-tier-list {
    list-style: none; padding: 0; margin: 0;
    font-size: 0.82rem; color: rgba(255,255,255,0.75); line-height: 1.8;
}
.demo-tier-list li::before { content: '✓ '; color: var(--correct); font-weight: 700; }
.demo-tier-list li strong { color: #fff; }

/* ===================== Account Pages (Profile, Communications) ===================== */

.account-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(160deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
}
.account-card {
    width: 100%; max-width: 480px;
    background: rgba(255,255,255,0.06); backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 16px;
    padding: 2rem;
}
.account-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.account-header h2 { color: #fff; margin: 0; font-size: 1.4rem; }
.account-form .form-label { color: rgba(255,255,255,0.8); font-weight: 600; }
.account-form .form-control {
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
    color: #fff; border-radius: 10px;
}
.account-form .form-control:focus { border-color: var(--primary); background: rgba(255,255,255,0.12); color: #fff; }
.account-form .form-control::placeholder { color: rgba(255,255,255,0.3); }
.account-link-row { display: flex; flex-direction: column; gap: 0.5rem; }
.account-info-row { display: flex; justify-content: space-between; align-items: center; padding: 0.3rem 0; }

.consent-item { margin-bottom: 0.25rem; }
.consent-item .form-check-label strong { color: #fff; }
.consent-essential { opacity: 0.6; }

/* Review stars */
.review-star { transition: color 0.15s; }
.star-active   { color: var(--star-gold); }
.star-inactive { color: rgba(255,255,255,0.2); }

/* ===================== Feedback Page ===================== */
.feedback-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem 4rem;
}
.feedback-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 600px;
}
.feedback-header { text-align: center; margin-bottom: 2rem; }
.feedback-header h1 { font-size: 1.8rem; font-weight: 900; color: #fff; margin-bottom: 0.5rem; }
.feedback-subtitle { color: rgba(255,255,255,0.65); font-size: 1rem; margin: 0; }

.feedback-field { margin-bottom: 1.5rem; }
.feedback-label {
    display: block;
    color: rgba(255,255,255,0.85);
    font-weight: 700;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}
.feedback-hint { color: rgba(255,255,255,0.45); font-size: 0.85rem; margin-top: 0.3rem; }

/* Category buttons */
.feedback-category-grid {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.feedback-cat-btn {
    padding: 0.55rem 1.1rem;
    border-radius: 2rem;
    border: 2px solid rgba(255,255,255,0.25);
    background: transparent;
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
}
.feedback-cat-btn:hover { border-color: rgba(255,255,255,0.55); color: #fff; }
.feedback-cat-active {
    border-color: var(--primary) !important;
    background: var(--primary) !important;
    color: #fff !important;
}

/* Star rating */
.feedback-stars {
    display: flex;
    gap: 0.5rem;
}
.feedback-star-btn {
    font-size: 2.2rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.25);
    cursor: pointer;
    line-height: 1;
    transition: transform 0.1s, color 0.15s;
    padding: 0;
}
.feedback-star-btn:hover { transform: scale(1.2); color: #f6d365; }
.feedback-star-filled { color: #f6d365 !important; }
.feedback-rating-label {
    margin-top: 0.4rem;
    color: #f6d365;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Textarea + input */
.feedback-textarea, .feedback-input {
    width: 100%;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 0.6rem;
    color: #fff;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    resize: vertical;
}
.feedback-textarea::placeholder, .feedback-input::placeholder { color: rgba(255,255,255,0.35); }
.feedback-textarea:focus, .feedback-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.3);
}

/* Submit row */
.feedback-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}
.feedback-submit-btn { min-width: 160px; }

/* Success state */
.feedback-success {
    text-align: center;
    padding: 2rem 1rem;
}
.feedback-success-icon { font-size: 4rem; margin-bottom: 1rem; }
.feedback-success h2 { font-size: 1.8rem; font-weight: 900; color: #fff; }
.feedback-success p { color: rgba(255,255,255,0.75); font-size: 1rem; }

/* Admin feedback cards */
.feedback-admin-card { border: 1px solid rgba(255,255,255,0.1); }

/* ============================================================
   SCHOOL / ACCOUNT TYPE
   ============================================================ */

.logo-school-name {
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.03em;
}

.school-name-badge {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    font-size: 0.85rem;
    color: #fff;
    font-weight: 600;
    margin-right: auto;
}

.class-tag {
    background: rgba(99,179,237,0.25);
    border: 1px solid rgba(99,179,237,0.5);
    color: #90cdf4;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.1rem 0.55rem;
    white-space: nowrap;
}
.class-tag-empty {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.4);
}

.class-filter-row { background: rgba(255,255,255,0.05); border-radius: 12px; padding: 0.75rem 1rem; }

.pupil-row {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 0.4rem 0.75rem;
}

.pupils-tab { padding: 0.5rem 0; }

/* ============================================================
   LEADERBOARD
   ============================================================ */

.leaderboard-page {
    min-height: 100vh;
    background: var(--bg-dark);
    padding-bottom: 3rem;
}

.leaderboard-header {
    background: linear-gradient(135deg, #1a1a3e 0%, #2d1b69 50%, #1a1a3e 100%);
    padding: 1.5rem 1rem 1rem;
    text-align: center;
    position: relative;
}
.leaderboard-header h1 { color: #fff; font-size: 2rem; font-weight: 900; margin: 0.5rem 0 0.25rem; }
.leaderboard-sub { color: rgba(255,255,255,0.6); font-size: 0.9rem; margin: 0; }
.leaderboard-header .back-btn { position: absolute; top: 1rem; left: 1rem; }

.lb-metric-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    flex-wrap: wrap;
}
.lb-tab {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.lb-tab.active, .lb-tab:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}

.lb-scope-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1rem 0.75rem;
    flex-wrap: wrap;
}
.lb-scope {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.6);
    border-radius: 999px;
    padding: 0.3rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.lb-scope.active, .lb-scope:hover { background: rgba(255,255,255,0.16); color: #fff; }

.lb-class-filter {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding: 0 1rem 0.75rem;
}

.lb-game-selector {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding: 0 1rem 0.75rem;
}

.lb-loading { display: flex; justify-content: center; padding: 3rem; }

.lb-list { max-width: 640px; margin: 0 auto; padding: 0 1rem; }

.lb-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 0.65rem 1rem;
    margin-bottom: 0.5rem;
    transition: background 0.15s;
}
.lb-top-1 { background: rgba(255,215,0,0.12);  border-color: rgba(255,215,0,0.35); }
.lb-top-2 { background: rgba(192,192,192,0.1); border-color: rgba(192,192,192,0.3); }
.lb-top-3 { background: rgba(205,127,50,0.1);  border-color: rgba(205,127,50,0.3); }
.lb-me    { outline: 2px solid rgba(99,179,237,0.7); }

.lb-rank  { font-size: 1.1rem; font-weight: 900; color: #fff; min-width: 2.5rem; text-align: center; }
.lb-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.lb-name  { color: #fff; font-weight: 700; flex: 1; }
.lb-class-tag {
    background: rgba(99,179,237,0.2);
    border: 1px solid rgba(99,179,237,0.4);
    color: #90cdf4;
    border-radius: 999px;
    font-size: 0.7rem;
    padding: 0.1rem 0.5rem;
    font-weight: 700;
}
.lb-value { color: var(--star-gold); font-weight: 900; font-size: 0.95rem; white-space: nowrap; }
.lb-empty { color: rgba(255,255,255,0.4); text-align: center; padding: 2rem; }

/* ============================================================
   PRICING PAGE
   ============================================================ */

.pricing-page {
    min-height: 100vh;
    background: var(--bg-dark);
    padding-bottom: 4rem;
}

.pricing-header {
    background: linear-gradient(135deg, #1a1a3e 0%, #2d1b69 50%, #1a1a3e 100%);
    padding: 2.5rem 1rem 2rem;
    text-align: center;
}
.pricing-header h1 { color: #fff; font-size: 2.2rem; font-weight: 900; margin-bottom: 0.25rem; }
.pricing-header p  { color: rgba(255,255,255,0.65); margin-bottom: 1.5rem; }

.pricing-toggle {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    font-size: 0.9rem;
    gap: 0.25rem;
}
.toggle-active { color: #fff; }
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.25);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: #667eea; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

.saving-badge {
    background: #43e97b;
    color: #1a1a3e;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    margin-left: 0.3rem;
}

.pricing-sections { max-width: 900px; margin: 0 auto; padding: 0 1rem; }

.pricing-section { margin-top: 3rem; }
.pricing-section h2 { color: #fff; font-size: 1.4rem; font-weight: 900; margin-bottom: 0.25rem; }
.pricing-section-sub { color: rgba(255,255,255,0.5); margin-bottom: 1.25rem; font-size: 0.9rem; }

.pricing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.pricing-card {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.pricing-card-highlight {
    background: linear-gradient(135deg, rgba(102,126,234,0.25), rgba(118,75,162,0.25));
    border-color: rgba(102,126,234,0.5);
}
.pricing-card-name  { color: #fff; font-weight: 900; font-size: 1.05rem; }
.pricing-card-desc  { color: rgba(255,255,255,0.55); font-size: 0.82rem; min-height: 2.5rem; display: flex; align-items: center; justify-content: center; }
.pricing-card-price { margin: 0.5rem 0; }
.price-amount { color: #fff; font-size: 1.8rem; font-weight: 900; }
.price-period { color: rgba(255,255,255,0.5); font-size: 0.85rem; margin-left: 0.2rem; }
.pricing-card-limit { color: rgba(255,255,255,0.45); font-size: 0.78rem; }
.pricing-cta { margin-top: 0.75rem; font-weight: 700; border-radius: 999px; }

.pricing-footer {
    text-align: center;
    margin-top: 3rem;
    color: rgba(255,255,255,0.45);
    font-size: 0.85rem;
}
.pricing-footer a { color: rgba(255,255,255,0.7); }

/* ============================================================
   SCHOOL LANDING PAGE
   ============================================================ */

.school-callout-strip {
    background: linear-gradient(90deg, rgba(102,126,234,0.2), rgba(118,75,162,0.2));
    border-top: 1px solid rgba(102,126,234,0.3);
    border-bottom: 1px solid rgba(102,126,234,0.3);
    padding: 0.9rem 1.5rem;
}
.school-callout-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.school-callout-icon { font-size: 1.6rem; flex-shrink: 0; }
.school-callout-inner strong { color: #fff; font-size: 0.95rem; }
.school-callout-text { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.school-callout-btn { flex-shrink: 0; margin-left: auto; }

.school-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.school-feature-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 1.5rem;
}
.school-feature-icon { font-size: 2rem; display: block; margin-bottom: 0.75rem; }
.school-feature-card h3 { color: #fff; font-size: 1.05rem; font-weight: 800; margin-bottom: 0.4rem; }
.school-feature-card p  { color: rgba(255,255,255,0.65); font-size: 0.9rem; line-height: 1.55; margin: 0; }

.school-pricing-toggle {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    font-size: 0.9rem;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
}

.school-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.family-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    max-width: 640px;
    margin: 0 auto;
}

.school-pricing-card {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    padding: 1.75rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    position: relative;
}
.school-pricing-card-highlight {
    background: linear-gradient(160deg, rgba(102,126,234,0.25), rgba(118,75,162,0.25));
    border-color: rgba(102,126,234,0.55);
    box-shadow: 0 8px 32px rgba(102,126,234,0.2);
}
.school-pricing-badge {
    position: absolute;
    top: -0.65rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #f6d365, #fda085);
    color: #1a1a3e;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.school-pricing-name  { color: #fff; font-weight: 900; font-size: 1.1rem; }
.school-pricing-desc  { color: rgba(255,255,255,0.5); font-size: 0.82rem; min-height: 2.2rem; }
.school-pricing-price { margin: 0.5rem 0; }
.school-price-amount  { color: #fff; font-size: 2rem; font-weight: 900; }
.school-price-period  { color: rgba(255,255,255,0.45); font-size: 0.85rem; margin-left: 0.2rem; }
.school-pricing-limit { color: rgba(255,255,255,0.45); font-size: 0.8rem; }

.school-pricing-features {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
    flex: 1;
}
.school-pricing-features li {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    padding: 0.2rem 0;
}
.school-pricing-features li::before { content: "✓ "; color: #43e97b; font-weight: 700; }

.school-pricing-cta {
    margin-top: 1rem;
    border-radius: 999px;
    font-weight: 700;
}

.school-pricing-note {
    text-align: center;
    color: rgba(255,255,255,0.45);
    font-size: 0.85rem;
    margin-top: 1.5rem;
}
.school-pricing-note a { color: rgba(255,255,255,0.65); }

/* School FAQ */
.school-faq { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.school-faq-item { background: rgba(255,255,255,0.05); border-radius: 14px; padding: 1.25rem 1.5rem; }
.school-faq-item h3 { color: #fff; font-size: 1rem; font-weight: 800; margin-bottom: 0.5rem; }
.school-faq-item p  { color: rgba(255,255,255,0.65); font-size: 0.88rem; line-height: 1.55; margin: 0; }
.school-faq-item a  { color: rgba(255,255,255,0.8); }

/* ── Family pricing compare table ── */
.family-compare-table {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    overflow: hidden;
    max-width: 640px;
    margin: 0 auto;
}
.fct-header, .fct-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0;
}
.fct-header {
    background: rgba(255,255,255,0.1);
    font-weight: 800;
    font-size: 0.85rem;
    color: #fff;
}
.fct-row { border-top: 1px solid rgba(255,255,255,0.07); }
.fct-row:nth-child(even) { background: rgba(255,255,255,0.03); }
.fct-feature, .fct-free, .fct-premium { padding: 0.65rem 1rem; }
.fct-feature { color: rgba(255,255,255,0.75); font-size: 0.88rem; }
.fct-free    { color: rgba(255,255,255,0.5);  font-size: 0.85rem; text-align: center; min-width: 110px; }
.fct-premium { color: #43e97b; font-size: 0.85rem; text-align: center; min-width: 110px; font-weight: 700; }

/* ── Admin filter cards ── */
.admin-filter-card {
    transition: transform 0.1s, box-shadow 0.1s;
    user-select: none;
}
.admin-filter-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.admin-filter-active {
    outline: 3px solid #fff;
    outline-offset: 2px;
    transform: translateY(-2px);
}

/* ── Admin pupil usage bar ── */
.admin-usage-bar {
    height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
    width: 80px;
    overflow: hidden;
}
.admin-usage-fill {
    height: 100%;
    background: #43e97b;
    border-radius: 999px;
    transition: width 0.3s;
    min-width: 2px;
}
.admin-usage-near { background: #f6d365; }
.admin-usage-full { background: #f5576c; }

/* ── Subscription tier comparison ── */
.tier-comparison {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}
.tier-col {
    flex: 1;
    border-radius: 10px;
    padding: 1rem 1.1rem;
}
.tier-free {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
}
.tier-premium {
    background: linear-gradient(135deg, #fef9c3, #fef3c7);
    border: 2px solid #fbbf24;
}
.tier-title {
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 0.6rem;
    color: #1e293b;
}
.tier-premium .tier-title { color: #92400e; }
.tier-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    color: #475569;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.tier-premium ul { color: #78350f; }
@media (max-width: 540px) {
    .tier-comparison { flex-direction: column; }
}

/* ── Heatmap ── */
.heatmap-table { font-size: 0.8rem; }
.heatmap-th    { min-width: 38px; font-size: 0.75rem; white-space: nowrap; }
.heatmap-cell  { min-width: 38px; font-weight: 600; }
.heatmap-light-green { background-color: #5cb85c !important; color: #fff; }

/* ── Child History Page ── */
.history-page { min-height: 100vh; background: var(--bg-dark); padding-bottom: 3rem; }
.history-title { color: #fff; font-size: 1.2rem; font-weight: 800; margin: 0 0 0 auto; }
.history-section { max-width: 860px; margin: 1.5rem auto; padding: 0 1rem; }
.history-section-title { color: #fff; font-size: 1rem; font-weight: 800; margin-bottom: 0.75rem; }
.history-empty {
    text-align: center; color: rgba(255,255,255,0.8);
    padding: 3rem 1rem;
}
.history-empty h3 { color: #fff; margin-top: 0.5rem; }

/* Best scores topic grid */
.topic-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}
.topic-stat-card {
    background: rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 0.9rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    text-align: center;
}
.topic-stat-emoji  { font-size: 1.6rem; }
.topic-stat-name   { color: rgba(255,255,255,0.9); font-size: 0.75rem; font-weight: 700; }
.topic-stat-stars  { display: flex; gap: 1px; font-size: 0.85rem; }
.topic-stat-bar-track {
    width: 100%; height: 5px;
    background: rgba(255,255,255,0.15);
    border-radius: 999px;
    overflow: hidden;
}
.topic-stat-bar-fill {
    height: 100%; background: #43e97b;
    border-radius: 999px;
    transition: width 0.6s;
}
.topic-stat-meta   { color: rgba(255,255,255,0.65); font-size: 0.7rem; display: flex; gap: 0.3rem; align-items: center; }
.topic-stat-attempts { color: rgba(255,255,255,0.45); font-size: 0.65rem; }
.trend-up          { color: #43e97b; font-weight: 700; }

/* Recent sessions timeline */
.session-date-label {
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 1rem 0 0.4rem;
}
.session-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.4rem;
}
.session-topic-emoji { font-size: 1.35rem; width: 2rem; text-align: center; flex-shrink: 0; }
.session-info { flex: 1; min-width: 0; }
.session-topic-name { color: #fff; font-size: 0.85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-score-bar-track {
    width: 100%; height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 4px;
}
.session-score-bar-fill {
    height: 100%; border-radius: 999px; transition: width 0.5s;
}
.fill-good { background: #43e97b; }
.fill-ok   { background: #f6d365; }
.fill-low  { background: #f5576c; }
.session-right   { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.session-score-text { color: #fff; font-size: 0.85rem; font-weight: 800; }
.session-stars-mini { display: flex; gap: 1px; }
.session-time    { color: rgba(255,255,255,0.45); font-size: 0.68rem; }

/* ── Weak Spots Tab ── */
.weakspots-tab { padding: 0.75rem 0 1.5rem; }
.weakspots-topic-heading {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin: 0 0 0.4rem;
}

/* ── Parent Activity Tab ── */
.activity-tab { padding: 0.75rem 0 1.5rem; }

/* Default: stacked (mobile) */
.activity-split {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Side-by-side on wider screens */
@media (min-width: 860px) {
    .activity-split {
        flex-direction: row;
        align-items: flex-start;
        gap: 1.25rem;
    }
    .activity-stats-panel { flex: 0 0 320px; }
    .activity-chart-panel { flex: 1; min-width: 0; }
}

.activity-stats-panel {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.activity-chart-panel { flex: 1; min-width: 0; }

.activity-panel-title {
    color: #1e293b;
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0 0 0.6rem;
}

/* Child summary table */
.activity-stats-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    font-size: 0.85rem;
}

.activity-stats-table thead tr {
    background: #f1f5f9;
}

.activity-stats-table th {
    padding: 0.5rem 0.75rem;
    color: #64748b;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.activity-stats-table td {
    padding: 0.55rem 0.75rem;
    color: #1e293b;
    border-top: 1px solid #f1f5f9;
    vertical-align: middle;
}

.activity-stats-table tbody tr:hover {
    background: #f8fafc;
}

.activity-child-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    vertical-align: middle;
    margin-right: 0.4rem;
}

.activity-child-name {
    color: #1e293b;
    font-weight: 700;
    font-size: 0.88rem;
    vertical-align: middle;
}

/* Chart panel */
.activity-chart-wrap {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    padding: 1rem;
    height: 300px;
    position: relative;
}

.activity-chart-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* ── Share button ────────────────────────────────────────────────────────────── */
.share-btn-wrapper {
    position: relative;
    display: inline-block;
}

.share-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e1e3a;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    min-width: 180px;
    z-index: 1050;
    overflow: hidden;
}

.share-dropdown-item {
    display: block;
    width: 100%;
    padding: 11px 18px;
    background: none;
    border: none;
    color: #e2e8f0;
    font-size: 0.9rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}

.share-dropdown-item:hover {
    background: rgba(255,255,255,0.1);
    color: #ffffff;
}

.share-dropdown-item + .share-dropdown-item {
    border-top: 1px solid rgba(255,255,255,0.08);
}

.share-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1049;
}

/* ── Social proof bar ────────────────────────────────────────────────────────── */
.proof-bar {
    background: rgba(255,255,255,0.06);
    border-top: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 1.1rem 0;
}

.proof-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 0;
}

.proof-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.3rem 1.4rem;
    text-align: center;
}

.proof-stat-num {
    font-size: 1.45rem;
    font-weight: 800;
    color: #f0c040;
    line-height: 1.1;
}

.proof-stat-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.proof-divider {
    width: 1px;
    height: 2rem;
    background: rgba(255,255,255,0.15);
}

@media (max-width: 540px) {
    .proof-divider { display: none; }
    .proof-stat { padding: 0.4rem 1rem; }
}

/* ── Screenshot showcase ────────────────────────────────────────────────────── */
.screenshot-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem; max-width: 1000px; margin: 0 auto 1.5rem;
}
.screenshot-item {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius); overflow: hidden; transition: transform 0.2s;
}
.screenshot-item:hover { transform: translateY(-4px); }
.screenshot-item img { width: 100%; height: auto; display: block; }
.screenshot-caption {
    padding: 0.6rem 0.75rem; color: rgba(255,255,255,0.8);
    font-size: 0.85rem; font-weight: 600; text-align: center;
}

/* ── Parent reviews on landing page ──────────────────────────────────────────── */
.review-carousel {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem; max-width: 900px; margin: 0 auto;
}
.review-card-lp {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius); padding: 1.25rem; text-align: center;
}
.review-stars-lp { color: var(--star-gold); font-size: 1.2rem; margin-bottom: 0.5rem; }
.review-text-lp { color: rgba(255,255,255,0.85); font-size: 0.95rem; line-height: 1.5; font-style: italic; margin-bottom: 0.5rem; }
.review-author-lp { color: rgba(255,255,255,0.5); font-size: 0.85rem; font-weight: 600; }

/* ── Free vs Premium comparison cards ───────────────────────────────────────── */
.lp-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 760px;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .lp-compare-grid { grid-template-columns: 1fr; max-width: 380px; }
}

.lp-compare-card {
    position: relative;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 1.75rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.lp-compare-card-premium {
    background: linear-gradient(145deg, rgba(102,126,234,0.25) 0%, rgba(118,75,162,0.25) 100%);
    border-color: #667eea;
    box-shadow: 0 0 0 1px #667eea, 0 8px 32px rgba(102,126,234,0.2);
}

.lp-compare-badge {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: #f0c040;
    color: #1a1a2e;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

.lp-compare-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.lp-compare-price {
    font-size: 2rem;
    font-weight: 900;
    color: #f0c040;
    margin-bottom: 1.25rem;
    line-height: 1.1;
}

.lp-compare-price span {
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255,255,255,0.5);
}

.lp-compare-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    flex: 1;
}

.lp-compare-list li {
    font-size: 0.875rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.75);
}

.lp-compare-list li:last-child { border-bottom: none; }

.lp-compare-list li.lp-yes::before {
    content: "✅ ";
}

.lp-compare-list li.lp-no {
    color: rgba(255,255,255,0.35);
    text-decoration: line-through;
    text-decoration-color: rgba(255,255,255,0.2);
}

.lp-compare-list li.lp-no::before {
    content: "✗ ";
    color: rgba(255,255,255,0.25);
    text-decoration: none;
    display: inline-block;
}

/* ── FAQ accordion ───────────────────────────────────────────────────────────── */
.lp-faq {
    max-width: 700px;
    margin: 0 auto;
}

.lp-faq-item {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.lp-faq-item:first-child {
    border-top: 1px solid rgba(255,255,255,0.1);
}

.lp-faq-q {
    padding: 1.1rem 0.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.lp-faq-q::-webkit-details-marker { display: none; }

.lp-faq-q::after {
    content: "+";
    font-size: 1.3rem;
    font-weight: 400;
    color: rgba(255,255,255,0.45);
    flex-shrink: 0;
    margin-left: 1rem;
    transition: transform 0.2s;
}

details[open] .lp-faq-q::after {
    transform: rotate(45deg);
}

.lp-faq-a {
    padding: 0 0.25rem 1.1rem;
    font-size: 0.92rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.7;
}

.lp-faq-a a {
    color: #9b8ff0;
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.about-team {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}
.about-team-member {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 1rem;
    color: #fff;
}
.about-team-icon { font-size: 2rem; flex-shrink: 0; line-height: 1; }
.about-team-member strong { display: block; font-size: 1rem; font-weight: 800; margin-bottom: 0.25rem; color: #fff; }
.about-team-member p { font-size: 0.88rem; color: rgba(255,255,255,0.75); margin: 0; line-height: 1.5; }
