.theme-child {
    --ft-bg: #f3efff;
    --ft-card: #ffffff;
    --ft-text: #29144b;
    --ft-muted: #6b5f88;
    background:
        radial-gradient(circle at top left, rgba(251, 191, 36, 0.25), transparent 26%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.22), transparent 28%),
        linear-gradient(180deg, #f7f1ff 0%, #edf7ff 100%);
}

.theme-child .app-navbar {
    background: rgba(255, 255, 255, 0.72);
    border-bottom: 1px solid rgba(124, 58, 237, 0.1);
    box-shadow: 0 10px 26px rgba(124, 58, 237, 0.08);
}

.theme-child .brand-mark {
    background: linear-gradient(135deg, #7c3aed, #3b82f6 58%, #f59e0b 100%);
    box-shadow: 0 14px 26px rgba(124, 58, 237, 0.24);
}

.theme-child .navbar-brand,
.theme-child h1,
.theme-child h2,
.theme-child h3,
.theme-child .eyebrow-pill,
.theme-child .child-metric-value {
    font-family: "Baloo 2", cursive;
}

.child-shell {
    position: relative;
}

.child-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20px 20px, rgba(255, 255, 255, 0.24) 0, rgba(255, 255, 255, 0.24) 2px, transparent 2px),
        radial-gradient(circle at 60px 60px, rgba(124, 58, 237, 0.08) 0, rgba(124, 58, 237, 0.08) 2px, transparent 2px);
    background-size: 120px 120px;
    pointer-events: none;
    opacity: 0.55;
}

.treasure-map-hero {
    position: relative;
    overflow: hidden;
}

.treasure-map-hero::after {
    content: "";
    position: absolute;
    inset: auto -10% -20% auto;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 68%);
    pointer-events: none;
}

.child-hero {
    color: #fff;
    border-radius: 34px;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 30%),
        linear-gradient(135deg, #7c3aed 0%, #3b82f6 55%, #14b8a6 100%);
}

.avatar-bubble {
    width: 82px;
    height: 82px;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.35);
    font-size: 2rem;
    font-weight: 800;
}

.adventure-avatar {
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.18);
}

.streak-card {
    padding: 1rem 1.2rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 170px;
    text-align: center;
}

.hero-rank-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.hero-rank-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-weight: 700;
}

.map-hero-panel {
    min-width: 280px;
    max-width: 340px;
    padding: 1.15rem 1.2rem;
    border-radius: 26px;
    background: rgba(14, 23, 44, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
}

.map-progress {
    height: 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    overflow: hidden;
}

.map-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #facc15, #fb7185);
}

.child-metric {
    border-radius: 28px;
    color: #fff;
    border: 0;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}

.child-metric:hover {
    transform: translateY(-4px);
}

.child-metric::after {
    content: "";
    position: absolute;
    inset: auto -10% -25% auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
}

.child-metric.coin {
    background: linear-gradient(135deg, #f59e0b, #f97316);
}

.child-metric.missions {
    background: linear-gradient(135deg, #22c55e, #14b8a6);
}

.child-metric.goals {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
}

.child-metric.badges {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.fun-card {
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 24px 46px rgba(91, 33, 182, 0.1);
}

.theme-child .sidebar-card-child {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 240, 255, 0.98));
    border: 1px solid rgba(124, 58, 237, 0.12);
}

.theme-child .sidebar-card .list-group {
    gap: 0.38rem;
}

.theme-child .sidebar-card .list-group-item {
    border: 0;
    border-radius: 18px;
    padding: 0.85rem 0.95rem;
    font-weight: 700;
    color: var(--ft-text);
    background: transparent;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.theme-child .sidebar-card .list-group-item:hover,
.theme-child .sidebar-card .list-group-item:focus {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(59, 130, 246, 0.1));
    color: #1f1450;
    transform: translateX(2px);
}

.theme-child .sidebar-card .list-group-item i {
    color: #7c3aed;
}

.map-card {
    display: block;
    height: 100%;
    text-decoration: none;
    color: var(--ft-text);
    padding: 1.15rem;
    border-radius: 28px;
    background: linear-gradient(180deg, #ffffff, #f7f5ff);
    border: 1px solid rgba(124, 58, 237, 0.12);
    box-shadow: 0 20px 35px rgba(124, 58, 237, 0.08);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
    position: relative;
    overflow: hidden;
}

.map-card:hover {
    transform: translateY(-6px) rotate(-1deg);
    box-shadow: 0 28px 42px rgba(59, 130, 246, 0.14);
    color: var(--ft-text);
}

.map-card::after {
    content: "";
    position: absolute;
    right: -22px;
    bottom: -28px;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
}

.map-card-icon {
    width: 62px;
    height: 62px;
    border-radius: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    color: #fff;
    margin-bottom: 0.9rem;
}

.map-card-title {
    font-family: "Baloo 2", cursive;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.map-card-copy {
    font-size: 0.92rem;
    color: var(--ft-muted);
    line-height: 1.45;
}

.map-card-mission .map-card-icon {
    background: linear-gradient(135deg, #22c55e, #14b8a6);
}

.map-card-wallet .map-card-icon {
    background: linear-gradient(135deg, #f59e0b, #f97316);
}

.map-card-goal .map-card-icon {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
}

.map-card-badge .map-card-icon {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.map-card-school .map-card-icon {
    background: linear-gradient(135deg, #0ea5e9, #22c55e);
}

.map-card-avatar .map-card-icon {
    background: linear-gradient(135deg, #fb7185, #f97316);
}

.map-card-challenge .map-card-icon {
    background: linear-gradient(135deg, #eab308, #f97316);
}

.map-card-spend .map-card-icon {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.adventure-stat {
    height: 100%;
    padding: 1.15rem;
    border-radius: 24px;
    color: #fff;
}

.adventure-mission {
    background: linear-gradient(135deg, #16a34a, #0ea5e9);
}

.adventure-parent {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
}

.adventure-win {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.adventure-stat-label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.82;
    margin-bottom: 0.3rem;
}

.adventure-stat-value {
    font-family: "Baloo 2", cursive;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.05;
}

.goal-adventure-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 24px;
    background: linear-gradient(135deg, #fff8df, #ffffff);
    border: 1px solid rgba(245, 158, 11, 0.24);
}

.goal-adventure-card::before {
    content: "";
    position: absolute;
}

.goal-adventure-icon {
    width: 76px;
    height: 76px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f59e0b, #fb7185);
    color: #fff;
    font-size: 2rem;
    flex-shrink: 0;
}

.goal-adventure-body {
    flex: 1;
}

.hero-mini-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hero-mini-avatar {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    color: #fff;
    font-size: 1.9rem;
}

.mascot-bubble {
    padding: 1rem 1.1rem;
    border-radius: 22px 22px 22px 10px;
    background: linear-gradient(135deg, #fff7ed, #ffffff);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #15803d;
    font-weight: 700;
}

.wallet-pocket-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.quest-pocket {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff, #faf7ff);
}

.quest-pocket::after {
    content: "";
    position: absolute;
    right: -14px;
    bottom: -16px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
}

.quest-pocket.spend {
    border-color: rgba(249, 115, 22, 0.22);
}

.quest-pocket.save {
    border-color: rgba(34, 197, 94, 0.24);
}

.quest-pocket.give {
    border-color: rgba(59, 130, 246, 0.22);
}

.quest-pocket.grow {
    border-color: rgba(139, 92, 246, 0.24);
}

.quest-goal-card {
    background: linear-gradient(180deg, #ffffff, #fffaf0);
}

.celebration-item {
    position: relative;
    overflow: hidden;
}

.badge-shelf {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-weight: 700;
}

.badge-pill.faded {
    background: #ede9fe;
    color: #6d28d9;
}

.theme-child .playful {
    background: linear-gradient(180deg, #fff9db, #fff);
}

.celebrate-launch {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 244, 214, 0.96));
}

.celebration-burst {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f59e0b, #ec4899);
    color: #fff;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.confetti-piece {
    position: absolute;
    top: -12px;
    width: 10px;
    height: 18px;
    border-radius: 999px;
    opacity: 0;
    animation: confetti-drop 1.8s ease forwards;
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.badge-grid-wide {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.badge-tile,
.badge-card {
    border-radius: 24px;
    padding: 1rem;
    background: linear-gradient(180deg, #fff7d6, #ffffff);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-card.locked {
    background: linear-gradient(180deg, #f8fafc, #ffffff);
    border-color: rgba(148, 163, 184, 0.25);
}

.badge-tile-icon,
.badge-card-icon,
.leader-rank {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.leader-rank {
    margin-bottom: 0;
    font-weight: 800;
}

.leaderboard-me {
    border: 2px solid rgba(124, 58, 237, 0.28);
}

.notification-unread {
    box-shadow: inset 4px 0 0 #7c3aed;
}

.child-celebration-toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1080;
    width: min(360px, calc(100vw - 2rem));
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    border-radius: 22px;
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    color: #fff;
    box-shadow: 0 20px 35px rgba(59, 130, 246, 0.24);
    transform: translateY(20px);
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.child-celebration-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.child-celebration-level_up {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
}

.child-celebration-badge_unlocked,
.child-celebration-certificate_earned {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.child-celebration-goal_completed,
.child-celebration-lesson_completed,
.child-celebration-mission_approved {
    background: linear-gradient(135deg, #14b8a6, #3b82f6);
}

.child-celebration-icon {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
    font-size: 1.2rem;
}

.child-celebration-text {
    font-weight: 700;
    line-height: 1.45;
}

.avatar-item-card {
    border-radius: 24px;
    padding: 1rem;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid rgba(148, 163, 184, 0.16);
    height: 100%;
}

.avatar-item-card.unlocked {
    background: linear-gradient(180deg, #fff7d6, #ffffff);
    border-color: rgba(245, 158, 11, 0.25);
}

.avatar-item-card.equipped {
    border: 2px solid rgba(124, 58, 237, 0.32);
}

.theme-child .alert-warning {
    border: 1px solid rgba(245, 158, 11, 0.22);
    background: linear-gradient(135deg, #fffdf3, #fff7e6);
    color: #8a6112;
}

.theme-child .alert-success {
    border: 1px solid rgba(20, 184, 166, 0.18);
    background: linear-gradient(135deg, #f2fffb, #edfcff);
    color: #0f766e;
}

.theme-child .alert-info {
    border: 1px solid rgba(59, 130, 246, 0.2);
    background: linear-gradient(135deg, #eef7ff, #f4faff);
    color: #1d4ed8;
}

.theme-child .child-summary-card {
    background: linear-gradient(180deg, #ffffff, #faf7ff);
    border: 1px solid rgba(124, 58, 237, 0.1);
    box-shadow: 0 14px 30px rgba(124, 58, 237, 0.08);
}

.theme-child .certificate-card {
    position: relative;
    overflow: hidden;
    border-radius: 32px;
    padding: 1.4rem;
    background: linear-gradient(135deg, #fffdf1, #ffffff 60%, #f6f8ff);
    border: 1px solid rgba(234, 179, 8, 0.22);
    box-shadow: 0 28px 50px rgba(245, 158, 11, 0.08);
}

.theme-child .certificate-card::after {
    content: "";
    position: absolute;
    right: -28px;
    top: -20px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(250, 204, 21, 0.16);
}

.theme-child .certificate-seal {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.theme-child .certificate-inner {
    position: relative;
    z-index: 1;
}

.theme-child .certificate-title {
    font-family: "Baloo 2", cursive;
    font-size: 1.7rem;
    color: var(--ft-text);
}

.avatar-item-glyph {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    color: #fff;
    font-weight: 800;
    margin-bottom: 0.85rem;
}

@media (max-width: 767.98px) {
    .goal-adventure-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .map-hero-panel {
        min-width: 100%;
    }
}

@keyframes confetti-drop {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        transform: translateY(180px) rotate(320deg);
        opacity: 0;
    }
}

.theme-child.theme-purple .child-hero,
.avatar-preview.theme-purple {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 30%),
        linear-gradient(135deg, #7c3aed 0%, #3b82f6 55%, #14b8a6 100%);
}

.theme-child.theme-sky .child-hero,
.avatar-preview.theme-sky {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 30%),
        linear-gradient(135deg, #0ea5e9 0%, #38bdf8 50%, #22c55e 100%);
}

.theme-child.theme-mint .child-hero,
.avatar-preview.theme-mint {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 30%),
        linear-gradient(135deg, #10b981 0%, #14b8a6 50%, #3b82f6 100%);
}

.theme-child.theme-sunset .child-hero,
.avatar-preview.theme-sunset {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 30%),
        linear-gradient(135deg, #f97316 0%, #ec4899 55%, #8b5cf6 100%);
}
