/* Learn Shona — Child Mode
 * Tablet-landscape first, works on phones. Tap targets >= 120px.
 */
:root {
    --sun: #FFC83D;
    --msasa: #F2803A;
    --savanna: #3BA55C;
    --sky: #4FB3E8;
    --clay: #D9534F;
    --cream: #FFF8EC;
    --ink: #2E2A3A;
    --radius: 28px;
    --shadow: 0 8px 0 rgba(46, 42, 58, .12), 0 14px 30px rgba(46, 42, 58, .12);
    --heading: 'Baloo 2', 'Nunito', system-ui, sans-serif;
    --body: 'Nunito', system-ui, sans-serif;
}

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

html, body { height: 100%; margin: 0; }

body.play {
    font-family: var(--body);
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 200, 61, .35) 0 120px, transparent 121px),
        radial-gradient(circle at 92% 85%, rgba(79, 179, 232, .22) 0 160px, transparent 161px),
        var(--cream);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    overscroll-behavior: none;
}

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { opacity: .25; cursor: default; }
button:focus-visible { outline: 4px solid var(--sky); outline-offset: 4px; }

/* ---------- top bar ---------- */
.bar {
    position: fixed; inset: 0 0 auto 0; z-index: 20;
    display: flex; align-items: center; gap: 14px;
    padding: max(14px, env(safe-area-inset-top)) 18px 10px;
}
.bar .spacer { flex: 1; }
.round-btn {
    width: 72px; height: 72px; border-radius: 50%;
    background: #fff; box-shadow: var(--shadow);
    font-size: 32px; display: grid; place-items: center;
    transition: transform .12s;
}
.round-btn:active { transform: scale(.92); }
.avatar {
    width: 64px; height: 64px; border-radius: 50%;
    background: #fff; box-shadow: var(--shadow);
    display: grid; place-items: center; font-size: 38px;
}

/* parent gate: press and hold, ring fills over 3s */
.lock {
    position: relative; width: 56px; height: 56px; border-radius: 50%;
    background: rgba(255, 255, 255, .7); font-size: 22px;
    display: grid; place-items: center; opacity: .6;
    touch-action: none;
}
.lock .ring {
    position: absolute; inset: -4px; border-radius: 50%;
    background: conic-gradient(var(--savanna) var(--p, 0%), transparent 0);
    -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%);
    mask: radial-gradient(circle, transparent 58%, #000 60%);
}
.lock.holding { opacity: 1; }
.lock.holding .ring { animation: fill 3s linear forwards; }
@property --p { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
@keyframes fill { to { --p: 100%; } }
.lock-wide {
    width: auto; height: auto; border-radius: 999px; padding: 16px 26px;
    font-size: 16px; font-weight: 700; opacity: 1; background: #fff; box-shadow: var(--shadow);
}
.lock-wide .ring { border-radius: 999px; -webkit-mask: none; mask: none; opacity: .25; inset: 0; }

/* ---------- stage ---------- */
.stage {
    position: absolute; inset: 0;
    padding: 100px 24px 150px;
    overflow-y: auto;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.screen-title {
    font-family: var(--heading); font-weight: 800;
    font-size: clamp(30px, 5vw, 52px); margin: 0 0 24px; text-align: center;
    color: var(--ink);
}
.screen-title span { display: inline-block; animation: bob 2.4s ease-in-out infinite; }
.screen-title em { display: block; font-family: var(--body); font-style: normal; font-weight: 700; font-size: .42em; opacity: .55; }

.grid { display: grid; gap: clamp(14px, 2.4vw, 28px); width: 100%; max-width: 1100px; justify-content: center; }
.grid-world { grid-template-columns: repeat(auto-fit, minmax(170px, 210px)); }
.grid-avatars { grid-template-columns: repeat(auto-fit, minmax(140px, 170px)); }
.grid-hub { grid-template-columns: repeat(auto-fit, minmax(200px, 260px)); }

/* topic islands */
.island {
    --c: var(--sun);
    aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff8 0 18%, transparent 19%), var(--c);
    box-shadow: var(--shadow), inset 0 -10px 0 rgba(0, 0, 0, .1);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .18);
    transition: transform .15s;
    animation: pop-in .45s backwards;
}
.island:nth-child(2) { animation-delay: .05s; } .island:nth-child(3) { animation-delay: .1s; }
.island:nth-child(4) { animation-delay: .15s; } .island:nth-child(5) { animation-delay: .2s; }
.island:nth-child(6) { animation-delay: .25s; } .island:nth-child(7) { animation-delay: .3s; }
.island:active { transform: scale(.93); }
.island-icon { font-size: clamp(54px, 7vw, 76px); line-height: 1; filter: drop-shadow(0 4px 0 rgba(0,0,0,.12)); }
.island-name { font-family: var(--heading); font-weight: 800; font-size: 28px; line-height: 1.1; margin-top: 6px; }
.island-en { font-size: 15px; font-weight: 700; opacity: .9; }
.stars { font-size: 18px; letter-spacing: 2px; color: #fff; margin-top: 2px; }
.stars .dim { opacity: .35; }

/* tiles */
.tile {
    --c: var(--sky);
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow); border-bottom: 10px solid var(--c);
    padding: 22px 14px; min-height: 150px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    position: relative; transition: transform .12s;
    animation: pop-in .4s backwards;
}
.tile:active { transform: scale(.94); }
.tile-icon { font-size: 70px; line-height: 1.1; }
.tile-label { font-family: var(--heading); font-weight: 800; font-size: 28px; }
.tile-sub { font-weight: 700; opacity: .55; }
.tile-star { position: absolute; top: 10px; right: 14px; font-size: 30px; }
.tile-mode { min-height: 220px; }
.tile-mode .tile-icon { font-size: 90px; }

/* ---------- learn ---------- */
.learn {
    display: grid; grid-template-columns: auto minmax(0, 520px) auto;
    align-items: center; gap: clamp(10px, 3vw, 40px); width: 100%; justify-content: center;
}
.card {
    --c: var(--sun);
    background: #fff; border-radius: 40px; box-shadow: var(--shadow);
    border: 10px solid var(--c);
    padding: 26px 20px 28px; text-align: center; cursor: pointer;
    animation: pop-in .35s;
}
.card.from-right { animation: from-right .35s; }
.card.from-left { animation: from-left .35s; }
.card.boop { animation: boop .35s; }
.card-pic { font-size: clamp(110px, 20vh, 190px); line-height: 1.15; }
.card-word {
    font-family: var(--heading); font-weight: 800;
    font-size: clamp(44px, 8vw, 78px); line-height: 1; margin-top: 10px; letter-spacing: .5px;
}
.card-say { font-size: 20px; margin-top: 10px; opacity: .65; font-weight: 700; }
.card-say span { color: var(--msasa); opacity: 1; }
.nav-arrow {
    width: 96px; height: 96px; border-radius: 50%;
    background: var(--savanna); color: #fff; font-size: 40px;
    box-shadow: var(--shadow); transition: transform .12s;
}
.nav-arrow.prev { background: #fff; color: var(--ink); }
.nav-arrow:active { transform: scale(.9); }
.dots { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(46, 42, 58, .15); transition: all .2s; }
.dots i.done { background: var(--sun); }
.dots i.on { background: var(--savanna); width: 34px; border-radius: 99px; }

/* ---------- game ---------- */
.game { display: flex; flex-direction: column; align-items: center; width: 100%; }
.hear {
    font-size: 40px; width: 88px; height: 88px; border-radius: 50%;
    background: #fff; box-shadow: var(--shadow); margin-bottom: 24px;
    animation: pulse 1.8s ease-in-out infinite;
}
.grid-choices.n2 { grid-template-columns: repeat(2, minmax(150px, 300px)); }
.grid-choices.n3 { grid-template-columns: repeat(3, minmax(120px, 260px)); }
.choice {
    --c: var(--sun);
    aspect-ratio: 1; border-radius: 40px; background: #fff;
    box-shadow: var(--shadow); border: 8px solid transparent;
    font-size: clamp(90px, 15vw, 170px); line-height: 1;
    transition: transform .15s, border-color .2s;
    animation: pop-in .4s backwards;
}
.choice:nth-child(2) { animation-delay: .08s; } .choice:nth-child(3) { animation-delay: .16s; }
.choice:active { transform: scale(.94); }
.choice.right { border-color: var(--savanna); animation: celebrate .7s; background: #EAF8EE; }
.choice.wobble { animation: wobble .5s; }

/* ---------- sing ---------- */
.sing { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 760px; }
.lyrics { list-style: none; padding: 0; margin: 0 0 24px; width: 100%; }
.lyrics li {
    background: #fff; border-radius: 22px; padding: 14px 22px; margin-bottom: 12px;
    box-shadow: 0 4px 0 rgba(46, 42, 58, .08); cursor: pointer;
    transition: transform .2s, background .2s;
}
.lyrics li strong { display: block; font-family: var(--heading); font-size: clamp(22px, 3.4vw, 32px); }
.lyrics li span { opacity: .55; font-weight: 700; }
.lyrics li.on { background: #FFE8F4; transform: scale(1.04); box-shadow: 0 0 0 5px #E86FB0; }

/* ---------- splash / reward ---------- */
.splash, .reward { text-align: center; }
.splash-title {
    font-family: var(--heading); font-weight: 800; font-size: clamp(48px, 9vw, 96px);
    margin: 0 0 20px; color: var(--msasa); text-shadow: 0 5px 0 rgba(242, 128, 58, .2);
}
.splash-hint { font-weight: 700; opacity: .6; font-size: 18px; }
.big-play {
    width: 180px; height: 180px; border-radius: 50%;
    background: var(--savanna); color: #fff; font-size: 80px; padding-left: 12px;
    box-shadow: 0 12px 0 #2C8247, 0 22px 40px rgba(59, 165, 92, .4);
    animation: pulse 1.6s ease-in-out infinite;
}
.big-play.small { width: 120px; height: 120px; font-size: 52px; box-shadow: 0 8px 0 #2C8247; }
.big-play:active { transform: translateY(6px); box-shadow: 0 4px 0 #2C8247; }
.sticker { font-size: 160px; line-height: 1; animation: sticker 1s cubic-bezier(.2, 1.6, .4, 1); }
.reward h2 { font-family: var(--heading); font-size: clamp(40px, 7vw, 68px); margin: 8px 0 0; color: var(--savanna); }
.reward p { font-weight: 700; font-size: 22px; opacity: .6; margin: 0 0 24px; }
.reward-actions { display: flex; gap: 28px; justify-content: center; }
.reward-actions .round-btn { width: 110px; height: 110px; font-size: 50px; }

/* ---------- Shiri ---------- */
.shiri-wrap {
    position: fixed; left: max(12px, env(safe-area-inset-left)); bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 15; display: flex; align-items: flex-end; pointer-events: none;
}
.shiri {
    width: clamp(110px, 14vw, 150px); pointer-events: auto; cursor: pointer;
    transform-origin: 50% 100%; animation: idle 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 6px rgba(0, 0, 0, .12));
}
.shiri.talking { animation: talk .28s ease-in-out infinite alternate; }
.shiri.dancing { animation: dance .6s ease-in-out infinite; }
.shiri.hop { animation: hop .5s; }
.bubble {
    order: 2; margin: 0 0 90px -10px; max-width: min(56vw, 420px);
    background: #fff; border-radius: 24px 24px 24px 6px; padding: 12px 18px;
    box-shadow: var(--shadow);
    opacity: 0; transform: scale(.6) translateY(10px); transform-origin: 0 100%;
    transition: all .25s cubic-bezier(.2, 1.4, .4, 1);
}
.bubble.show { opacity: 1; transform: none; }
.bubble strong { display: block; font-family: var(--heading); font-size: 26px; line-height: 1.1; }
.bubble span { font-weight: 700; opacity: .55; font-size: 15px; }

/* ---------- overlays ---------- */
.overlay {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(46, 42, 58, .45); backdrop-filter: blur(6px);
    display: grid; place-items: center; padding: 20px;
}
.overlay[hidden] { display: none; }
.overlay-card {
    background: var(--cream); border-radius: 32px; padding: 28px;
    width: min(560px, 100%); max-height: 92vh; overflow: auto; text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .3); animation: pop-in .3s;
}
.overlay-card h2 { font-family: var(--heading); font-size: 36px; margin: 0; }
.overlay-card .sticker { font-size: 100px; }
.panel { text-align: left; user-select: text; -webkit-user-select: text; }
.panel label { display: block; font-weight: 700; margin-top: 16px; }
.panel select, .panel input[type=range] {
    display: block; width: 100%; margin-top: 6px; font: inherit;
    padding: 10px 12px; border-radius: 14px; border: 2px solid #E8DFCC; background: #fff;
}
.panel .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.muted, .hint { opacity: .6; margin: 6px 0; }
.hint { font-size: 14px; }
.panel-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.panel-actions > * { flex: 1; }
.btn-soft, .btn-solid {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 16px; border-radius: 14px; font-weight: 700; text-decoration: none;
    background: #fff; border: 2px solid #E8DFCC; color: var(--ink); margin-top: 8px;
}
.btn-soft.danger { color: var(--clay); }
.btn-solid { background: var(--savanna); border-color: var(--savanna); color: #fff; }
.btn-solid.alt { background: var(--ink); border-color: var(--ink); }

.no-tts {
    position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 60;
    background: var(--clay); color: #fff; padding: 10px 18px; border-radius: 0 0 14px 14px; font-weight: 700;
}

/* confetti */
.confetti {
    position: fixed; top: -20px; width: 12px; height: 18px; border-radius: 3px; z-index: 40;
    pointer-events: none; animation: fall 2.4s cubic-bezier(.3, .6, .6, 1) forwards;
}

/* ---------- keyframes ---------- */
@keyframes pop-in { from { opacity: 0; transform: scale(.6); } }
@keyframes from-right { from { opacity: 0; transform: translateX(120px) rotate(6deg); } }
@keyframes from-left { from { opacity: 0; transform: translateX(-120px) rotate(-6deg); } }
@keyframes boop { 50% { transform: scale(1.06) rotate(-2deg); } }
@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes pulse { 50% { transform: scale(1.07); } }
@keyframes wobble { 20% { transform: rotate(-8deg); } 40% { transform: rotate(7deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(3deg); } }
@keyframes celebrate { 30% { transform: scale(1.15) rotate(-4deg); } 60% { transform: scale(.98) rotate(3deg); } }
@keyframes sticker { from { transform: scale(0) rotate(-40deg); } }
@keyframes idle { 50% { transform: translateY(-6px) rotate(-2deg); } }
@keyframes talk { from { transform: rotate(-3deg) scale(1); } to { transform: rotate(3deg) scale(1.05, .97); } }
@keyframes dance { 25% { transform: rotate(-10deg) translateY(-14px); } 75% { transform: rotate(10deg) translateY(-14px); } }
@keyframes hop { 40% { transform: translateY(-40px) rotate(-8deg); } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: .8; } }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
    .stage { padding: 96px 14px 140px; justify-content: flex-start; }
    .grid-world { grid-template-columns: repeat(2, 1fr); }
    .island-name { font-size: 22px; }
    .island-en { font-size: 13px; }
    .learn { grid-template-columns: 1fr 1fr; }
    .card { grid-column: 1 / -1; grid-row: 1; }
    .nav-arrow { justify-self: center; width: 84px; height: 84px; }
    .grid-choices.n3 { grid-template-columns: repeat(2, 1fr); }
    .tile-mode { min-height: 160px; }
    .bubble { margin-bottom: 70px; }
}
@media (max-height: 600px) and (orientation: landscape) {
    .stage { padding-top: 84px; padding-bottom: 20px; }
    .card-pic { font-size: 90px; }
    .shiri { width: 90px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- Social Sharing Modal & Toast in Child Mode ---------- */
.ls-modal-backdrop {
    position: fixed; inset: 0; z-index: 1050;
    background: rgba(46, 42, 58, 0.55); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.ls-modal-backdrop.show { opacity: 1; pointer-events: auto; }
.ls-modal-card {
    background: #FFF8EC; border-radius: 28px; padding: 32px 28px; width: 100%; max-width: 460px;
    text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25); position: relative;
    transform: scale(0.95); transition: transform .2s ease;
}
.ls-modal-backdrop.show .ls-modal-card { transform: scale(1); }
.ls-modal-close {
    position: absolute; top: 16px; right: 20px; border: 0; background: none;
    font-size: 32px; line-height: 1; color: #8C8297; cursor: pointer;
}
.ls-modal-close:hover { color: #2E2A3A; }
.ls-modal-icon { font-size: 48px; margin-bottom: 8px; }
.ls-modal-card h3 { font-family: var(--heading); font-size: 26px; margin: 0 0 8px; color: #2E2A3A; }
.ls-modal-card p { color: #6A6275; font-size: 15px; margin: 0 0 20px; }
.ls-share-buttons { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.ls-sbtn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px 20px; border-radius: 999px; font-weight: 700; text-decoration: none;
    color: #fff; font-size: 16px; transition: transform .12s, filter .12s;
}
.ls-sbtn:hover { filter: brightness(1.08); color: #fff; transform: translateY(-2px); }
.sbtn-whatsapp { background: #25D366; }
.sbtn-facebook { background: #1877F2; }
.sbtn-twitter { background: #000; }
.ls-copy-box {
    display: flex; gap: 8px; background: #fff; border: 2px solid #EADFC8; border-radius: 999px;
    padding: 4px 6px 4px 16px;
}
.ls-copy-box input {
    border: 0; outline: none; background: transparent; flex: 1; font-size: 14px;
    color: #2E2A3A; min-width: 0;
}
.ls-copy-box button {
    background: var(--savanna); color: #fff; border: 0; border-radius: 999px;
    padding: 8px 18px; font-weight: 700; font-size: 14px; cursor: pointer;
}
.ls-copy-box button:hover { background: #2F8F4E; }

.ls-share-toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(50px);
    background: #2E2A3A; color: #fff; padding: 12px 24px; border-radius: 999px;
    font-weight: 700; font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    z-index: 2000; opacity: 0; transition: all .25s cubic-bezier(.2, 1.4, .4, 1);
    pointer-events: none;
}
.ls-share-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

