/* CodeQuest Kids — Soft, kid-friendly theme (easy on young eyes) */

:root {
    --purple: #8b7ec8;
    --purple-light: #c4b8e8;
    --purple-dark: #6b5fa8;
    --blue: #7eb3e8;
    --blue-light: #b8d4f5;
    --orange: #f0a868;
    --orange-light: #fde4c8;
    --green: #72c9a8;
    --green-light: #c2ecd8;
    --pink: #e8a0bc;
    --yellow: #f5dc7a;
    --bg: #faf8f5;
    --bg-soft: #f4f1fa;
    --bg-card: #fffdf9;
    --text: #4a4568;
    --text-muted: #7d7896;
    --border: #ebe6f2;
    --shadow: 0 4px 20px rgba(107, 95, 168, 0.07);
    --shadow-lg: 0 10px 36px rgba(107, 95, 168, 0.1);
    --radius: 20px;
    --radius-sm: 14px;
    --font-display: 'Fredoka', sans-serif;
    --font-body: 'Nunito', sans-serif;
    --font-chalk: 'Fredericka the Great', 'Caveat', cursive;
    --font-chalk-hand: 'Caveat', cursive;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.65;
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Soft playful sky — gentle on eyes, not harsh white */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 50% at 10% -10%, rgba(196, 184, 232, 0.2), transparent),
        radial-gradient(ellipse 60% 40% at 95% 10%, rgba(184, 212, 245, 0.18), transparent),
        radial-gradient(ellipse 50% 30% at 50% 100%, rgba(253, 228, 200, 0.15), transparent);
}

main,
.navbar,
.site-footer {
    position: relative;
    z-index: 1;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--text);
    letter-spacing: 0.01em;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Chalk-style typography */
.chalk-text {
    font-family: var(--font-chalk);
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--purple-dark);
    text-shadow:
        1px 1px 0 rgba(255, 255, 255, 0.5),
        -1px 0 0 rgba(107, 95, 168, 0.15),
        0 2px 0 rgba(107, 95, 168, 0.1);
}

.chalk-text-sm { font-size: 1.55rem; line-height: 1.1; }

.chalk-title {
    font-family: var(--font-chalk);
    font-weight: 400;
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    line-height: 1.08;
    color: #fffef8;
    text-shadow:
        2px 2px 0 rgba(0, 0, 0, 0.12),
        -1px -1px 0 rgba(255, 255, 255, 0.08),
        0 0 18px rgba(255, 255, 255, 0.15),
        3px 3px 6px rgba(74, 69, 104, 0.25);
}

.chalk-title-sm {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.chalk-highlight {
    color: #fde68a;
    -webkit-text-fill-color: #fde68a;
    background: none;
}

.chalk-section-title {
    font-family: var(--font-chalk);
    font-weight: 400;
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    color: var(--purple-dark);
    text-shadow:
        1px 1px 0 rgba(255, 255, 255, 0.7),
        2px 2px 0 rgba(196, 184, 232, 0.35);
}

.chalk-text-light {
    color: #fffef8;
    text-shadow:
        2px 2px 0 rgba(0, 0, 0, 0.15),
        0 0 12px rgba(255, 255, 255, 0.12);
}

.chalk-badge {
    font-family: var(--font-chalk-hand);
    font-size: 1.05rem;
    font-weight: 700;
}

/* Floating kid characters (original friendly pals) */
.kid-deco-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 3;
}

.kid-deco-char {
    position: absolute;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(74, 69, 104, 0.2));
    animation: kid-deco-float 5s ease-in-out infinite;
    z-index: 3;
}

/* Sticker bubble (footer/hero) */
.kid-deco-sticker {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 253, 249, 0.95);
    border: 2px solid var(--border);
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(107, 95, 168, 0.14);
    pointer-events: none;
    z-index: 3;
}

.kid-deco-sticker .kid-deco-char {
    position: static;
    display: block;
}

@keyframes kid-deco-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(2deg); }
}

@keyframes kid-deco-float-bee {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(-3deg); }
}

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

@keyframes parade-buzz {
    0%, 100% { transform: translateY(-4px) rotate(-4deg); }
    50% { transform: translateY(-10px) rotate(4deg); }
}

/* Header wrap + wave */
.site-header-wrap {
    position: relative;
    background: linear-gradient(135deg, #f4f1fa 0%, #eef6ff 45%, #fff9ed 100%);
    border-bottom: none;
    overflow: visible;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header-wrap .navbar {
    background: rgba(255, 253, 249, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: none;
    box-shadow: none;
    position: relative;
    z-index: 2;
    top: auto;
    overflow: visible;
    min-height: 76px;
    padding: 10px 0;
    display: flex;
    align-items: center;
}

.site-header-wrap .nav-inner {
    position: relative;
    z-index: 5;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
}

/* Buddy parade — centered crew between logo & menu */
.nav-buddy-parade {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    max-width: 280px;
    margin: 0 auto;
    padding: 4px 12px 6px;
    background: linear-gradient(135deg, rgba(244, 241, 250, 0.95), rgba(238, 246, 255, 0.95), rgba(255, 249, 237, 0.95));
    border: 2px dashed rgba(196, 184, 232, 0.55);
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(107, 95, 168, 0.08);
}

.nav-buddy-parade-label {
    font-family: var(--font-chalk-hand);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--purple-dark);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.85;
    line-height: 1;
}

.nav-buddy-parade-track {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 2px 4px 0;
}

.nav-buddy-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.nav-buddy-slot img {
    width: 40px;
    height: 40px;
    display: block;
    filter: drop-shadow(0 3px 6px rgba(74, 69, 104, 0.15));
}

.nav-buddy-hi {
    font-family: var(--font-chalk-hand);
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--purple-dark);
    line-height: 1;
    white-space: nowrap;
}

.nav-buddy-slot.parade-mouse {
    transform: translateY(5px) rotate(-6deg);
    animation: parade-bounce 3.2s ease-in-out infinite;
}

.nav-buddy-slot.parade-bear {
    transform: translateY(2px);
    animation: parade-bounce 3.6s ease-in-out infinite 0.3s;
}

.nav-buddy-slot.parade-bee {
    animation: parade-buzz 2.4s ease-in-out infinite 0.6s;
}

.nav-buddy-slot.parade-bee img {
    width: 34px;
    height: 34px;
}

.nav-buddy-slot.parade-monkey {
    transform: translateY(4px) rotate(5deg);
    animation: parade-bounce 3.4s ease-in-out infinite 0.9s;
}

.nav-buddy-parade:hover .nav-buddy-hi {
    opacity: 1;
}

.header-wave {
    color: var(--bg);
    line-height: 0;
    margin-top: -2px;
    position: relative;
    z-index: 1;
}

.header-wave svg {
    display: block;
    width: 100%;
    height: 28px;
}

/* Navbar */
.navbar {
    background: rgba(255, 253, 249, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(107, 95, 168, 0.05);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
    position: relative;
    z-index: 3;
}

.logo-icon { font-size: 1.8rem; flex-shrink: 0; }

.logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    color: #4c3d9e;
    background: linear-gradient(135deg, #5c4db8 0%, #3b6fd4 55%, #5c4db8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Readable fallback if gradient text unsupported */
    text-shadow: none;
}

@supports not (background-clip: text) {
    .logo-text {
        color: #5c4db8;
        -webkit-text-fill-color: #5c4db8;
    }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

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

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    padding: 4px 12px 4px 4px;
    border-radius: 50px;
    border: 2px solid var(--border);
}

/* Nav profile avatar menu */
.nav-profile-wrap {
    position: relative;
    margin-left: 4px;
}

.nav-avatar-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px 4px 4px;
    border: 2px solid var(--purple-light);
    border-radius: 50px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    font-family: inherit;
}

.nav-avatar-btn:hover,
.nav-profile-wrap.is-open .nav-avatar-btn {
    border-color: var(--purple);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.2);
}

.nav-avatar-circle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #ede9fe, #dbeafe);
    border-radius: 50%;
    line-height: 1;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar-photo {
    object-fit: cover;
    border-radius: 50%;
    display: block;
    background: #e2e8f0;
}

.nav-avatar-circle.user-avatar-photo,
.nav-avatar-btn .user-avatar-photo {
    width: 40px;
    height: 40px;
}

.nav-profile-header .user-avatar-photo {
    width: 44px;
    height: 44px;
}

.nav-avatar-chevron {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding-right: 4px;
    transition: transform 0.2s;
}

.nav-profile-wrap.is-open .nav-avatar-chevron {
    transform: rotate(180deg);
}

.nav-profile-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 260px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 12px;
    z-index: 200;
}

.nav-profile-menu[hidden] { display: none; }

.nav-profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 4px 8px;
}

.nav-profile-header .avatar {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: linear-gradient(135deg, #ede9fe, #dbeafe);
    border-radius: 50%;
}

.nav-profile-name {
    display: block;
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text);
}

.nav-profile-user {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.nav-profile-stats {
    display: flex;
    gap: 8px;
    padding: 0 4px 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--purple);
}

.nav-profile-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.nav-profile-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 0.92rem;
    transition: background 0.15s;
}

.nav-profile-link:hover {
    background: var(--bg);
    color: var(--purple);
}

.nav-profile-logout {
    color: #dc2626;
}

.nav-profile-logout:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.avatar { font-size: 1.4rem; }

.user-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.xp-pill {
    background: linear-gradient(135deg, var(--yellow), var(--orange));
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 50px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: white;
    box-shadow: 0 4px 14px rgba(107, 95, 168, 0.22);
}

.btn-primary:hover { box-shadow: 0 6px 18px rgba(107, 95, 168, 0.28); }

.btn-outline {
    background: var(--bg-card);
    color: var(--purple-dark);
    border-color: var(--purple-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}

.btn-ghost:hover { color: var(--purple); background: var(--bg); }

.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }

.btn-run {
    background: linear-gradient(135deg, var(--green), #16a34a);
    color: white;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
    width: 100%;
}

.btn-reset {
    background: white;
    color: var(--text-muted);
    border: 2px solid var(--border);
    width: 100%;
    margin-top: 8px;
}

.btn-hint {
    background: linear-gradient(135deg, var(--yellow), var(--orange));
    color: white;
    width: 100%;
    border: none;
}

/* Hero */
.hero {
    padding: 60px 0 80px;
    background: linear-gradient(180deg, rgba(244, 241, 250, 0.9) 0%, var(--bg) 100%);
}

.hero-playful {
    position: relative;
    overflow: hidden;
    padding: 72px 0 100px;
    background: transparent;
}

.hero-playful-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(45, 42, 74, 0.72), rgba(74, 69, 104, 0.55)),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="800" height="600"><rect fill="%23c4b8e8" width="800" height="600"/><circle cx="120" cy="100" r="60" fill="%23f5dc7a" opacity="0.4"/><circle cx="650" cy="450" r="90" fill="%2372c9a8" opacity="0.3"/><circle cx="400" cy="280" r="50" fill="%23e8a0bc" opacity="0.35"/></svg>');
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.hero-playful .container {
    position: relative;
    z-index: 2;
}

.hero-playful .hero-subtitle {
    color: rgba(255, 254, 248, 0.92);
    font-size: 1.2rem;
}

.hero-playful .hero-badge {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fffef8;
    backdrop-filter: blur(4px);
}

.hero-playful .hero-trust-pill {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fffef8;
}

.hero-playful .stat-num {
    color: #fde68a;
    font-family: var(--font-chalk);
    font-size: 2rem;
}

.hero-playful .stat-label {
    color: rgba(255, 254, 248, 0.85);
}

.kid-deco-hero .kid-deco-hero-bear {
    width: 90px;
    left: 3%;
    bottom: 12%;
    opacity: 0.92;
}

.kid-deco-hero .kid-deco-hero-bee {
    width: 64px;
    right: 8%;
    top: 18%;
    opacity: 0.9;
    animation-delay: 0.6s;
}

.kid-deco-hero .kid-deco-hero-princess {
    width: 80px;
    right: 4%;
    bottom: 10%;
    opacity: 0.88;
    animation-delay: 1.2s;
}

.kid-deco-hero .kid-deco-hero-monkey {
    width: 76px;
    left: 10%;
    top: 22%;
    opacity: 0.85;
    animation-delay: 0.3s;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.hero-badge {
    display: inline-block;
    background: var(--bg-card);
    border: 2px solid var(--purple-light);
    color: var(--purple-dark);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 16px;
    border-radius: 50px;
    margin-bottom: 16px;
}

.hero-playful .chalk-title {
    margin-bottom: 16px;
}

.hero h1 {
    font-size: 2.8rem;
    line-height: 1.15;
    margin-bottom: 16px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--purple-dark), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

.hero-trust-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.hero-trust-pill {
    display: inline-flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 50px;
    white-space: nowrap;
}

.page-landing .hero-trust-pills {
    justify-content: flex-start;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 36px;
}

.hero-stats {
    display: flex;
    gap: 32px;
}

.stat { text-align: center; }

.stat-num {
    display: block;
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--purple-dark);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Demo board */
.hero-visual { position: relative; }

.demo-board {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border);
    position: relative;
    width: 280px;
    margin: 0 auto;
}

.demo-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
}

.demo-grid .cell {
    aspect-ratio: 1;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.demo-grid .cell.path { background: #dcfce7; }

.demo-bot {
    position: absolute;
    font-size: 2rem;
    transition: all 0.5s ease;
    top: 52px;
    left: 36px;
}

.demo-star {
    position: absolute;
    font-size: 1.5rem;
    top: 52px;
    right: 36px;
}

.demo-blocks {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
    align-items: center;
}

.demo-block {
    padding: 8px 16px;
    border-radius: 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
    animation: float 3s ease-in-out infinite;
}

.demo-block:nth-child(2) { animation-delay: 0.5s; }
.demo-block:nth-child(3) { animation-delay: 1s; }

.block-move { background: #3b82f6; }
.block-turn { background: #8b5cf6; }
.block-repeat { background: #f97316; }

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

/* Features */
.features, .how-it-works { padding: 80px 0; }

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 48px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    border: 2px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.feature-icon { font-size: 2.5rem; margin-bottom: 12px; }

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Kid-safe trust section (landing) */
.safe-zone {
    padding: 72px 0;
    background: linear-gradient(180deg, var(--bg) 0%, rgba(244, 241, 250, 0.65) 50%, var(--bg) 100%);
}

.safe-zone-head {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 40px;
}

.safe-zone-badge {
    display: inline-block;
    background: var(--bg-card);
    border: 2px solid var(--green-light);
    color: #3d7a62;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 50px;
    margin-bottom: 14px;
}

.safe-zone-title {
    margin-bottom: 14px;
}

.safe-zone-lead {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.65;
}

.safe-zone-lead strong {
    color: var(--text);
}

.safe-zone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.safe-zone-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 26px 24px;
    border: 2px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.safe-zone-card-shield { border-color: rgba(126, 179, 232, 0.35); }
.safe-zone-card-eyes { border-color: rgba(196, 184, 232, 0.4); }
.safe-zone-card-fun { border-color: rgba(114, 201, 168, 0.35); }
.safe-zone-card-earn { border-color: rgba(245, 220, 122, 0.45); }

.safe-zone-icon {
    font-size: 2.2rem;
    line-height: 1;
    margin-bottom: 12px;
}

.safe-zone-card h3 {
    font-size: 1.08rem;
    margin-bottom: 8px;
    color: var(--purple-dark);
}

.safe-zone-card > p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 12px;
}

.safe-zone-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.safe-zone-list li {
    position: relative;
    padding-left: 18px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.4;
}

.safe-zone-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--green);
    font-weight: 700;
}

.safe-zone-parent-note {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
    background: linear-gradient(135deg, #f0faf5, #f4f1fa);
    border: 2px solid var(--green-light);
    border-radius: var(--radius);
    padding: 16px 22px;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.safe-zone-parent-note strong {
    color: #3d7a62;
}

/* Steps */
.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.step {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    border: 2px solid var(--border);
    flex: 1;
    min-width: 180px;
    max-width: 240px;
}

.step-num {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 auto 12px;
}

.step h3 { font-size: 1rem; margin-bottom: 6px; }
.step p { color: var(--text-muted); font-size: 0.85rem; }

.step-arrow {
    font-size: 1.5rem;
    color: var(--purple-light);
    font-weight: 700;
}

/* CTA */
.cta { padding: 0 0 80px; }

.cta-box {
    background: linear-gradient(135deg, #9b8fd4 0%, #7eb3e8 100%);
    border-radius: var(--radius);
    padding: 60px 40px;
    text-align: center;
    color: white;
    box-shadow: var(--shadow-lg);
}

.cta-box h2 { font-size: 2rem; margin-bottom: 12px; }
.cta-box p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 28px; }
.cta-box .btn-primary { background: white; color: var(--purple); box-shadow: none; }

/* Auth */
.page-auth main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }

.auth-container { width: 100%; max-width: 420px; }

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border);
    text-align: center;
}

.auth-mascot { font-size: 3.5rem; margin-bottom: 12px; }

.auth-card h1 { font-size: 1.8rem; margin-bottom: 8px; }

.auth-subtitle { color: var(--text-muted); margin-bottom: 24px; }

.auth-form { text-align: left; }

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--purple-light);
}

.form-group small {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 0.9rem;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 2px solid #fecaca;
}

.field-error {
    margin: 6px 0 0;
    font-size: 0.875rem;
    color: #dc2626;
    font-weight: 600;
}
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 2px solid #86efac;
}

.auth-footer {
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-footer a { color: var(--purple); font-weight: 700; }

/* Dashboard */
.dashboard { padding: 40px 0 60px; }

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.dashboard-header h1 { font-size: 2rem; }

.dashboard-subtitle { color: var(--text-muted); margin-top: 4px; }

.progress-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.progress-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: conic-gradient(var(--purple) calc(var(--pct, 0) * 1%), var(--border) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-ring::before {
    content: '';
    position: absolute;
    width: 56px;
    height: 56px;
    background: var(--bg-card);
    border-radius: 50%;
}

.progress-text {
    position: relative;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--purple-dark);
}

.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.lesson-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 2px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.lesson-card:not(.locked):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.lesson-card.locked { opacity: 0.65; background: var(--bg-soft); }
.lesson-card.completed { border-color: var(--green-light); }

.lesson-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.lesson-num {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--purple);
    background: #ede9fe;
    padding: 2px 10px;
    border-radius: 50px;
}

.lesson-card h3 { font-size: 1.15rem; margin-bottom: 6px; }
.lesson-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; margin-bottom: 16px; }

.lesson-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.xp-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--orange);
    background: #fff7ed;
    padding: 4px 10px;
    border-radius: 50px;
}

.locked-text { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

.dashboard-extras { margin-top: 8px; }

.extra-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #ede9fe, #dbeafe);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    color: var(--text);
    border: 2px solid var(--purple-light);
    transition: transform 0.2s;
}

.extra-card:hover { transform: translateY(-2px); }
.extra-icon { font-size: 2.5rem; }
.extra-card h3 { font-size: 1.1rem; margin-bottom: 4px; }
.extra-card p { color: var(--text-muted); font-size: 0.9rem; }
.extra-arrow { margin-left: auto; font-size: 1.5rem; color: var(--purple); }

/* Lesson page */
.page-lesson main { flex: 1; }

.lesson-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: calc(100vh - 130px);
}

.lesson-sidebar {
    background: white;
    border-right: 2px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 8px;
}

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

.mission-badge {
    display: inline-block;
    background: #ede9fe;
    color: var(--purple);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 3px 12px;
    border-radius: 50px;
    margin-bottom: 8px;
}

.playground-badge { background: #fef3c7; color: #d97706; }

.lesson-info h1 { font-size: 1.4rem; margin-bottom: 8px; }

.lesson-story {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.goal-box {
    background: #f0fdf4;
    border: 2px solid var(--green-light);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.hint-panel { margin-top: auto; }

.hint-text {
    margin-top: 10px;
    background: #fffbeb;
    border: 2px solid var(--yellow);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #92400e;
}

.result-panel {
    border-radius: var(--radius-sm);
    padding: 14px;
    font-weight: 600;
    font-size: 0.9rem;
}

.result-panel.success { background: #f0fdf4; border: 2px solid var(--green-light); color: #166534; }
.result-panel.fail { background: #fef2f2; border: 2px solid #fecaca; color: #dc2626; }

.lesson-workspace {
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.workspace-panels {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 16px;
    flex: 1;
    min-height: 500px;
}

.blockly-panel, .game-panel {
    background: white;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg);
    border-bottom: 2px solid var(--border);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
}

.block-count, .status-badge {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 600;
}

.status-badge.running { color: var(--orange); }
.status-badge.success { color: var(--green); }
.status-badge.fail { color: #dc2626; }

#blocklyDiv {
    flex: 1;
    min-height: 400px;
}

#gameCanvas {
    display: block;
    margin: 16px auto;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
}

/* Celebration */
.celebration-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 27, 75, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.celebration-card {
    background: white;
    border-radius: var(--radius);
    padding: 48px 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: popIn 0.4s ease;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.celebration-stars { font-size: 2.5rem; margin-bottom: 12px; }
.celebration-card h2 { font-size: 1.8rem; margin-bottom: 8px; }
.celebration-xp {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--orange);
    font-weight: 700;
    margin: 16px 0 24px;
}

.celebration-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Footer */
.site-footer {
    margin-top: auto;
    position: relative;
    color: #e2e8f0;
    overflow: hidden;
}

.footer-wave {
    color: var(--bg);
    line-height: 0;
    margin-top: 40px;
    position: relative;
    z-index: 2;
}

.footer-wave svg {
    display: block;
    width: 100%;
    height: 48px;
}

.footer-main {
    background: linear-gradient(160deg, #5c5494 0%, #4a4568 55%, #3d3858 100%);
    padding: 48px 0 32px;
    position: relative;
    z-index: 1;
}

.kid-deco-footer .kid-deco-bear {
    width: 88px;
    left: 2%;
    bottom: 18%;
    opacity: 0.9;
}

.kid-deco-footer .kid-deco-princess {
    width: 78px;
    right: 3%;
    top: 22%;
    opacity: 0.88;
    animation-delay: 0.5s;
}

.kid-deco-footer .kid-deco-monkey-footer {
    width: 70px;
    right: 12%;
    bottom: 8%;
    opacity: 0.85;
    animation-delay: 1s;
}

.kid-deco-footer .kid-deco-mouse-footer {
    width: 64px;
    left: 14%;
    top: 28%;
    opacity: 0.82;
    animation-delay: 1.5s;
}

.footer-deco-flower {
    position: absolute;
    right: 24px;
    bottom: 24px;
    font-size: 2.5rem;
    z-index: 3;
    pointer-events: none;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    animation: kid-deco-float 4s ease-in-out infinite;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.footer-logo-icon { font-size: 2rem; }

.footer-logo-text {
    font-family: var(--font-chalk);
    font-size: 1.75rem;
    font-weight: 400;
    color: #fffef8;
}

.footer-tagline {
    color: #d4c8f0;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
    max-width: 280px;
}

.footer-free-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(114, 201, 168, 0.18), rgba(114, 201, 168, 0.08));
    border: 2px solid rgba(114, 201, 168, 0.35);
    border-radius: 14px;
    padding: 14px 16px;
    max-width: 260px;
}

.free-badge-icon { font-size: 1.8rem; flex-shrink: 0; }

.footer-free-badge strong {
    display: block;
    color: #a8e6cf;
    font-family: var(--font-display);
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.footer-free-badge span {
    color: #c2ecd8;
    font-size: 0.8rem;
}

.footer-links-col h4 {
    font-family: var(--font-chalk-hand);
    font-size: 1.15rem;
    color: #fffef8;
    margin-bottom: 14px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #d4c8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a {
    color: #ede9fe;
    text-decoration: none;
    transition: color 0.15s;
}

.footer-links a:hover { color: var(--yellow); }

.footer-check {
    color: #72c9a8;
    font-weight: 700;
}

.footer-made-col {
    text-align: right;
}

.footer-india {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    font-size: 0.95rem;
    color: #e0e7ff;
    margin-bottom: 12px;
}

.india-flag { font-size: 1.6rem; }

.footer-india strong { color: #fbbf24; }

.footer-creator {
    font-size: 0.9rem;
    color: #c4b5fd;
    margin-bottom: 8px;
}

.footer-creator a {
    color: white;
    font-weight: 700;
    text-decoration: none;
}

.footer-creator a:hover { color: #fbbf24; }

.footer-website {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fbbf24;
    padding: 8px 16px;
    border-radius: 50px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.15s, transform 0.15s;
}

.footer-website:hover {
    background: rgba(251, 191, 36, 0.15);
    transform: translateY(-2px);
}

.footer-bottom {
    background: #0f172a;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 0;
}

.footer-bottom-inner {
    text-align: center;
}

.footer-bottom p {
    color: #94a3b8;
    font-size: 0.85rem;
    margin: 0;
}

.footer-bottom-note {
    margin-top: 4px !important;
    font-size: 0.8rem !important;
    color: #64748b !important;
}

.page-lesson .site-footer { display: none; }

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
    .footer-made-col {
        grid-column: 1 / -1;
        text-align: center;
    }
    .footer-india { justify-content: center; }
}

@media (max-width: 600px) {
    .footer-grid { grid-template-columns: 1fr; }
    .footer-made-col { text-align: left; }
    .footer-india { justify-content: flex-start; }
}

/* Blockly custom colors */
.blocklyTreeLabel { font-family: var(--font-display) !important; }

/* Responsive */
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero-actions, .hero-stats { justify-content: center; }
    .page-landing .hero-trust-pills { justify-content: center; }
    .hero h1 { font-size: 2rem; }
    .lesson-layout { grid-template-columns: 1fr; }
    .workspace-panels { grid-template-columns: 1fr; }
    .lesson-sidebar { border-right: none; border-bottom: 2px solid var(--border); }
}

@media (max-width: 600px) {
    .nav-links .nav-link { display: none; }
    .nav-profile-menu {
        right: -8px;
        min-width: 240px;
    }
    .steps { flex-direction: column; }
    .step-arrow { transform: rotate(90deg); }
}

/* Plugin cards (kids dashboard) */
.section-label {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin: 28px 0 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: -8px 0 16px;
}

/* Game search */
.game-search-wrap {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 28px;
    box-shadow: var(--shadow);
}

.game-search-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--purple-dark);
    margin-bottom: 10px;
}

.game-search-icon { font-size: 1.3rem; }

.game-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 2px solid var(--purple-light);
    border-radius: 50px;
    padding: 4px 6px 4px 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.game-search-box:focus-within {
    border-color: var(--purple);
    box-shadow: 0 0 0 4px rgba(139, 126, 200, 0.12);
}

.game-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 1.05rem;
    padding: 12px 0;
    outline: none;
    color: var(--text);
}

.game-search-input::placeholder { color: var(--text-muted); }

.game-search-clear {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--border);
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
}

.game-search-clear:hover { background: var(--purple-light); color: white; }

.game-search-count {
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--purple-dark);
    min-height: 1.2em;
}

.game-search-empty {
    text-align: center;
    padding: 40px 20px;
    background: #fff9ed;
    border: 2px dashed #f5dc7a;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.game-search-empty-icon { font-size: 2.5rem; display: block; margin-bottom: 8px; }
.game-search-empty p { color: #8b6914; font-size: 1rem; }

.plugin-section.hidden-by-search { display: none; }

.plugin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 16px;
}

.plugin-card-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
}

.plugin-fav-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
    padding: 0;
}

.plugin-fav-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.plugin-fav-btn.is-favorite {
    background: #fff1f2;
    border-color: #fda4af;
}

.plugin-fav-btn.is-favorite:hover {
    background: #ffe4e6;
}

.plugin-fav-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.plugin-fav-btn.is-busy {
    opacity: 0.6;
    pointer-events: none;
}

.fav-dock {
    background: linear-gradient(135deg, #fff5f7 0%, #f8f0fc 100%);
    border: 2px solid #e8c4d4;
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(232, 160, 188, 0.1);
}

.fav-dock.is-collapsed .fav-dock-body {
    display: none;
}

.fav-dock.is-collapsed .fav-dock-chevron {
    transform: rotate(-90deg);
}

.fav-dock-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: var(--font-display);
    text-align: left;
}

.fav-dock-toggle:hover {
    background: rgba(255, 255, 255, 0.35);
}

.fav-dock-toggle-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fav-dock-heart { font-size: 1.25rem; line-height: 1; }

.fav-dock-title {
    font-size: 1rem;
    font-weight: 700;
    color: #9b6b82;
}

.fav-dock-count {
    background: #e8a0bc;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fav-dock-chevron {
    color: #9b6b82;
    font-size: 0.85rem;
    transition: transform 0.25s ease;
}

.fav-dock-body {
    padding: 0 14px 14px;
}

.fav-dock-hint {
    font-size: 0.78rem;
    color: #9b6b82;
    margin: 0 0 10px 4px;
    opacity: 0.85;
}

.fav-dock-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 2px 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #e8c4d4 transparent;
}

.fav-dock-scroll::-webkit-scrollbar { height: 5px; }
.fav-dock-scroll::-webkit-scrollbar-thumb { background: #fda4af; border-radius: 4px; }

.fav-chip {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 76px;
    text-decoration: none;
    color: var(--text);
    position: relative;
    scroll-snap-align: start;
    transition: transform 0.15s;
}

.fav-chip:hover {
    transform: translateY(-3px);
}

.fav-chip-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.2);
    background: white;
    display: block;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.fav-chip:hover .fav-chip-img {
    border-color: #fda4af;
    box-shadow: 0 6px 16px rgba(244, 63, 94, 0.3);
}

.fav-chip-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fav-chip-name {
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    max-width: 76px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #881337;
}

.fav-chip-unfav {
    position: absolute;
    top: -2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    background: #f43f5e;
    color: white;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.15s, transform 0.15s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fav-chip:hover .fav-chip-unfav,
.fav-chip-unfav:focus {
    opacity: 1;
    transform: scale(1);
}

.fav-dock-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin-bottom: 20px;
    background: #fff;
    border: 2px dashed #fecdd3;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #9f1239;
}

.fav-dock-empty-icon { font-size: 1.2rem; }
.fav-dock-empty strong { color: #e11d48; }

.plugin-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

.plugin-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--purple-light);
}

.plugin-thumb {
    height: 150px;
    background: linear-gradient(135deg, var(--bg-soft), var(--bg));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.plugin-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.plugin-type-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 253, 249, 0.95);
    padding: 5px 11px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(74, 69, 104, 0.1);
    max-width: calc(100% - 56px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.plugin-info {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0;
}

.plugin-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.plugin-card-head h3 {
    font-size: 1.02rem;
    line-height: 1.25;
    margin: 0;
    flex: 1;
    min-width: 0;
}

.plugin-age-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #c4b5fd;
    line-height: 1.2;
}

.plugin-age-badge.is-teen {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #93c5fd;
}

.plugin-info p {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.plugin-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 2px;
}

.plugin-plays {
    font-size: 0.78rem;
    color: var(--purple-dark);
    font-weight: 700;
}

.teen-age-pill {
    margin-bottom: 12px;
    display: inline-block;
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    border-color: #93c5fd !important;
}

.user-xp-big {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f5dc7a, #f0a868);
    color: #5c4a20;
    padding: 8px 16px;
    border-radius: 50px;
}

.header-stats { display: flex; gap: 10px; flex-wrap: wrap; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.plugin-missions { padding: 32px 0 60px; }

/* Home hints banner */
.home-tips-bar { background: linear-gradient(90deg, #fff9ed, #f4f1fa); padding: 12px 0; border-bottom: 1px solid var(--border); }

.home-hints-banner { margin-bottom: 24px; }

.home-hints-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #fff9ed, #f4f1fa);
  border: 2px solid #f5dc7a;
  border-radius: var(--radius);
  padding: 14px 18px;
}

.home-hints-icon { font-size: 1.5rem; flex-shrink: 0; }

.home-hints-inner p {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  color: #6b5a3a;
  line-height: 1.4;
  margin: 0;
}

.home-hints-next {
  background: white;
  border: 2px solid #fde68a;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  color: #b45309;
  flex-shrink: 0;
}

.home-hints-next:hover { background: #fef3c7; }

/* In-game hints — Mayra buddy + speech balloon */
.hints-floater {
  position: fixed;
  top: calc(var(--site-header-h, 140px) + 12px);
  right: max(16px, env(safe-area-inset-right, 0px));
  left: auto;
  bottom: auto;
  z-index: 250;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hints-buddy-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  font-family: inherit;
}

.hints-buddy-ring {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 78px;
  height: 78px;
  margin-left: -39px;
  border-radius: 50%;
  border: 3px solid #fbbf24;
  animation: hintsRingPulse 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes hintsRingPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.12); opacity: 0.35; }
}

.hints-buddy-sticker {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #fffef9, #fff4d6);
  border: 3px solid #fbbf24;
  border-radius: 50%;
  box-shadow:
    0 8px 24px rgba(245, 158, 11, 0.28),
    0 2px 8px rgba(74, 69, 104, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hints-buddy-btn:hover .hints-buddy-sticker,
.hints-floater.is-open .hints-buddy-sticker {
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    0 12px 28px rgba(245, 158, 11, 0.35),
    0 4px 12px rgba(74, 69, 104, 0.12);
}

.hints-buddy-img {
  width: 52px;
  height: 52px;
  display: block;
  animation: hintsBuddyBounce 2.8s ease-in-out infinite;
}

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

.hints-buddy-bulb {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: linear-gradient(135deg, #fde047, #f59e0b);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.45);
  animation: hintsBulbWiggle 3s ease-in-out infinite;
}

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

.hints-buddy-name {
  font-family: var(--font-chalk-hand);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--purple-dark);
  line-height: 1;
}

.hints-buddy-tag {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b45309;
  background: #fef3c7;
  border: 2px solid #fde68a;
  padding: 2px 10px;
  border-radius: 999px;
}

.hints-buddy-nudge {
  pointer-events: none;
  margin: 0 0 8px;
  padding: 8px 14px;
  max-width: 200px;
  text-align: center;
  font-family: var(--font-chalk-hand);
  font-size: 0.95rem;
  font-weight: 700;
  color: #92400e;
  background: #fffbeb;
  border: 2px dashed #fbbf24;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(180, 83, 9, 0.12);
  animation: hintsNudgePop 0.5s ease, hintsNudgeFloat 3s ease-in-out 0.5s infinite;
  transition: opacity 0.3s, transform 0.3s;
}

.hints-buddy-nudge.is-hidden {
  opacity: 0;
  transform: translateY(6px);
  visibility: hidden;
}

@keyframes hintsNudgePop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

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

.hints-balloon {
  position: absolute;
  top: 4px;
  right: calc(100% + 16px);
  left: auto;
  bottom: auto;
  width: min(320px, calc(100vw - 120px));
  background: #fffbeb;
  border: 2px solid #fbbf24;
  border-radius: 22px;
  padding: 16px 18px 18px;
  box-shadow:
    0 16px 40px rgba(180, 83, 9, 0.16),
    0 4px 12px rgba(0, 0, 0, 0.06);
  pointer-events: auto;
  transform-origin: right center;
  animation: hintsBalloonIn 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.hints-balloon[hidden] {
  display: block !important;
  visibility: hidden;
  opacity: 0;
  transform: scale(0.92) translateX(8px);
  pointer-events: none;
}

.hints-floater.is-open .hints-balloon:not([hidden]) {
  visibility: visible;
  opacity: 1;
  transform: scale(1) translateX(0);
}

@keyframes hintsBalloonIn {
  from {
    opacity: 0;
    transform: scale(0.88) translateX(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateX(0);
  }
}

.hints-balloon-tail {
  position: absolute;
  right: -11px;
  top: 38px;
  left: auto;
  bottom: auto;
  width: 22px;
  height: 11px;
  overflow: hidden;
  transform: rotate(90deg);
}

.hints-balloon-tail::before,
.hints-balloon-tail::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
}

.hints-balloon-tail::before {
  top: 0;
  border-bottom: 11px solid #fbbf24;
}

.hints-balloon-tail::after {
  top: 3px;
  border-bottom: 9px solid #fffbeb;
}

.hints-balloon-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.hints-balloon-buddy {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #fde68a;
  padding: 4px;
  object-fit: contain;
}

.hints-balloon-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: #92400e;
  line-height: 1.2;
}

.hints-balloon-close {
  margin-left: auto;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  color: #b45309;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.hints-balloon-close:hover { background: #fff; }

.hints-label {
  font-size: 0.75rem;
  color: #b45309;
  font-weight: 700;
  margin-top: 2px;
}

.hints-text {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #78350f;
  margin: 0;
}

.btn-hint-next {
  margin-top: 12px;
  background: white;
  border: 2px solid #fde68a;
  padding: 8px 16px;
  border-radius: 50px;
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
  color: #b45309;
  font-size: 0.88rem;
  transition: background 0.15s, transform 0.15s;
}

.btn-hint-next:hover {
  background: #fef3c7;
  transform: translateY(-1px);
}

@media (max-width: 700px) {
  .hints-floater {
    top: auto;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    right: max(14px, env(safe-area-inset-right, 0px));
  }

  .hints-buddy-nudge {
    font-size: 0.85rem;
    max-width: 160px;
    padding: 6px 10px;
  }

  .hints-balloon {
    top: auto;
    bottom: calc(100% + 12px);
    right: 0;
    left: auto;
    width: min(300px, calc(100vw - 28px));
    transform-origin: right bottom;
  }

  .hints-balloon[hidden] {
    transform: scale(0.92) translateY(8px);
  }

  .hints-balloon-tail {
    right: 28px;
    top: auto;
    bottom: -11px;
    transform: rotate(180deg);
  }
}

/* Profile page */
.profile-page {
  padding: 32px 0 60px;
  max-width: 720px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.profile-hero-avatar-wrap {
    flex-shrink: 0;
}

.profile-hero-avatar-wrap .user-avatar,
.profile-hero-avatar-wrap .profile-hero-avatar {
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(135deg, #ede9fe, #dbeafe);
    border-radius: 50%;
    border: 3px solid var(--purple-light);
    overflow: hidden;
}

.profile-hero-avatar-wrap .user-avatar-photo {
    width: 88px;
    height: 88px;
    border: 3px solid var(--purple-light);
}

.profile-photo-card {
    margin-bottom: 20px;
}

.profile-photo-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: -8px 0 16px;
    line-height: 1.45;
}

.profile-photo-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.profile-photo-preview .user-avatar,
.profile-photo-preview .profile-photo-avatar {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    background: linear-gradient(135deg, #ede9fe, #dbeafe);
    border-radius: 50%;
    border: 3px solid var(--purple-light);
    overflow: hidden;
}

.profile-photo-preview .user-avatar-photo {
    width: 120px;
    height: 120px;
}

.profile-upload-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.profile-upload-label input[type="file"] {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.profile-upload-note {
    display: block;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.profile-remove-photo-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.profile-hero h1 {
  font-size: 1.75rem;
  margin-bottom: 4px;
}

.profile-hero-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.profile-hero-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.profile-tab {
  padding: 10px 18px;
  border-radius: 50px;
  border: 2px solid var(--border);
  background: white;
  text-decoration: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.15s;
}

.profile-tab:hover,
.profile-tab.active {
  border-color: var(--purple);
  color: var(--purple);
  background: #f5f3ff;
}

.profile-panel {
  display: none;
}

.profile-panel.active {
  display: block;
}

.profile-card {
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.profile-card h2 {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.profile-form-narrow {
  max-width: 400px;
}

.avatar-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.avatar-option-form {
    margin: 0;
    padding: 0;
}

.avatar-option {
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    font: inherit;
}

.avatar-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.avatar-option-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  font-size: 1.8rem;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  transition: all 0.15s;
}

.avatar-option:hover .avatar-option-emoji,
.avatar-option.selected .avatar-option-emoji {
  border-color: var(--purple);
  background: #ede9fe;
  transform: scale(1.08);
}

.profile-empty {
  text-align: center;
  padding: 32px 16px;
  background: #fff1f2;
  border: 2px dashed #fecdd3;
  border-radius: var(--radius);
}

.profile-empty-icon { font-size: 2.5rem; display: block; margin-bottom: 8px; }
.profile-empty p { color: #9f1239; margin: 0; }
.profile-empty a { color: var(--purple); font-weight: 700; }

.profile-fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
}

.profile-fav-card {
  text-decoration: none;
  color: var(--text);
  text-align: center;
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

.profile-fav-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--purple-light);
}

.profile-fav-card img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}

.profile-fav-name {
  display: block;
  padding: 8px 6px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-display);
  line-height: 1.2;
}

@media (max-width: 600px) {
  .profile-hero {
    flex-direction: column;
    text-align: center;
  }
  .profile-hero-stats { justify-content: center; }
}

/* ── Kid-friendly polish: soft sections, welcome card, eye comfort ── */

::selection {
    background: rgba(196, 184, 232, 0.45);
    color: var(--text);
}

.plugin-section {
    border-radius: var(--radius);
    padding: 0;
    margin-bottom: 16px;
    overflow: hidden;
}

.plugin-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: var(--font-display);
    text-align: left;
}

.plugin-section-toggle:hover {
    background: rgba(255, 255, 255, 0.35);
}

.plugin-section-toggle-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.plugin-section-emoji {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.plugin-section-headings {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.plugin-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.plugin-section-meta {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.plugin-section-count {
    background: rgba(255, 255, 255, 0.75);
    color: var(--purple-dark);
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.plugin-section-chevron {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.plugin-section.is-collapsed .plugin-section-body {
    display: none;
}

.plugin-section.is-collapsed .plugin-section-chevron {
    transform: rotate(-90deg);
}

.plugin-section-body {
    padding: 0 16px 16px;
}

.plugin-section-body .section-desc {
    margin: 0 0 14px;
}

.section-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.section-nav-label {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--purple-dark);
    flex-shrink: 0;
}

.section-nav-jumps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.section-nav-btn {
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.section-nav-btn:hover {
    background: var(--bg-card);
    border-color: var(--purple-light);
    transform: translateY(-1px);
}

.section-nav-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.section-nav-action {
    border: none;
    background: transparent;
    color: var(--purple-dark);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.section-nav-action:hover {
    background: var(--bg-soft);
}

.plugin-section[data-section="coding"] {
    background: linear-gradient(135deg, rgba(196, 184, 232, 0.14), transparent 70%);
    border: 1px solid rgba(196, 184, 232, 0.25);
}

.plugin-section[data-section="money"] {
    background: linear-gradient(135deg, rgba(245, 220, 122, 0.18), transparent 70%);
    border: 1px solid rgba(245, 220, 122, 0.35);
}

.plugin-section[data-section="games"] {
    background: linear-gradient(135deg, rgba(126, 179, 232, 0.12), transparent 70%);
    border: 1px solid rgba(126, 179, 232, 0.22);
}

.plugin-section[data-section="puzzles"] {
    background: linear-gradient(135deg, rgba(114, 201, 168, 0.12), transparent 70%);
    border: 1px solid rgba(114, 201, 168, 0.22);
}

/* Continue playing — in-progress games */
.continue-dock {
    background: linear-gradient(135deg, #eef6ff 0%, #f4f1fa 100%);
    border: 2px solid #b8d4f5;
    border-radius: var(--radius);
    margin-bottom: 24px;
    padding: 16px 16px 14px;
    box-shadow: 0 4px 16px rgba(126, 179, 232, 0.1);
}

.continue-dock-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.continue-dock-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.continue-dock-titles {
    flex: 1;
    min-width: 180px;
}

.continue-dock-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: #4a6fa5;
    margin: 0;
}

.continue-dock-hint {
    font-size: 0.82rem;
    color: #6b85a8;
    margin: 2px 0 0;
}

.continue-dock-count {
    background: #7eb3e8;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.continue-dock-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 2px 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #b8d4f5 transparent;
}

.continue-dock-scroll::-webkit-scrollbar { height: 5px; }
.continue-dock-scroll::-webkit-scrollbar-thumb {
    background: #b8d4f5;
    border-radius: 50px;
}

.continue-chip {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
    max-width: 280px;
    padding: 10px 14px 10px 10px;
    background: var(--bg-card);
    border: 2px solid #d4e8fb;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text);
    scroll-snap-align: start;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.continue-chip:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: #7eb3e8;
}

.continue-chip-img {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--border);
}

.continue-chip-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.continue-chip-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(74, 111, 165, 0.45);
    color: white;
    font-size: 1.1rem;
    opacity: 0;
    transition: opacity 0.15s;
}

.continue-chip:hover .continue-chip-play {
    opacity: 1;
}

.continue-chip-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.continue-chip-name {
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.continue-chip-level {
    font-size: 0.8rem;
    font-weight: 700;
    color: #4a6fa5;
}

.continue-chip-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.page-dashboard .dashboard-header {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    box-shadow: var(--shadow);
}

.page-dashboard .dashboard-header h1 {
    font-family: var(--font-chalk);
    font-weight: 400;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--purple-dark);
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.6);
}

.page-dashboard .dashboard-subtitle {
    font-size: 1.05rem;
}

.page-landing .hero h1 {
    font-size: clamp(1.75rem, 5vw, 3rem);
    line-height: 1.15;
}

.page-landing .hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 520px;
}

.page-landing .hero-trust-pills {
    justify-content: flex-start;
}

@media (max-width: 900px) {
    .page-landing .hero-trust-pills {
        justify-content: center;
    }
}

/* Softer focus rings for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(139, 126, 200, 0.45);
    outline-offset: 2px;
}

@media (max-width: 700px) {
    .section-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .section-nav-actions {
        justify-content: flex-end;
    }

    .site-header-wrap .nav-inner {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-buddy-parade {
        order: 3;
        flex: 1 1 100%;
        max-width: 100%;
        margin: 4px 0 0;
    }

    .kid-deco-hero .kid-deco-char {
        width: 56px !important;
        opacity: 0.65;
    }

    .kid-deco-footer .kid-deco-char {
        width: 52px !important;
        opacity: 0.6;
    }
}

/* ── Dashboard layout: main + right side panel ── */
.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    align-items: start;
}

.dashboard-main {
    min-width: 0;
}

.kids-side-panel {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.kids-mascot-parade {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.mascot-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 10px 8px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.mascot-face {
    display: block;
    font-size: 1.6rem;
    line-height: 1.1;
    margin-bottom: 4px;
}

.mascot-name {
    display: block;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--purple-dark);
}

.mascot-hi {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 2px;
}

.mascot-sparkle { border-color: #e8c4f0; background: linear-gradient(135deg, #fdf4ff, #fffdf9); }
.mascot-zebra { border-color: #c8d0d8; background: linear-gradient(135deg, #f4f6f8, #fffdf9); }
.mascot-coiny { border-color: #f5dc7a; background: linear-gradient(135deg, #fff9ed, #fffdf9); }
.mascot-bot { border-color: #b8d4f5; background: linear-gradient(135deg, #eef6ff, #fffdf9); }

.side-panel-block {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow);
}

.side-panel-continue { border-color: #b8d4f5; }
.side-panel-favorites { border-color: #e8c4d4; }

.side-panel-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.side-panel-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    flex: 1;
    min-width: 0;
}

.side-panel-count {
    background: #e8a0bc;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.side-panel-view-all {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--purple-dark);
    text-decoration: none;
    white-space: nowrap;
}

.side-panel-view-all:hover {
    text-decoration: underline;
}

.side-panel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-game-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: var(--bg);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, transform 0.15s;
    position: relative;
}

.side-game-item:hover {
    border-color: var(--purple-light);
    transform: translateX(2px);
}

.side-game-thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    border: 1px solid var(--border);
}

.side-game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.side-game-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(74, 111, 165, 0.5);
    color: white;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.15s;
}

.side-continue-item:hover .side-game-play { opacity: 1; }

.side-game-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.side-game-name {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-game-meta {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--purple-dark);
}

.side-game-time {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.side-fav-unfav {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: #e8a0bc;
    color: white;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
    padding: 0;
}

.side-fav-item:hover .side-fav-unfav,
.side-fav-unfav:focus { opacity: 1; }

.side-panel-empty {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    padding: 12px 8px;
    line-height: 1.45;
}

.side-panel-empty span { display: block; font-size: 1.4rem; margin-bottom: 4px; }

.side-panel-hub-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #9b8fd4, #7eb3e8);
    color: white;
    border-radius: var(--radius);
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s;
}

.side-panel-hub-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.side-panel-hub-icon { font-size: 1.2rem; }
.side-panel-hub-arrow { margin-left: auto; opacity: 0.9; }

/* My Games hub page */
.my-games-page { padding: 32px 0 60px; }

.my-games-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.my-games-hero-chars {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.my-games-char {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 50%;
    animation: mascot-bounce 3s ease-in-out infinite;
}

.my-games-char:nth-child(2) { animation-delay: 0.4s; }
.my-games-char:nth-child(3) { animation-delay: 0.8s; }
.my-games-char:nth-child(4) { animation-delay: 1.2s; }

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

.my-games-hero h1 {
    font-size: clamp(1.4rem, 4vw, 1.9rem);
    margin-bottom: 4px;
}

.my-games-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.my-games-hero .btn { margin-left: auto; }

.my-games-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.my-games-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 50px;
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}

.my-games-tab:hover { border-color: var(--purple-light); }
.my-games-tab.active {
    background: linear-gradient(135deg, var(--purple), var(--blue));
    border-color: transparent;
    color: white;
}

.my-games-tab-count {
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.75rem;
}

.my-games-tab:not(.active) .my-games-tab-count {
    background: var(--bg-soft);
    color: var(--purple-dark);
}

.my-games-panel-head {
    margin-bottom: 20px;
}

.my-games-panel-head h2 {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.my-games-panel-head p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.my-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.my-game-card {
    position: relative;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.my-game-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.my-game-card-link {
    display: flex;
    align-items: stretch;
    gap: 14px;
    padding: 14px;
    text-decoration: none;
    color: var(--text);
}

.my-game-thumb {
    width: 88px;
    height: 88px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--border);
}

.my-game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.my-game-body {
    flex: 1;
    min-width: 0;
}

.my-game-body h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.my-game-body p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.my-game-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--purple-dark);
    background: var(--bg-soft);
    padding: 3px 10px;
    border-radius: 50px;
}

.my-game-time {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.my-game-progress {
    height: 6px;
    background: var(--border);
    border-radius: 50px;
    margin-top: 8px;
    overflow: hidden;
}

.my-game-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--purple-light), var(--blue));
    border-radius: 50px;
}

.my-game-play-btn {
    align-self: center;
    flex-shrink: 0;
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    padding: 8px 12px;
    border-radius: 50px;
    white-space: nowrap;
}

.my-game-unfav {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid white;
    background: #e8a0bc;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    z-index: 2;
    padding: 0;
    line-height: 1;
}

.my-games-empty {
    text-align: center;
    padding: 48px 24px;
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
}

.my-games-empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.my-games-empty h3 {
    margin-bottom: 8px;
}

.my-games-empty p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

@media (max-width: 1100px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .kids-side-panel {
        position: static;
        order: -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .kids-mascot-parade {
        grid-column: 1 / -1;
        grid-template-columns: repeat(4, 1fr);
    }

    .side-panel-hub-link {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .kids-side-panel {
        grid-template-columns: 1fr;
    }

    .kids-mascot-parade {
        grid-template-columns: 1fr 1fr;
    }

    .my-games-hero {
        flex-direction: column;
        text-align: center;
    }

    .my-games-hero .btn {
        margin-left: 0;
    }

    .my-game-card-link {
        flex-wrap: wrap;
    }

    .my-game-play-btn {
        width: 100%;
        text-align: center;
        margin-top: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .btn:hover,
    .feature-card:hover,
    .plugin-card:hover,
    .lesson-card:not(.locked):hover,
    .my-games-char {
        transform: none;
    }

    .my-games-char {
        animation: none !important;
    }

    .kid-deco-char,
    .footer-deco-flower,
    .nav-buddy-slot {
        animation: none !important;
    }
}
