@font-face {
  font-family: "Nunito";
  src: url("fonts/nunito.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: "Nunito", system-ui, sans-serif; background: #fff; color: #4b4b4b; padding-bottom: 68px; }
/* v8.0.2: niente scorrimento laterale — la pagina si poteva trascinare di lato
   (le etichette dei nodi spostati a destra uscivano dallo schermo). "clip" non
   crea un contenitore di scorrimento, quindi la barra in alto resta fissa. */
html, body { overflow-x: hidden; overflow-x: clip; }
body.no-tabs { padding-bottom: 0; }
body.no-tabs .tabbar, body.no-tabs .topbar { display: none; }

/* ---- Barra in alto stile Duolingo ---- */
.topbar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 2px solid #e5e5e5; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 12px 10px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.stat { display: flex; align-items: center; gap: 4px; font-weight: 800; font-size: 16px; }
.stat .ic { font-size: 20px; }
.stat.streak { color: #ff9600; } .stat.gems { color: #1cb0f6; } .stat.hearts { color: #ff4b4b; } .stat.energy { color: #ffc800; }
.stat.course { color: #1cb0f6; }

/* ---- Pulsanti Duolingo ---- */
.btn { display: block; width: 100%; border: none; border-radius: 16px; padding: 15px 16px; font-family: "Nunito", sans-serif; font-weight: 800; font-size: 15px; letter-spacing: .8px; text-transform: uppercase; cursor: pointer; color: #fff; text-align: center; transition: filter .15s, transform .08s, box-shadow .08s; }
.btn:hover { filter: brightness(1.06); }
.btn:focus-visible { outline: 3px solid rgba(28,176,246,.55); outline-offset: 2px; }
.btn-green { background: #58cc02; box-shadow: 0 4px 0 #46a302; }
.btn-blue { background: #1cb0f6; box-shadow: 0 4px 0 #1899d6; }
.btn-red { background: #ff4b4b; box-shadow: 0 4px 0 #d33131; }
.btn-yellow { background: #ffc800; box-shadow: 0 4px 0 #cc9f00; color: #4b4b4b; }
.btn-gray { background: #e5e5e5; box-shadow: 0 4px 0 #cfcfcf; color: #afafaf; }
.btn:active { transform: translateY(4px) scale(.98); box-shadow: none; filter: brightness(.97); }
.btn:disabled { opacity: .5; }
.btn.small { width: auto; padding: 10px 18px; font-size: 13px; }
.linklike { background: none; border: none; color: #1cb0f6; font-weight: 800; font-family: "Nunito", sans-serif; font-size: 15px; cursor: pointer; padding: 10px; border-radius: 12px; transition: background .15s; }
.linklike:hover { background: #ddf4ff; }
.linklike:active { transform: scale(.97); }

/* ---- Schermi ---- */
.screen { display: none; max-width: 560px; margin: 0 auto; padding: 16px 16px 24px; }
.screen.active { display: block; }
h2 { font-size: 24px; font-weight: 800; margin: 10px 0 6px; color: #3c3c3c; }
.sub { color: #6e6e6e; margin: 4px 0 16px; font-size: 15px; line-height: 1.45; }
.tiny { font-size: 12px; }

/* ---- Obiettivo giornaliero ---- */
.goal-card { border: 2px solid #e5e5e5; border-radius: 18px; padding: 16px 18px; margin-bottom: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.05); background: #fff; }
.goal-title { font-weight: 800; font-size: 16px; color: #3c3c3c; }
.goal-text { color: #6e6e6e; font-size: 14px; margin-top: 3px; line-height: 1.45; }
.goal-bar { height: 14px; background: #e5e5e5; border-radius: 8px; margin-top: 10px; overflow: hidden; }
.goal-fill { height: 100%; background: #58cc02; border-radius: 8px; transition: width .4s; }

/* ---- Percorso a serpente ---- */
.unit-banner { background: #58cc02; color: #fff; border-radius: 18px; padding: 16px 18px; margin: 20px 0 8px; display: flex; align-items: center; gap: 12px; box-shadow: 0 4px 0 #46a302, 0 6px 14px rgba(88,204,2,.28); }
.unit-banner .ub-icon { font-size: 28px; }
.unit-banner b { display: block; font-size: 17px; font-weight: 800; }
.unit-banner span { font-size: 13px; opacity: .95; }
.path-list { display: flex; flex-direction: column; align-items: center; padding: 6px 0 10px; }
.path-row { height: 78px; display: flex; align-items: center; justify-content: center; position: relative; width: 100%; }
.path-row.pos-0 { transform: translateX(0); } .path-row.pos-1 { transform: translateX(-38px); }
.path-row.pos-2 { transform: translateX(-64px); } .path-row.pos-3 { transform: translateX(-38px); }
.path-row.pos-4 { transform: translateX(0); } .path-row.pos-5 { transform: translateX(38px); }
.path-row.pos-6 { transform: translateX(64px); } .path-row.pos-7 { transform: translateX(38px); }
.node { width: 66px; height: 66px; border-radius: 50%; border: none; font-size: 28px; cursor: pointer; background: #fff; border: 2px solid #e5e5e5; box-shadow: 0 5px 0 #e5e5e5; display: flex; align-items: center; justify-content: center; position: relative; z-index: 2; transition: transform .1s, box-shadow .1s, filter .15s; }
.node:hover { filter: brightness(1.04); }
.node:active { transform: translateY(5px); box-shadow: none; }
.node.done { background: #ffc800; border-color: #ffc800; box-shadow: 0 5px 0 #cc9f00; color: #fff; }
.node.next { background: #58cc02; border-color: #58cc02; box-shadow: 0 5px 0 #46a302; color: #fff; width: 76px; height: 76px; font-size: 32px; animation: pulse 1.6s infinite; }
.node.chest-node { background: #fff; }
.node.locked { color: #afafaf; }
@keyframes pulse { 0%,100% { box-shadow: 0 5px 0 #46a302, 0 0 0 0 rgba(88,204,2,.45); } 50% { box-shadow: 0 5px 0 #46a302, 0 0 0 12px rgba(88,204,2,0); } }
.node-mascot { position: absolute; left: 50%; top: -52px; transform: translateX(-50%); width: 72px; z-index: 3; pointer-events: none; }
.node-label { position: absolute; left: calc(50% + 52px); top: 50%; transform: translateY(-50%); font-weight: 800; font-size: 13px; color: #afafaf; white-space: nowrap; z-index: 1; }
.node-label.next-label { color: #58cc02; }
/* v8.0.2: le righe spostate a destra (pos-5/6/7) avevano l'etichetta fuori dallo
   schermo: ora l'etichetta sta a sinistra del nodo. */
.path-row.pos-5 .node-label, .path-row.pos-6 .node-label, .path-row.pos-7 .node-label { left: auto; right: calc(50% + 52px); }
.trophy-row { text-align: center; padding: 14px; font-weight: 800; color: #ffc800; font-size: 18px; }

/* ---- Lezione (contenuto) ---- */
.speech-row { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 18px; }
.speech-row img { width: 76px; flex-shrink: 0; }
.bubble { background: #fff; border: 2px solid #e5e5e5; border-radius: 18px; padding: 13px 15px; font-weight: 700; font-size: 16px; line-height: 1.45; position: relative; flex: 1; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.bubble::before { content: ""; position: absolute; left: -9px; top: 22px; width: 14px; height: 14px; background: #fff; border-left: 2px solid #e5e5e5; border-bottom: 2px solid #e5e5e5; transform: rotate(45deg); }
.lesson-card { border: 2px solid #e5e5e5; border-radius: 18px; padding: 16px 18px; margin-bottom: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.05); background: #fff; }
.lesson-card h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; }
.letters { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 10px; }
.letter { border: 2px solid #e5e5e5; border-radius: 14px; padding: 11px 0 7px; text-align: center; cursor: pointer; background: #fff; transition: background .15s, border-color .15s, transform .08s; }
.letter:hover { border-color: #b8b8b8; }
.letter:active { background: #ddf4ff; border-color: #1cb0f6; transform: scale(.96); }
.letter b { display: block; font-size: 22px; font-weight: 800; }
.letter span { font-size: 11px; color: #afafaf; font-weight: 700; }
.wordrow { display: flex; align-items: center; gap: 10px; padding: 12px 8px; border-bottom: 2px solid #f0f0f0; cursor: pointer; font-weight: 700; }
.wordrow:last-child { border-bottom: none; }
.wordrow .play { font-size: 18px; }
.wordrow .ru { font-size: 18px; font-weight: 800; min-width: 96px; }
.wordrow .tr { color: #afafaf; font-size: 13px; }
.wordrow .it { margin-left: auto; color: #1cb0f6; }

/* ---- Esercizi stile Duolingo ---- */
.ex-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px 6px; max-width: 560px; margin: 0 auto; }
.ex-close { border: none; background: none; font-size: 24px; color: #afafaf; cursor: pointer; font-weight: 800; padding: 6px 8px; border-radius: 12px; transition: background .15s, color .15s; }
.ex-close:hover { background: #f1f1f1; color: #777; }
.ex-progress { flex: 1; height: 16px; background: #e5e5e5; border-radius: 8px; overflow: hidden; }
.ex-progress-fill { height: 100%; background: #58cc02; border-radius: 8px; transition: width .3s; }
.ex-hearts { font-weight: 800; color: #ff4b4b; font-size: 16px; white-space: nowrap; }
.ex-timer { font-weight: 800; color: #ff9600; font-size: 16px; white-space: nowrap; }
.ex-body { max-width: 560px; margin: 0 auto; padding: 14px 20px 130px; }
.ex-q { font-size: 22px; font-weight: 800; margin: 8px 0 18px; }
.ex-big { font-size: 64px; font-weight: 800; text-align: center; margin: 6px 0 18px; }
.opt-btn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; border: 2px solid #e5e5e5; border-bottom-width: 4px; border-radius: 18px; padding: 15px 16px; margin-bottom: 12px; font-family: "Nunito", sans-serif; font-size: 17px; font-weight: 700; color: #4b4b4b; cursor: pointer; transition: border-color .15s, background .15s, transform .08s; }
.opt-btn:hover:not(:disabled) { border-color: #c8c8c8; }
.opt-btn:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; }
.opt-btn .key { flex-shrink: 0; width: 26px; height: 26px; border: 2px solid #e5e5e5; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: #afafaf; }
.opt-btn.selected { border-color: #1cb0f6; background: #ddf4ff; color: #1899d6; }
.opt-btn.selected .key { border-color: #1cb0f6; color: #1899d6; background: #fff; }
.opt-btn.correct { border-color: #58cc02; background: #d7ffb8; color: #46a302; animation: opt-pop .35s ease; }
.opt-btn.correct .key { border-color: #58cc02; color: #46a302; background: #fff; }
.opt-btn.wrong { border-color: #ff4b4b; background: #ffdfe0; color: #d33131; animation: shake .4s ease; }
.opt-btn.wrong .key { border-color: #ff4b4b; color: #d33131; background: #fff; }
.opt-btn:disabled { cursor: default; }
.listen-btn { margin-bottom: 16px; }
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match-col { display: flex; flex-direction: column; gap: 10px; }
.match-btn { padding: 15px 10px; border: 2px solid #e5e5e5; border-bottom-width: 4px; border-radius: 16px; background: #fff; font-family: "Nunito", sans-serif; font-size: 16px; font-weight: 700; color: #4b4b4b; cursor: pointer; transition: border-color .15s, background .15s, transform .08s; }
.match-btn:active { transform: translateY(2px); border-bottom-width: 2px; }
.match-btn.selected { border-color: #1cb0f6; background: #ddf4ff; color: #1899d6; }
.match-btn.matched { border-color: #58cc02; background: #d7ffb8; color: #46a302; animation: opt-pop .35s ease; }
.match-btn.wrong { border-color: #ff4b4b; background: #ffdfe0; color: #d33131; animation: shake .4s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.check-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 18px 16px 20px; border-top: 2px solid #e5e5e5; background: #fff; box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
.check-bar.ok { background: #d7ffb8; border-top-color: #58cc02; }
.check-bar.no { background: #ffdfe0; border-top-color: #ff4b4b; }
.check-bar-inner { max-width: 560px; margin: 0 auto; }
.check-msg { font-weight: 800; font-size: 18px; margin-bottom: 10px; }
.check-bar.ok .check-msg { color: #46a302; }
.check-bar.no .check-msg { color: #d33131; }
.check-msg small { display: block; font-weight: 700; font-size: 14px; margin-top: 2px; }

/* ---- Risultati ---- */
.result-wrap { text-align: center; padding-top: 26px; }
.result-wrap img { width: 150px; }
.result-title { font-size: 26px; font-weight: 800; color: #ffc800; margin: 10px 0 4px; }
.result-pct { font-size: 20px; font-weight: 800; }
.xp-card { background: #ffc800; color: #fff; border-radius: 18px; padding: 16px; margin: 18px 0; box-shadow: 0 4px 0 #cc9f00, 0 8px 18px rgba(255,200,0,.30); }
.xp-card b { display: block; font-size: 28px; font-weight: 800; }
.xp-card span { font-weight: 800; font-size: 14px; letter-spacing: 1px; }
.result-stats { display: flex; gap: 10px; margin-bottom: 18px; }
.result-stat { flex: 1; border: 2px solid #e5e5e5; border-radius: 16px; padding: 12px 4px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.result-stat b { display: block; font-size: 18px; font-weight: 800; }
.result-stat span { font-size: 12px; color: #afafaf; font-weight: 700; }
.confetti { font-size: 26px; letter-spacing: 6px; animation: bounce 1s infinite alternate; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-8px); } }

/* ---- Lega ---- */
.league-banner { border: 2px solid #e5e5e5; border-radius: 18px; padding: 18px 16px; margin-bottom: 16px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.05); background: #fff; }
.league-name { font-size: 22px; font-weight: 800; }
.board-row { display: flex; align-items: center; gap: 10px; padding: 12px 10px; border-bottom: 2px solid #f0f0f0; font-weight: 700; }
.board-row.me { background: #ddf4ff; border-radius: 12px; }
.board-row .rank { width: 34px; font-weight: 800; }
.board-row .name { flex: 1; }
.board-row .score { font-weight: 800; color: #1cb0f6; }

/* ---- Missioni / Negozio ---- */
.quest-row { display: flex; justify-content: space-between; font-weight: 700; font-size: 15px; margin-top: 10px; }
.quest-row.done { color: #58cc02; }
.shop-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 2px solid #f0f0f0; font-weight: 700; }
.shop-row small { display: block; color: #afafaf; font-size: 12px; font-weight: 700; }
.card { border: 2px solid #e5e5e5; border-radius: 18px; padding: 16px 18px; margin-bottom: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.05); background: #fff; }

/* ---- Profilo / trofei ---- */
.profile-head { display: flex; align-items: center; gap: 14px; margin: 8px 0 16px; }
.profile-head img { width: 84px; }
.profile-head b { font-size: 22px; font-weight: 800; display: block; }
.profile-head span { color: #afafaf; font-weight: 700; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat-box { border: 2px solid #e5e5e5; border-radius: 16px; padding: 14px 12px; text-align: center; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.stat-box b { display: block; font-size: 22px; font-weight: 800; }
.stat-box span { font-size: 12px; color: #afafaf; font-weight: 700; }
#badgeList { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.badge { background: #f2fbe6; border: 2px solid #58cc02; border-radius: 14px; padding: 10px 8px; text-align: center; font-size: 22px; min-width: 66px; box-shadow: 0 2px 0 #d8ecc0; }
.badge span { display: block; font-size: 10px; font-weight: 800; margin-top: 2px; }
.badge.locked { background: #f1f1f1; border-color: #e5e5e5; opacity: .45; filter: grayscale(1); }

/* ---- Onboarding ---- */
#onboarding { position: fixed; inset: 0; background: #fff; z-index: 50; overflow-y: auto; padding: 30px 20px 60px; text-align: center; }
.ob-step { display: none; max-width: 440px; margin: 0 auto; }
.ob-step.active { display: block; }
.ob-mascot { width: 150px; }
.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.lang-card { border: 2px solid #e5e5e5; border-radius: 16px; padding: 15px 8px; background: #fff; font-family: "Nunito", sans-serif; cursor: pointer; transition: border-color .15s, background .15s, transform .08s; }
.lang-card:hover { border-color: #b8b8b8; }
.lang-card:active { transform: scale(.97); }
.lang-card b { display: block; font-size: 16px; font-weight: 800; margin-top: 4px; }
.lang-card span { font-size: 12px; color: #afafaf; font-weight: 700; }
.lang-card.selected { border-color: #1cb0f6; background: #ddf4ff; }
.lang-card.locked { opacity: .55; }
#profileName { width: 100%; padding: 15px 14px; border: 2px solid #e5e5e5; border-radius: 16px; font-family: "Nunito", sans-serif; font-size: 17px; font-weight: 700; margin: 12px 0; text-align: center; transition: border-color .15s; }
#profileName:focus { outline: none; border-color: #1cb0f6; box-shadow: 0 0 0 3px rgba(28,176,246,.18); }

/* ---- Trailer ---- */
.trailer-overlay { position: fixed; inset: 0; background: #000; z-index: 60; display: flex; align-items: center; justify-content: center; }
.trailer-overlay video { width: 100%; height: 100%; object-fit: contain; }
.trailer-skip { position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,.92); border: none; border-radius: 20px; padding: 10px 16px; font-weight: 800; font-family: "Nunito", sans-serif; cursor: pointer; z-index: 61; }

/* ---- Tab bar ---- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 2px solid #e5e5e5; display: flex; z-index: 20; }
.tabbar button { flex: 1; background: none; border: none; padding: 8px 0 10px; font-size: 22px; color: #afafaf; cursor: pointer; font-family: "Nunito", sans-serif; transition: color .15s, transform .08s; }
.tabbar button:active { transform: scale(.94); }
.tabbar button span { display: block; font-size: 11px; font-weight: 800; margin-top: 1px; }
.tabbar button.active { color: #1cb0f6; }
.tabbar button.active span { color: #1cb0f6; }

/* ---- Toast ---- */
#toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px); background: #4b4b4b; color: #fff; padding: 12px 18px; border-radius: 24px; font-weight: 700; font-size: 15px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 70; max-width: 88%; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hidden { display: none !important; }

/* v4.0: sezioni, livello, podcast, immagini al posto delle emoji */
.sec-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.sec-tab { flex: 1; border: 2px solid #e5e5e5; background: #fff; border-radius: 14px; padding: 10px 4px; font-family: "Nunito", sans-serif; font-weight: 800; font-size: 13px; color: #afafaf; cursor: pointer; transition: border-color .15s, background .15s, color .15s, transform .08s; }
.sec-tab:hover:not(.locked) { border-color: #b8b8b8; }
.sec-tab:active:not(.locked) { transform: scale(.96); }
.sec-tab.active { border-color: #58cc02; background: #d7ffb8; color: #46a302; }
.sec-tab.locked { opacity: .55; }
.section-head { margin: 4px 0 6px; }
.section-head b { font-size: 19px; font-weight: 800; display: block; }
.section-head span { color: #afafaf; font-weight: 700; font-size: 13px; }
.node-img { width: 40px; height: 40px; object-fit: contain; }
.node.done .node-img { filter: brightness(0) invert(1); }
.podcast-card { border: 2px solid #1cb0f6; background: #ddf4ff; border-radius: 18px; padding: 16px; margin-bottom: 16px; text-align: center; box-shadow: 0 4px 0 #1899d6, 0 8px 18px rgba(28,176,246,.18); }
.podcast-card img { width: 96px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.18)); }
.podcast-card b { display: block; font-size: 17px; font-weight: 800; margin: 6px 0 10px; }
.podcast-card audio { width: 100%; }
.lesson-img { width: 100%; border-radius: 14px; margin-bottom: 12px; }
.fact-box { background: #fff8db; border: 2px solid #ffc800; border-radius: 14px; padding: 12px 14px; font-weight: 700; font-size: 14px; line-height: 1.45; margin-bottom: 16px; }

.acc-input { width: 100%; padding: 13px 14px; border: 2px solid #e5e5e5; border-radius: 16px; font-family: "Nunito", sans-serif; font-size: 16px; font-weight: 700; margin: 6px 0; box-sizing: border-box; transition: border-color .15s; }
.acc-input:focus { outline: none; border-color: #1cb0f6; box-shadow: 0 0 0 3px rgba(28,176,246,.18); }

/* ---- v6.0: tapwords, repeat, errori, quiz in lezione ---- */
.tap-pool { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.word-chip { border: 2px solid #e5e5e5; border-bottom-width: 4px; border-radius: 16px; background: #fff; padding: 12px 16px; font-family: "Nunito", sans-serif; font-size: 17px; font-weight: 800; color: #4b4b4b; cursor: pointer; transition: background .15s, border-color .15s, transform .08s; }
.word-chip:active { background: #ddf4ff; border-color: #1cb0f6; transform: translateY(2px); border-bottom-width: 2px; }
.word-chip.used { opacity: .35; }
.tap-answer { min-height: 58px; border: 2px dashed #e5e5e5; border-radius: 14px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tap-answer .word-chip { border-color: #1cb0f6; background: #ddf4ff; color: #1899d6; }
.tap-placeholder { color: #afafaf; font-weight: 700; font-size: 14px; }
.repeat-target { border: 2px solid #e5e5e5; border-radius: 18px; padding: 18px 16px; text-align: center; margin-bottom: 16px; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.repeat-target b { display: block; font-size: 22px; font-weight: 800; }
.repeat-target span { display: block; color: #777; font-weight: 700; margin-top: 4px; }
.rec-btn { margin-bottom: 12px; }
.repeat-result { margin-bottom: 8px; }
.repeat-msg { font-weight: 700; font-size: 15px; background: #f7f7f7; border: 2px solid #e5e5e5; border-radius: 12px; padding: 10px 12px; }
.repeat-msg.warn { background: #fff8db; border-color: #ffc800; }
.repeat-skip { text-align: center; }
.mistakes-card { border-color: #ffc800; background: #fff8db; }

/* ============================================================
   v7.0 — Passata di bellezza (agente GRAFICA)
   Solo ritocchi: palette Duolingo invariata (#58cc02, #1cb0f6,
   #ffc800), nessuna classe esistente rinominata, nessuna
   struttura spostata. Mascotte Kot più presente.
   ============================================================ */

/* ---- Animazioni Kot ---- */
@keyframes kot-pop {
  0% { opacity: 0; transform: scale(.55) translateY(14px); }
  60% { opacity: 1; transform: scale(1.07) translateY(-3px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes kot-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes kot-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

/* ---- Kot in home (img aggiunta dall'agente APP, vedi gfx-index-patch.md) ---- */
.home-mascot-wrap { display: flex; align-items: center; gap: 14px; margin: 2px 0 16px; }
.home-mascot {
  width: 104px; height: 104px; flex-shrink: 0;
  border-radius: 50%; object-fit: cover;
  border: 3px solid #58cc02;
  box-shadow: 0 4px 0 #46a302, 0 10px 20px rgba(88,204,2,.28);
  animation: kot-pop .55s ease-out, kot-bob 2.8s ease-in-out 1s infinite;
  background: #fff;
}
.home-mascot-wrap .home-mascot-text { font-weight: 800; font-size: 17px; color: #3c3c3c; line-height: 1.35; }
.home-mascot-wrap .home-mascot-text span { display: block; font-size: 14px; font-weight: 700; color: #afafaf; margin-top: 2px; }

/* ---- Kot nella lezione ---- */
#lessonMascot {
  width: 88px; height: 88px; object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 4px 12px rgba(0,0,0,.16);
  border: 2px solid #e5e5e5;
  background: #fff;
  animation: kot-pop .5s ease-out;
}
.speech-row img#lessonMascot { flex-shrink: 0; }

/* ---- Kot nel profilo ---- */
.profile-head img {
  width: 96px; height: 96px; object-fit: cover;
  border-radius: 50%;
  border: 3px solid #58cc02;
  box-shadow: 0 4px 0 #46a302, 0 8px 16px rgba(88,204,2,.25);
  background: #fff;
  animation: kot-pop .55s ease-out;
}
.profile-head b { color: #3c3c3c; }

/* ---- Kot nell'onboarding ---- */
.ob-mascot {
  width: 168px; height: 168px; object-fit: cover;
  border-radius: 32px;
  box-shadow: 0 8px 22px rgba(0,0,0,.14);
  border: 2px solid #e5e5e5;
  background: #fff;
  animation: kot-pop .55s ease-out;
}

/* ---- Kot nei risultati e sul percorso ---- */
.result-wrap img {
  width: 160px; height: 160px; object-fit: cover;
  border-radius: 50%;
  border: 3px solid #ffc800;
  box-shadow: 0 6px 18px rgba(255,200,0,.35);
  background: #fff;
  animation: kot-pop .6s ease-out, kot-wiggle 3.2s ease-in-out 1.2s infinite;
}
.node-mascot {
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.22));
  animation: kot-bob 2.4s ease-in-out infinite;
}

/* ---- v8.0: chip lingua nella barra superiore (la carta centrale è stata rimossa) ---- */
.top-lang-chip {
  display: flex; align-items: center; gap: 5px; flex-shrink: 0;
  border: 2px solid #e5e5e5; background: #fff; border-radius: 999px;
  padding: 5px 10px; font-family: "Nunito", sans-serif; font-weight: 800;
  font-size: 13px; color: #3c3c3c; cursor: pointer; max-width: 128px;
  transition: border-color .15s, background .15s, transform .08s;
}
.top-lang-chip:hover { border-color: #1cb0f6; background: #f4fbff; }
.top-lang-chip:active { transform: scale(.96); }
.top-lang-chip #topLangName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-lang-chip .top-lang-chev { font-size: 11px; color: #afafaf; }
.topbar { flex-wrap: wrap; row-gap: 6px; }
@media (max-width: 420px) {
  .topbar { gap: 8px; padding: 10px 8px; }
  .stat { font-size: 14px; }
  .stat .ic { font-size: 17px; }
  .top-lang-chip { font-size: 12px; padding: 4px 8px; max-width: 102px; }
}

/* ---- Menù lingue (modale, agente APP — vedi gfx-index-patch.md) ---- */
.lang-modal {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(75,75,75,.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.lang-modal.hidden { display: none !important; }
.lang-modal-card {
  background: #fff; width: 100%; max-width: 560px;
  border-radius: 24px 24px 0 0; padding: 20px 18px 28px;
  box-shadow: 0 -8px 30px rgba(0,0,0,.18);
  animation: kot-pop .3s ease-out;
  max-height: 82vh; overflow-y: auto;
}
.lang-modal-card h3 { margin: 2px 0 4px; font-size: 20px; font-weight: 800; color: #3c3c3c; text-align: center; }
.lang-modal-card .sub { text-align: center; margin-bottom: 12px; }
.lang-option {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: 2px solid #e5e5e5; border-radius: 16px; background: #fff;
  padding: 13px 14px; margin-bottom: 10px; cursor: pointer;
  font-family: "Nunito", sans-serif; text-align: left;
  transition: border-color .15s, background .15s, transform .08s;
}
.lang-option:hover { border-color: #1cb0f6; background: #f4fbff; }
.lang-option:active { transform: scale(.98); }
.lang-option.current { border-color: #58cc02; background: #d7ffb8; }
.lang-option .lo-flag { font-size: 28px; line-height: 1; flex-shrink: 0; }
.lang-option .lo-name { flex: 1; font-weight: 800; font-size: 16px; color: #3c3c3c; }
.lang-option .lo-name span { display: block; font-size: 12px; font-weight: 700; color: #afafaf; margin-top: 1px; }
.lang-option .lo-check { font-size: 20px; font-weight: 800; color: #58cc02; }
.lang-modal-close { margin-top: 4px; }

/* ---- Piccoli ritocchi finali v7 ---- */
.goal-bar { box-shadow: inset 0 2px 4px rgba(0,0,0,.08); }
.goal-fill { background: linear-gradient(90deg, #58cc02, #7ee62e); }
.ex-progress { box-shadow: inset 0 2px 4px rgba(0,0,0,.08); }
.ex-progress-fill { background: linear-gradient(90deg, #58cc02, #7ee62e); }
#toast { box-shadow: 0 6px 20px rgba(0,0,0,.30); }
.board-row { border-radius: 12px; transition: background .15s; }
.board-row.me { box-shadow: 0 2px 8px rgba(28,176,246,.20); }
.wordrow { transition: background .15s; border-radius: 10px; }
.wordrow:hover { background: #f7f7f7; }
.quest-row { line-height: 1.4; }
.shop-row { line-height: 1.4; }
.section-head { margin: 6px 0 8px; }
.trophy-row { text-shadow: 0 2px 0 rgba(204,159,0,.25); }

/* ---- v7.3: animazioni stile Duolingo (anteprima approvata dall'utente) ---- */
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes opt-pop { 0% { transform: scale(1); } 45% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes xp-float-up { 0% { opacity: 0; transform: translate(-50%, 0) scale(.8); } 15% { opacity: 1; transform: translate(-50%, -10px) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -70px) scale(1); } }
@keyframes flame-pop { 0% { transform: scale(.3) rotate(-10deg); opacity: 0; } 60% { transform: scale(1.25) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes flame-flicker { 0%,100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.06) rotate(2deg); } }
@keyframes glow-pulse { 0%,100% { filter: drop-shadow(0 0 12px rgba(255,150,0,.55)); } 50% { filter: drop-shadow(0 0 30px rgba(255,150,0,.9)); } }
@keyframes confetti-fall { 0% { transform: translateY(-4vh) rotate(0deg); opacity: 1; } 100% { transform: translateY(105vh) rotate(720deg); opacity: .85; } }
@keyframes celeb-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
@keyframes node-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 70% { transform: scale(.92); } 100% { transform: scale(1); } }
@keyframes star-burst { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.3) rotate(-30deg); } 40% { opacity: 1; transform: translate(-50%,-50%) scale(1.5) rotate(10deg); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.8) rotate(20deg); } }
@keyframes plus-pop { 0% { transform: scale(0) rotate(-12deg); opacity: 0; } 70% { transform: scale(1.2) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }

.screen.active { animation: screen-in .28s ease; }
.node.just-done { animation: node-pop .6s ease; }
.node.just-done::after { content: "⭐"; position: absolute; left: 50%; top: 50%; font-size: 30px; transform: translate(-50%,-50%); animation: star-burst .8s ease forwards; pointer-events: none; }
.xp-float { position: fixed; left: 50%; top: 34%; z-index: 70; font-size: 26px; font-weight: 800; color: #58cc02; text-shadow: 0 2px 0 #fff, 0 0 12px rgba(88,204,2,.4); pointer-events: none; animation: xp-float-up 1s ease-out forwards; }
.celebration { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; background: rgba(20,20,40,.55); overflow: hidden; }
.celebration.show { display: flex; }
.celebration.show .celeb-card { animation: celeb-in .35s ease; }
.celeb-card { position: relative; z-index: 2; background: #fff; border-radius: 24px; padding: 28px 24px 22px; margin: 16px; max-width: 420px; width: calc(100% - 32px); text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.celeb-flame { font-size: 96px; line-height: 1; display: inline-block; animation: flame-pop .55s ease-out, flame-flicker 1.4s ease-in-out .55s infinite, glow-pulse 1.4s ease-in-out infinite; }
.celeb-plus { display: inline-block; background: #ffc800; color: #fff; font-size: 22px; font-weight: 800; border-radius: 999px; padding: 6px 14px; box-shadow: 0 3px 0 #cc9f00; animation: plus-pop .45s .35s ease-out both; margin-left: 8px; vertical-align: 34px; }
.celeb-title { font-size: 26px; font-weight: 800; color: #4b4b4b; margin-top: 10px; }
.celeb-sub { font-size: 15px; color: #777; margin: 6px 0 16px; font-weight: 700; }
.celeb-kot { width: 110px; height: 110px; object-fit: cover; border-radius: 50%; border: 3px solid #ffc800; margin-bottom: 8px; animation: kot-bob 1.6s ease-in-out infinite; }
.celeb-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.celeb-confetti span { position: absolute; top: -4vh; display: block; animation: confetti-fall linear forwards; }
.lvl-bar { height: 14px; background: #e5e5e5; border-radius: 999px; overflow: hidden; margin: 12px 0 4px; }
.lvl-fill { height: 100%; width: 0; background: linear-gradient(90deg, #58cc02, #8ee000); border-radius: 999px; transition: width .9s ease; }
.lvl-label { font-size: 12px; font-weight: 700; color: #afafaf; }
.wn-list { list-style: none; padding: 0; margin: 12px 0 16px; text-align: left; }
.wn-list li { font-size: 15px; font-weight: 700; color: #4b4b4b; line-height: 1.45; padding: 8px 4px; border-bottom: 2px solid #f0f0f0; }
.wn-list li:last-child { border-bottom: none; }

/* Rispetta chi disattiva le animazioni: Kot resta fermo ma visibile */
@media (prefers-reduced-motion: reduce) {
  .home-mascot, #lessonMascot, .profile-head img, .ob-mascot,
  .result-wrap img, .node-mascot { animation: none; }
  .node.next { animation: none; }
  .confetti { animation: none; }
  .screen.active, .opt-btn.correct, .opt-btn.wrong, .match-btn.matched, .match-btn.wrong,
  .node.just-done, .node.just-done::after, .xp-float, .celeb-flame, .celeb-plus,
  .celebration.show .celeb-card, .celeb-kot, .celeb-confetti span { animation: none; }
  .lvl-fill { transition: none; }
}

/* ============================================================
   v8.0 — Chiamate con Kot (design §6)
   ============================================================ */
.call-head { text-align: center; padding: 18px 0 6px; }
.call-avatar {
  width: 120px; height: 120px; object-fit: cover;
  border-radius: 50%; border: 3px solid #58cc02;
  box-shadow: 0 4px 0 #46a302, 0 10px 20px rgba(88,204,2,.28);
  background: #fff; animation: kot-pop .55s ease-out, kot-bob 2.8s ease-in-out 1s infinite;
}
.call-name { font-size: 22px; font-weight: 800; color: #3c3c3c; margin-top: 8px; }
.call-timer { font-size: 16px; font-weight: 800; color: #1cb0f6; margin-top: 2px; font-variant-numeric: tabular-nums; }
.call-status { font-size: 13px; font-weight: 700; color: #afafaf; margin-top: 2px; }
.call-chat { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; max-height: 38vh; overflow-y: auto; padding-right: 2px; }
.call-bubble { border: 2px solid #e5e5e5; border-radius: 18px; padding: 12px 14px; font-weight: 700; font-size: 15px; line-height: 1.45; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.05); max-width: 92%; }
.call-bubble.kot { align-self: flex-start; border-bottom-left-radius: 6px; }
.call-bubble.me { align-self: flex-end; background: #ddf4ff; border-color: #1cb0f6; border-bottom-right-radius: 6px; color: #1899d6; }
.call-bubble.ok { align-self: center; background: #d7ffb8; border-color: #58cc02; color: #46a302; text-align: center; }
.call-bubble.no { align-self: center; background: #ffdfe0; border-color: #ff4b4b; color: #d33131; text-align: center; }
.call-bubble.sys { align-self: center; background: #fff8db; border-color: #ffc800; text-align: center; }
.call-controls { display: flex; justify-content: center; gap: 22px; margin: 6px 0 8px; }
.call-round {
  width: 64px; height: 64px; border-radius: 50%; border: none; font-size: 28px;
  background: #fff; border: 2px solid #e5e5e5; box-shadow: 0 4px 0 #e5e5e5;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform .08s, box-shadow .08s, background .15s;
}
.call-round:active { transform: translateY(4px); box-shadow: none; }
.call-round:disabled { opacity: .5; }
.call-round.listening { background: #ff4b4b; border-color: #ff4b4b; box-shadow: 0 4px 0 #d33131; animation: call-pulse 1.2s infinite; }
@keyframes call-pulse { 0%,100% { box-shadow: 0 4px 0 #d33131, 0 0 0 0 rgba(255,75,75,.45); } 50% { box-shadow: 0 4px 0 #d33131, 0 0 0 14px rgba(255,75,75,0); } }
.call-round.call-end { background: #ff4b4b; border-color: #ff4b4b; box-shadow: 0 4px 0 #d33131; }
.call-mic-label { text-align: center; font-weight: 700; font-size: 14px; color: #afafaf; margin-bottom: 12px; }
.call-replies { display: flex; flex-direction: column; gap: 4px; }
.call-replies .opt-btn { margin-bottom: 8px; }
#callSummary .result-wrap { padding-top: 6px; }
/* ---- v8.0: Kot + errori affiancati in home (~50/50) ---- */
.home-top-row { display: flex; gap: 10px; margin: 2px 0 16px; align-items: stretch; }
.home-top-row .kot-mini-card { flex: 1; min-width: 0; margin: 0; }
.home-top-row .kot-mini-card .home-mascot { width: 64px; height: 64px; }
.home-top-row .kot-mini-card .home-mascot-text { font-size: 15px; }
.home-top-row .kot-mini-card .home-mascot-text span { font-size: 12px; }
.home-top-row .mistakes-card { flex: 1; min-width: 0; margin-bottom: 0; display: flex; flex-direction: column; justify-content: center; }
.home-top-row .mistakes-card .btn { margin-top: 8px; }

/* ---- v8.0: sezioni precedenti (a scomparsa) + animazione di sblocco ---- */
#sectionTabs .prev-toggle { padding: 6px 10px; font-size: 14px; }
.prev-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.prev-list .sec-tab { flex: 0 1 auto; padding: 8px 12px; }
#unlockBadge { text-align: center; margin: 2px 0 6px; min-height: 0; }
#unlockBadge:empty { display: none; }
.unlock-badge {
  display: inline-block;
  background: linear-gradient(90deg, #ffc800, #ffdf5e);
  color: #4b4b4b; font-weight: 800; font-size: 14px;
  border-radius: 999px; padding: 7px 14px;
  box-shadow: 0 3px 0 #cc9f00, 0 0 18px rgba(255,200,0,.55);
  animation: unlock-badge-pop .55s ease-out, glow-pulse 1.6s ease-in-out .55s infinite;
}
@keyframes unlock-badge-pop { 0% { transform: scale(.5); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes unlock-head-in { from { opacity: 0; transform: translateY(-12px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.section-head.unlock-anim { animation: unlock-head-in .5s ease; }
@keyframes node-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes node-pop-in { 0% { transform: scale(.4); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.path-row.node-enter { opacity: 0; animation: node-fade .4s ease forwards; }
.path-row.node-enter .node { animation: node-pop-in .45s ease both; }

/* Rispetta chi disattiva le animazioni */
@media (prefers-reduced-motion: reduce) {
  .call-avatar, .call-round.listening { animation: none; }
  .path-row.node-enter, .path-row.node-enter .node, .section-head.unlock-anim, .unlock-badge { animation: none; }
  .path-row.node-enter { opacity: 1; }
}


/* ============================================================
   v10.0 — NUOVO DESIGN (agente DESIGN)
   Restyle completo: palette moderna con il blu Linguao #1CB0F6
   come identità, card morbide, tipografia curata, spaziature
   ariose. Le regole storiche sopra restano come base; questa
   sezione viene DOPO e le sovrascrive (stessa specificità,
   ordine dopo). Nessun id/classe usati da app.js è stato
   rinominato o rimosso; le nuove schermate usano gli stessi
   pattern (screen + contenitori riempiti da JS).
   ============================================================ */
:root {
  --blue: #1CB0F6;
  --blue-dark: #1899D6;
  --blue-ink: #0E7CB8;
  --blue-soft: #DDF4FF;
  --green: #58CC02;
  --green-dark: #46A302;
  --green-soft: #D7FFB8;
  --yellow: #FFC800;
  --yellow-dark: #CC9F00;
  --yellow-soft: #FFF8DB;
  --red: #FF4B4B;
  --red-dark: #D33131;
  --red-soft: #FFDFE0;
  --orange: #FF9600;
  --ink: #3C3C3C;
  --text: #4B4B4B;
  --muted: #AFAFAF;
  --muted-2: #777777;
  --card: #FFFFFF;
  --bg: #F4F9FD;
  --line: #E6EEF4;
  --grad-blue: linear-gradient(135deg, #1CB0F6 0%, #1899D6 100%);
  --grad-green: linear-gradient(135deg, #7EE62E 0%, #58CC02 100%);
  --grad-hero: linear-gradient(135deg, #E3F5FF 0%, #F0FBFF 55%, #FFF6DB 100%);
  --grad-sun: linear-gradient(135deg, #FFD93D 0%, #FFC800 100%);
  --shadow-card: 0 4px 16px rgba(30, 70, 110, .07);
  --shadow-lift: 0 10px 28px rgba(30, 70, 110, .12);
  --r-lg: 20px;
  --r-md: 16px;
}

/* ---- Base ---- */
body { background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; padding-bottom: 96px; }
h2 { font-size: 26px; letter-spacing: -.3px; color: var(--ink); }
.sub { color: var(--muted-2); }
.home-section-title { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -.2px; margin: 6px 0 10px; }

/* ---- Barra in alto ---- */
.topbar { background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); box-shadow: 0 4px 18px rgba(30, 70, 110, .06); gap: 8px; padding: 10px; }
.top-lang-chip { border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; box-shadow: var(--shadow-card); font-size: 15px; }

/* ---- Pulsanti ---- */
.btn { border-radius: 18px; letter-spacing: .6px; }
.btn-green { background: var(--grad-green); box-shadow: 0 4px 0 var(--green-dark), 0 8px 16px rgba(88, 204, 2, .25); }
.btn-blue { background: var(--grad-blue); box-shadow: 0 4px 0 var(--blue-dark), 0 8px 16px rgba(28, 176, 246, .25); }
.btn-yellow { background: var(--grad-sun); box-shadow: 0 4px 0 var(--yellow-dark), 0 8px 16px rgba(255, 200, 0, .25); }
.btn-red { box-shadow: 0 4px 0 var(--red-dark), 0 8px 16px rgba(255, 75, 75, .25); }
.btn-gray { background: #EEF2F6; box-shadow: 0 4px 0 #DDE5EC; color: #7A8794; }
.linklike { color: var(--blue-dark); }

/* ---- Card generiche ---- */
.card, .goal-card, .lesson-card { border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.goal-title { color: var(--ink); }
.goal-text { color: var(--muted-2); }
.goal-text b { color: var(--ink); }
.goal-card.mistakes-card { border-color: #FFD93D; background: var(--yellow-soft); }

/* ---- Obiettivo giornaliero + livello ---- */
.goal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.goal-level-badge { background: var(--grad-blue); color: #fff; font-size: 12px; font-weight: 800; padding: 5px 11px; border-radius: 999px; box-shadow: 0 3px 0 var(--blue-dark); white-space: nowrap; }
.goal-bar { height: 16px; background: #EDF3F8; border-radius: 999px; }
.goal-fill { background: linear-gradient(90deg, #58CC02, #8EE62E); box-shadow: 0 0 0 1px rgba(88, 204, 2, .15); }

/* ---- Kot in home ---- */
.home-mascot-wrap { background: var(--grad-hero); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--shadow-card); }
.home-mascot { width: 88px; height: 88px; border: 3px solid #fff; box-shadow: 0 6px 16px rgba(28, 176, 246, .28); }
.home-top-row .kot-mini-card { background: var(--grad-hero); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 12px; }
.home-top-row .kot-mini-card .home-mascot { border: 3px solid #fff; box-shadow: 0 6px 16px rgba(28, 176, 246, .28); }

/* ---- v10: le avventure di Kot in home ---- */
.kot-adventures { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
.kot-adventure { border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-card); padding: 16px 10px 14px; text-align: center; cursor: pointer; font-family: "Nunito", sans-serif; color: var(--text); transition: transform .12s, box-shadow .15s, border-color .15s; }
.kot-adventure:hover { border-color: var(--blue); box-shadow: var(--shadow-lift); }
.kot-adventure:active { transform: scale(.97); }
.kot-adventure .ka-ic { font-size: 34px; display: block; line-height: 1.1; }
.kot-adventure b { display: block; font-size: 15px; font-weight: 800; color: var(--ink); margin-top: 6px; }
.kot-adventure span { display: block; font-size: 12px; color: var(--muted-2); font-weight: 700; margin-top: 2px; line-height: 1.35; }
.kot-adventure.wide { grid-column: 1 / -1; background: linear-gradient(135deg, #FFF6DB, #FFFFFF 70%); border-color: #FFE9A8; }

/* ---- Sezioni e percorso ---- */
.section-head b { font-size: 21px; letter-spacing: -.3px; color: var(--ink); }
.section-head span { color: var(--muted-2); }
.sec-tab.active { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); }
.unit-banner { background: var(--grad-green); border-radius: var(--r-lg); box-shadow: 0 4px 0 var(--green-dark), 0 10px 20px rgba(88, 204, 2, .25); }
.path-row { height: 88px; }
.node { width: 74px; height: 74px; border: 2px solid var(--line); box-shadow: 0 6px 0 #E3EAF0, 0 10px 18px rgba(30, 70, 110, .10); font-size: 30px; }
.node.done { background: var(--grad-green); border-color: var(--green); box-shadow: 0 6px 0 var(--green-dark), 0 10px 18px rgba(88, 204, 2, .30); color: #fff; }
.node.next { width: 84px; height: 84px; background: var(--grad-blue); border-color: var(--blue); box-shadow: 0 6px 0 var(--blue-dark), 0 12px 22px rgba(28, 176, 246, .35); font-size: 34px; }
.node.locked { background: #F2F5F8; color: #C6CFD8; border-color: #E8EEF3; box-shadow: 0 6px 0 #E8EEF3; }
.node.chest-node { background: #FFF6DB; border-color: #FFE9A8; box-shadow: 0 6px 0 #F0D98A; }
.node-label { color: #9AA7B4; font-size: 13px; }
.node-label.next-label { color: var(--blue-dark); }
@keyframes pulse { 0%, 100% { box-shadow: 0 6px 0 var(--blue-dark), 0 0 0 0 rgba(28, 176, 246, .45); } 50% { box-shadow: 0 6px 0 var(--blue-dark), 0 0 0 14px rgba(28, 176, 246, 0); } }

/* ---- v10: griglia "Chiamate e altro" ---- */
.extra-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
.feature-card { padding: 16px 8px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-card); font-size: 15px; cursor: pointer; font-family: "Nunito", sans-serif; color: var(--text); text-align: center; transition: transform .12s, box-shadow .15s, border-color .15s; }
.feature-card:hover { border-color: var(--blue); box-shadow: var(--shadow-lift); }
.feature-card:active { transform: scale(.97); }
.feature-card .fc-ic { font-size: 30px; display: block; line-height: 1.1; }
.feature-card b { display: block; font-size: 15px; font-weight: 800; color: var(--ink); margin-top: 4px; }
.feature-card small { color: var(--muted-2); font-weight: 700; }
.feature-card.wide { grid-column: 1 / -1; }
.feature-card.hot { background: linear-gradient(135deg, #FFF6DB, #FFFFFF 70%); border-color: #FFE9A8; }
.feature-card.blue { background: linear-gradient(135deg, #EAF7FF, #FFFFFF 70%); border-color: #BDE9FF; }

/* ---- Profilo / trofei ---- */
.profile-head img { border: 3px solid #fff; box-shadow: 0 6px 16px rgba(88, 204, 2, .30); }
.stat-box { border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-card); }
.stat-box b { color: var(--ink); }
.badge { border-radius: 14px; box-shadow: 0 2px 0 #D8ECC0, var(--shadow-card); }

/* ---- Barra inferiore: dock flottante ---- */
.tabbar { left: 50%; right: auto; transform: translateX(-50%); bottom: 12px; width: calc(100% - 24px); max-width: 520px; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 12px 32px rgba(30, 70, 110, .16); padding: 4px; background: rgba(255, 255, 255, .96); }
.tabbar button { border-radius: 18px; padding: 8px 0 9px; }
.tabbar button.active { background: var(--blue-soft); color: var(--blue-dark); }
.tabbar button.active span { color: var(--blue-dark); }

/* ---- Lezione / esercizi: ritocchi morbidi ---- */
.bubble { border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.bubble::before { border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.opt-btn { border: 2px solid var(--line); box-shadow: 0 2px 0 #EDF1F5; }
.call-bubble { border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.call-round { border: 2px solid var(--line); box-shadow: 0 4px 0 #E8EEF3, var(--shadow-card); }
.lang-card.selected { border-color: var(--blue); background: var(--blue-soft); }
.lang-option.current { border-color: var(--green); background: var(--green-soft); }
.podcast-card { border: 1px solid #BDE9FF; background: linear-gradient(180deg, #EAF7FF, #FFFFFF); box-shadow: 0 4px 0 var(--blue-dark), 0 10px 20px rgba(28, 176, 246, .15); }
.fact-box { border-radius: var(--r-md); }
.wordrow:hover { background: #F4F9FD; }

/* ---- Transizione schermata v10 (ridefinisce screen-in) ---- */
@keyframes screen-in { from { opacity: 0; transform: translateY(12px) scale(.995); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ============================================================
   v10.0 — NUOVE SCHERMATE (solo markup + CSS; il JS arriva
   da un altro agente e riempirà i contenitori qui sotto,
   con gli stessi pattern di storie/podcast/chiamate).
   ============================================================ */

/* ---- Copertina storia lunga / diario ---- */
.longstory-cover { background: var(--grad-hero); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 16px; text-align: center; box-shadow: var(--shadow-card); margin-bottom: 14px; }
.longstory-cover img { width: 96px; height: 96px; object-fit: cover; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 6px 16px rgba(28, 176, 246, .28); background: #fff; animation: kot-pop .55s ease-out; }
.longstory-cover b { display: block; font-size: 20px; font-weight: 800; color: var(--ink); margin-top: 8px; }
.longstory-cover span { color: var(--muted-2); font-weight: 700; font-size: 14px; }
.longstory-cover .ls-setting { display: inline-block; margin-top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 800; color: var(--blue-dark); }

/* ---- Capitoli della storia lunga (riempiti da JS) ---- */
.chapter-row { display: flex; align-items: center; gap: 12px; }
.chapter-num { width: 46px; height: 46px; border-radius: 14px; background: var(--blue-soft); color: var(--blue-dark); font-weight: 800; font-size: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chapter-row.done .chapter-num { background: var(--green-soft); color: var(--green-dark); }
.chapter-row .chapter-meta { flex: 1; min-width: 0; }
.chapter-row .chapter-meta b { display: block; font-size: 16px; font-weight: 800; color: var(--ink); }
.chapter-row .chapter-meta span { display: block; font-size: 13px; color: var(--muted-2); font-weight: 700; margin-top: 1px; }
.chapter-row .chapter-go { font-size: 20px; color: var(--muted); flex-shrink: 0; }
.ls-line { display: flex; gap: 10px; align-items: flex-start; }
.ls-line .ls-audio { flex-shrink: 0; }
.ls-line .ls-text b { display: block; font-size: 16px; line-height: 1.5; color: var(--ink); }
.ls-line .ls-text span { display: block; font-size: 14px; line-height: 1.45; color: var(--muted-2); font-weight: 700; margin-top: 3px; }

/* ---- Diario di Kot ---- */
.diary-day { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--blue-dark); }
.diary-title { font-size: 20px; font-weight: 800; color: var(--ink); margin: 2px 0 10px; }
.diary-nav { display: flex; gap: 8px; margin-top: 12px; }
.diary-nav .btn { flex: 1; }

/* ---- Idee per Linguao ---- */
.idea-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.idea-input, .idea-textarea { width: 100%; padding: 14px; border: 2px solid var(--line); border-radius: var(--r-md); font-family: "Nunito", sans-serif; font-size: 16px; font-weight: 700; color: var(--text); background: #fff; box-sizing: border-box; transition: border-color .15s, box-shadow .15s; }
.idea-input:focus, .idea-textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(28, 176, 246, .18); }
.idea-textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
.idea-card .idea-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.idea-card .idea-head b { font-size: 16px; font-weight: 800; color: var(--ink); }
.idea-meta { font-size: 12px; color: var(--muted-2); font-weight: 700; margin-top: 2px; }
.idea-vote { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-family: "Nunito", sans-serif; font-weight: 800; font-size: 14px; color: var(--text); cursor: pointer; transition: border-color .15s, background .15s, transform .08s; margin-top: 10px; }
.idea-vote:active { transform: scale(.95); }
.idea-vote.voted { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }

/* ---- Sfida lampo ---- */
.lampo-board { display: flex; gap: 10px; margin-bottom: 14px; }
.lampo-box { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-card); padding: 14px 8px; text-align: center; }
.lampo-box b { display: block; font-size: 30px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.lampo-box span { font-size: 11px; font-weight: 800; color: var(--muted-2); text-transform: uppercase; letter-spacing: .5px; }
.lampo-box.timer b { color: var(--orange); }
.lampo-box.timer.low b { color: var(--red); animation: lampo-blink 1s infinite; }
@keyframes lampo-blink { 50% { opacity: .45; } }
.lampo-q { font-size: 22px; font-weight: 800; color: var(--ink); text-align: center; margin: 6px 0 16px; line-height: 1.3; }
.lampo-streak { text-align: center; font-weight: 800; color: var(--orange); font-size: 15px; margin-top: 10px; }

/* ---- Album adesivi (Profilo) ---- */
.sticker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sticker { border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-card); padding: 10px 6px 8px; text-align: center; }
.sticker img { width: 100%; max-width: 64px; height: auto; display: block; margin: 0 auto 4px; }
.sticker span { font-size: 10px; font-weight: 800; color: var(--muted-2); line-height: 1.25; display: block; }
.sticker:not(.locked) { border-color: #FFE9A8; background: linear-gradient(180deg, #FFFDF3, #FFFFFF); }
.sticker.locked { background: #F2F5F8; }
.sticker.locked img { filter: grayscale(1); opacity: .35; }
.sticker.locked span { color: #B7C0C9; }

/* ---- Interruttore audio (Profilo) ---- */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-weight: 800; color: var(--ink); font-size: 15px; cursor: pointer; }
.switch { position: relative; display: inline-block; width: 54px; height: 32px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #DDE5EC; border-radius: 999px; transition: background .2s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; width: 24px; height: 24px; left: 4px; top: 4px; background: #fff; border-radius: 50%; box-shadow: 0 2px 5px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(22px); }
.switch input:focus-visible + .slider { outline: 3px solid rgba(28, 176, 246, .55); outline-offset: 2px; }

/* ---- v10: animazioni ridotte ---- */
@media (prefers-reduced-motion: reduce) {
  .lampo-box.timer.low b, .longstory-cover img { animation: none; }
  .kot-adventure, .feature-card { transition: none; }
}
