/* Oltremappa — stile pensato per iPad e bambini di 7 anni:
   bottoni grandi, testi chiari (font Andika, creato per chi impara a leggere), colori vivaci. */

:root {
  --ink: #23305A;
  --ink-soft: #5B678A;
  --card: #FFFFFF;
  --line: #DCE6F5;
  --primary: #FF8A3D;
  --primary-d: #DB6519;
  --ok: #38C172;
  --ok-d: #23964C;
  --ko: #FF9F43;
  --ko-d: #E07B12;
  --gold: #FFC93D;
  --math: #3D7BFF;
  --ita: #FF5E7E;
  --cor: #9B5DE5;
  --sky1: #8EDBFF;
  --sky2: #D5F3FF;
  --grass: #E6F9EC;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(35, 48, 90, .12), 0 10px 24px rgba(35, 48, 90, .10);
  --font-text: 'Andika', 'Trebuchet MS', system-ui, sans-serif;
  --font-head: 'Baloo 2', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-text);
  font-size: 20px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 42%, var(--grass) 100%) fixed;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}
input, select, textarea { -webkit-user-select: text; user-select: text; font: inherit; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: .3em 0; }
svg { display: block; }

#app { min-height: 100%; }
.screen { max-width: 1120px; margin: 0 auto; padding: 0 16px calc(28px + var(--safe-b)); min-height: 100vh; }
.muted { color: var(--ink-soft); font-size: .85em; }
.row { display: flex; gap: 12px; justify-content: center; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* Maiuscolo opzionale per i testi di lettura */
body.caps .txt { text-transform: uppercase; }
body.caps .nocaps .txt, body.caps .txt.nocaps, body.caps .nocaps.txt, body.caps .nocaps { text-transform: none; }

/* ---------- Bottoni ---------- */
.btn {
  border: 0; border-radius: 18px; padding: 14px 22px; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem;
  background: #fff; color: var(--ink); box-shadow: 0 5px 0 rgba(35, 48, 90, .18); transition: transform .08s, box-shadow .08s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; min-height: 56px;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(35, 48, 90, .18); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 5px 0 var(--primary-d); }
.btn-primary:active { box-shadow: 0 1px 0 var(--primary-d); }
.btn-ok { background: var(--ok); color: #fff; box-shadow: 0 5px 0 var(--ok-d); }
.btn-ghost { background: rgba(255, 255, 255, .9); }
.btn-danger { background: #E5484D; color: #fff; box-shadow: 0 5px 0 #B3262B; }
.btn.big { font-size: 1.25rem; padding: 16px 30px; min-height: 64px; }

.chip {
  border: 0; border-radius: 999px; padding: 6px 14px; background: rgba(255, 255, 255, .92); font-family: var(--font-head);
  font-weight: 700; font-size: 1rem; box-shadow: 0 3px 0 rgba(35, 48, 90, .12); white-space: nowrap; min-height: 42px;
}
.chip.sel { background: var(--ink); color: #fff; }
.chip-hot { background: var(--gold); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }

.speak-btn {
  border: 0; background: #fff; border-radius: 50%; width: 52px; height: 52px; font-size: 1.4rem; flex: none;
  box-shadow: 0 3px 0 rgba(35, 48, 90, .15); display: inline-flex; align-items: center; justify-content: center;
}
.speak-btn.sm { width: 44px; height: 44px; font-size: 1.15rem; vertical-align: middle; margin-left: 8px; }

/* ---------- Barra in alto ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 0 10px; margin: 0 -16px 8px; padding-left: 16px; padding-right: 16px;
  background: linear-gradient(180deg, rgba(142, 219, 255, .97), rgba(142, 219, 255, .85));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 8px; }
.tb-title { margin: 0; font-size: 1.5rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-back {
  border: 0; width: 52px; height: 52px; border-radius: 16px; background: #fff; font-size: 2rem; line-height: 1; font-weight: 800;
  box-shadow: 0 4px 0 rgba(35, 48, 90, .15); flex: none; display: flex; align-items: center; justify-content: center; padding-bottom: 4px;
}
.tb-avatar { border: 0; background: #fff; border-radius: 50%; width: 52px; height: 52px; padding: 3px; box-shadow: 0 4px 0 rgba(35, 48, 90, .15); }
.tb-avatar svg { width: 100%; height: 100%; }

/* ---------- Finestre ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 100; background: rgba(20, 28, 60, .55); display: flex; align-items: center; justify-content: center;
  padding: 16px; animation: fadeIn .2s;
}
.modal-back.out { animation: fadeOut .2s forwards; }
.modal-box {
  position: relative; background: #fff; border-radius: 28px; padding: 28px 24px 24px; max-width: 640px; width: 100%; max-height: 92vh;
  overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); animation: popIn .25s cubic-bezier(.2, 1.4, .5, 1); text-align: center;
}
.modal-x { position: absolute; top: 10px; right: 10px; border: 0; background: #EEF2FA; width: 44px; height: 44px; border-radius: 50%; font-size: 1.1rem; z-index: 2; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popIn { from { transform: scale(.85); opacity: 0; } }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

.toast {
  position: fixed; left: 50%; bottom: calc(30px + var(--safe-b)); transform: translateX(-50%); z-index: 200; background: var(--ink); color: #fff;
  padding: 14px 22px; border-radius: 18px; font-size: 1.05rem; max-width: 90vw; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  animation: toastIn .25s;
}
.toast.out { opacity: 0; transition: opacity .35s; }
@keyframes toastIn { from { transform: translate(-50%, 30px); opacity: 0; } }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 12px; height: 18px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { top: 110vh; transform: rotate(720deg) translateX(40px); } }

.st { color: #D5DCEA; font-size: 1.6em; line-height: 1; text-shadow: 0 2px 0 rgba(35, 48, 90, .12); }
.st.on { color: var(--gold); }

.panel { background: #fff; border-radius: var(--radius); padding: 18px 20px; margin: 14px 0; box-shadow: var(--shadow); }

/* ---------- Accesso ---------- */
.login { text-align: center; padding-top: 30px; }
.login-hero { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.login-bit { width: 130px; animation: float 3s ease-in-out infinite; }
.logo { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 0; color: #fff; text-shadow: 0 4px 0 var(--ink), 0 8px 18px rgba(35, 48, 90, .3); letter-spacing: .5px; }
.login-sub { margin: 0; font-size: 1.3rem; font-family: var(--font-head); }
.login-q { margin-top: 28px; }
.profiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin: 14px 0 20px; }
.profile-card {
  border: 0; background: #fff; border-radius: 26px; width: 170px; padding: 16px 10px 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform .1s;
}
.profile-card:active { transform: scale(.96); }
.pc-av { width: 110px; height: 110px; display: flex; align-items: center; justify-content: center; }
.pc-av.plus { font-size: 4rem; color: var(--primary); font-family: var(--font-head); border: 4px dashed #FFC7A3; border-radius: 50%; width: 96px; height: 96px; }
.pc-name { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; }
.login-note { color: var(--ink-soft); font-size: .9rem; }
@keyframes float { 50% { transform: translateY(-8px); } }

.pass h2 { font-size: 1.4rem; padding: 0 30px; }
.pass-dots { display: flex; justify-content: center; gap: 12px; margin: 10px 0 16px; }
.pass-dots span { width: 62px; height: 62px; border-radius: 18px; background: #EEF2FA; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; border: 3px dashed #C9D3E6; }
.pass-dots span.on { background: #FFF4D6; border: 3px solid var(--gold); }
.pass-grid { display: grid; grid-template-columns: repeat(3, 92px); gap: 12px; justify-content: center; }
.pass-key { border: 0; width: 92px; height: 92px; border-radius: 22px; background: #F2F6FD; font-size: 3rem; box-shadow: 0 5px 0 #D3DCEC; }
.pass-key:active { transform: translateY(4px); box-shadow: 0 1px 0 #D3DCEC; }
.pass-actions { display: flex; justify-content: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.wizard h2 { font-size: 1.5rem; padding: 0 24px; }
.wz-bit { width: 110px; margin: 0 auto; }
.name-in { display: block; margin: 18px auto; width: min(360px, 100%); font-size: 1.6rem; padding: 14px 18px; border-radius: 18px; border: 3px solid var(--line); text-align: center; font-family: var(--font-head); }
.name-in:focus { outline: none; border-color: var(--primary); }
.starters { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 16px 0 20px; }
.starter { border: 4px solid transparent; background: #F5F8FE; border-radius: 26px; padding: 10px; display: flex; flex-direction: column; align-items: center; font-family: var(--font-head); font-size: 1.15rem; }
.starter.sel { border-color: var(--primary); background: #FFF3E9; transform: scale(1.05); }

/* ---------- Home ---------- */
.home-hello { display: flex; align-items: center; gap: 12px 24px; margin: 4px 0 14px; position: relative; flex-wrap: wrap; }
.hello-t h1 { font-size: 2.2rem; margin: 0; }
.hello-t p { margin: 0; font-size: 1.15rem; }
.home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.home-card {
  border: 0; border-radius: 28px; background: #fff; box-shadow: var(--shadow); padding: 18px; min-height: 190px; text-align: left;
  display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; transition: transform .1s;
}
.home-card:active { transform: scale(.97); }
.hc-emoji { font-size: 3.2rem; line-height: 1; }
.hc-emoji svg { width: 64px; height: 64px; }
.hc-title { font-family: var(--font-head); font-weight: 800; font-size: 1.6rem; }
.hc-sub { font-size: .95rem; color: var(--ink-soft); margin-top: auto; }
.hc-bar { height: 14px; background: #EEF2FA; border-radius: 99px; overflow: hidden; }
.hc-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--primary)); border-radius: 99px; min-width: 4px; }
.home-card.subj-mat { background: linear-gradient(160deg, #fff 55%, #DCE7FF); border-bottom: 8px solid var(--math); }
.home-card.subj-ita { background: linear-gradient(160deg, #fff 55%, #FFE0E7); border-bottom: 8px solid var(--ita); }
.home-card.subj-cor { background: linear-gradient(160deg, #fff 55%, #EDE1FB); border-bottom: 8px solid var(--cor); }
.home-card.daily { background: linear-gradient(160deg, #FFF8E1, #FFE7A8); border-bottom: 8px solid var(--gold); }
.home-card.daily.done { filter: saturate(.6); }
.home-card.eggs { border-bottom: 8px solid #F4C7A1; }
.home-card.eggs.hot .hc-emoji { animation: wobble 1.2s infinite; display: inline-block; }
.home-card.dex { border-bottom: 8px solid var(--ok); }
.home-foot { display: flex; justify-content: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.reward-pop .rp-emoji { font-size: 5rem; }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }

/* ---------- Mappa ---------- */
.worlds { display: flex; flex-direction: column; gap: 16px; }
.world-card {
  border: 0; display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 14px; background: #fff; border-radius: 28px;
  padding: 16px 18px; box-shadow: var(--shadow); text-align: left; transition: transform .1s;
}
.world-card:active { transform: scale(.98); }
.world-card.locked { background: rgba(255, 255, 255, .6); filter: grayscale(.6); }
.world-card.done { background: linear-gradient(120deg, #fff 70%, #E3F8EA); }
.wc-emoji { font-size: 3.6rem; text-align: center; }
.wc-num { font-size: .85rem; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); font-weight: 700; }
.wc-name { font-family: var(--font-head); font-weight: 800; font-size: 1.55rem; line-height: 1.1; }
.wc-desc { font-size: .9rem; color: var(--ink-soft); margin: 4px 0 8px; }
.wc-prog { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; }
.wc-prog .hc-bar { flex: 1; max-width: 320px; }
.guardian-badge { display: flex; flex-direction: column; align-items: center; font-family: var(--font-head); font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.guardian-badge.owned span { color: #B98500; }

.world-desc { text-align: center; color: var(--ink-soft); margin: 0 0 8px; }
.level-path { display: flex; flex-direction: column; gap: 10px; padding: 10px 0 40px; position: relative; max-width: 760px; margin: 0 auto; }
.lvl {
  border: 0; background: #fff; border-radius: 26px; box-shadow: var(--shadow); padding: 12px 18px; display: flex; align-items: center; gap: 16px;
  width: min(560px, 92%); text-align: left; transition: transform .1s;
}
.lvl:active { transform: scale(.97); }
.lvl.left { align-self: flex-start; }
.lvl.right { align-self: flex-end; }
.lvl-circle {
  width: 72px; height: 72px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-family: var(--font-head);
  font-weight: 800; font-size: 2rem; color: #fff; background: var(--subj, var(--primary)); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .15);
}
.lvl.locked { opacity: .65; }
.lvl.locked .lvl-circle { background: #C9D3E6; font-size: 1.6rem; }
.lvl.done .lvl-circle { background: var(--ok); }
.lvl-title { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; line-height: 1.15; }
.lvl-sub { font-size: .85rem; color: var(--ink-soft); }
.lvl-stars .st { font-size: 1.4em; }
.lvl.guardian { background: linear-gradient(135deg, #FFF7DA, #FFE39A); border: 3px solid var(--gold); width: min(640px, 100%); align-self: center; }
.lvl-g { flex: none; animation: float 3s ease-in-out infinite; }
.subj-mat { --subj: var(--math); }
.subj-ita { --subj: var(--ita); }
.subj-cor { --subj: var(--cor); }
.subj-daily { --subj: var(--primary); }

/* ---------- Gioco ---------- */
.play { padding-bottom: 0; }
.play-head {
  position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; margin: 0 -16px; background: rgba(142, 219, 255, .92);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.play-progress { display: flex; gap: 5px; }
.play-progress i { flex: 1; height: 16px; border-radius: 99px; background: rgba(255, 255, 255, .75); transition: background .3s; }
.play-progress i.cur { background: #fff; box-shadow: inset 0 0 0 3px var(--subj, var(--primary)); }
.play-progress i.ok { background: var(--ok); }
.play-progress i.half { background: var(--gold); }
.play-progress i.ko { background: var(--ko); }
.play-title { font-family: var(--font-head); font-weight: 700; font-size: 1rem; max-width: 30vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ex-area { padding: 14px 0 140px; display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.ex-card { background: #fff; border-radius: 28px; box-shadow: var(--shadow); padding: 18px 20px; text-align: center; }
.prompt { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 1.45rem; font-weight: 700; line-height: 1.3; }
.prompt.problem { font-size: 1.35rem; font-weight: 400; text-align: left; background: #F6F9FF; border-radius: 18px; padding: 14px 16px; }
.ask { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; margin-top: 10px; color: var(--subj, var(--primary)); }
.listen-btn { border: 0; margin: 12px auto 0; display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 800; font-size: 1.4rem; background: #E9F3FF; color: var(--math); border-radius: 20px; padding: 12px 26px; box-shadow: 0 5px 0 #C5DAF5; }
.listen-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #C5DAF5; }
.visual { margin-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.visual svg { max-width: 100%; height: auto; }
.passage { text-align: left; background: #FFFBEF; border: 3px solid #FFE7A8; border-radius: 22px; padding: 14px 18px; margin-bottom: 14px; }
.passage h3 { margin: 0 0 6px; display: flex; align-items: center; gap: 6px; }
.passage p { margin: 0; font-size: 1.3rem; line-height: 1.6; }
.ans-area { display: flex; justify-content: center; }

.explain { background: #FFF8E1; border: 3px solid var(--gold); border-radius: 26px; padding: 16px 20px; text-align: center; animation: popIn .25s; }
.explain .ex-head { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; }
.explain p { font-size: 1.25rem; margin: 8px 0 14px; }

/* Visuali */
.big-op { font-family: var(--font-head); font-weight: 800; font-size: 3rem; letter-spacing: 2px; line-height: 1.2; }
.big-op.sm { font-size: 2.1rem; }
.slot { display: inline-block; min-width: 1.2em; padding: 0 .2em; border-radius: 14px; background: #FFF1D6; color: var(--primary-d); border: 3px dashed var(--primary); line-height: 1.1; }
.count-grid { display: flex; flex-direction: column; gap: 6px; }
.cg-row { display: flex; justify-content: center; gap: 4px; font-size: 2.3rem; line-height: 1.15; }
.cg-gap { width: 16px; }
.emoji-sum { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.es-g { font-size: 2.2rem; max-width: 330px; letter-spacing: 2px; line-height: 1.3; }
.es-op { font-family: var(--font-head); font-size: 3rem; font-weight: 800; color: var(--subj, var(--primary)); }
.es-x { position: relative; opacity: .45; }
.es-x::after { content: ''; position: absolute; left: -2px; right: -2px; top: 50%; height: 5px; background: #E5484D; transform: rotate(-35deg); border-radius: 3px; }
.ten-frame { display: grid; grid-template-columns: repeat(5, 48px); gap: 5px; padding: 6px; background: var(--ink); border-radius: 12px; }
.ten-frame span { height: 48px; background: #fff; border-radius: 7px; }
.ten-frame span.on { background: radial-gradient(circle, #E5484D 55%, #fff 57%); }
.array-grid { display: flex; flex-direction: column; gap: 4px; font-size: 2.1rem; line-height: 1.15; letter-spacing: 4px; }
.groups { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.grp { background: #F4F7FD; border-radius: 18px; padding: 8px 10px; display: flex; flex-direction: column; align-items: center; }
.grp-items { font-size: 1.6rem; max-width: 140px; line-height: 1.2; }
.grp-c { font-size: 1.6rem; }
.pairs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; font-size: 2rem; }
.pairs span { background: #F4F7FD; border-radius: 14px; padding: 2px 8px; }
.pattern { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 2.6rem; align-items: center; }
.pattern .slot { font-size: 2rem; padding: 4px 14px; }
.share { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sh-items { font-size: 2rem; max-width: 480px; letter-spacing: 3px; }
.sh-kids { font-size: 2.6rem; letter-spacing: 8px; }
.money { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; align-items: center; }
.coin { width: 74px; height: 74px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 800; font-size: 1.7rem; color: #5A4300; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .15), 0 3px 6px rgba(0, 0, 0, .15); }
.coin i { font-style: normal; font-size: .9rem; margin-left: 2px; }
.coin.c1 { background: radial-gradient(circle, #F4D46B 52%, #C9CED6 54%); }
.coin.c2 { background: radial-gradient(circle, #C9CED6 52%, #F4D46B 54%); }
.banknote { width: 132px; height: 70px; border-radius: 10px; background: var(--c); display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 800; font-size: 2rem; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .2); border: 3px solid rgba(255, 255, 255, .6); box-shadow: 0 3px 8px rgba(0, 0, 0, .18); }
.banknote i { font-style: normal; margin-left: 4px; }
.pictogram { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pg-row { display: flex; align-items: center; gap: 10px; }
.pg-l { font-size: 2rem; width: 48px; text-align: center; }
.pg-v { font-size: 1.7rem; letter-spacing: 2px; }
.chart-title { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }
.word-big { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.wb-e { font-size: 3.6rem; }
.wb-w { font-size: 3rem; font-weight: 700; letter-spacing: 3px; }
.gap { display: inline-block; min-width: 2.2em; height: 1em; border-bottom: 5px solid var(--primary); background: #FFF1D6; border-radius: 10px 10px 0 0; vertical-align: -0.1em; margin: 0 4px; }
.emoji-xl { font-size: 6.5rem; line-height: 1.1; }
.emoji-xl.sm { font-size: 4.2rem; }
.sentence { font-size: 1.7rem; line-height: 1.6; font-weight: 700; }
.cursive-word { background: #fff; border-radius: 18px; padding: 6px 10px; border: 3px solid var(--line); max-width: 100%; overflow-x: auto; }
.cursive-word svg { height: 130px; width: auto; max-width: 100%; }
.cursive-word.big { margin: 10px auto; display: inline-block; }

/* Scelte */
.choices { display: grid; gap: 14px; width: 100%; max-width: 820px; grid-template-columns: repeat(3, 1fr); }
.choices.n2 { grid-template-columns: repeat(2, 1fr); max-width: 620px; }
.choices.n4 { grid-template-columns: repeat(4, 1fr); }
.choices.cs-word.n4 { grid-template-columns: repeat(2, 1fr); }
.choices.cs-sentence { grid-template-columns: 1fr; max-width: 760px; }
.choice {
  border: 0; border-radius: 24px; background: #fff; box-shadow: 0 6px 0 #CBD6EA; padding: 16px 12px; min-height: 84px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: transform .08s, background .2s;
}
.choice:active { transform: translateY(4px); box-shadow: 0 2px 0 #CBD6EA; }
.ch-l { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.ch-sub { font-size: .85rem; color: var(--ink-soft); }
.cs-symbol .ch-l { font-family: var(--font-head); font-size: 3rem; font-weight: 800; line-height: 1; }
.cs-emoji .choice { min-height: 120px; }
.cs-emoji .ch-l { font-size: 4.2rem; line-height: 1; }
.cs-syll .ch-l { font-size: 2.2rem; letter-spacing: 1px; }
.cs-sentence .choice { align-items: flex-start; text-align: left; padding: 14px 20px; min-height: 64px; }
.cs-sentence .ch-l { font-size: 1.35rem; font-weight: 400; }
.choice.ok { background: var(--ok); color: #fff; box-shadow: 0 6px 0 var(--ok-d); animation: bounce .4s; }
.choice.ok .ch-sub { color: #fff; }
.choice.ko { background: #FFE7D1; box-shadow: 0 6px 0 #F5C8A0; animation: shake .4s; opacity: .7; }
.choice.dim { opacity: .4; }
.choice.shown { background: #E3F8EA; box-shadow: 0 6px 0 #9DDDB4; outline: 4px solid var(--ok); }
@keyframes bounce { 40% { transform: scale(1.08); } }

/* Tastierino */
.ans-number { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.num-box { min-width: 150px; height: 92px; border-radius: 22px; background: #fff; border: 4px solid var(--subj, var(--primary)); font-family: var(--font-head); font-weight: 800; font-size: 3.2rem; display: flex; align-items: center; justify-content: center; padding: 0 16px; }
.num-box.empty { color: #C9D3E6; }
.num-box.small { min-width: 96px; height: 84px; font-size: 2.8rem; border-width: 4px; border-style: solid; }
.num-box.focus { box-shadow: 0 0 0 5px rgba(255, 201, 61, .7); }
.num-box.ok { background: var(--ok); color: #fff; border-color: var(--ok-d); animation: bounce .4s; }
.num-box.ko { background: #FFE7D1; border-color: var(--ko); animation: shake .4s; }
.num-box.shown { background: #E3F8EA; border-color: var(--ok); }
.multi-row { display: flex; gap: 22px; }
.multi-f { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.multi-l { font-family: var(--font-head); font-weight: 800; font-size: 1.6rem; }
.keypad { display: grid; grid-template-columns: repeat(3, 84px); gap: 10px; }
.key { border: 0; height: 74px; border-radius: 20px; background: #fff; box-shadow: 0 5px 0 #CBD6EA; font-family: var(--font-head); font-weight: 800; font-size: 2.1rem; }
.key:active { transform: translateY(4px); box-shadow: 0 1px 0 #CBD6EA; }
.key-back { background: #FFF1E6; box-shadow: 0 5px 0 #F5C8A0; }
.key-ok { background: var(--ok); color: #fff; box-shadow: 0 5px 0 var(--ok-d); }

/* Colonna */
.ans-column { display: flex; gap: 26px; align-items: center; justify-content: center; flex-wrap: wrap; }
.col-grid { display: grid; grid-template-columns: 56px 76px 76px; gap: 6px; align-items: center; justify-items: center; background: #fff; padding: 16px 18px; border-radius: 24px; box-shadow: var(--shadow); background-image: linear-gradient(#EEF3FB 1px, transparent 1px), linear-gradient(90deg, #EEF3FB 1px, transparent 1px); background-size: 20px 20px; }
.col-cell { width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 800; font-size: 2.6rem; }
.col-h { font-size: 1.5rem; height: 40px; }
.col-h.da { color: #E5484D; }
.col-h.u { color: #2F80ED; }
.col-op { color: var(--subj, var(--primary)); }
.col-help { border: 3px dashed #C9D3E6; background: #fff; border-radius: 12px; width: 46px; height: 46px; font-size: 1.5rem; color: #8A5BD6; }
.col-in { border: 4px solid var(--subj, var(--primary)); background: #fff; border-radius: 16px; }
.col-cell.focus { box-shadow: 0 0 0 5px rgba(255, 201, 61, .8); }
.col-cell.ok { background: var(--ok); color: #fff; border-color: var(--ok-d); }
.col-cell.ko { background: #FFE7D1; border-color: var(--ko); }
.col-line { grid-column: 1 / -1; width: 100%; height: 5px; background: var(--ink); border-radius: 3px; }
.col-note { font-size: .85rem; color: var(--ink-soft); max-width: 260px; margin-top: 8px; }

/* Tasselli da ordinare */
.ans-order { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.tiles-answer { min-height: 92px; width: 100%; max-width: 860px; border: 4px dashed #B8C6E0; border-radius: 24px; padding: 10px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; background: rgba(255, 255, 255, .55); transition: background .2s; }
.tiles-answer.empty::before { content: 'Tocca i tasselli nell\'ordine giusto'; color: #9AA8C2; font-size: 1rem; }
.tiles-answer.joined { gap: 2px; }
.tiles-answer.ok { background: #E3F8EA; border-color: var(--ok); border-style: solid; }
.tiles-answer.ko { background: #FFF1E6; border-color: var(--ko); animation: shake .4s; }
.tiles-answer.shown { border-color: var(--ok); border-style: solid; }
.tiles-bank { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 860px; }
.tiles-bank.vertical, .tiles-answer.vertical { flex-direction: column; align-items: stretch; }
.tile { border: 0; border-radius: 18px; background: #fff; box-shadow: 0 5px 0 #CBD6EA; padding: 12px 20px; font-size: 1.7rem; font-weight: 700; min-height: 64px; min-width: 64px; }
.vertical .tile { font-size: 1.25rem; font-weight: 400; text-align: left; }
.tiles-answer .tile { background: #FFF6DA; box-shadow: 0 5px 0 #F2D27C; }
.tile:active { transform: translateY(4px); box-shadow: 0 1px 0 #CBD6EA; }

/* Parole da toccare */
.tapwords { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 860px; }
.tapword { border: 0; border-radius: 16px; background: #fff; box-shadow: 0 5px 0 #CBD6EA; padding: 10px 16px; font-size: 1.8rem; font-weight: 700; }
.tapword.ok { background: var(--ok); color: #fff; box-shadow: 0 5px 0 var(--ok-d); }
.tapword.ko { background: #FFE7D1; opacity: .7; }
.tapword.shown { outline: 4px solid var(--ok); background: #E3F8EA; }

/* Abaco */
.ans-abaco { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.abaco-live { background: #fff; border-radius: 24px; padding: 12px 20px; box-shadow: var(--shadow); }
.abaco-live.ok { outline: 5px solid var(--ok); }
.abaco-live.ko { outline: 5px solid var(--ko); animation: shake .4s; }
.ab-ctrls { display: flex; gap: 40px; }
.ab-ctrl { display: flex; gap: 10px; }
.ab-btn { border: 0; width: 70px; height: 70px; border-radius: 20px; background: #fff; box-shadow: 0 5px 0 #CBD6EA; font-family: var(--font-head); font-size: 2.4rem; font-weight: 800; }

/* Risultato */
.result { background: #fff; border-radius: 30px; box-shadow: var(--shadow); padding: 26px 22px; text-align: center; animation: popIn .3s; }
.result h2 { font-size: 2rem; }
.res-stars { margin: 10px 0; }
.res-stars .st { font-size: 4.5rem; display: inline-block; animation: starIn .5s backwards; }
.res-stars .st:nth-child(2) { animation-delay: .25s; }
.res-stars .st:nth-child(3) { animation-delay: .5s; }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); } }
.res-pct { font-size: 1.15rem; color: var(--ink-soft); }
.res-reward { font-family: var(--font-head); font-weight: 800; font-size: 1.4rem; margin: 16px 0 6px; }
.res-eggs { display: flex; justify-content: center; gap: 10px; }
.res-egg { animation: wobble 1.2s infinite; }
.res-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; }
.res-legend { display: flex; justify-content: center; animation: float 3s ease-in-out infinite; }
.res-msg { font-size: 1.2rem; }
.guardian-intro > div:first-child { display: flex; justify-content: center; animation: float 3s ease-in-out infinite; }
.guardian-intro p { font-size: 1.15rem; }
.confirm p { font-size: 1.1rem; }

/* ---------- Bit ---------- */
.bit { position: relative; z-index: 30; }
.bit-btn { border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; }
.bit-face { width: 96px; animation: float 3s ease-in-out infinite; filter: drop-shadow(0 6px 6px rgba(35, 48, 90, .2)); }
.bit-batt { display: flex; gap: 4px; margin-top: 2px; }
.bit-batt span { width: 18px; height: 10px; border-radius: 3px; background: #C9D3E6; border: 2px solid var(--ink); }
.bit-batt span.on { background: #38C172; }
.bit-led { animation: led 1.4s infinite; }
@keyframes led { 50% { fill: #FFC93D; } }
.bit-eyes { animation: blink 4s infinite; transform-origin: 60px 53px; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.bit.talking .bit-mouth { animation: talk .25s infinite alternate; transform-origin: 60px 66px; }
@keyframes talk { to { transform: scaleY(.3); } }
.bit-bubble {
  position: absolute; left: 100%; bottom: 40px; margin-left: 10px; width: min(460px, 70vw); background: #fff; border-radius: 24px; padding: 16px 18px 14px;
  box-shadow: 0 10px 30px rgba(35, 48, 90, .25); font-size: 1.15rem; line-height: 1.4; border: 3px solid var(--ink); animation: popIn .2s;
}
.bit-bubble::before { content: ''; position: absolute; left: -16px; bottom: 26px; border: 10px solid transparent; border-right: 14px solid var(--ink); }
.bubble-x { position: absolute; top: 6px; right: 6px; border: 0; background: #EEF2FA; width: 34px; height: 34px; border-radius: 50%; font-size: .9rem; }
.bubble-t { padding-right: 26px; }
.bubble-v { margin-top: 8px; }
.bubble-v svg { max-width: 100%; height: auto; }
.bit-play { position: fixed; left: max(12px, env(safe-area-inset-left)); bottom: calc(10px + var(--safe-b)); }
.bit-home { display: flex; align-items: center; flex: 1 1 360px; min-height: 120px; }
.bit-home .bit-face { width: 104px; }
.bit-home .bit-bubble { position: static; margin-left: 16px; width: auto; flex: 1; max-width: 560px; }
.bit-home .bit-bubble::before { bottom: auto; top: 50%; transform: translateY(-50%); }
.bit-home .bit-batt { display: none; }

/* ---------- Corsivo ---------- */
.cursive-area { gap: 12px; padding-bottom: 150px; }
.cur-top { display: flex; align-items: center; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cur-mode { font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; background: var(--cor); color: #fff; border-radius: 99px; padding: 6px 16px; }
.cur-top .prompt { font-size: 1.2rem; font-weight: 400; max-width: 760px; }
.cur-model { display: flex; align-items: center; gap: 10px; justify-content: center; font-family: var(--font-head); font-weight: 700; color: var(--ink-soft); }
.cur-model svg { height: 110px; width: auto; background: #fff; border-radius: 14px; border: 3px solid var(--line); }
.tracer { position: relative; width: 100%; background: #fff; border-radius: 26px; box-shadow: var(--shadow); overflow: hidden; touch-action: none; }
.tracer canvas { position: absolute; top: 0; left: 50%; transform: translateX(-50%); }
.tr-ink { touch-action: none; cursor: crosshair; }
.cur-msg { text-align: center; font-size: 1.3rem; font-weight: 700; min-height: 1.4em; }
.cur-stars .st { font-size: 2.6rem; }
.cur-btns { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Uova ---------- */
.shards { background: #fff; border-radius: 22px; padding: 12px 16px; box-shadow: var(--shadow); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 700; }
.shards small { font-family: var(--font-text); font-weight: 400; color: var(--ink-soft); width: 100%; }
.shard-bar { display: inline-flex; gap: 4px; }
.shard-bar i { width: 30px; height: 18px; border-radius: 6px; background: #EEF2FA; border: 2px solid #C9D3E6; }
.shard-bar i.on { background: var(--gold); border-color: #D9A400; }
.egg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-top: 16px; }
.egg-card { border: 0; background: #fff; border-radius: 26px; box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-family: var(--font-head); }
.egg-card small { font-family: var(--font-text); color: var(--ink-soft); text-align: center; }
.egg-wobble { animation: wobble 1.6s infinite; }
.empty-eggs { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; background: #fff; border-radius: 26px; padding: 20px; box-shadow: var(--shadow); font-size: 1.2rem; }
.empty-eggs .bit-batt { display: none; }
.modal-hatch { background: radial-gradient(circle at 50% 40%, #fff 0%, #F0F5FF 70%); max-width: 560px; }
.hatch-stage { display: flex; flex-direction: column; align-items: center; min-height: 360px; justify-content: center; }
.hatch-egg { border: 0; background: none; position: relative; padding: 0; animation: wobble 1.4s infinite; }
.hatch-egg .cracks { position: absolute; inset: 0; width: 170px; height: 212px; pointer-events: none; }
.hatch-egg .cracks path { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.hatch-egg.crack-1 .c1, .hatch-egg.crack-2 .c1, .hatch-egg.crack-2 .c2 { opacity: 1; }
.hatch-egg.bump { animation: bumpEgg .3s; }
.hatch-egg.burst { animation: burst .45s forwards; }
@keyframes bumpEgg { 30% { transform: scale(1.12) rotate(-6deg); } 60% { transform: scale(.95) rotate(6deg); } }
@keyframes burst { to { transform: scale(1.6); opacity: 0; filter: brightness(3); } }
.hatch-hint { font-family: var(--font-head); font-weight: 800; font-size: 1.4rem; }
.reveal-card { position: relative; display: flex; flex-direction: column; align-items: center; animation: popIn .4s cubic-bezier(.2, 1.6, .5, 1); }
.rays { position: absolute; top: -10px; width: 320px; height: 320px; border-radius: 50%; z-index: 0; opacity: .55; background: repeating-conic-gradient(from 0deg, var(--ray, #FFE39A) 0 10deg, transparent 10deg 20deg); animation: spin 12s linear infinite; mask: radial-gradient(circle, #000 30%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); }
.rar-comune .rays { --ray: #E4E9F1; }
.rar-noncomune .rays { --ray: #BFF0CD; }
.rar-raro .rays { --ray: #BBD6FF; }
.rar-epico .rays { --ray: #DCC2FF; }
.rar-leggendario .rays { --ray: #FFD86B; opacity: .9; }
@keyframes spin { to { transform: rotate(360deg); } }
.rv-creature { position: relative; z-index: 1; animation: float 3s ease-in-out infinite; }
.rv-rarity { color: #fff; font-family: var(--font-head); font-weight: 800; border-radius: 99px; padding: 4px 16px; margin: 6px 0; display: inline-block; }
.reveal-card h2, .dex-detail h2 { font-size: 2.1rem; margin: 4px 0; display: flex; align-items: center; justify-content: center; }
.rv-meta { color: var(--ink-soft); font-family: var(--font-head); font-weight: 700; }
.rv-desc { font-size: 1.2rem; max-width: 420px; }
.rv-new { background: #E3F8EA; color: var(--ok-d); font-family: var(--font-head); font-weight: 800; padding: 8px 16px; border-radius: 16px; }
.rv-dup { background: #FFF6DA; color: #9A6B00; font-family: var(--font-head); font-weight: 800; padding: 8px 16px; border-radius: 16px; }

/* ---------- Atlante dei Portenti ---------- */
.dex-filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 4px 0 14px; }
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.dex-card { border: 0; background: #fff; border-radius: 22px; padding: 8px 6px 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; border-top: 6px solid #C9D3E6; }
.dex-card.rar-noncomune { border-top-color: #3FAE5A; }
.dex-card.rar-raro { border-top-color: #2F80ED; }
.dex-card.rar-epico { border-top-color: #9B51E0; }
.dex-card.rar-leggendario { border-top-color: #F2A900; background: linear-gradient(180deg, #FFF9E6, #fff 60%); }
.dex-card.unknown { background: #EEF2FA; }
.dc-num { font-size: .8rem; color: var(--ink-soft); align-self: flex-start; padding-left: 8px; font-weight: 700; }
.dc-name { font-family: var(--font-head); font-weight: 800; font-size: 1.05rem; text-align: center; line-height: 1.1; }
.dc-rar { font-size: .8rem; letter-spacing: 1px; }
.dex-detail > div:first-child { display: flex; justify-content: center; animation: float 3s ease-in-out infinite; }

/* ---------- Genitori ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpi { background: #F4F7FD; border-radius: 16px; padding: 10px; text-align: center; }
.kpi b { display: block; font-family: var(--font-head); font-size: 1.6rem; }
.kpi span { font-size: .8rem; color: var(--ink-soft); }
.skill-row { display: grid; grid-template-columns: 1fr 160px 56px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid #EEF2FA; font-size: .95rem; }
.skill-bar { height: 12px; background: #EEF2FA; border-radius: 99px; overflow: hidden; }
.skill-bar i { display: block; height: 100%; }
.panel h3 { margin-top: 16px; }
.prog-world { display: grid; grid-template-columns: 220px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid #EEF2FA; align-items: center; }
.pw-name { font-family: var(--font-head); font-weight: 700; }
.pw-levels { display: flex; flex-wrap: wrap; gap: 6px; }
.pw-l { background: #F4F7FD; border-radius: 10px; padding: 3px 8px; display: flex; flex-direction: column; align-items: center; max-width: 120px; }
.pw-l small { font-size: .65rem; text-align: center; line-height: 1.1; color: var(--ink-soft); }
.pw-l .st { font-size: .9em; }
.hist { width: 100%; border-collapse: collapse; font-size: .9rem; }
.hist td { padding: 6px 4px; border-bottom: 1px solid #EEF2FA; }
.hist .st { font-size: 1em; }
.toggle { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid #EEF2FA; cursor: pointer; }
.toggle input[type=checkbox] { display: none; }
.toggle small { display: block; color: var(--ink-soft); font-size: .8rem; }
.tg-ui { width: 58px; height: 34px; border-radius: 99px; background: #C9D3E6; position: relative; flex: none; transition: background .2s; }
.tg-ui::after { content: ''; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); }
.toggle input:checked + .tg-ui { background: var(--ok); }
.toggle input:checked + .tg-ui::after { transform: translateX(24px); }
.toggle select { margin-left: auto; font-size: 1rem; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--line); }
.panel.info li { margin-bottom: 8px; font-size: .95rem; }
.gate h2 { font-size: 1.5rem; }
.gate-in { font-size: 2rem; width: 160px; text-align: center; padding: 10px; border-radius: 16px; border: 3px solid var(--line); margin: 6px auto 4px; display: block; }
.gate-err { color: #E5484D; min-height: 1.4em; margin-bottom: 8px; }

/* ---------- Adattamenti ---------- */
@media (min-width: 900px) and (orientation: landscape) {
  .ex-area.kind-number, .ex-area.kind-multi, .ex-area.kind-column { display: grid; grid-template-columns: 1fr auto; align-items: start; }
  .ex-area.kind-number .explain, .ex-area.kind-multi .explain, .ex-area.kind-column .explain { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .home-grid { grid-template-columns: repeat(2, 1fr); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .prog-world { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 18px; }
  .home-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .home-card { min-height: 160px; padding: 14px; }
  .hc-title { font-size: 1.25rem; }
  .world-card { grid-template-columns: 60px 1fr; }
  .world-card .guardian-badge { display: none; }
  .choices, .choices.n4 { grid-template-columns: repeat(2, 1fr); }
  .keypad { grid-template-columns: repeat(3, 72px); }
  .key { height: 64px; }
  .big-op { font-size: 2.3rem; }
  .bit-face { width: 74px; }
  .bit-bubble { position: fixed; left: 12px; right: 12px; bottom: 130px; width: auto; margin: 0; }
  .bit-bubble::before { display: none; }
  .skill-row { grid-template-columns: 1fr 80px 44px; }
  .tb-title { font-size: 1.1rem; }
  .chip { padding: 4px 9px; font-size: .9rem; }
}

/* ---------- Online: famiglie, genitori, amministratore, privacy ---------- */
.center { text-align: center; }
.warn { color: #B3262B; }
.notice-local { display: inline-block; background: #FFF4D6; border: 2px dashed var(--gold); border-radius: 14px; padding: 6px 14px; font-size: .9rem; color: var(--ink); }
.notice-local.dev-unpaired { display: block; margin: 12px 0; padding: 10px 14px; }
.notice-local.dev-unpaired p { margin: 0 0 8px; }
.fam { padding-top: 20px; }
.fam.narrow { max-width: 680px; }
.fam .login-hero { margin-bottom: 8px; }
.fam.narrow .login-bit { width: 90px; }
.fam-card { text-align: left; }
.fam.login .fam-card { max-width: 680px; margin: 18px auto; }
.fam-card h2 { margin-top: 0; }
.fam-actions { display: flex; flex-direction: column; gap: 14px; margin: 18px 0 10px; }
.fam-actions .btn { width: 100%; text-align: center; }
.fam-links { text-align: center; font-size: .9rem; margin: 14px 0; }
.fam-links a, .f-links a { color: var(--ink); font-weight: 700; }
.fam-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fam-head h2, .fam-head p { margin: 0; }
.fam-modal { text-align: left; }
.fam-modal h2 { padding-right: 44px; }
.fam-howto li { margin-bottom: 6px; }
.fam-steps { display: flex; justify-content: center; gap: 6px; list-style: none; padding: 0; margin: 4px 0 0; flex-wrap: wrap; counter-reset: st; }
.fam-steps li { counter-increment: st; font-size: .8rem; padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .6); color: var(--ink-soft); }
.fam-steps li::before { content: counter(st) '. '; }
.fam-steps li.on { background: var(--primary); color: #fff; font-weight: 700; }
.fam-steps li.done { background: #DFF5E7; color: var(--ok-d); }
.wizard-inline .wizard { text-align: center; }

/* Campi dei moduli */
.f-form { display: flex; flex-direction: column; gap: 12px; margin: 10px 0; }
.f-row { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.f-label { font-family: var(--font-head); font-weight: 700; font-size: 1rem; }
.f-in { width: 100%; font-size: 1.1rem; padding: 12px 14px; border-radius: 14px; border: 3px solid var(--line); background: #fff; color: var(--ink); }
.f-in:focus { outline: none; border-color: var(--primary); }
.f-code { text-transform: uppercase; letter-spacing: 2px; font-family: ui-monospace, Menlo, monospace; }
.f-pw { display: flex; gap: 6px; align-items: center; }
.f-pw .f-in { flex: 1; }
.f-eye { border: 0; background: #EEF2FA; border-radius: 12px; width: 52px; height: 52px; flex: none; font-size: 1.2rem; }
.f-hint { color: var(--ink-soft); font-size: .8rem; display: block; }
.f-err { color: #C9282D; min-height: 1.2em; margin: 0; font-size: .95rem; }
.f-err:empty { min-height: 0; }
.f-ok { color: var(--ok-d); font-weight: 700; }
.f-links { text-align: center; font-size: .9rem; margin: 4px 0 0; }
.f-inline { display: grid; grid-template-columns: 160px 1fr; gap: 12px; }
.f-consent { display: flex; gap: 12px; align-items: flex-start; background: #F4F7FD; border-radius: 16px; padding: 12px 14px; margin: 12px 0; cursor: pointer; font-size: 1rem; text-align: left; }
.f-check { width: 28px; height: 28px; flex: none; margin: 2px 0 0; accent-color: var(--ok); }
.btn-sm { min-height: 44px; padding: 8px 14px; font-size: .9rem; border-radius: 14px; }
.btn.busy { opacity: .6; }
.privacy-short ul { padding-left: 20px; }
.privacy-short li { margin-bottom: 6px; font-size: .95rem; }

/* Codici da conservare */
.code-big {
  font-family: ui-monospace, Menlo, monospace; font-size: clamp(1.4rem, 5vw, 2.2rem); font-weight: 700; letter-spacing: 3px; text-align: center;
  background: #FFF8E1; border: 3px dashed var(--gold); border-radius: 18px; padding: 16px 10px; margin: 12px 0; user-select: all; -webkit-user-select: all; word-break: break-all;
}
.recovery { text-align: left; }
.code-list { list-style: none; padding: 0; columns: 2; }
.code-list li { font-family: ui-monospace, Menlo, monospace; padding: 4px 0; }

/* Indicatore del salvataggio */
.save-chip { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 600; background: rgba(255, 255, 255, .55); box-shadow: none; color: var(--ink-soft); }
.save-chip .sc-ic { font-size: 1rem; }
.save-chip[data-status="offline"], .save-chip[data-status="auth"], .save-chip[data-status="error"] { background: #FFF4D6; }

/* "Chi sta giocando?" */
.profile-card { position: relative; }
.profile-card.locked { opacity: .7; }
.pc-lock { position: absolute; top: 8px; right: 10px; font-size: 1.6rem; }
.pass-msg { min-height: 1.4em; margin: 12px 0 0; font-weight: 700; color: var(--ko-d); }
.pass-msg:empty { min-height: 0; margin: 0; }
.bit-sleep { position: relative; width: 120px; margin: 0 auto; filter: grayscale(.4); }
.bit-sleep > div { animation: float 4s ease-in-out infinite; }
.bit-sleep .zzz { position: absolute; top: -6px; right: -18px; font-size: 2rem; animation: float 2s ease-in-out infinite; }

/* Area genitori online */
.kid-row, .dev-row { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid #EEF2FA; }
.dev-row { grid-template-columns: 1fr auto; }
.kid-av { width: 64px; height: 64px; }
.kid-av svg { width: 100%; height: 100%; }
.kid-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kid-info b { font-family: var(--font-head); font-size: 1.2rem; overflow-wrap: anywhere; }
.kid-info small { color: var(--ink-soft); font-size: .85rem; }
.kid-info small.warn { color: #B3262B; }
.kid-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.fam-row .kid-actions { grid-column: 1 / -1; }
.panel > .btn-primary { margin-top: 12px; }
.parents.fam .panel > .row.wrap { justify-content: flex-start; }
.avatar-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 10px 0; }
.avatar-grid .starter { font-size: .9rem; }
.danger-zone { margin-top: 18px; padding: 12px 14px; border: 2px solid #F6C9CA; border-radius: 16px; background: #FFF6F6; }
.danger-zone h3 { margin-top: 0; }
.modal-box.modal-wide { max-width: 860px; }
.privacy-text { text-align: left; font-size: .95rem; line-height: 1.5; -webkit-user-select: text; user-select: text; }
.privacy-text h2 { font-size: 1.3rem; margin-top: 1em; }
.privacy-text h3 { font-size: 1.1rem; }
.modal-text { padding-top: 10px; }

/* Privacy per i bambini */
.kp-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; margin-bottom: 10px; }
.kp-bit { width: 110px; animation: float 3s ease-in-out infinite; }
.kp-list { list-style: none; padding: 0; margin: 0; }
.kp-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; font-size: 1.2rem; transition: background .2s; }
.kp-item .speak-btn.sm { margin-left: 0; }
.kp-item.on { background: #FFF4D6; }

/* Stampa: biglietti invito, codici di recupero e di reset */
.print-area { display: none; }
@media print {
  body.printing { background: #fff; }
  body.printing > *:not(.print-area) { display: none !important; }
  body.printing .print-area { display: block; }
  .ticket { border: 2px dashed #999; border-radius: 12px; padding: 14px 18px; margin: 0 0 14px; break-inside: avoid; page-break-inside: avoid; font-size: 12pt; color: #000; }
  .ticket h2 { font-size: 15pt; margin: 0 0 6px; }
  .ticket p, .ticket li { margin: 3px 0; }
  .ticket-code { font-family: ui-monospace, Menlo, monospace; font-size: 22pt; font-weight: 700; letter-spacing: 3px; text-align: center; border: 2px solid #000; border-radius: 8px; padding: 6px; margin: 8px 0 !important; }
}

@media (max-width: 600px) {
  .f-inline { grid-template-columns: 1fr; }
  .save-chip .sc-t { display: none; }
  .code-list { columns: 1; }
  .fam-head { flex-direction: column; align-items: stretch; }
}
