@import url('https://fonts.googleapis.com/css2?family=Baloo+Da+2:wght@500;600;700;800&family=Hind+Siliguri:wght@400;500;600;700&display=swap');

:root {
    /* Palette */
    --bg:            #EAF6FB;
    --surface:       #FFFFFF;
    --ink:           #233142;
    --ink-soft:      #56657A;
    --primary:       #1F9AA6;
    --primary-dark:  #157A84;
    --coral:         #FF6B5B;
    --coral-dark:    #E24E3F;
    --yellow:        #FFC93C;
    --purple:        #8C6FE0;
    --green:         #3FAE6A;
    --border:        #D7EBF2;

    /* Type */
    --font-display: 'Baloo Da 2', 'Hind Siliguri', sans-serif;
    --font-body:    'Hind Siliguri', 'Baloo Da 2', sans-serif;

    --radius-lg: 26px;
    --radius-md: 16px;
    --shadow-card: 0 10px 24px rgba(31, 154, 166, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
}

h1, h2, h3, h4, .display {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 0.5em;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; }

:focus-visible {
    outline: 3px solid var(--purple);
    outline-offset: 2px;
}

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

/* ---------- Top nav ---------- */
.topbar {
    background: var(--surface);
    border-bottom: 3px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    max-width: 1100px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 12px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-dark);
}
.brand .bubble-mark {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    background: var(--coral);
    border-radius: 12px 12px 12px 4px;
    color: white;
    font-size: 1.2rem;
    box-shadow: var(--shadow-card);
}
.brand-logo-img {
    height: 40px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    border-radius: 8px;
}
.nav-links { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--ink); font-weight: 600; }
.nav-links a:hover { color: var(--primary-dark); text-decoration: none; }

/* ---------- Dropdown nav (Activities, Parent Dashboard) ---------- */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
    background: none;
    border: none;
    font: inherit;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-dropdown-toggle:hover { color: var(--primary-dark); }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 8px;
    min-width: 210px;
    z-index: 30;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-menu a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
}
.nav-dropdown-menu a:hover { background: var(--bg); text-decoration: none; }

.lang-switch { display: flex; gap: 6px; }
.lang-switch a {
    padding: 6px 12px;
    border-radius: 999px;
    border: 2px solid var(--border);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--ink-soft);
}
.lang-switch a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    padding: 12px 24px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--coral); color: white; box-shadow: 0 8px 18px rgba(255,107,91,.35); }
.btn-secondary { background: var(--primary); color: white; box-shadow: 0 8px 18px rgba(31,154,166,.3); }
.btn-outline { background: transparent; color: var(--primary-dark); border: 2px solid var(--primary); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 2px solid var(--border); }
.btn-lg { padding: 16px 32px; font-size: 1.1rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Speech-bubble card (signature element) ---------- */
.bubble-card {
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 6px;
    box-shadow: var(--shadow-card);
    padding: 24px;
    position: relative;
    border: 3px solid var(--border);
}
.bubble-card::after {
    content: '';
    position: absolute;
    left: 26px;
    bottom: -14px;
    width: 26px; height: 26px;
    background: var(--surface);
    border-right: 3px solid var(--border);
    border-bottom: 3px solid var(--border);
    clip-path: polygon(0 0, 100% 0, 0 100%);
    border-radius: 0 0 0 6px;
}

/* ---------- Hero ---------- */
.hero {
    padding: 64px 0 40px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
}
.hero h1 { font-size: 2.6rem; color: var(--ink); }
.hero .highlight { color: var(--coral); }
.hero p { color: var(--ink-soft); font-size: 1.15rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 24px; flex-wrap: wrap; }
.hero-art {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 30px;
    text-align: center;
    font-size: 5rem;
    border: 3px solid var(--border);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.hero-art span { display: block; }

@media (max-width: 800px) {
    .hero { grid-template-columns: 1fr; padding-top: 30px; }
    .hero h1 { font-size: 2rem; }
}

/* ---------- Sound wave (TTS playing indicator) ---------- */
.soundwave { display: inline-flex; align-items: flex-end; gap: 3px; height: 18px; }
.soundwave span {
    width: 3px;
    background: currentColor;
    border-radius: 2px;
    animation: wave 0.9s ease-in-out infinite;
    opacity: 0.55;
}
.soundwave span:nth-child(1) { height: 40%; animation-delay: 0s; }
.soundwave span:nth-child(2) { height: 100%; animation-delay: .15s; }
.soundwave span:nth-child(3) { height: 65%; animation-delay: .3s; }
.soundwave span:nth-child(4) { height: 85%; animation-delay: .45s; }
.playing .soundwave span { opacity: 1; }
@keyframes wave {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1); }
}
@media (prefers-reduced-motion: reduce) {
    .soundwave span { animation: none; }
}

/* ---------- Grids / sections ---------- */
.section { padding: 40px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Activity / type chips ---------- */
.chip {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: white;
}
.chip-picture_word { background: var(--primary); }
.chip-listen_repeat { background: var(--purple); }
.chip-conversation { background: var(--coral); }
.chip-story { background: #E0994F; }
.chip-rhyme { background: #4FA0E0; }
.chip-game { background: var(--green); }

.filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-pill {
    padding: 8px 16px;
    border-radius: 999px;
    border: 2px solid var(--border);
    background: var(--surface);
    font-weight: 600;
    color: var(--ink-soft);
    font-size: 0.9rem;
}
.filter-pill.active { background: var(--ink); color: white; border-color: var(--ink); }

.activity-card {
    background: var(--surface);
    border: 3px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--shadow-card);
    transition: transform .12s ease;
}
.activity-card:hover { transform: translateY(-4px); }
.activity-emoji { font-size: 2.6rem; }
.activity-card h3 { font-size: 1.15rem; margin: 0; }
.activity-card .done-mark { color: var(--green); font-weight: 700; font-size: 0.85rem; }
.points-tag { color: var(--yellow); font-weight: 800; font-size: 0.85rem; }

/* ---------- Player (activity play screen) ---------- */
.player-stage {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}
.player-emoji { font-size: 6rem; margin-bottom: 10px; }
.player-prompt {
    font-family: var(--font-display);
    font-size: 2rem;
    margin: 10px 0 24px;
    color: var(--ink);
}
.player-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.story-page { display: none; }
.story-page.active { display: block; }
.story-dots { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.story-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.story-dots span.active { background: var(--coral); }

.game-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 20px; }
@media (max-width: 520px) { .game-options { grid-template-columns: 1fr; } }
.game-option {
    background: var(--surface);
    border: 3px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    font-size: 1.4rem;
    font-family: var(--font-display);
    cursor: pointer;
}
.game-option.correct { border-color: var(--green); background: #E9FBF0; }
.game-option.incorrect { border-color: var(--coral); background: #FFEFEC; }

.celebrate {
    background: var(--surface);
    border: 3px solid var(--yellow);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow-card);
}
.celebrate .big-emoji { font-size: 4rem; }

/* ---------- Forms ---------- */
.form-card { max-width: 460px; margin: 40px auto; }
.field { margin-bottom: 16px; text-align: left; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.92rem; }
.field input, .field select, .field textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    font-family: var(--font-body);
    font-size: 1rem;
    background: #FBFEFF;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--primary);
    outline: none;
}
.form-error {
    background: #FFEFEC;
    border: 2px solid var(--coral);
    color: var(--coral-dark);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-weight: 600;
}
.form-note { font-size: 0.85rem; color: var(--ink-soft); margin-top: 16px; text-align: center; }

/* ---------- Dashboard ---------- */
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 3px solid var(--border);
    padding: 20px;
    text-align: center;
}
.stat-card .stat-value { font-family: var(--font-display); font-size: 2.2rem; color: var(--primary-dark); }
.stat-card .stat-label { color: var(--ink-soft); font-weight: 600; font-size: 0.9rem; }

.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bar-row .bar-label { width: 90px; font-weight: 600; font-size: 0.85rem; flex-shrink: 0; }
.bar-track { flex: 1; background: var(--bg); border-radius: 999px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 999px; }

.child-tab {
    padding: 10px 18px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 3px solid var(--border);
    border-bottom: none;
    background: var(--surface);
    font-weight: 700;
    cursor: pointer;
}
.child-tab.active { background: var(--ink); color: white; border-color: var(--ink); }

/* ---------- Badges ---------- */
.badge-card {
    text-align: center;
    padding: 20px;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 3px solid var(--border);
}
.badge-card .badge-icon { font-size: 2.8rem; }
.badge-card.locked { opacity: 0.4; filter: grayscale(1); }

/* ---------- Footer ---------- */
footer {
    margin-top: 60px;
    padding: 30px 0;
    background: var(--surface);
    border-top: 3px solid var(--border);
    color: var(--ink-soft);
    font-size: 0.9rem;
}
footer a { color: var(--primary-dark); }

.note-box {
    background: #FFF9E8;
    border: 2px solid var(--yellow);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    font-size: 0.92rem;
    color: var(--ink-soft);
    margin: 20px 0;
}
