@font-face { font-family: 'Lexend'; font-weight: 400; font-display: swap; src: url(fonts/lexend-400.woff2) format('woff2'); }
@font-face { font-family: 'Lexend'; font-weight: 600; font-display: swap; src: url(fonts/lexend-600.woff2) format('woff2'); }
@font-face { font-family: 'Lexend'; font-weight: 700; font-display: swap; src: url(fonts/lexend-700.woff2) format('woff2'); }
@font-face { font-family: 'Grandstander'; font-weight: 600; font-display: swap; src: url(fonts/grandstander-600.woff2) format('woff2'); }
@font-face { font-family: 'Grandstander'; font-weight: 800; font-display: swap; src: url(fonts/grandstander-800.woff2) format('woff2'); }

:root {
  --carta: #FBFCFF; --quadretto: #DDE7F6; --margine: #F4A3A0;
  --ink: #1E2A4A; --ink-2: #4A5677; --ink-3: #7B86A3;
  --pomodoro: #F0533E; --limone: #FFCF3F; --basilico: #2FAE6B; --cielo: #4BA3F5; --lavanda: #8C6CF2; --inchiostro: #2A3A66;
  --pomodoro-l: #FFE1DC; --limone-l: #FFF3C9; --basilico-l: #D8F3E4; --cielo-l: #DCEEFF; --lavanda-l: #ECE5FF; --inchiostro-l: #E2E6F2;
  --r: 18px; --r-sm: 12px;
  --display: 'Grandstander', 'Comic Sans MS', system-ui, sans-serif;
  --body: 'Lexend', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.55; color: var(--ink);
  background-color: var(--carta);
  background-image: linear-gradient(var(--quadretto) 1px, transparent 1px), linear-gradient(90deg, var(--quadretto) 1px, transparent 1px);
  background-size: 26px 26px; min-height: 100vh;
}
body::before { content: ''; position: fixed; top: 0; bottom: 0; left: 56px; width: 2px; background: var(--margine); opacity: .7; pointer-events: none; z-index: 0; }
@media (max-width: 700px) { body::before { left: 14px; } }
#app { position: relative; z-index: 1; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.005em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 .8em; }
a { color: var(--inchiostro); }
img, svg { max-width: 100%; }
.muted { color: var(--ink-3); }
.small { font-size: .86rem; }
.center { text-align: center; }
:focus-visible { outline: 3px solid var(--cielo); outline-offset: 2px; border-radius: 6px; }
.loading { padding: 30vh 0; text-align: center; font-family: var(--display); font-size: 1.4rem; }

/* ---- Bottoni */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; border: 2px solid var(--ink); border-radius: 999px; padding: .55em 1.2em;
  font: 600 1rem var(--body); cursor: pointer; text-decoration: none; color: var(--ink); background: #fff; box-shadow: 0 3px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--limone); }
.btn-ghost { background: #fff; }
.btn-ghost.on { background: var(--cielo-l); }
.btn-danger { background: var(--pomodoro); color: #fff; }
.btn-sm { padding: .35em .9em; font-size: .9rem; }
.btn-lg { padding: .75em 1.5em; font-size: 1.08rem; }
.icon-btn { border: 0; background: none; font-size: 1.1rem; cursor: pointer; color: var(--ink-3); padding: .3em .5em; }

/* ---- Testata */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem clamp(1rem, 5vw, 5rem); flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--ink); }
.logo-n { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; font: 800 1.25rem var(--display); color: #fff; border: 2px solid var(--ink); }
.ln1 { background: var(--pomodoro); transform: rotate(-6deg); } .ln2 { background: var(--limone); color: var(--ink); transform: rotate(4deg); } .ln3 { background: var(--cielo); transform: rotate(-3deg); }
.logo-word { font: 800 1.35rem var(--display); margin-left: 8px; }
.top-nav { display: flex; gap: .5rem; flex-wrap: wrap; }
main { padding: 0 clamp(1rem, 5vw, 5rem) 3rem; max-width: 1200px; margin: 0 auto; }
.foot { display: flex; justify-content: space-between; padding: 2rem clamp(1rem, 5vw, 5rem); color: var(--ink-3); font-size: .85rem; }

/* ---- Landing */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; padding: 2rem 0 4rem; }
.hero-num { display: flex; justify-content: center; gap: 1rem; }
.hn { position: relative; font: 800 clamp(7rem, 15vw, 12rem)/0.9 var(--display); color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }
.hn1 { color: var(--pomodoro); transform: rotate(-8deg); } .hn2 { color: var(--limone); transform: translateY(1.2rem) rotate(5deg); } .hn3 { color: var(--cielo); transform: rotate(-4deg); }
.hn i { position: absolute; left: 50%; bottom: -1.6rem; transform: translateX(-50%); }
.hn i .avatar { filter: drop-shadow(0 3px 0 rgba(30,42,74,.25)); }
@media (prefers-reduced-motion: no-preference) {
  .hn { animation: drop .7s cubic-bezier(.2,1.6,.4,1) backwards; }
  .hn2 { animation-delay: .12s; } .hn3 { animation-delay: .24s; }
  @keyframes drop { from { opacity: 0; transform: translateY(-60px) rotate(0); } }
}
.hero-text h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 34em; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.5rem 0 1rem; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.feat { padding: 1.4rem; border: 2px solid var(--ink); border-radius: var(--r); background: #fff; }
.feat h3 { margin-top: .4rem; }
.feat p { color: var(--ink-2); margin: 0; }
.feat-ico { font-size: 2rem; }
.f-limone { background: var(--limone-l); } .f-cielo { background: var(--cielo-l); } .f-lavanda { background: var(--lavanda-l); }
.f-pomodoro { background: var(--pomodoro-l); } .f-basilico { background: var(--basilico-l); } .f-inchiostro { background: var(--inchiostro-l); }
.how { margin: 4rem 0 1rem; max-width: 720px; }
.steps { padding-left: 1.4rem; font-size: 1.08rem; }
.steps li { margin-bottom: .7rem; padding-left: .3rem; }
.steps li::marker { font: 800 1.3rem var(--display); color: var(--pomodoro); }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; gap: 3.5rem; } .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

/* ---- Card e form */
.card { background: #fff; border: 2px solid var(--ink); border-radius: var(--r); padding: 1.4rem 1.5rem; margin-bottom: 1.2rem; }
.card.narrow { max-width: 460px; margin: 2rem auto; }
.prose { max-width: 760px; margin: 1rem auto; }
.note { background: var(--limone-l); padding: .8rem 1rem; border-radius: var(--r-sm); }
.form { display: grid; gap: 1rem; }
.form label { display: grid; gap: .35rem; font-weight: 600; font-size: .95rem; }
.form input:not([type=checkbox]):not([type=radio]):not([type=range]), .form select, .form textarea, .composer input, .composer select, .kid-composer input, .own-wish input {
  font: 400 1rem var(--body); padding: .7em .85em; border: 2px solid #C9D3E6; border-radius: var(--r-sm); background: #fff; color: var(--ink); width: 100%; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--cielo); outline: none; }
.form textarea { resize: vertical; }
.form .check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.form .check input { margin-top: .3rem; width: 18px; height: 18px; flex: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: .7rem; justify-content: flex-end; flex-wrap: wrap; }
.seg { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }
.seg legend { font-weight: 600; font-size: .95rem; margin-bottom: .4rem; }
.seg label { display: flex !important; align-items: center; gap: .4rem; font-weight: 400 !important; }
.setup { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.2rem; max-width: 1000px; margin: 1rem auto; align-items: start; }
.setup .join { background: var(--cielo-l); }
@media (max-width: 800px) { .setup { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip, .chip-check span { display: inline-block; border: 2px solid #C9D3E6; border-radius: 999px; padding: .35em .85em; background: #fff; cursor: pointer; font: 400 .92rem var(--body); color: var(--ink); }
.chip.on, .chip-check input:checked + span { border-color: var(--ink); background: var(--limone); }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check input:focus-visible + span { outline: 3px solid var(--cielo); }
.presets { margin-bottom: 1rem; }
.rules { background: var(--basilico-l); border-radius: var(--r-sm); padding: .9rem 1rem; font-size: .92rem; }
.danger-zone { border-color: var(--pomodoro); }
.code { font: 800 2rem var(--display); letter-spacing: .12em; background: var(--limone-l); display: inline-block; padding: .2em .6em; border-radius: var(--r-sm); }

/* ---- Editor avatar */
.av-editor { display: grid; grid-template-columns: 170px 1fr; gap: 1.2rem; align-items: start; }
.av-preview { background: var(--cielo-l); border-radius: 50%; width: 170px; height: 170px; display: grid; place-items: center; border: 2px solid var(--ink); position: sticky; top: 1rem; }
.av-row { display: grid; gap: .3rem; margin-bottom: .7rem; }
.av-label { font-weight: 600; font-size: .9rem; }
.av-opts { display: flex; flex-wrap: wrap; gap: .4rem; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; background: var(--c); box-shadow: 0 0 0 2px #C9D3E6; cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 3px var(--ink); }
@media (max-width: 560px) { .av-editor { grid-template-columns: 1fr; } .av-preview { margin: 0 auto; position: static; } }
.pic-pick, .gate-pad { display: grid; grid-template-columns: repeat(3, 72px); gap: .6rem; }
.pic-pick button, .gate-pad button { font-size: 2.2rem; height: 72px; border-radius: var(--r-sm); border: 2px solid var(--ink); background: #fff; cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.pic-pick button:active, .gate-pad button:active { transform: translateY(3px); box-shadow: none; }
.pic-chosen { font-size: 1.4rem; margin: .8rem 0 .4rem; }
input[type=range] { width: 100%; accent-color: var(--pomodoro); }

/* ---- Toast e modali */
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .8em 1.3em; border-radius: 999px; z-index: 100; font-weight: 600; transition: opacity .4s, transform .4s; max-width: 92vw; text-align: center; }
.toast-err { background: var(--pomodoro); }
.toast.out { opacity: 0; transform: translate(-50%, 10px); }
.modal-back { position: fixed; inset: 0; background: rgba(30,42,74,.45); display: grid; place-items: center; z-index: 50; padding: 1rem; }
.modal { background: #fff; border: 2px solid var(--ink); border-radius: var(--r); padding: 1.6rem; max-width: 560px; width: 100%; max-height: 90vh; overflow: auto; text-align: center; }
.pin-modal { max-width: 340px; }
.pin-dots { display: flex; justify-content: center; gap: .8rem; margin: 1rem 0 1.3rem; }
.pin-dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink); }
.pin-dots span.on { background: var(--ink); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1rem; }
.pin-pad button { font: 600 1.4rem var(--body); height: 58px; border-radius: var(--r-sm); border: 2px solid #C9D3E6; background: #fff; cursor: pointer; color: var(--ink); }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }

/* ---- Area genitori */
.page-head { margin: .5rem 0 1.5rem; }
.back { text-decoration: none; font-weight: 600; font-size: .92rem; color: var(--ink-2); }
.kid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.2rem; margin-bottom: 1.5rem; }
.kid-card { display: flex; gap: 1rem; padding: 1.2rem; background: #fff; border: 2px solid var(--ink); border-radius: var(--r); text-decoration: none; color: var(--ink); box-shadow: 4px 4px 0 var(--ink); transition: transform .1s, box-shadow .1s; }
.kid-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.kid-card h3 { margin-bottom: .3rem; }
.kid-card.add { flex-direction: column; align-items: center; justify-content: center; border-style: dashed; box-shadow: none; color: var(--ink-2); min-height: 180px; font-weight: 600; }
.plus { font: 800 3rem/1 var(--display); }
.kc-body { flex: 1; min-width: 0; }
.kc-body p { margin: .25rem 0; }
.badge { display: inline-block; border-radius: 999px; padding: .1em .65em; font-size: .82rem; font-weight: 600; background: var(--inchiostro-l); }
.g-piccoli.badge { background: var(--limone-l); } .g-esploratori.badge { background: var(--basilico-l); } .g-inventori.badge { background: var(--lavanda-l); }
.meter { height: 8px; background: var(--inchiostro-l); border-radius: 99px; overflow: hidden; margin: .6rem 0 .2rem; }
.meter span { display: block; height: 100%; background: var(--basilico); border-radius: 99px; }
.pill { display: inline-block; border-radius: 999px; padding: .25em .8em; font-size: .85rem; font-weight: 600; background: var(--inchiostro-l); }
.pill-new { background: var(--cielo-l); } .pill-alert { background: var(--pomodoro-l); } .pill-ok { background: var(--basilico-l); }
.tip { background: var(--limone-l); }
.child-head { display: flex; gap: 1.2rem; align-items: center; margin: .5rem 0 1rem; }
.child-head h1 { margin: 0; }
.child-head p { margin: 0; }
.tabs { display: flex; gap: .3rem; overflow-x: auto; margin-bottom: 1.2rem; padding-bottom: .3rem; scrollbar-width: thin; }
.tab { padding: .5em 1em; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 600; white-space: nowrap; border: 2px solid transparent; }
.tab.on { background: #fff; border-color: var(--ink); color: var(--ink); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-2 + .card { margin-top: 1.2rem; }
.alert-card { border-color: var(--pomodoro); background: var(--pomodoro-l); }
.quote { background: #fff; padding: .6rem .9rem; border-radius: var(--r-sm); }
.bars { display: flex; gap: .5rem; height: 130px; align-items: flex-end; margin-bottom: .6rem; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .3rem; }
.bar span { width: 100%; background: var(--cielo); border-radius: 8px 8px 3px 3px; }
.bar span.over { background: var(--pomodoro); }
.bar i { font-style: normal; font-size: .78rem; color: var(--ink-3); }
.big-num { font: 800 3.2rem/1 var(--display); color: var(--pomodoro); margin: .2rem 0; }
.fav { padding-left: 1.2rem; margin: 0; }
.log, .mlist, .vlist, .wlist, .members { list-style: none; padding: 0; margin: 0; }
.log li { display: grid; grid-template-columns: 2rem 1fr auto; gap: .6rem; padding: .5rem 0; border-bottom: 1px dashed #D5DDEB; align-items: center; }
.mlist li, .vlist li, .wlist li { display: flex; gap: .8rem; align-items: center; padding: .6rem 0; border-bottom: 1px dashed #D5DDEB; }
.mlist li > div, .vlist li > div { flex: 1; }
.mlist li p, .vlist li p { margin: 0; }
.mlist .done b { text-decoration: line-through; color: var(--ink-3); }
.vlist img { border-radius: 8px; width: 120px; height: 68px; object-fit: cover; }
.wlist li > span:nth-child(2) { flex: 1; }
.wlist .done { opacity: .6; }
.w-emo { font-size: 1.8rem; }
.members li { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; }
.msg-ini { width: 36px; height: 36px; border-radius: 50%; background: var(--limone); border: 2px solid var(--ink); display: grid; place-items: center; font: 800 1rem var(--display); flex: none; text-transform: uppercase; }
.msg-ini.big { width: 44px; height: 44px; }
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.char-card { background: #fff; border: 2px solid var(--ink); border-radius: var(--r); padding: 1rem; text-align: center; font: inherit; color: var(--ink); }
.char-card.off { opacity: .55; }
.char-card.add { border-style: dashed; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 600; min-height: 220px; }
.with-av { display: flex; align-items: center; gap: .6rem; }

/* chat genitori */
.thread { max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: .7rem; padding: .3rem; margin-bottom: 1rem; }
.thread.static { max-height: none; }
.msg { display: flex; gap: .6rem; align-items: flex-end; }
.msg.from-parent { flex-direction: row-reverse; }
.bubble { background: var(--inchiostro-l); padding: .6rem .9rem; border-radius: 16px; max-width: 75%; }
.from-parent .bubble { background: var(--cielo-l); }
.bubble b { display: block; font-size: .82rem; }
.bubble p { margin: .2rem 0; }
.msg.flagged .bubble { background: var(--pomodoro-l); outline: 2px solid var(--pomodoro); }
.sticker { font-size: 2rem; display: block; }
.composer { display: grid; gap: .6rem; }
.composer-row { display: flex; gap: .5rem; }
.composer select { width: auto; }
.quick { display: flex; gap: .4rem; }
.quick button { font-size: 1.4rem; background: #fff; border: 2px solid #C9D3E6; border-radius: 12px; padding: .2rem .5rem; cursor: pointer; }

/* ==================== MODALITÀ BAMBINO ==================== */
body.kid-mode { background-size: 34px 34px; }
body.kid-mode::before { display: none; }
.kid { min-height: 100vh; font-size: 1.1rem; }
.kid-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; padding: .8rem clamp(.8rem, 3vw, 2rem); }
.kid-me { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--ink); font: 800 1.3rem var(--display); background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: .15rem 1rem .15rem .2rem; }
.kid-me .avatar { border-radius: 50%; background: var(--cielo-l); }
.kid-title { font-size: clamp(1.3rem, 3.5vw, 1.8rem); margin: 0; text-align: center; }
.kid-top-r { display: flex; gap: .6rem; align-items: center; }
.star-count { background: var(--limone); border: 2px solid var(--ink); border-radius: 999px; padding: .3rem .9rem; font: 800 1.15rem var(--display); }
.kbtn { width: 52px; height: 52px; display: grid; place-items: center; background: #fff; border: 2px solid var(--ink); border-radius: 50%; font-size: 1.4rem; text-decoration: none; color: var(--ink); box-shadow: 0 3px 0 var(--ink); cursor: pointer; flex: none; }
.kbtn:active { transform: translateY(3px); box-shadow: none; }
.back-btn { font-size: 1.6rem; font-weight: 800; }
.kid-main { max-width: 1000px; margin: 0 auto; padding: .5rem clamp(.8rem, 3vw, 2rem) 3rem; }
.kid-h2 { font-size: 1.5rem; margin: 1.6rem 0 .8rem; }
.kid-sub { font-size: 1.2rem; text-align: center; color: var(--ink-2); }
.kid-foot { text-align: center; color: var(--ink-3); font-size: .95rem; margin-top: 2rem; }

.picker { display: flex; flex-direction: column; align-items: center; padding: 3rem 1rem; position: relative; }
.kid-hello { font-size: clamp(2.2rem, 6vw, 3.4rem); text-align: center; }
.pick-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem; margin-top: 1rem; }
.pick { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--ink); font: 800 1.6rem var(--display); }
.pick .avatar { background: #fff; border: 3px solid var(--ink); border-radius: 50%; box-shadow: 0 6px 0 var(--ink); transition: transform .12s; }
.pick:hover .avatar { transform: translateY(-4px) rotate(-3deg); }
.corner { position: absolute; top: 1rem; right: 1rem; } .corner-l { position: absolute; top: 1rem; left: 1rem; }
.gate-av .avatar { background: #fff; border: 3px solid var(--ink); border-radius: 50%; }
.gate-dots { display: flex; gap: .8rem; margin: 1rem 0 1.5rem; }
.gate-dots span { width: 64px; height: 64px; border: 3px dashed var(--ink-3); border-radius: 16px; display: grid; place-items: center; font-size: 2rem; background: #fff; }
.gate-dots span.on { border-style: solid; border-color: var(--ink); }
.gate-pad { grid-template-columns: repeat(3, 92px); gap: .9rem; }
.gate-pad button { height: 92px; font-size: 3rem; }
.pop { animation: pop .25s; }
@keyframes pop { 50% { transform: scale(1.15); } }

.welcome { display: flex; flex-direction: column; align-items: center; margin: .5rem 0 1.5rem; }
.friend-stage { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.friend .avatar { background: #fff; border: 3px solid var(--ink); border-radius: 50%; }
.speech { position: relative; background: #fff; border: 3px solid var(--ink); border-radius: 26px; padding: 1rem 1.4rem; font: 600 1.35rem/1.35 var(--display); max-width: 440px; text-decoration: none; color: var(--ink); box-shadow: 0 5px 0 var(--ink); }
.speech::before { content: ''; position: absolute; left: -16px; top: 50%; width: 24px; height: 24px; background: #fff; border-left: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: translateY(-50%) rotate(45deg); }
@media (max-width: 560px) { .speech::before { display: none; } }
.more-friends { display: flex; gap: .5rem; margin-top: .8rem; }
.more-friends .avatar { background: #fff; border: 2px solid var(--ink); border-radius: 50%; }
@media (prefers-reduced-motion: no-preference) { .bob { animation: bob 3s ease-in-out infinite; } @keyframes bob { 50% { transform: translateY(-6px) rotate(-2deg); } } }
.bday { background: var(--pomodoro); color: #fff; font: 800 1.4rem var(--display); text-align: center; padding: .8rem; border-radius: var(--r); border: 3px solid var(--ink); margin-bottom: 1rem; }
.preview-banner { background: var(--lavanda-l); border: 2px dashed var(--lavanda); border-radius: var(--r); padding: .8rem 1rem; text-align: center; margin-bottom: 1rem; font-weight: 600; }

.islands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.island, .game-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; padding: 1.2rem .6rem; border: 3px solid var(--ink); border-radius: 26px; text-decoration: none; color: var(--ink); font: 800 1.25rem/1.2 var(--display); text-align: center; box-shadow: 0 6px 0 var(--ink); transition: transform .1s, box-shadow .1s; min-height: 140px; position: relative; }
.island:active, .game-tile:active { transform: translateY(6px); box-shadow: 0 0 0 var(--ink); }
.i-ico, .g-ico { font-size: 3rem; line-height: 1; }
.c-limone { background: var(--limone); } .c-cielo { background: var(--cielo-l); } .c-basilico { background: var(--basilico-l); }
.c-pomodoro { background: var(--pomodoro-l); } .c-lavanda { background: var(--lavanda-l); } .c-inchiostro { background: var(--inchiostro-l); }
@media (max-width: 640px) { .islands { grid-template-columns: 1fr 1fr; } .island { min-height: 120px; } }
.kid-row { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.pill-btn { position: relative; background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: .7rem 1.3rem; text-decoration: none; color: var(--ink); font: 800 1.2rem var(--display); box-shadow: 0 4px 0 var(--ink); }
.badge-dot { position: absolute; top: -10px; right: -8px; background: var(--pomodoro); color: #fff; border: 2px solid var(--ink); border-radius: 99px; min-width: 28px; height: 28px; display: grid; place-items: center; font-size: .95rem; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.new-tag { position: absolute; top: -10px; right: -6px; background: var(--lavanda); color: #fff; font-style: normal; font-size: .8rem; padding: .15rem .6rem; border-radius: 99px; border: 2px solid var(--ink); }

/* gioco */
.play { max-width: 760px; margin: 0 auto; }
.progress { display: flex; gap: .5rem; justify-content: center; margin-bottom: 1.3rem; }
.progress span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; }
.progress .ok { background: var(--basilico); } .progress .half { background: var(--limone); }
.q { display: flex; align-items: center; justify-content: center; gap: .8rem; margin-bottom: 1rem; }
.q-prompt { font: 800 clamp(1.5rem, 4vw, 2.1rem)/1.25 var(--display); text-align: center; margin: 0; }
.q-prompt b { color: var(--pomodoro); }
.q-visual { text-align: center; margin: .5rem 0 1.5rem; font-size: 4rem; }
.caption { font: 800 1.6rem var(--display); }
.count-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; max-width: 420px; margin: 0 auto; }
.big-emoji { font-size: 3.4rem; line-height: 1.1; }
.sum { font: 800 3.4rem var(--display); }
.answers { display: grid; gap: 1rem; }
.answers.n2 { grid-template-columns: 1fr 1fr; } .answers.n3 { grid-template-columns: repeat(3, 1fr); }
.answer { min-height: 130px; border: 3px solid var(--ink); border-radius: 24px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; box-shadow: 0 6px 0 var(--ink); font-family: var(--display); color: var(--ink); padding: .6rem; }
.answer:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.answer.right { background: var(--basilico) !important; animation: pop .35s; }
.answer.wrong { background: #E7EAF1 !important; opacity: .55; animation: shake .4s; }
.opt-word { font: 800 2.6rem var(--display); }
.opt-text { font: 800 1.25rem/1.25 var(--display); }
.opt-small { font-size: 1rem; }
.color-dot { width: 76px; height: 76px; border-radius: 50%; border: 3px solid var(--ink); display: block; }
.explain { text-align: center; margin-top: 1.2rem; font-size: 1.2rem; }
.explain p { background: #fff; border: 2px solid var(--ink); border-radius: var(--r); padding: 1rem; }
@media (max-width: 560px) { .answers.n3 { grid-template-columns: 1fr; } .answer { min-height: 90px; flex-direction: row; } }
.result { text-align: center; padding: 2rem 1rem; background: #fff; border: 3px solid var(--ink); border-radius: 28px; }
.result-stars { font-size: 4rem; }
.result-btns { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.memory { display: grid; gap: .7rem; grid-template-columns: repeat(4, 1fr); max-width: 560px; margin: 1rem auto; }
.mcard { aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 18px; cursor: pointer; position: relative; background: var(--cielo); box-shadow: 0 4px 0 var(--ink); font-size: clamp(2rem, 7vw, 3rem); padding: 0; }
.mcard .front { display: none; } .mcard .backf { color: #fff; font: 800 2rem var(--display); }
.mcard.open { background: #fff; } .mcard.open .front { display: inline; } .mcard.open .backf { display: none; }
.mcard.found { background: var(--basilico-l); cursor: default; }

/* lezione */
.lesson { max-width: 720px; margin: 0 auto; }
.slide { background: #fff; border: 3px solid var(--ink); border-radius: 28px; padding: 2rem; text-align: center; position: relative; box-shadow: 0 6px 0 var(--ink); }
.slide-emo { font-size: 5rem; }
.slide p { font: 600 clamp(1.3rem, 3.4vw, 1.7rem)/1.4 var(--display); }
.slide .say { position: absolute; top: 1rem; right: 1rem; }
.slide-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 1.3rem; font-weight: 600; }

/* video */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.vcard { background: #fff; border: 3px solid var(--ink); border-radius: 20px; overflow: hidden; text-decoration: none; color: var(--ink); font: 800 1.05rem/1.25 var(--display); box-shadow: 0 5px 0 var(--ink); }
.vcard img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.vcard span { display: block; padding: .7rem .9rem; }
.player-wrap { position: relative; aspect-ratio: 16/9; background: var(--ink); border-radius: 20px; overflow: hidden; border: 3px solid var(--ink); }
.player-wrap iframe, .player-wrap #yt { position: absolute; inset: 0; width: 100%; height: 100%; }
.after { position: absolute; inset: 0; display: grid; place-items: center; background: var(--cielo-l); padding: 1rem; }
.empty-kid { text-align: center; font-size: 4rem; padding: 2rem 1rem; }
.empty-kid p { font: 600 1.3rem/1.4 var(--display); max-width: 480px; margin: .5rem auto; }

/* il mio mondo */
.world-card { background: #fff; border: 3px solid var(--ink); border-radius: 26px; padding: 1.2rem 1.4rem; margin-bottom: 1.2rem; }
.bday-card { display: flex; align-items: center; gap: 1.2rem; background: var(--pomodoro-l); }
.cake { font-size: 4.5rem; }
.bday-card .big { font: 800 2rem var(--display); color: var(--pomodoro); margin: 0; }
.wish-row { display: flex; flex-wrap: wrap; gap: .8rem; }
.wish { position: relative; width: 110px; min-height: 110px; border: 3px solid var(--ink); border-radius: 20px; background: var(--limone-l); font-size: 2.6rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: .4rem; color: var(--ink); }
.wish span { font: 600 .85rem/1.15 var(--body); margin-top: .2rem; }
.wish.add { background: #fff; border-style: dashed; font: 800 2.4rem var(--display); }
.wish.got { background: var(--basilico-l); }
.wish i { position: absolute; top: -12px; right: -8px; font-style: normal; font-size: 1.6rem; }
.like-grid { display: flex; flex-wrap: wrap; gap: .6rem; }
.like { border: 3px solid var(--ink); border-radius: 999px; padding: .5rem 1rem; background: #fff; font: 600 1.05rem var(--body); cursor: pointer; color: var(--ink); }
.like.on { background: var(--limone); }
.kid-modal { max-width: 760px; }
.pick-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .7rem; margin: 1rem 0; }
.pick-items button { border: 3px solid var(--ink); border-radius: 18px; background: #fff; font-size: 2.6rem; padding: .6rem .3rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; color: var(--ink); }
.pick-items span { font: 600 .85rem/1.15 var(--body); margin-top: .2rem; }
.own-wish { display: flex; gap: .5rem; margin-bottom: 1rem; }

/* messaggi bambino */
.kid-thread { display: flex; flex-direction: column; gap: .9rem; margin-bottom: 1.2rem; max-height: 52vh; overflow-y: auto; padding: .4rem; }
.kmsg { display: flex; gap: .6rem; align-items: flex-end; }
.kmsg.mine { justify-content: flex-end; }
.kmsg .avatar { background: #fff; border: 2px solid var(--ink); border-radius: 50%; flex: none; }
.kbubble { position: relative; background: #fff; border: 3px solid var(--ink); border-radius: 22px; padding: .7rem 1rem; max-width: 78%; font: 600 1.2rem/1.35 var(--display); }
.kmsg.mine .kbubble { background: var(--limone-l); }
.kbubble b { display: block; font-size: .95rem; color: var(--ink-2); }
.kbubble p { margin: .1rem 0; }
.say-sm { border: 0; background: none; font-size: 1.2rem; cursor: pointer; padding: 0; }
.sticker-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.sticker-bar button { border: 3px solid var(--ink); border-radius: 18px; background: #fff; padding: .5rem; cursor: pointer; font: 600 .95rem/1.2 var(--body); display: flex; flex-direction: column; align-items: center; color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.sticker-bar span { font-size: 2rem; }
@media (max-width: 560px) { .sticker-bar { grid-template-columns: repeat(2, 1fr); } }
.kid-composer { display: flex; gap: .5rem; margin-top: 1rem; }
.kid-composer input { font-size: 1.15rem; border: 3px solid var(--ink); border-radius: 999px; }

/* amico */
.friend-page { max-width: 760px; margin: 0 auto; }
.friend-hero { text-align: center; }
.friend-hero .avatar { background: #fff; border: 3px solid var(--ink); border-radius: 50%; }
.friend-hero h2 { font-size: 2rem; margin-top: .4rem; }
.quick-q { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.quick-q button { border: 2px solid var(--ink); border-radius: 999px; background: var(--lavanda-l); padding: .5rem 1rem; font: 600 1rem var(--body); cursor: pointer; color: var(--ink); }
.kid-note { text-align: center; color: var(--ink-3); margin-top: 1.2rem; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); animation: blink 1s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }

/* missioni bambino */
.mission { display: flex; align-items: center; gap: 1rem; background: #fff; border: 3px solid var(--ink); border-radius: 24px; padding: 1rem 1.2rem; margin-bottom: 1rem; box-shadow: 0 5px 0 var(--ink); }
.mission.done { opacity: .6; box-shadow: none; }
.m-ico { font-size: 2.6rem; }
.m-body { flex: 1; }
.m-body b { font: 800 1.3rem var(--display); }
.m-body p { margin: .2rem 0 0; }

/* riposo */
.rest { position: fixed; inset: 0; background: var(--inchiostro); display: grid; place-items: center; z-index: 40; padding: 1rem; }
.rest-box { background: #fff; border: 3px solid var(--ink); border-radius: 30px; padding: 2rem; text-align: center; max-width: 480px; font-size: 1.2rem; }
.rest-box .avatar { background: var(--lavanda-l); border-radius: 50%; }
.rest-box .kbtn { margin: 1rem auto 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.demo-bar { position: sticky; top: 0; z-index: 30; background: var(--lavanda); color: #fff; text-align: center; font-size: .88rem; padding: .35rem 1rem; font-weight: 600; }
.demo-bar button { margin-left: .6rem; background: #fff; color: var(--ink); border: 0; border-radius: 99px; padding: .1rem .7rem; font: 600 .8rem var(--body); cursor: pointer; }

.ask-text { font: 600 1.15rem/1.4 var(--display); }
.ask-input { font: 400 1rem var(--body); padding: .7em .85em; border: 2px solid #C9D3E6; border-radius: var(--r-sm); width: 100%; margin-bottom: 1rem; }
