/* TSAKKLI – kids.tsakk.com. TSAKK navy/green/cream, plus playful kid colours. */
@font-face { font-family: 'Nunito'; font-weight: 700; src: url('fonts/Nunito_700Bold.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Nunito'; font-weight: 800; src: url('fonts/Nunito_800ExtraBold.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Nunito'; font-weight: 900; src: url('fonts/Nunito_900Black.ttf') format('truetype'); font-display: swap; }

:root {
  --navy: #04224B; --navy2: #0B3A78; --green: #4FC004; --green-d: #2F7A04; --green-s: #E2F4DA;
  --cream: #F9F5E9; --card: #fff; --border: #ECE6D6; --muted: #56637A; --gold: #FFC53D; --gold-d: #E09B00;
  --pink: #FF7BA5; --sky: #7FD1FF; --purple: #7B61FF; --red: #E5484D;
  --radius: 22px; --shadow: 0 2px 14px rgba(4, 34, 75, .08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif; font-weight: 700; color: var(--navy); background: var(--cream); overscroll-behavior-y: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
#app { min-height: 100%; }
.wrap { max-width: 560px; margin: 0 auto; padding: 18px 16px calc(100px + env(safe-area-inset-bottom)); }
h1 { font-weight: 900; font-size: 28px; line-height: 1.15; margin: 0 0 6px; }
h2 { font-weight: 900; font-size: 21px; margin: 22px 0 10px; }
h3 { font-weight: 800; font-size: 17px; margin: 0; }
p { margin: 0 0 10px; line-height: 1.45; }
.muted { color: var(--muted); font-weight: 700; }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.hidden { display: none !important; }

/* header */
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 34px; height: 34px; }
.wordmark { font-weight: 900; font-size: 24px; letter-spacing: .5px; }
.wordmark b { color: var(--green); font-weight: 900; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-weight: 800; font-size: 14px; }

/* cards & buttons */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border-radius: 999px;
  font-weight: 900; font-size: 17px; background: var(--green); color: var(--navy); box-shadow: 0 4px 0 var(--green-d); transition: transform .08s, box-shadow .08s; user-select: none; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--green-d); }
.btn.block { width: 100%; }
.btn.navy { background: var(--navy); color: #fff; box-shadow: 0 4px 0 #000E22; }
.btn.white { background: #fff; color: var(--navy); box-shadow: 0 4px 0 #D8D2C2; }
.btn.gold { background: var(--gold); color: var(--navy); box-shadow: 0 4px 0 var(--gold-d); }
.btn.red { background: #FFE4E4; color: #B42318; box-shadow: 0 4px 0 #F3C2C2; }
.btn.round { width: 50px; min-height: 50px; padding: 0; font-size: 22px; flex: none; }
.btn.small { min-height: 40px; font-size: 15px; padding: 0 14px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link { color: var(--navy2); text-decoration: underline; font-weight: 800; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--card); box-shadow: var(--shadow); font-size: 18px; }

/* forms */
label.f { display: block; font-weight: 800; font-size: 14px; margin: 12px 0 6px; }
.input { width: 100%; height: 50px; border-radius: 14px; border: 2px solid var(--border); background: #fff; padding: 0 14px; font-size: 17px; font-weight: 700; outline: none; }
.input:focus { border-color: var(--green); }
.input.code { text-align: center; letter-spacing: 8px; font-size: 28px; font-weight: 900; text-transform: uppercase; height: 64px; }
.err { color: #B42318; font-weight: 800; margin-top: 8px; min-height: 1em; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 46px; height: 46px; border-radius: 50%; background: var(--green-s); font-size: 22px; font-weight: 900; }
.stepper .val { min-width: 70px; text-align: center; font-size: 24px; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.picker { display: flex; flex-wrap: wrap; gap: 8px; }
.picker button { width: 48px; height: 48px; border-radius: 14px; background: var(--cream); font-size: 26px; border: 3px solid transparent; }
.picker button.on { border-color: var(--green); background: var(--green-s); }
.picker.colors button { width: 40px; height: 40px; border-radius: 50%; }
.picker.colors button.on { border-color: var(--navy); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { padding: 9px 14px; border-radius: 999px; background: var(--cream); font-weight: 800; border: 2px solid transparent; }
.seg button.on { background: var(--green-s); border-color: var(--green); }

/* landing */
.landing { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 24px 18px 40px; max-width: 520px; margin: 0 auto; }
.landing .mascots { display: flex; justify-content: center; margin: -6px 0 -16px; }
.landing .mascots svg { width: 33%; height: auto; }
.bigchoice { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 26px; text-align: left; width: 100%; box-shadow: 0 5px 0 rgba(0,0,0,.12); transition: transform .08s; }
.bigchoice:active { transform: translateY(3px); }
.bigchoice .e { font-size: 44px; }
.bigchoice h3 { font-size: 21px; font-weight: 900; }
.bigchoice.kid { background: linear-gradient(135deg, #FFD23F, #FF9F43); }
.bigchoice.parent { background: #fff; }
.partof { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; }
.partof img { height: 18px; }

/* PIN pad & kid picker */
.kidpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.kidpick button { background: #fff; border-radius: 24px; padding: 16px 8px; box-shadow: 0 5px 0 rgba(4,34,75,.1); display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 900; font-size: 18px; }
.ava { width: 72px; height: 72px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 42px; background: #fff; border: 5px solid var(--green); }
.ava.sm { width: 44px; height: 44px; font-size: 24px; border-width: 3px; }
.pinbox { display: flex; justify-content: center; gap: 14px; margin: 18px 0 22px; }
.pinbox span { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--navy); }
.pinbox span.on { background: var(--navy); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; max-width: 300px; margin: 0 auto; }
.pinpad button { height: 70px; border-radius: 22px; background: #fff; font-size: 30px; font-weight: 900; box-shadow: 0 4px 0 #D8D2C2; }
.pinpad button:active { transform: translateY(3px); box-shadow: 0 1px 0 #D8D2C2; }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

/* parent */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--border); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
.tabs .in { display: flex; width: 100%; max-width: 560px; }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; font-size: 12px; font-weight: 800; color: var(--muted); position: relative; }
.tabs button .ic { font-size: 22px; width: 52px; height: 30px; border-radius: 15px; display: flex; align-items: center; justify-content: center; }
.tabs button.on { color: var(--navy); }
.tabs button.on .ic { background: var(--green-s); }
.tabs .badge { position: absolute; top: 4px; left: calc(50% + 10px); background: var(--red); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.item .em { width: 46px; height: 46px; border-radius: 14px; background: var(--cream); display: flex; align-items: center; justify-content: center; font-size: 26px; flex: none; }
.item.off { opacity: .55; }
.coinnum { display: inline-flex; align-items: center; gap: 4px; font-weight: 900; white-space: nowrap; }
.coinnum svg { flex: none; }
.kidcard { display: flex; align-items: center; gap: 12px; }
.kidcard .mini { width: 74px; height: 74px; flex: none; }
.kidcard .mini svg { width: 100%; height: 100%; }
.bar { height: 10px; background: var(--cream); border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #FF9F43); border-radius: 5px; transition: width .8s; }
.chipset { display: flex; flex-wrap: wrap; gap: 8px; }
.chipset button { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); font-weight: 800; font-size: 14px; }
.chipset button.done { opacity: .45; }
.codebig { font-size: 40px; font-weight: 900; letter-spacing: 8px; text-align: center; padding: 10px 0; }
.feed .line { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.feed .line:last-child { border-bottom: 0; }
.tag { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--cream); font-weight: 800; white-space: nowrap; }
.tag.ok { background: var(--green-s); color: var(--green-d); }
.tag.no { background: #FFE4E4; color: #B42318; }
.tag.wait { background: #FFF3D1; color: #8A5A00; }

/* sheets & toasts */
.overlay { position: fixed; inset: 0; background: rgba(4, 34, 75, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 28px 28px 0 0; padding: 20px 18px calc(24px + env(safe-area-inset-bottom)); animation: up .25s cubic-bezier(.2, .9, .3, 1.2); }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 28px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(60px); opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 16px; z-index: 80; max-width: 90vw; font-weight: 800; animation: up .25s; box-shadow: 0 8px 30px rgba(0,0,0,.25); }

/* ---------- KID WORLD ---------- */
body.kid { background: linear-gradient(180deg, #BDE9FF 0%, #E8F7FF 45%, #FFF6DC 100%) fixed; }
.kidtop { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kidtop .who { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 900; }
.coinpill { display: inline-flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 6px 16px 6px 8px; font-size: 26px; font-weight: 900; box-shadow: 0 4px 0 rgba(4,34,75,.12); }
.coinpill.bump { animation: bump .35s; }
@keyframes bump { 50% { transform: scale(1.18); } }
.stage { position: relative; display: flex; flex-direction: column; align-items: center; margin: 6px 0 4px; }
.stage .mascot { width: min(78vw, 330px); height: auto; filter: drop-shadow(0 10px 0 rgba(4,34,75,.06)); }
.stage .lvl { background: var(--purple); color: #fff; font-weight: 900; padding: 5px 14px; border-radius: 999px; font-size: 15px; margin-top: -8px; box-shadow: 0 3px 0 #5A43D6; }
.m-body { transform-origin: 120px 226px; animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.03, .975); } }
.m-eye { animation: blink 4.5s infinite; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.m-tail { transform-origin: 160px 170px; animation: wag 1.6s ease-in-out infinite; }
@keyframes wag { 50% { transform: rotate(6deg); } }
.m-wing { transform-origin: 70px 140px; animation: flap 1.2s ease-in-out infinite; }
.m-wing-r { transform-origin: 170px 140px; animation-direction: reverse; }
@keyframes flap { 50% { transform: rotate(-8deg); } }
.m-sparkles { animation: twinkle 1.8s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .35; } }
.mascot.gulp .m-body { animation: gulp .5s ease-out; }
@keyframes gulp { 30% { transform: scale(1.15, .85); } 60% { transform: scale(.94, 1.08); } }
.mascot.happy .m-body { animation: hop .6s ease-out 2; }
@keyframes hop { 40% { transform: translateY(-18px) scale(1.02); } }
.progress { width: 100%; max-width: 360px; margin: 10px auto 0; text-align: center; font-size: 14px; color: var(--navy2); }
.progress .bar { height: 14px; border-radius: 7px; background: rgba(255,255,255,.8); margin-bottom: 6px; }
.bigbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.bigbtn { border-radius: 28px; padding: 18px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 22px; font-weight: 900; box-shadow: 0 6px 0 rgba(0,0,0,.14); transition: transform .08s; }
.bigbtn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.14); }
.bigbtn .e { font-size: 46px; line-height: 1; }
.bigbtn.jobs { background: var(--green); }
.bigbtn.shop { background: var(--gold); }
.jobgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.jobcard { background: #fff; border-radius: 26px; padding: 14px 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; box-shadow: 0 6px 0 rgba(4,34,75,.1); position: relative; transition: transform .08s; min-height: 170px; }
.jobcard:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(4,34,75,.1); }
.jobcard .e { font-size: 54px; line-height: 1.1; }
.jobcard .tt { font-size: 16px; font-weight: 900; line-height: 1.2; }
.jobcard .val { display: inline-flex; align-items: center; gap: 4px; font-size: 20px; font-weight: 900; background: #FFF3D1; padding: 3px 10px; border-radius: 999px; }
.jobcard .state { position: absolute; top: 8px; right: 8px; font-size: 12px; background: #FFF3D1; padding: 3px 8px; border-radius: 999px; font-weight: 900; }
.jobcard.waiting { opacity: .75; }
.jobcard.done { opacity: .5; }
.jobcard.done .state { background: var(--green-s); color: var(--green-d); }
.jobcard.cant .val { background: #F1ECDF; }
.jobcard .need { font-size: 13px; color: var(--muted); }
.jobcard .bar { width: 85%; height: 8px; }
.pendlist { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; }
.pendlist .p { flex: none; background: rgba(255,255,255,.85); border-radius: 16px; padding: 8px 12px; display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; }
.buddy { display: grid; grid-template-columns: 1fr; gap: 12px; }
.buddy button { background: #fff; border-radius: 28px; padding: 6px 12px 14px; display: flex; align-items: center; gap: 8px; box-shadow: 0 6px 0 rgba(4,34,75,.1); }
.buddy button svg { width: 130px; height: 130px; flex: none; }
.buddy button h3 { font-size: 24px; font-weight: 900; }
.kidback { display: inline-flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 900; background: #fff; padding: 8px 14px; border-radius: 999px; box-shadow: 0 3px 0 rgba(4,34,75,.1); }

/* coins flying */
.flycoin { position: fixed; z-index: 90; pointer-events: none; width: 44px; height: 44px; }
.burst { position: fixed; z-index: 95; pointer-events: none; font-weight: 900; font-size: 34px; color: #fff; -webkit-text-stroke: 2px var(--navy); paint-order: stroke fill; text-shadow: 0 4px 0 var(--navy); animation: rise 1.6s ease-out forwards; white-space: nowrap; transform: translateX(-50%); }
@keyframes rise { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -10px) scale(1.15); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70px) scale(1); } }
.confetti { position: fixed; z-index: 85; pointer-events: none; width: 10px; height: 14px; border-radius: 3px; }
.celebrate { text-align: center; }
.celebrate .e { font-size: 80px; animation: hop .6s ease-out 3; display: inline-block; }
