:root {
  --ink: #f7faf7;
  --muted: #94a5a6;
  --night: #050b0f;
  --night-2: #081419;
  --panel: rgba(9, 24, 28, .94);
  --line: rgba(175, 222, 216, .15);
  --petrol: #0c6970;
  --aqua: #6ef3d6;
  --gold: #ffc96b;
  --violet: #9989ff;
  --red: #ff6f7d;
  --green: #5ee6a8;
  --shadow: 0 24px 70px rgba(0, 0, 0, .38);
  font-family: "Didact Gothic", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--night);
}
* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; overflow-x: hidden; overflow-y: auto; background: var(--night); }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow-x: hidden; overflow-y: visible; touch-action: pan-y; background: radial-gradient(circle at 18% -5%, rgba(22, 129, 135, .28), transparent 31rem), radial-gradient(circle at 91% 90%, rgba(103, 67, 183, .18), transparent 34rem), linear-gradient(145deg, #040a0d, #081317 58%, #07090d); }
button, a { font: inherit; }
button { color: inherit; }
a { color: var(--aqua); text-underline-offset: 3px; }
.hidden { display: none !important; }
.app-shell { min-height: 100dvh; height: auto; overflow: visible; padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.topbar { height: 72px; padding: 0 max(20px, calc((100vw - 1120px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.04); }
.brand { display: flex; gap: 11px; align-items: center; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; }
.brand-mark { width: 40px; height: 40px; }
.minimal-mark { display: grid; place-items: center; position: relative; overflow: visible; border-radius: 13px 13px 4px 13px; background: var(--aqua); box-shadow: 0 9px 24px rgba(62,213,193,.18); color: #041012; font: 850 .94rem/1 "Segoe UI",Arial,sans-serif; letter-spacing: -.08em; }
.minimal-mark i { width: 15px; height: 3px; position: absolute; top: 2px; right: -4px; transform: rotate(-39deg); background: var(--gold); box-shadow: 0 0 8px rgba(255,201,107,.65); }
.brand-copy { display: grid; gap: 1px; }
.brand-copy > span { font: 400 1.05rem/1.1 Georgia, serif; letter-spacing: .08em; text-transform: uppercase; }
.brand-copy small { color: var(--muted); font-size: .68rem; letter-spacing: .08em; }
.today-chip { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(6,16,17,.72); color: var(--muted); font-size: .83rem; }
.today-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
main { width: min(100% - 32px, 1120px); margin: 0 auto; overflow: visible; }
.view { overflow: visible; animation: enter .28s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
.eyebrow { margin: 0 0 12px; color: var(--aqua); font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
h1 { max-width: 650px; margin-bottom: 16px; font-size: clamp(2.5rem, 6vw, 5rem); line-height: .98; letter-spacing: -.035em; }
.lede { max-width: 600px; color: #b8c4c3; font-size: 1.03rem; line-height: 1.55; }

.primary, .secondary, .ghost { min-height: 48px; padding: 0 20px; border-radius: 12px; font-weight: 750; letter-spacing: .02em; cursor: pointer; transition: transform .13s, box-shadow .13s, background .13s; }
.primary:disabled, .secondary:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.primary { border: 1px solid var(--aqua); background: var(--aqua); color: #071213; box-shadow: 0 9px 28px rgba(80, 217, 204, .16); }
.secondary { border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--ink); }
.ghost { border: 1px solid rgba(255,255,255,.42); background: transparent; color: var(--ink); }
.primary:hover, .secondary:hover, .ghost:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.primary:focus-visible, .secondary:focus-visible, .ghost:focus-visible, .choice:focus-visible, .bottom-nav button:focus-visible { outline: 3px solid rgba(99,216,205,.35); outline-offset: 3px; }
.text-button { border: 0; background: transparent; color: var(--aqua); cursor: pointer; font-weight: 700; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; }
.centered { justify-content: center; }

.home-stage { min-height: calc(100dvh - 178px); display: grid; grid-template-columns: 1.35fr .65fr; gap: 16px; }
.stage-main { min-height: 560px; padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(135deg, rgba(5,19,21,.9), rgba(11,27,29,.88)); box-shadow: var(--shadow); }
.stage-main::before { content: ""; position: absolute; inset: -20% 10% 30% -20%; background: radial-gradient(ellipse at top, rgba(77, 190, 186, .28), transparent 58%); transform: rotate(-9deg); pointer-events: none; }
.stage-main::after { content: "È  É  Ò  Ó"; position: absolute; right: -8px; bottom: -16px; color: rgba(255,255,255,.035); font: 400 clamp(4rem, 10vw, 9rem)/1 Georgia, serif; letter-spacing: -.12em; pointer-events: none; }
.stage-main > * { position: relative; z-index: 1; }
.stage-brand { color: var(--gold); font: 400 .8rem/1 Georgia, serif; letter-spacing: .18em; text-transform: uppercase; }
.stage-brand span { display: block; margin-top: 6px; color: var(--muted); font-family: inherit; font-size: .65rem; }
.home-side { display: grid; grid-template-rows: auto auto 1fr auto; gap: 12px; }
.completion-card, .home-metrics, .recent-card { border: 1px solid var(--line); background: var(--panel); box-shadow: 0 12px 38px rgba(0,0,0,.2); }
.completion-card { padding: 18px; display: flex; align-items: center; gap: 16px; }
.completion-ring { --progress: 0deg; width: 78px; aspect-ratio: 1; display: grid; place-items: center; position: relative; border-radius: 50%; background: conic-gradient(var(--aqua) var(--progress), rgba(255,255,255,.08) 0); }
.completion-ring::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #0d1c1e; }
.completion-ring strong, .completion-ring small { position: absolute; z-index: 1; }
.completion-ring strong { transform: translateY(-5px); font: 400 1.45rem/1 Georgia, serif; }
.completion-ring small { transform: translateY(12px); color: var(--muted); font-size: .68rem; }
.completion-card > div:last-child { display: grid; gap: 3px; }
.completion-card span, .completion-card small { color: var(--muted); font-size: .76rem; }
.completion-card > div:last-child strong { font: 400 1.25rem/1.1 Georgia, serif; }
.home-metrics { display: grid; grid-template-columns: repeat(3, 1fr); }
.home-metrics div { padding: 15px 8px; text-align: center; border-right: 1px solid var(--line); }
.home-metrics div:last-child { border: 0; }
.home-metrics strong { display: block; margin-bottom: 5px; color: var(--gold); font: 400 1.35rem/1 Georgia, serif; }
.home-metrics span { color: var(--muted); font-size: .68rem; }
.recent-card { padding: 16px; }
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.card-title button { border: 0; background: none; color: var(--aqua); font-size: .7rem; cursor: pointer; }
.quick-words { display: grid; gap: 2px; }
.quick-words div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.quick-words strong { color: var(--gold); font: 400 1rem/1 Georgia, serif; }
.empty-copy { color: var(--muted); }
.promo-card { display: block; padding: 18px; position: relative; overflow: hidden; border: 1px solid rgba(255,201,107,.46); border-radius: 18px; background: radial-gradient(circle at 90% 20%,rgba(153,137,255,.17),transparent 9rem),linear-gradient(135deg,rgba(70,51,27,.55),rgba(10,22,25,.98)); color: var(--ink); text-decoration: none; box-shadow: 0 14px 38px rgba(0,0,0,.24); }
.promo-card::after { content: "OFM"; position: absolute; right: -7px; bottom: -17px; color: rgba(255,201,107,.075); font: 400 4.8rem/1 Georgia,serif; pointer-events: none; }
.promo-card > * { position: relative; z-index: 1; }
.promo-card span { display: block; margin-bottom: 7px; color: var(--gold); font-size: .65rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.promo-card strong { display: block; font: 400 1.15rem/1.15 Georgia, serif; }
.promo-card p { margin: 8px 0; color: #bfc4bd; line-height: 1.45; }
.promo-card b { display: inline-block; margin-top: 9px; padding: 5px 8px; border: 1px solid rgba(110,243,214,.22); border-radius: 999px; color: var(--aqua); font-size: .72rem; }
.promo-card.has-image { min-height: 235px; padding: 20px; display: flex; align-items: flex-end; border-color: rgba(255,201,107,.56); background: #170d09; isolation: isolate; }
.promo-card.has-image::before { position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg,rgba(5,9,10,.96) 0%,rgba(8,12,13,.78) 46%,rgba(8,12,13,.14) 78%),linear-gradient(0deg,rgba(4,8,9,.78),transparent 68%); content: ''; pointer-events: none; }
.promo-card.has-image::after { display: none; }
.promo-card .promo-art { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .5s cubic-bezier(.16,1,.3,1); }
.promo-card.has-image:hover .promo-art { transform: scale(1.035); }
.promo-card .promo-content { position: relative; z-index: 2; width: min(72%,390px); }
.promo-card.has-image strong { max-width: 340px; color: #fff8e9; font-size: 1.38rem; text-shadow: 0 2px 14px rgba(0,0,0,.7); }
.promo-card.has-image p { color: #e6d8c5; }
.promo-card.has-image b { border-color: rgba(255,201,107,.42); background: rgba(15,8,6,.55); color: var(--gold); }

.level-screen { min-height: calc(100dvh - 178px); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.ofm-kicker { margin-bottom: 32px; color: var(--gold); font: 400 .78rem/1 Georgia, serif; letter-spacing: .18em; text-transform: uppercase; }
.ofm-kicker i { margin: 0 8px; color: var(--aqua); font-style: normal; }
.level-intro h1 { margin-bottom: 10px; }
.level-intro > p:last-child { color: var(--muted); }
.level-choices { width: min(100%, 900px); margin: 20px 0 14px; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.level-card { min-height: 180px; padding: 24px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 8px; position: relative; overflow: hidden; border: 1px solid var(--line); background: rgba(12,26,28,.88); text-align: left; cursor: pointer; transition: transform .16s, border-color .16s, background .16s; }
.level-card::before { content: ""; position: absolute; inset: -50% 20% 40% -20%; background: radial-gradient(circle, rgba(99,216,205,.14), transparent 65%); }
.level-card:hover { transform: translateY(-4px); border-color: rgba(99,216,205,.7); background: rgba(15,40,42,.95); }
.level-card.featured { border-color: rgba(228,195,140,.6); }
.level-card > span { position: absolute; top: 18px; color: var(--aqua); font-size: .72rem; letter-spacing: .15em; }
.level-card strong { font: 400 1.65rem/1 Georgia, serif; }
.level-card small { color: var(--muted); }
.level-card em { position: absolute; top: 14px; right: 14px; color: var(--gold); font-size: .65rem; font-style: normal; text-transform: uppercase; letter-spacing: .1em; }
.privacy-note { color: var(--muted); font-size: .75rem; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 26px 0 14px; }
.section-head h2 { margin: 0; font-size: clamp(1.9rem, 4vw, 3.1rem); }
.section-head p { margin: 0; color: var(--muted); }
.route-summary { display: grid; justify-items: end; }
.route-summary strong { color: var(--gold); font: 400 1.7rem/1 Georgia, serif; }
.route-summary span { color: var(--muted); font-size: .75rem; }
.lesson-legend { margin-bottom: 16px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 18px; border: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #596867; }
.dot.complete { background: var(--green); box-shadow: 0 0 10px rgba(87,211,155,.6); }
.dot.started { background: var(--gold); }
.lesson-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; padding-bottom: 24px; }
.lesson-card { min-height: 188px; padding: 16px; display: flex; flex-direction: column; position: relative; border: 1px solid var(--line); background: rgba(11,24,26,.88); text-align: left; cursor: pointer; transition: transform .14s, border-color .14s, background .14s; }
.lesson-card:hover { transform: translateY(-3px); border-color: rgba(99,216,205,.5); background: #10282a; }
.lesson-card.completed { border-color: rgba(87,211,155,.42); background: linear-gradient(145deg, rgba(12,41,35,.96), rgba(10,24,26,.94)); }
.lesson-number { color: var(--aqua); font: 400 1.25rem/1 Georgia, serif; }
.lesson-status { margin: 10px 0 5px; color: var(--muted); font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; }
.lesson-card > strong { font: 400 1.05rem/1.1 Georgia, serif; }
.lesson-score { margin-top: auto; display: grid; }
.lesson-score b { color: var(--gold); font: 400 1.35rem/1 Georgia, serif; }
.lesson-score span, .lesson-card small { color: var(--muted); font-size: .66rem; }
.lesson-progress { height: 4px; margin: 10px 0 7px; overflow: hidden; background: rgba(255,255,255,.08); }
.lesson-progress i { display: block; height: 100%; background: linear-gradient(90deg,var(--aqua),var(--green)); }
.lesson-check { position: absolute; top: 14px; right: 14px; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--green); border-radius: 50%; color: var(--green); }

.word-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.word-filters button { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--muted); cursor: pointer; }
.word-filters button.active { border-color: var(--aqua); background: rgba(99,216,205,.1); color: var(--ink); }
.word-filters b { margin-left: 5px; color: var(--gold); }
.memory-explainer { margin-bottom: 12px; padding: 12px 15px; display: flex; align-items: center; gap: 12px; border: 1px solid rgba(110,243,214,.18); background: rgba(110,243,214,.045); }
.memory-explainer p { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.memory-explainer strong { color: var(--ink); }
.word-list { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; padding-bottom: 24px; }
.word-row { min-height: 70px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); background: rgba(10,24,26,.86); color: var(--ink); text-decoration: none; }
.word-row > div { display: grid; gap: 3px; }
.word-row > div:last-child { justify-items: end; }
.word-row span, .word-row small { color: var(--muted); font-size: .72rem; }
.word-row strong { color: var(--gold); font: 400 1.25rem/1 Georgia, serif; }
.word-row b { color: var(--aqua); font-size: .75rem; }
.word-row em { max-width: 28rem; color: var(--muted); font-size: .76rem; font-style: normal; line-height: 1.35; }
.word-row .word-memory { min-width: 118px; gap: 5px; }
.word-row .word-memory > em { color: #718383; font-size: .62rem; }
.word-row .word-memory.stable small { color: var(--green); }
.word-row .word-memory.weak small { color: #ff9ca3; }
.memory-pips { display: inline-flex; gap: 4px; align-items: center; }
.memory-pips i { width: 16px; height: 4px; display: block; border-radius: 999px; background: rgba(255,255,255,.11); }
.memory-pips i.on { background: linear-gradient(90deg,var(--aqua),var(--green)); box-shadow: 0 0 7px rgba(110,243,214,.24); }
.word-row.has-context { min-height: 86px; }
.empty-state { grid-column: 1/-1; padding: 50px; display: grid; justify-items: center; gap: 8px; border: 1px solid var(--line); color: var(--muted); }

.session { width: min(100%,720px); margin: 12px auto; }
.session-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; margin-bottom: 14px; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); background: rgba(255,255,255,.04); cursor: pointer; }
.progress-track { height: 5px; overflow: hidden; background: rgba(255,255,255,.09); }
.progress-fill { height: 100%; background: linear-gradient(90deg,var(--aqua),var(--green)); transition: width .28s ease; }
.progress-fill.recovery { background: linear-gradient(90deg,var(--gold),#e07c6f); }
.counter { min-width: 55px; color: var(--muted); font-size: .78rem; font-weight: 700; text-align: right; }
.recovery-counter { color: var(--gold); min-width: 110px; }
.question-card { min-height: 540px; padding: clamp(24px,5vw,46px); display: flex; flex-direction: column; position: relative; overflow: hidden; border: 1px solid var(--line); background: rgba(10,23,25,.95); box-shadow: var(--shadow); }
.question-card::before { content: ""; position: absolute; inset: -40% 20% 45% -20%; background: radial-gradient(circle,rgba(99,216,205,.14),transparent 62%); pointer-events: none; }
.question-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .78rem; }
.pill { padding: 5px 9px; border: 1px solid rgba(99,216,205,.28); color: var(--aqua); font-weight: 700; }
.word-stage { margin: auto 0; text-align: center; }
.word { margin: 0; color: var(--ink); text-align: center; font: 400 clamp(3.4rem,12vw,7rem)/1 Georgia,serif; letter-spacing: -.045em; text-shadow: 0 0 35px rgba(99,216,205,.1); }
.word-context { max-width: 34rem; margin: 14px auto 0; color: #d6dddc; font-size: 1rem; line-height: 1.45; }
.word-context span { display: block; margin-bottom: 4px; color: var(--aqua); font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.prompt { text-align: center; color: var(--muted); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.choice { min-height: 68px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.035); cursor: pointer; font-size: 1rem; font-weight: 750; transition: background .13s,border-color .13s,transform .13s; }
.choice:hover { transform: translateY(-2px); border-color: var(--aqua); background: rgba(99,216,205,.08); }
.choice .key { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 8px; border: 1px solid var(--line); color: var(--aqua); }
.choice.right-answer { border-color: var(--green); background: rgba(87,211,155,.13); color: var(--green); box-shadow: inset 0 0 0 1px rgba(87,211,155,.22), 0 0 24px rgba(87,211,155,.08); }
.choice.wrong-answer { border-color: var(--red); background: rgba(215,107,114,.2); color: #ffd8db; box-shadow: inset 0 0 0 1px rgba(215,107,114,.34), 0 0 28px rgba(215,107,114,.13); }
.feedback { margin-top: 14px; padding: 16px; display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; border: 1px solid transparent; border-left-width: 5px; animation: feedbackRise .36s cubic-bezier(.2,.8,.2,1) both; }
.feedback.good { border-color: rgba(87,211,155,.65); background: linear-gradient(135deg,rgba(42,115,83,.3),rgba(18,53,43,.24)); box-shadow: 0 12px 34px rgba(32,119,82,.12); }
.feedback.bad { border-color: rgba(215,107,114,.85); background: linear-gradient(135deg,rgba(139,37,48,.42),rgba(77,20,29,.36)); box-shadow: 0 12px 36px rgba(146,31,45,.2); }
.feedback span { display: block; margin-bottom: 4px; color: var(--muted); font-size: .62rem; font-weight: 800; letter-spacing: .12em; }
.feedback strong { display: block; color: var(--gold); font: 400 1.35rem/1.1 Georgia,serif; }
.feedback p { margin: 5px 0 0; color: #bac5c4; }
.feedback.bad span { color: #ff9ca3; }
.feedback.bad strong { color: #fff0f1; }
.feedback.bad p { color: #ffd4d7; }
.feedback.bad a { color: #ffd0a8; }
.feedback.bad .primary { border-color: #ff9ca3; background: #ff9ca3; color: #30090f; box-shadow: 0 9px 28px rgba(215,107,114,.2); }
.contrast-note { margin-top: 10px; padding: 9px 11px; border: 1px solid rgba(228,195,140,.28); background: rgba(228,195,140,.07); color: #e8ddd0; font-size: .8rem; line-height: 1.35; }
.contrast-note b { margin-right: 8px; color: var(--gold); font-size: .62rem; letter-spacing: .12em; }
.question-card.is-correct { animation: correctStage .7s cubic-bezier(.2,.8,.2,1); }
.question-card.is-wrong { border-color: rgba(215,107,114,.62); animation: wrongStage .48s cubic-bezier(.36,.07,.19,.97); }
.answer-mark { position: absolute; z-index: 8; top: 39%; left: 50%; opacity: 0; color: var(--green); font: 700 clamp(4.5rem,11vw,6.6rem)/1 Georgia,serif; text-shadow: 0 0 12px rgba(87,211,155,.8), 0 0 42px rgba(87,211,155,.5); pointer-events: none; animation: answerMark .84s cubic-bezier(.16,1,.3,1) both; }
.answer-mark.bad { color: #ff7d86; text-shadow: 0 0 12px rgba(255,125,134,.85), 0 0 42px rgba(215,107,114,.52); }
@keyframes answerMark { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.42) rotate(-6deg); } 20% { opacity: 1; transform: translate(-50%,-50%) scale(1.22) rotate(2deg); } 42%,68% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 100% { opacity: 0; transform: translate(-50%,-68%) scale(.88); } }
@keyframes feedbackRise { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@keyframes correctStage { 38% { border-color: rgba(87,211,155,.8); box-shadow: inset 0 0 115px rgba(87,211,155,.2), 0 0 46px rgba(87,211,155,.16), var(--shadow); transform: scale(1.008); } }
@keyframes wrongStage { 18%,54% { transform: translateX(-7px); } 36%,72% { transform: translateX(7px); } 45% { box-shadow: inset 0 0 115px rgba(215,107,114,.24), 0 0 40px rgba(215,107,114,.12), var(--shadow); } }

.recovery-gate, .summary-stage { width: min(100%,760px); min-height: 560px; margin: 18px auto; padding: clamp(30px,6vw,64px); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; border: 1px solid var(--line); background: rgba(9,22,24,.96); text-align: center; box-shadow: var(--shadow); }
.gate-light, .spotlight { position: absolute; inset: -70% 8% 48%; background: radial-gradient(ellipse,rgba(228,195,140,.3),transparent 63%); pointer-events: none; }
.recovery-gate h2, .summary-stage h2 { position: relative; margin-bottom: 12px; font-size: clamp(2.2rem,6vw,4rem); }
.recovery-gate p:not(.eyebrow) { max-width: 500px; color: var(--muted); line-height: 1.55; }
.final-score { width: 154px; aspect-ratio: 1; margin: 16px auto; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; border: 1px solid rgba(228,195,140,.6); border-radius: 50%; box-shadow: 0 0 45px rgba(228,195,140,.12); }
.final-score strong { color: var(--gold); font: 400 3.3rem/1 Georgia,serif; }
.final-score span { color: var(--muted); }
.final-score small { position: absolute; top: calc(100% + 8px); width: 200px; color: var(--muted); font-size: .7rem; }
.result-grid { width: min(100%,620px); margin: 26px 0 16px; display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--line); }
.result-grid div { padding: 14px; border-right: 1px solid var(--line); }
.result-grid div:last-child { border: 0; }
.result-grid strong { display: block; color: var(--aqua); font: 400 1.5rem/1 Georgia,serif; }
.result-grid span { color: var(--muted); font-size: .68rem; }
.result-note { max-width: 550px; color: var(--muted); }
.summary-stage .promo-card { width: min(100%,560px); margin: 8px 0 16px; text-align: left; }
.summary-stage .promo-card.has-image { min-height: 210px; }

.sources-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-bottom: 24px; }
.content-card { padding: clamp(22px,4vw,36px); border: 1px solid var(--line); background: rgba(10,23,25,.9); }
.content-card h2 { font-size: 1.7rem; }
.content-card p, .content-card li { color: var(--muted); line-height: 1.6; }
.ambiguity-list { display: grid; gap: 8px; }
.ambiguity { padding: 13px; border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.ambiguity strong { color: var(--gold); }
.ambiguity p { margin: 4px 0; }
.ambiguity-links { font-size: .72rem; }
.local-data { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }

.bottom-nav { position: fixed; z-index: 20; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 24px),620px); padding: 6px; display: grid; grid-template-columns: repeat(5,1fr); gap: 3px; border: 1px solid var(--line); border-radius: 18px; background: rgba(5,14,17,.93); box-shadow: 0 18px 45px rgba(0,0,0,.42); backdrop-filter: blur(18px); }
.bottom-nav button { border: 0; background: transparent; padding: 7px 4px; color: var(--muted); cursor: pointer; font-size: .72rem; }
.bottom-nav button span { display: block; height: 19px; font-size: .95rem; }
.bottom-nav button.active { background: rgba(99,216,205,.1); color: var(--aqua); }

/* Identità e progressione */
.onboarding .topbar, .onboarding .bottom-nav { display: none; }
.onboarding .app-shell { padding: 0; }
.onboarding main { width: 100%; }
.seal-mini { color: var(--gold); filter: drop-shadow(0 0 7px rgba(255,201,107,.5)); }
.seal-row { display: inline-flex; gap: 4px; align-items: center; }
.seal-row i { color: rgba(255,255,255,.12); font-size: .7rem; font-style: normal; }
.seal-row i.earned { color: var(--gold); filter: drop-shadow(0 0 5px rgba(255,201,107,.45)); animation: sealBreathe 2.8s ease-in-out infinite; }
@keyframes sealBreathe { 50% { filter: drop-shadow(0 0 10px rgba(255,201,107,.75)); transform: scale(1.08); } }

.welcome-screen { width: 100%; min-height: 100dvh; padding: clamp(40px,6vh,72px) 24px; display: grid; grid-template-rows: auto auto; place-content: center; place-items: center; gap: clamp(26px,4vh,44px); position: relative; overflow: hidden; background: radial-gradient(circle at 50% 42%,rgba(18,127,125,.25),transparent 29rem),radial-gradient(circle at 74% 20%,rgba(153,137,255,.1),transparent 20rem),linear-gradient(145deg,#03090c,#071519 60%,#070a0e); isolation: isolate; }
.welcome-screen::before { content: ""; position: absolute; width: min(70vw,720px); aspect-ratio: 1; border: 1px solid rgba(110,243,214,.13); transform: rotate(45deg); box-shadow: 0 0 0 74px rgba(110,243,214,.025),0 0 0 148px rgba(153,137,255,.018); z-index: -1; animation: orbitPulse 6s ease-in-out infinite; }
.welcome-screen::after { content: ""; position: absolute; inset: 22px; z-index: -1; border: 1px solid rgba(255,255,255,.045); pointer-events: none; }
.welcome-grid { position: absolute; inset: 0; z-index: -2; opacity: .16; background-image: linear-gradient(rgba(110,243,214,.12) 1px,transparent 1px),linear-gradient(90deg,rgba(110,243,214,.12) 1px,transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(circle at center,black,transparent 65%); }
@keyframes orbitPulse { 50% { transform: rotate(45deg) scale(1.035); opacity: .72; } }
.welcome-lockup { align-self: auto; text-align: center; }
.welcome-emblem { width: 94px; height: 94px; margin: 0 auto 34px; border-radius: 28px 28px 7px 28px; font-size: 2.6rem; filter: drop-shadow(0 18px 26px rgba(0,0,0,.35)); animation: emblemEnter .9s cubic-bezier(.16,1,.3,1) both; }
.welcome-emblem i { width: 31px; height: 5px; top: 7px; right: -7px; }
@keyframes emblemEnter { from { opacity: 0; transform: translateY(18px) scale(.72) rotate(-8deg); } }
.welcome-kicker { margin: 0 0 13px; color: var(--aqua); font-size: .66rem; font-weight: 800; letter-spacing: .25em; text-transform: uppercase; }
.welcome-lockup h1 { max-width: none; margin: 0; display: flex; justify-content: center; align-items: baseline; gap: .16em; font-size: clamp(4rem,10vw,7.8rem); letter-spacing: -.065em; }
.welcome-lockup h1 > span:last-child { position: relative; color: var(--gold); font-style: italic; }
.welcome-lockup h1 i { position: absolute; width: .34em; height: .035em; top: -.02em; right: .05em; transform: rotate(-38deg); background: var(--aqua); box-shadow: 0 0 14px rgba(110,243,214,.7); }
.welcome-credit { margin: 15px 0 0; color: var(--muted); font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; }
.welcome-credit strong { color: #dce7e5; font-weight: 700; }
.welcome-action { align-self: auto; display: grid; justify-items: center; gap: 12px; }
.welcome-cta { min-width: 260px; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-inline: 22px; border-radius: 2px; box-shadow: 0 16px 42px rgba(68,215,194,.2); }
.welcome-cta span { font-size: 1.25rem; transition: transform .18s; }
.welcome-cta:hover span { transform: translateX(4px); }
.welcome-action small { color: #758586; font-size: .72rem; }
.welcome-orbit { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.welcome-orbit span { position: absolute; color: rgba(255,255,255,.045); font: 400 clamp(3rem,8vw,7rem)/1 Georgia,serif; }
.welcome-orbit span:nth-child(1) { top: 12%; left: 12%; transform: rotate(-12deg); }
.welcome-orbit span:nth-child(2) { top: 18%; right: 11%; transform: rotate(9deg); }
.welcome-orbit span:nth-child(3) { bottom: 14%; left: 17%; transform: rotate(8deg); }
.welcome-orbit span:nth-child(4) { right: 17%; bottom: 12%; transform: rotate(-8deg); }

.dashboard { min-height: calc(100dvh - 176px); display: grid; grid-template-columns: 1.35fr .65fr; gap: 14px; }
.continue-panel { min-height: 560px; padding: clamp(30px,6vw,72px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg, rgba(7,28,31,.96), rgba(7,15,19,.97)); box-shadow: var(--shadow); }
.continue-panel::before { content: ""; position: absolute; width: 520px; height: 520px; top: -310px; left: -120px; border: 1px solid rgba(110,243,214,.2); border-radius: 50%; box-shadow: 0 0 90px rgba(110,243,214,.1); }
.continue-panel::after { content: "È É Ò Ó"; position: absolute; right: -18px; bottom: -20px; color: rgba(255,255,255,.035); font: 400 clamp(5rem,10vw,9rem)/1 Georgia,serif; letter-spacing: -.13em; }
.continue-panel > * { position: relative; z-index: 1; }
.continue-copy p:last-child { color: var(--muted); font-size: 1rem; }
.dashboard-side { display: grid; grid-template-rows: auto auto 1fr auto; gap: 12px; }
.metric-strip, .general-card { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.metric-strip { display: grid; grid-template-columns: repeat(3,1fr); }
.metric-strip div { padding: 18px 8px; text-align: center; border-right: 1px solid var(--line); }
.metric-strip div:last-child { border: 0; }
.metric-strip strong { display: block; color: var(--gold); font: 400 1.55rem/1 Georgia,serif; }
.metric-strip span { color: var(--muted); font-size: .68rem; }
.general-card { padding: 22px; position: relative; overflow: hidden; }
.general-card::after { content: "?"; position: absolute; right: -8px; bottom: -28px; color: rgba(153,137,255,.09); font: 400 8rem/1 Georgia,serif; }
.general-card > * { position: relative; z-index: 1; }
.general-card .micro-label { display: block; margin-bottom: 14px; color: var(--violet); font-size: .68rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.general-card strong { display: block; font: 400 1.35rem/1.1 Georgia,serif; }
.general-card p { margin: 9px 0 16px; color: var(--muted); line-height: 1.45; }
.general-card.locked { background: rgba(9,19,23,.75); }
.dashboard-side .recent-card { border-radius: 18px; }
.mobile-promo { display: none; }
.dashboard-side .promo-card { padding: 15px 17px; }
.dashboard-side .promo-card p { margin: 5px 0; font-size: .78rem; }

.seal-total { min-width: 96px; display: grid; grid-template-columns: auto auto; justify-content: end; align-items: center; gap: 0 8px; }
.seal-total > span { grid-row: 1/3; color: var(--gold); font-size: 1.5rem; filter: drop-shadow(0 0 10px rgba(255,201,107,.4)); }
.seal-total strong { color: var(--gold); font: 400 1.75rem/1 Georgia,serif; }
.seal-total small { color: var(--muted); font-size: .67rem; }
.path-key { margin-bottom: 8px; display: flex; justify-content: center; gap: 18px; color: var(--muted); font-size: .72rem; }
.path-key i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; }
.key-current { background: var(--aqua); box-shadow: 0 0 8px var(--aqua); }
.key-done { background: var(--green); }
.key-special { background: var(--violet); }
.seal-guide { width: min(100%,760px); margin: 14px auto 0; border: 1px solid rgba(255,201,107,.2); border-radius: 16px; background: linear-gradient(120deg,rgba(62,46,20,.24),rgba(9,22,25,.84)); overflow: hidden; }
.seal-guide summary { min-height: 64px; padding: 10px 16px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; cursor: pointer; list-style: none; }
.seal-guide summary::-webkit-details-marker { display: none; }
.seal-guide-icon { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,201,107,.32); transform: rotate(45deg); color: var(--gold); filter: drop-shadow(0 0 8px rgba(255,201,107,.3)); }
.seal-guide summary > span:nth-child(2) { display: grid; gap: 3px; }
.seal-guide summary strong { font-size: .83rem; }
.seal-guide summary small { color: var(--muted); font-size: .68rem; }
.seal-guide summary > b { color: var(--gold); font-size: 1.2rem; font-weight: 400; transition: transform .2s; }
.seal-guide[open] summary > b { transform: rotate(45deg); }
.seal-rules { padding: 0 16px 16px; display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.seal-rules > div { min-height: 92px; padding: 13px; display: grid; align-content: end; gap: 4px; border: 1px solid rgba(255,255,255,.075); background: rgba(255,255,255,.025); }
.seal-rules span { color: var(--gold); font-size: .66rem; letter-spacing: .16em; }
.seal-rules strong { font: 400 1rem/1 Georgia,serif; }
.seal-rules small { color: var(--muted); font-size: .65rem; line-height: 1.35; }
.route-map { width: min(100%,760px); margin: 0 auto; padding: 30px 0 100px; position: relative; }
.route-map::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%); background: linear-gradient(var(--aqua), rgba(110,243,214,.18) 65%, rgba(255,255,255,.05)); box-shadow: 0 0 18px rgba(110,243,214,.18); }
.path-step { min-height: 154px; display: flex; align-items: center; position: relative; }
.path-step.left, .path-step.right { justify-content: center; }
.path-node { width: 116px; height: 116px; display: grid; place-content: center; justify-items: center; position: relative; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; background: #091519; cursor: pointer; box-shadow: 0 16px 35px rgba(0,0,0,.3); transition: transform .18s,border-color .18s,box-shadow .18s; }
.path-step.left .path-node { margin-right: 110px; }
.path-step.right .path-node { margin-left: 110px; }
.path-node:hover:not(.locked) { transform: scale(1.055); }
.path-node b { font: 400 1.65rem/1 Georgia,serif; }
.path-node small { margin: 5px 0; color: var(--muted); font-size: .63rem; }
.path-node .node-halo { position: absolute; inset: -8px; border: 1px solid transparent; border-radius: inherit; }
.path-node.available { border-color: var(--aqua); background: radial-gradient(circle,rgba(31,112,108,.52),#091519 68%); box-shadow: 0 0 0 7px rgba(110,243,214,.06),0 0 38px rgba(110,243,214,.22); }
.path-node.available .node-halo { border-color: rgba(110,243,214,.24); animation: nodePing 2s ease-out infinite; }
@keyframes nodePing { 70%,100% { inset: -22px; opacity: 0; } }
.path-node.completed, .path-node.mastered { border-color: var(--green); background: radial-gradient(circle,rgba(39,111,79,.55),#091519 70%); }
.path-node.mastered { box-shadow: 0 0 34px rgba(94,230,168,.2); }
.path-node.validated { border-style: dashed; border-color: rgba(153,137,255,.6); }
.path-node.locked { opacity: .43; cursor: not-allowed; filter: saturate(.4); }
.path-node.coming { border-style: dashed; border-color: rgba(153,137,255,.55); background: radial-gradient(circle,rgba(74,57,139,.3),#091519 70%); cursor: default; box-shadow: 0 0 34px rgba(153,137,255,.12); }
.path-node.coming b { color: #c9c1ff; }
.path-node.coming small { color: var(--violet); text-transform: uppercase; letter-spacing: .07em; }
.coming-note { width: 190px; min-height: 72px; padding: 13px 15px; display: grid; align-content: center; gap: 4px; position: absolute; right: calc(50% + 104px); border: 1px dashed rgba(153,137,255,.32); border-radius: 16px; background: rgba(28,23,56,.34); }
.coming-note span { color: var(--violet); font-size: .6rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.coming-note strong { font: 400 1rem/1.2 Georgia,serif; }
.special-branch { width: 190px; min-height: 84px; padding: 12px; display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 10px; position: absolute; top: 35px; border: 1px solid rgba(153,137,255,.4); border-radius: 16px; background: linear-gradient(135deg,rgba(54,43,110,.45),rgba(9,20,24,.96)); text-align: left; cursor: pointer; box-shadow: 0 14px 32px rgba(0,0,0,.28); }
.path-step.left .special-branch { left: calc(50% + 104px); }
.path-step.right .special-branch { right: calc(50% + 104px); }
.special-branch .branch-icon { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(153,137,255,.55); border-radius: 12px; color: #c9c1ff; font: 700 .85rem/1 Georgia,serif; }
.special-branch > span:nth-child(2) { display: grid; gap: 2px; }
.special-branch small { color: var(--violet); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; }
.special-branch strong { font: 400 .98rem/1 Georgia,serif; }
.special-branch em { color: var(--muted); font-size: .62rem; font-style: normal; }
.special-branch .seal-row { grid-column: 2; }
.special-branch.locked { opacity: .42; cursor: not-allowed; }

.lesson-filters { margin-bottom: 14px; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.lesson-filters::-webkit-scrollbar { display: none; }
.lesson-filters button { min-height: 40px; padding: 0 15px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.025); color: var(--muted); cursor: pointer; }
.lesson-filters button.active { border-color: var(--aqua); background: rgba(110,243,214,.1); color: var(--ink); }
.lesson-card { border-radius: 17px; overflow: hidden; }
.lesson-card .seal-row { position: absolute; top: 15px; right: 13px; }
.lesson-card.available { border-color: rgba(110,243,214,.55); box-shadow: inset 0 0 36px rgba(110,243,214,.05); }
.lesson-card.validated { border-style: dashed; border-color: rgba(153,137,255,.45); }
.lesson-card.locked { opacity: .48; cursor: not-allowed; filter: saturate(.35); }
.lesson-card.mastered { border-color: var(--green); background: linear-gradient(145deg,rgba(11,53,39,.85),rgba(8,22,25,.96)); }
.special-card { min-height: 240px; border-color: rgba(153,137,255,.35); background: linear-gradient(145deg,rgba(40,31,83,.3),rgba(9,22,25,.96)); }
.special-card p { margin: 8px 0 10px; color: var(--muted); font-size: .76rem; line-height: 1.4; }

.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.stat-hero, .stat-card, .test-lab, .history-card, .method-card, .reset-zone { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.stat-hero, .stat-card { min-height: 150px; padding: 20px; display: flex; flex-direction: column; justify-content: flex-end; }
.stat-hero { grid-column: span 2; position: relative; overflow: hidden; background: linear-gradient(135deg,rgba(25,85,82,.55),rgba(8,20,24,.96)); }
.stat-hero::after { content: "ÈÉÒÓ"; position: absolute; top: -10px; right: -14px; color: rgba(255,255,255,.045); font: 400 5.5rem/1 Georgia,serif; letter-spacing: -.15em; }
.stat-hero span, .stat-card span { color: var(--muted); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.stat-hero strong, .stat-card strong { margin: 7px 0 4px; color: var(--gold); font: 400 2rem/1 Georgia,serif; }
.stat-hero small, .stat-card small { color: var(--muted); }
.rank-hero em { margin-top: 7px; color: #b7c5c3; font-size: .72rem; font-style: normal; }
.share-profile-button { width: fit-content; margin-top: 16px; padding: 10px 13px; display: inline-flex; align-items: center; gap: 9px; position: relative; z-index: 1; border: 1px solid rgba(110,243,214,.34); border-radius: 999px; background: rgba(6,28,29,.62); color: var(--aqua); font: 750 .72rem/1 "Segoe UI",sans-serif; cursor: pointer; }
.share-profile-button span { color: var(--gold); font-size: .95rem; line-height: 1; }
.share-profile-button:hover { border-color: var(--aqua); background: rgba(27,78,72,.58); transform: translateY(-1px); }
.rank-progress { width: min(100%,460px); height: 6px; margin-top: 14px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.09); }
.rank-progress i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg,var(--aqua),var(--gold)); box-shadow: 0 0 14px rgba(110,243,214,.2); }
.stat-card i { --value: 0%; height: 4px; margin-top: 12px; position: relative; overflow: hidden; background: rgba(255,255,255,.08); }
.stat-card i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--value); background: linear-gradient(90deg,var(--aqua),var(--violet)); }
.rank-ladder { margin-top: 12px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(135deg,rgba(13,43,45,.7),rgba(8,20,24,.96)); }
.rank-ladder-head { margin-bottom: 16px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.rank-ladder-head h3 { margin: 0; font: 400 1.65rem/1.1 Georgia,serif; }
.rank-ladder-head > div:last-child { display: grid; justify-items: end; gap: 3px; }
.rank-ladder-head > div:last-child strong { color: var(--gold); font: 400 1.5rem/1 Georgia,serif; }
.rank-ladder-head > div:last-child span { color: var(--muted); font-size: .72rem; }
.rank-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.rank-tier { min-height: 96px; padding: 13px; display: grid; align-content: end; gap: 4px; position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,.08); border-radius: 13px; background: rgba(255,255,255,.025); }
.rank-tier > span { position: absolute; top: 11px; left: 12px; color: #627474; font: 700 .67rem/1 "Segoe UI",sans-serif; letter-spacing: .08em; }
.rank-tier strong { font: 400 .98rem/1.15 Georgia,serif; }
.rank-tier small { color: var(--muted); font-size: .68rem; }
.rank-tier.unlocked { border-color: rgba(94,230,168,.25); background: rgba(34,105,76,.09); }
.rank-tier.unlocked > span { color: var(--green); }
.rank-tier.current { border-color: var(--gold); background: linear-gradient(145deg,rgba(102,70,23,.32),rgba(15,35,35,.9)); box-shadow: inset 0 0 26px rgba(255,201,107,.06),0 0 22px rgba(255,201,107,.08); }
.rank-tier.current::after { content: "ATTUALE"; position: absolute; top: 10px; right: 10px; color: var(--gold); font-size: .55rem; font-weight: 800; letter-spacing: .1em; }
.rank-tier.current > span { color: var(--gold); }
.rank-tier.locked { opacity: .48; filter: saturate(.4); }
.test-lab { margin-top: 12px; padding: 26px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; background: linear-gradient(135deg,rgba(48,38,103,.32),rgba(8,20,24,.96)); }
.test-lab h3 { margin-bottom: 8px; font: 400 1.8rem/1.1 Georgia,serif; }
.test-lab p:not(.eyebrow) { max-width: 600px; color: var(--muted); line-height: 1.5; }
.test-record { min-width: 145px; aspect-ratio: 1; display: grid; place-content: center; justify-items: center; border: 1px solid rgba(153,137,255,.45); border-radius: 50%; }
.test-record span, .test-record small { color: var(--muted); font-size: .68rem; }
.test-record strong { margin: 4px 0; color: #d2ccff; font: 400 2.1rem/1 Georgia,serif; }
.history-card { margin-top: 12px; padding: 20px; }
.score-chart { min-height: 170px; padding: 20px 8px 0; display: flex; align-items: end; justify-content: space-around; gap: 10px; border-top: 1px solid rgba(255,255,255,.05); }
.chart-bar { height: 140px; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: end; position: relative; }
.chart-bar i { width: min(34px,80%); min-height: 8px; display: block; border-radius: 8px 8px 2px 2px; background: linear-gradient(var(--violet),var(--aqua)); box-shadow: 0 0 18px rgba(110,243,214,.12); }
.chart-bar span { position: absolute; bottom: calc(var(--bar,0%) + 4px); color: var(--ink); font-size: .68rem; }
.chart-bar small { margin-top: 5px; color: var(--muted); }
.chart-empty { margin: auto; color: var(--muted); }
.method-card { margin-top: 12px; padding: 0 22px; }
.method-card summary { padding: 20px 0; cursor: pointer; font-weight: 750; }
.method-grid { padding: 0 0 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.method-grid p { color: var(--muted); line-height: 1.55; }
.reset-zone { margin: 12px 0 28px; padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.reset-zone p { margin: 5px 0 0; color: var(--muted); font-size: .8rem; }
.danger, .danger-text { color: #ff929c; }
.danger { min-height: 42px; padding: 0 14px; border: 1px solid rgba(255,111,125,.5); border-radius: 10px; background: rgba(108,25,36,.35); cursor: pointer; }
.reset-confirm { display: flex; align-items: center; gap: 8px; }
.placement-split { width: min(100%,520px); margin: 8px 0 2px; display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--line); }
.placement-split div { padding: 12px; border-right: 1px solid var(--line); }
.placement-split div:last-child { border: 0; }
.placement-split span { display: block; color: var(--muted); font-size: .68rem; }
.placement-split strong { color: var(--aqua); font: 400 1.25rem/1 Georgia,serif; }
.seal-unlock { margin: 5px 0; padding: 10px 16px; display: flex; align-items: center; gap: 11px; border: 1px solid rgba(255,201,107,.35); border-radius: 14px; background: rgba(94,67,24,.22); animation: sealReveal .7s cubic-bezier(.16,1,.3,1) both; }
.seal-unlock > span { color: var(--gold); font-size: 1.8rem; filter: drop-shadow(0 0 12px rgba(255,201,107,.55)); }
.seal-unlock div { display: grid; text-align: left; }
.seal-unlock strong { color: var(--gold); }
.seal-unlock small { color: var(--muted); }
@keyframes sealReveal { from { opacity: 0; transform: scale(.72) rotate(-3deg); } 60% { transform: scale(1.05); } }
.grammar-tag { width: fit-content; margin: 10px auto 0; padding: 6px 9px; border: 1px solid rgba(153,137,255,.35); border-radius: 999px; color: #c8c1ff; font-size: .68rem; }
.app-toast { position: fixed; z-index: 80; left: 50%; bottom: calc(94px + env(safe-area-inset-bottom)); max-width: min(90vw,440px); padding: 12px 16px; transform: translate(-50%,20px); opacity: 0; border: 1px solid var(--line); border-radius: 12px; background: #0b1c20; box-shadow: var(--shadow); color: var(--ink); pointer-events: none; transition: opacity .2s,transform .2s; }
.app-toast.show { opacity: 1; transform: translate(-50%,0); }
.modal-open { overflow: hidden; }
.share-modal { position: fixed; z-index: 120; inset: 0; padding: 24px; display: grid; place-items: center; overflow-y: auto; background: rgba(1,7,9,.84); backdrop-filter: blur(16px); animation: shareFade .22s ease-out both; }
.share-dialog { width: min(100%,470px); max-height: calc(100dvh - 48px); padding: 22px; overflow-y: auto; border: 1px solid rgba(110,243,214,.24); border-radius: 24px; background: linear-gradient(155deg,#0c2426,#071417 68%); box-shadow: 0 30px 90px rgba(0,0,0,.65),0 0 48px rgba(110,243,214,.08); animation: shareRise .36s cubic-bezier(.16,1,.3,1) both; }
.share-dialog-head { margin-bottom: 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.share-dialog-head h2 { margin: 3px 0 0; font: 400 1.9rem/1.05 Georgia,serif; }
.share-close { width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.04); color: var(--ink); font-size: 1.4rem; cursor: pointer; }
.share-preview { width: min(100%,350px); margin: 0 auto; padding: 7px; border: 1px solid rgba(255,201,107,.23); border-radius: 19px; background: rgba(255,255,255,.035); box-shadow: 0 18px 50px rgba(0,0,0,.32); }
.share-preview canvas { width: 100%; height: auto; display: block; border-radius: 13px; background: #071719; }
.share-note { margin: 15px 0; color: var(--muted); font-size: .76rem; line-height: 1.5; text-align: center; }
.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.share-actions button { width: 100%; }
@keyframes shareFade { from { opacity: 0; } }
@keyframes shareRise { from { opacity: 0; transform: translateY(24px) scale(.97); } }

@media (max-width: 900px) {
  .home-stage { grid-template-columns: 1fr; }
  .home-side { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
  .dashboard { grid-template-columns: 1fr; }
  .dashboard-side { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
  .dashboard-side .metric-strip { grid-column: 1/-1; }
  .lesson-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 620px) {
  .app-shell { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .topbar { height: 60px; padding: 0 13px; }
  .brand-copy > span { font-size: .84rem; }
  .brand-copy small { font-size: .56rem; }
  .today-chip { padding: 7px 9px; }
  main { width: calc(100% - 20px); }
  #path-view, #lessons-view, #words-view, #stats-view, #session-view.scrollable-view {
    height: calc(100dvh - 60px);
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
    scrollbar-width: thin;
  }
  .home-stage { min-height: calc(100dvh - 148px); display: block; }
  .stage-main { min-height: calc(100dvh - 148px); padding: 24px 20px; }
  .stage-main h1 { font-size: clamp(2.65rem,14vw,4.2rem); }
  .home-side { display: none; }
  .welcome-screen { min-height: 100dvh; padding: max(28px,env(safe-area-inset-top)) 20px max(26px,env(safe-area-inset-bottom)); grid-template-rows: auto auto; place-content: center; gap: clamp(24px,5dvh,42px); }
  .welcome-screen::before { width: 88vw; box-shadow: 0 0 0 38px rgba(110,243,214,.025),0 0 0 76px rgba(153,137,255,.018); }
  .welcome-screen::after { inset: 12px; }
  .welcome-grid { background-size: 38px 38px; }
  .welcome-lockup { align-self: auto; }
  .welcome-emblem { width: 76px; height: 76px; margin-bottom: 25px; font-size: 2.05rem; }
  .welcome-lockup h1 { display: grid; justify-items: center; gap: 0; font-size: clamp(3.85rem,18vw,5.4rem); line-height: .8; }
  .welcome-lockup h1 > span:last-child { transform: none; }
  .welcome-kicker { margin-bottom: 17px; font-size: .58rem; }
  .welcome-credit { margin-top: 22px; }
  .welcome-action { width: 100%; align-self: auto; }
  .welcome-cta { width: min(100%,360px); }
  .welcome-action small { font-size: .63rem; }
  .dashboard { min-height: calc(100dvh - 148px); display: block; }
  .continue-panel { min-height: calc(100dvh - 148px); padding: 20px; gap: 18px; border-radius: 18px; }
  .stage-brand { min-width: 0; font-size: .7rem; letter-spacing: .12em; }
  .stage-brand span { font-size: .58rem; }
  .continue-copy h1 { font-size: clamp(2.65rem,14vw,4.2rem); }
  .continue-panel .mobile-promo { display: block; position: relative; flex: 0 0 auto; margin-top: 2px; padding: 11px 13px; border-radius: 13px; box-shadow: 0 12px 32px rgba(0,0,0,.3); }
  .continue-panel .mobile-promo.has-image { min-height: 118px; display: flex; padding: 13px; }
  .continue-panel .mobile-promo.has-image::before { background: linear-gradient(90deg,rgba(5,9,10,.96),rgba(5,9,10,.72) 60%,rgba(5,9,10,.12)); }
  .mobile-promo.has-image .promo-content { width: 72%; }
  .mobile-promo.has-image .promo-art { object-position: 65% center; }
  .mobile-promo span { margin-bottom: 3px; font-size: .56rem; }
  .mobile-promo strong { font-size: .93rem; }
  .mobile-promo p { display: none; }
  .mobile-promo b { margin-top: 5px; padding: 3px 7px; font-size: .62rem; }
  .result-promo.has-image { min-height: 185px; }
  .result-promo.has-image .promo-content { width: 68%; }
  .dashboard-side { display: none; }
  .level-screen { min-height: calc(100dvh - 148px); justify-content: flex-start; padding-top: 12px; }
  .ofm-kicker { margin-bottom: 18px; }
  .level-intro h1 { font-size: 2.55rem; }
  .level-intro > p:last-child { font-size: .88rem; }
  .level-choices { margin: 8px 0; grid-template-columns: 1fr; gap: 7px; }
  .level-card { min-height: 92px; padding: 14px 14px 13px 58px; justify-content: center; }
  .level-card > span { top: 50%; left: 16px; transform: translateY(-50%); }
  .level-card em { top: 9px; right: 9px; }
  .section-head { padding-top: 18px; align-items: start; }
  .section-head h2 { font-size: 2rem; }
  .path-head h2 { max-width: 230px; }
  .path-key { justify-content: flex-start; gap: 10px; overflow-x: auto; white-space: nowrap; }
  .seal-guide { margin-top: 12px; }
  .seal-rules { grid-template-columns: 1fr; }
  .seal-rules > div { min-height: 70px; }
  .route-map { width: 100%; padding-top: 22px; }
  .route-map::before { left: 39px; transform: none; }
  .path-step, .path-step.left, .path-step.right { min-height: 152px; justify-content: flex-start; padding-left: 0; }
  .path-step.left .path-node, .path-step.right .path-node { width: 80px; height: 80px; margin: 0; flex: 0 0 80px; }
  .path-node b { font-size: 1.25rem; }
  .path-node small { font-size: .56rem; }
  .path-node .seal-row { transform: scale(.82); }
  .special-branch, .path-step.left .special-branch, .path-step.right .special-branch { width: calc(100% - 98px); min-height: 78px; top: 37px; right: 0; left: auto; }
  .coming-note { width: calc(100% - 98px); min-height: 70px; top: 41px; right: 0; }
  .special-branch .seal-row { position: absolute; right: 10px; bottom: 8px; }
  .lesson-legend span:last-child { width: 100%; }
  .lesson-grid { grid-template-columns: repeat(2,1fr); padding-bottom: 0; }
  .lesson-card { min-height: 170px; }
  .special-card { min-height: 230px; grid-column: 1/-1; }
  .word-list { grid-template-columns: 1fr; padding-bottom: 0; }
  .word-row { min-height: 86px; gap: 12px; }
  .word-row > div:first-child { min-width: 0; }
  .word-row .word-memory { min-width: 102px; }
  .word-row em { font-size: .7rem; }
  .memory-explainer { align-items: flex-start; }
  .session { margin-top: 8px; }
  .question-card { min-height: calc(100dvh - 205px); padding: 20px 16px; }
  .word-stage { position: absolute; top: clamp(165px,30dvh,260px); right: 16px; left: 16px; margin: 0; transform: translateY(-50%); }
  .word { font-size: clamp(3.1rem,17vw,5.4rem); }
  .prompt { margin-top: auto; }
  .choices { gap: 8px; }
  .choice { min-height: 60px; }
  .question-card.has-feedback .prompt, .question-card.has-feedback .choices { display: none; }
  .question-card.has-feedback #feedback-slot { margin-top: auto; }
  .answer-mark { top: clamp(96px,18dvh,150px); font-size: clamp(4rem,19vw,5.6rem); }
  .feedback { grid-template-columns: 1fr; padding: 14px; border-right: 0; border-bottom: 0; border-top-width: 1px; box-shadow: none; }
  .feedback.good { background: linear-gradient(90deg,rgba(42,115,83,.25),rgba(18,53,43,.12)); box-shadow: none; }
  .feedback.bad { background: linear-gradient(90deg,rgba(139,37,48,.28),rgba(77,20,29,.14)); box-shadow: none; }
  .feedback .primary { width: 100%; }
  .recovery-gate, .summary-stage { min-height: calc(100dvh - 164px); height: auto; margin: 0; padding: 28px 18px; }
  .result-grid { grid-template-columns: 1fr 1fr 1fr; }
  .result-grid div { padding: 10px 5px; }
  .placement-split { grid-template-columns: 1fr 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-hero { grid-column: 1/-1; }
  .share-profile-button { width: 100%; justify-content: center; }
  .stat-card { min-height: 130px; }
  .rank-ladder { padding: 17px; }
  .rank-ladder-head { align-items: flex-start; }
  .rank-ladder-head h3 { font-size: 1.35rem; }
  .rank-ladder-head > div:last-child span { max-width: 120px; text-align: right; }
  .rank-grid { grid-template-columns: 1fr 1fr; }
  .rank-tier { min-height: 92px; }
  .test-lab { grid-template-columns: 1fr; padding: 20px; }
  .test-record { min-width: 0; width: 120px; justify-self: center; }
  .method-grid { grid-template-columns: 1fr; }
  .reset-zone { align-items: flex-start; flex-direction: column; }
  .reset-confirm { width: 100%; justify-content: space-between; }
  .sources-layout { grid-template-columns: 1fr; padding-bottom: 0; }
  .bottom-nav { width: calc(100% - 16px); bottom: calc(8px + env(safe-area-inset-bottom)); border-radius: 16px; }
  .bottom-nav button { padding-inline: 1px; font-size: .61rem; }
  .share-modal { padding: 10px; place-items: end center; }
  .share-dialog { width: 100%; max-height: calc(100dvh - 20px); padding: 17px; border-radius: 22px 22px 16px 16px; }
  .share-dialog-head h2 { font-size: 1.55rem; }
  .share-preview { width: min(100%,300px); }
  .share-note { margin: 11px 0; }
}
@media (max-width: 620px) and (max-height: 700px) {
  .welcome-screen { gap: 18px; padding-block: 18px; }
  .welcome-emblem { width: 58px; height: 58px; margin-bottom: 17px; font-size: 1.6rem; }
  .welcome-kicker { margin-bottom: 12px; }
  .welcome-lockup h1 { font-size: clamp(3.2rem,16vw,4.4rem); }
  .welcome-credit { margin-top: 16px; }
  .welcome-cta { min-height: 50px; }
  .welcome-action { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation: none !important; transition: none !important; } }

/* Account layer — locale oggi, stessi contratti UI per l'autenticazione pubblica. */
.account-slot { margin-left: auto; display: flex; align-items: center; }
.account-chip { min-width: 128px; height: 42px; padding: 5px 12px 5px 7px; display: grid; grid-template-columns: 30px 1fr; grid-template-rows: 1fr 1fr; column-gap: 8px; align-items: center; border: 1px solid rgba(110,243,214,.28); border-radius: 999px; background: rgba(6,27,29,.72); color: var(--ink); cursor: pointer; text-align: left; backdrop-filter: blur(16px); }
.account-chip > span { width: 30px; height: 30px; grid-row: 1/3; display: grid; place-items: center; border-radius: 50%; background: var(--aqua); color: #061215; font-weight: 900; }
.account-chip b { align-self: end; overflow: hidden; font-size: .72rem; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.account-chip small { align-self: start; color: var(--muted); font-size: .56rem; line-height: 1.2; }
.account-chip.guest > span { background: rgba(255,255,255,.08); color: var(--aqua); }
.account-modal-open { overflow: hidden; }
.account-modal { position: fixed; z-index: 180; inset: 0; padding: 24px; display: grid; place-items: center; overflow-y: auto; background: rgba(1,7,9,.88); backdrop-filter: blur(18px); animation: shareFade .2s ease-out both; }
.account-dialog { position: relative; width: min(100%,520px); max-height: calc(100dvh - 48px); padding: clamp(24px,5vw,40px); overflow-y: auto; border: 1px solid rgba(110,243,214,.26); border-radius: 26px; background: radial-gradient(circle at 100% 0,rgba(110,243,214,.1),transparent 35%),linear-gradient(155deg,#0c2527,#071416 70%); box-shadow: 0 32px 110px rgba(0,0,0,.72); animation: shareRise .38s cubic-bezier(.16,1,.3,1) both; }
.account-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.04); color: var(--ink); font-size: 1.35rem; cursor: pointer; }
.account-brand { margin-bottom: 30px; display: flex; align-items: center; gap: 12px; }
.account-brand .minimal-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--aqua); color: #061215; font-weight: 900; }
.account-brand .minimal-mark i { display: none; }
.account-brand div { display: grid; }
.account-brand b { font: 400 1.15rem/1.1 Georgia,serif; }
.account-brand small { margin-top: 3px; color: var(--muted); font-size: .62rem; letter-spacing: .11em; text-transform: uppercase; }
.account-dialog h2 { margin: 7px 0 12px; max-width: 420px; font: 400 clamp(2.25rem,7vw,3.6rem)/.95 Georgia,serif; }
.account-lede,.account-email { color: var(--muted); line-height: 1.55; }
.social-login { margin: 22px 0 18px; display: grid; gap: 9px; }
.social-login button { min-height: 52px; padding: 0 16px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.035); color: var(--ink); text-align: left; }
.social-login button:disabled { opacity: .58; }
.social-login button > span { font-weight: 850; text-align: center; }
.social-login button small { color: var(--gold); font-size: .62rem; }
.account-divider { margin: 17px 0; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .68rem; }
.account-divider::before,.account-divider::after { height: 1px; flex: 1; background: var(--line); content: ''; }
.account-dialog form > label:not(.account-check) { margin-bottom: 12px; display: grid; gap: 6px; color: var(--muted); font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; }
.account-dialog form input:not([type=checkbox]) { width: 100%; min-height: 49px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; outline: 0; background: rgba(0,0,0,.18); color: var(--ink); font: inherit; }
.account-dialog form input:focus { border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(110,243,214,.09); }
.account-check { margin: 13px 0; display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; color: var(--muted); font-size: .74rem; line-height: 1.45; }
.account-check input { margin: 2px 0 0; accent-color: var(--aqua); }
.account-check.required span::after { color: var(--gold); content: ' *'; }
.account-error { min-height: 1.2em; color: #ff929c; font-size: .76rem; }
.account-submit { width: 100%; }
.local-mode-note { margin-top: 14px; display: block; color: var(--muted); font-size: .64rem; line-height: 1.45; text-align: center; }
.profile-dialog { width: min(100%,480px); }
.profile-sync { margin: 24px 0; padding: 16px; display: flex; align-items: center; gap: 12px; border: 1px solid rgba(110,243,214,.22); border-radius: 15px; background: rgba(110,243,214,.06); }
.profile-sync > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--aqua); color: #061215; font-weight: 900; }
.profile-sync div,.consent-controls label span { display: grid; gap: 3px; }
.profile-sync small,.consent-controls small { color: var(--muted); font-size: .66rem; }
.consent-controls { border-top: 1px solid var(--line); }
.consent-controls label { padding: 16px 2px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.consent-controls input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--aqua); }
.profile-actions { margin-top: 22px; display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.profile-actions .secondary { display: grid; place-items: center; text-decoration: none; }
.profile-actions .ghost { min-width: 82px; border: 1px solid var(--line); border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; }
.auth-tabs { margin: -4px 0 25px; padding: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(0,0,0,.16); }
.auth-tabs button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 800; }
.auth-tabs button.active { background: rgba(110,243,214,.12); color: var(--aqua); box-shadow: inset 0 0 0 1px rgba(110,243,214,.2); }
.auth-forgot { width: fit-content; margin: -3px 0 12px auto; padding: 0; color: var(--aqua); }
.local-code { margin: 20px 0; padding: 17px; display: grid; gap: 5px; border: 1px solid rgba(255,201,107,.3); border-radius: 15px; background: rgba(255,201,107,.07); text-align: center; }
.local-code span,.local-code small { color: var(--muted); font-size: .75rem; }
.local-code strong { color: var(--gold); font: 400 2rem/1.1 Georgia,serif; letter-spacing: .2em; }
.legacy-security { margin: 22px 0; padding: 17px; border: 1px solid rgba(255,201,107,.28); border-radius: 15px; background: rgba(255,201,107,.06); }
.legacy-security > strong { color: var(--gold); }
.legacy-security > p { color: var(--muted); font-size: .82rem; line-height: 1.45; }
.legacy-security .primary { width: 100%; }
.profile-data-actions { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 9px; }
.profile-data-actions > * { min-height: 44px; display: grid; place-items: center; border-radius: 11px; text-align: center; text-decoration: none; }
.profile-data-actions .ghost { border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.delete-account { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.delete-account summary { color: #ff929c; cursor: pointer; font-size: .78rem; }
.delete-account form { margin-top: 14px; }
.delete-account p { color: var(--muted); font-size: .78rem; line-height: 1.45; }
.delete-account .danger { width: 100%; }
@media (max-width:620px) {
  .account-chip { min-width: 42px; width: 42px; padding: 5px; grid-template-columns: 30px; }
  .account-chip b,.account-chip small { display: none; }
  .account-modal { padding: 8px; place-items: end center; }
  .account-dialog { width: 100%; max-height: calc(100dvh - 16px); padding: 26px 20px 22px; border-radius: 24px 24px 14px 14px; }
  .account-brand { margin-bottom: 22px; }
  .account-dialog h2 { font-size: 2.55rem; }
  .profile-actions { grid-template-columns: 1fr; }
  .profile-actions .ghost { min-height: 44px; }
  .profile-data-actions { grid-template-columns: 1fr; }
}
