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

:root {
    --sky: #EAF6FF;
    --sunshine: #FFC93C;
    --coral: #FF6F59;
    --grass: #4CAF7D;
    --berry: #5B3E96;
    --sea: #5B9BD5;
    --plum: #B569D6;
    --white: #FFFFFF;
    --ink: #3A3450;
    --radius: 22px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
    font-family: 'Quicksand', sans-serif;
    background: var(--sky);
    color: var(--ink);
    min-height: 100vh;
    -webkit-user-select: none;
    user-select: none;
}

h1, h2, h3, .display {
    font-family: 'Baloo 2', sans-serif;
    color: var(--berry);
    font-weight: 800;
}

a { text-decoration: none; color: inherit; }

/* ===== Top bar / garden trail signature ===== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--white);
    box-shadow: 0 2px 12px rgba(91,62,150,0.08);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar .brand { font-family: 'Baloo 2', sans-serif; font-weight: 800; color: var(--berry); font-size: 20px; display: flex; align-items: center; gap: 8px; }
.stars-badge { background: var(--sunshine); color: #7A5200; font-weight: 700; padding: 6px 14px; border-radius: 30px; font-size: 14px; display: flex; align-items: center; gap: 4px; }

.container { max-width: 720px; margin: 0 auto; padding: 20px 16px 100px; }

/* ===== Garden trail: signature element ===== */
.garden-trail {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    padding: 24px 10px;
    position: relative;
}
.garden-trail::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 5%;
    right: 5%;
    height: 6px;
    background: repeating-linear-gradient(90deg, #C9E6B8 0, #C9E6B8 10px, transparent 10px, transparent 18px);
    border-radius: 6px;
    z-index: 0;
}
.trail-flower {
    width: 56px; height: 56px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    background: var(--white);
    border: 4px solid #E3E9E0;
    position: relative; z-index: 1;
    transition: transform .15s ease;
}
.trail-flower.bloomed { border-color: var(--grass); background: #F0FBEA; }
.trail-flower.active { border-color: var(--sunshine); transform: scale(1.15); }

/* ===== Cards ===== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 6px 20px rgba(91,62,150,0.08);
    margin-bottom: 16px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 20px;
}
@media (min-width: 500px) { .game-grid { grid-template-columns: repeat(3, 1fr); } }

.game-tile {
    border-radius: 20px;
    padding: 20px 14px;
    text-align: center;
    color: #fff;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    transition: transform .12s ease;
    display: block;
}
.game-tile:active { transform: scale(0.95); }
.game-tile .icon { font-size: 38px; display: block; margin-bottom: 8px; }
.game-tile .desc { font-family: 'Quicksand', sans-serif; font-weight: 600; font-size: 12px; opacity: 0.9; display: block; margin-top: 4px; }

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 16px;
    border: none;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    text-align: center;
}
.btn-primary { background: var(--coral); color: #fff; }
.btn-secondary { background: var(--sea); color: #fff; }
.btn-outline { background: #fff; color: var(--berry); border: 2px solid var(--berry); }
.btn-block { display: block; width: 100%; }

/* ===== Forms ===== */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; color: var(--berry); font-size: 14px; }
.field input, .field select {
    width: 100%; padding: 13px 16px; border: 2px solid #E7E4F0; border-radius: 14px;
    font-family: 'Quicksand', sans-serif; font-size: 15px; font-weight: 600;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--sunshine); }

/* ===== Game play area ===== */
.game-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.back-btn {
    width: 44px; height: 44px; border-radius: 50%; background: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.progress-bar-track { flex: 1; height: 14px; background: #E7E4F0; border-radius: 10px; margin: 0 14px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--grass); border-radius: 10px; transition: width .4s ease; }

.big-stage {
    background: #fff; border-radius: 28px; padding: 40px 20px;
    text-align: center; box-shadow: 0 8px 24px rgba(91,62,150,0.1);
    margin-bottom: 20px; min-height: 220px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.big-char { font-size: 100px; font-family: 'Baloo 2', sans-serif; font-weight: 800; color: var(--berry); line-height: 1; }
.big-emoji { font-size: 70px; }
.stage-label { font-size: 20px; font-weight: 700; color: var(--ink); font-family: 'Quicksand', sans-serif; }

.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.choice-btn {
    background: #fff; border: 3px solid #E7E4F0; border-radius: 20px;
    padding: 24px 10px; font-size: 40px; font-family: 'Baloo 2', sans-serif; font-weight: 800;
    color: var(--berry); cursor: pointer; transition: all .15s ease;
}
.choice-btn.correct { background: #E4F7E1; border-color: var(--grass); }
.choice-btn.wrong { background: #FFE5E0; border-color: var(--coral); animation: shake .3s; }
@keyframes shake { 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

.speak-btn {
    background: var(--sunshine); border: none; border-radius: 50%;
    width: 60px; height: 60px; font-size: 26px; cursor: pointer;
    box-shadow: 0 4px 12px rgba(255,201,60,0.5);
}

/* ===== Result overlay ===== */
.result-overlay {
    position: fixed; inset: 0; background: rgba(91,62,150,0.55);
    display: flex; align-items: center; justify-content: center; z-index: 100;
    padding: 20px;
}
.result-card {
    background: #fff; border-radius: 28px; padding: 36px 28px; text-align: center; max-width: 320px;
}
.result-card .emoji { font-size: 72px; }
.result-card h2 { margin: 12px 0 6px; }
.result-stars { font-size: 32px; margin: 12px 0; letter-spacing: 6px; }

/* ===== Bottom nav ===== */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; display: flex; justify-content: space-around;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
    z-index: 10;
}
.bottom-nav a { text-align: center; font-size: 11px; font-weight: 700; color: #999; }
.bottom-nav a.active { color: var(--coral); }
.bottom-nav .nav-icon { font-size: 22px; display: block; }

.empty-state { text-align: center; padding: 40px 20px; color: #888; }
.empty-state .emoji { font-size: 56px; margin-bottom: 12px; display: block; }

.child-avatar-picker { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 14px 0; }
.child-avatar-picker button {
    width: 52px; height: 52px; border-radius: 50%; border: 3px solid transparent;
    background: #F5F3FA; font-size: 26px; cursor: pointer;
}
.child-avatar-picker button.selected { border-color: var(--sunshine); background: #FFF6DE; }
