:root{--bg: #f4f1ea;--surface: #ffffff;--surface-2: #ece7db;--text: #1d1b17;--muted: #5d574b;--border: #d4ccb8;--accent: #1f6f4a;--accent-text: #ffffff;--danger: #b3261e;--warn: #a55d00;--good: #1f6f4a;--felt: #2b7a52;--felt-edge: #1d553a;--tri-a: #e8d9b5;--tri-b: #9b6a45;--bar: #6b4a32;--off: #1f553a;--chk-l: #fbf7ec;--chk-l-stroke: #4a4033;--chk-d: #2b2420;--chk-d-stroke: #000000;--lbl: #f2ecd9;--focus: #0b57d0;--target: #ffd23f;--hint: #3aa6ff;--last: #ff7a59;--tap: 48px}:root[data-theme=scuro]{--bg: #14130f;--surface: #1f1d18;--surface-2: #2a2720;--text: #f1ede0;--muted: #b2aa97;--border: #3b372d;--accent: #4cc38a;--accent-text: #0b1f15;--danger: #ff8a80;--warn: #ffb74d;--good: #6fdca8;--felt: #1d4f38;--felt-edge: #0f2d20;--tri-a: #6d6248;--tri-b: #45301f;--bar: #2f2216;--off: #123525;--chk-l: #f1ead6;--chk-l-stroke: #bdb08f;--chk-d: #0e0c0a;--chk-d-stroke: #7e7560;--lbl: #cfc6ab;--focus: #8ab4f8}@media(prefers-color-scheme:dark){:root[data-theme=auto]{--bg: #14130f;--surface: #1f1d18;--surface-2: #2a2720;--text: #f1ede0;--muted: #b2aa97;--border: #3b372d;--accent: #4cc38a;--accent-text: #0b1f15;--danger: #ff8a80;--warn: #ffb74d;--good: #6fdca8;--felt: #1d4f38;--felt-edge: #0f2d20;--tri-a: #6d6248;--tri-b: #45301f;--bar: #2f2216;--off: #123525;--chk-l: #f1ead6;--chk-l-stroke: #bdb08f;--chk-d: #0e0c0a;--chk-d-stroke: #7e7560;--lbl: #cfc6ab;--focus: #8ab4f8}}*{box-sizing:border-box}html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;font-size:16px;line-height:1.45;-webkit-text-size-adjust:100%}#app{max-width:560px;margin:0 auto;min-height:100dvh;display:flex;flex-direction:column}main{flex:1;padding:10px 12px 96px}h1,h2,h3{line-height:1.2;margin:.2em 0 .5em}h2{font-size:1.25rem}h3{font-size:1.05rem}p{margin:.5em 0}a{color:var(--accent)}:focus-visible{outline:3px solid var(--focus);outline-offset:2px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}nav.tabs{position:fixed;left:0;right:0;bottom:0;z-index:10;background:var(--surface);border-top:1px solid var(--border);padding-bottom:env(safe-area-inset-bottom)}nav.tabs .inner{max-width:560px;margin:0 auto;display:grid;grid-template-columns:repeat(4,1fr)}nav.tabs button{min-height:56px;background:none;border:0;color:var(--muted);font:inherit;font-size:.82rem;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;cursor:pointer}nav.tabs button .ico{font-size:1.3rem;line-height:1}nav.tabs button[aria-selected=true]{color:var(--accent);font-weight:700}button,.btn{font:inherit;min-height:var(--tap);padding:8px 14px;border-radius:12px;border:1px solid var(--border);background:var(--surface);color:var(--text);cursor:pointer}button.primary{background:var(--accent);color:var(--accent-text);border-color:var(--accent);font-weight:700}button:disabled{opacity:.45;cursor:not-allowed}button.link{border:0;background:none;color:var(--accent);text-decoration:underline;min-height:36px;padding:4px 6px}.row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.row>.grow{flex:1}.actions{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin:10px 0}.actions.three{grid-template-columns:repeat(3,1fr)}.actions button{width:100%}.card{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:12px 14px;margin:10px 0}.card.good{border-color:var(--good)}.card.bad{border-color:var(--danger)}.card.warn{border-color:var(--warn)}.chip{display:inline-block;border-radius:999px;padding:2px 10px;font-size:.82rem;font-weight:700;background:var(--surface-2)}.chip.g-Ottima{background:var(--good);color:var(--accent-text)}.chip.g-Buona{background:#7bbf6a;color:#10230c}.chip.g-Imprecisione{background:#f0c24b;color:#3b2a00}.chip.g-Errore{background:#e9893a;color:#2c1300}.chip.g-Errore-grave{background:var(--danger);color:#fff}.muted{color:var(--muted)}.small{font-size:.86rem}.board-wrap{margin:4px 0}svg.board{width:100%;height:auto;display:block;touch-action:manipulation;-webkit-tap-highlight-color:transparent;user-select:none}svg.board .felt{fill:var(--felt);stroke:var(--felt-edge);stroke-width:3}svg.board .barbg{fill:var(--bar)}svg.board .offbg{fill:var(--off)}svg.board .tri-a{fill:var(--tri-a)}svg.board .tri-b{fill:var(--tri-b)}svg.board .tri.mark{stroke:var(--target);stroke-width:2.5}svg.board .tri.hint-from,svg.board .tri.hint-to{stroke:var(--hint);stroke-width:3}svg.board .tri.last-from,svg.board .tri.last-to{stroke:var(--last);stroke-width:2.5;stroke-dasharray:5 3}svg.board .lbl{fill:var(--lbl);font-size:11px;font-weight:600}svg.board .lbl.small{font-size:8px;letter-spacing:.04em}svg.board .chk-l{fill:var(--chk-l);stroke:var(--chk-l-stroke);stroke-width:1.5}svg.board .chk-d{fill:var(--chk-d);stroke:var(--chk-d-stroke);stroke-width:1.5}svg.board .cnt{font-size:12px;font-weight:800}svg.board .cnt-l{fill:#2b2420}svg.board .cnt-d{fill:#f1ead6}svg.board .hit{fill:transparent;cursor:pointer}svg.board .hit:focus-visible{stroke:var(--focus);stroke-width:3}svg.board .ring-movable{fill:none;stroke:#ffffff8c;stroke-width:1.5;stroke-dasharray:3 3;pointer-events:none}svg.board .ring-selected{fill:#ffd23f2e;stroke:var(--target);stroke-width:3;pointer-events:none}svg.board .target{fill:#ffd23f59;stroke:var(--target);stroke-width:3;pointer-events:none}svg.board .target-col{fill:#ffd23f24;pointer-events:none}svg.board .arrow{fill:none;stroke:var(--target);stroke-width:3;pointer-events:none}svg.board .arrowhead{fill:var(--target)}.dice{display:flex;gap:8px;align-items:center;justify-content:center;min-height:56px}svg.die{width:48px;height:48px}svg.die.small{width:34px;height:34px}svg.die .face{fill:#fdfaf0;stroke:#403628;stroke-width:2}svg.die .pip{fill:#2b2420}svg.die.used{opacity:.28}.turnbar{display:flex;justify-content:space-between;align-items:center;gap:8px}.status{min-height:2.6em;text-align:center;font-weight:600}.bar{display:flex;align-items:center;gap:8px;margin:4px 0}.bar .lab{width:108px;font-size:.9rem}.bar .track{flex:1;height:14px;background:var(--surface-2);border-radius:7px;overflow:hidden}.bar .fill{height:100%;background:var(--accent)}.bar .val{width:36px;text-align:right;font-variant-numeric:tabular-nums;font-size:.9rem}table.games{width:100%;border-collapse:collapse;font-size:.9rem}table.games th,table.games td{text-align:left;padding:6px 4px;border-bottom:1px solid var(--border)}.big-num{font-size:1.6rem;font-weight:800}.stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;text-align:center}.lesson-list button.lesson{display:block;width:100%;text-align:left;margin:8px 0;padding:12px 14px}.lesson-list .num{display:inline-block;width:28px;height:28px;line-height:28px;text-align:center;border-radius:50%;background:var(--accent);color:var(--accent-text);font-weight:700;margin-right:8px}.lesson-list .done{color:var(--good);font-weight:700}.options{display:grid;gap:8px;margin:8px 0}.options button{text-align:left;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.options button.right{border-color:var(--good);background:color-mix(in srgb,var(--good) 20%,var(--surface))}.options button.wrong{border-color:var(--danger);background:color-mix(in srgb,var(--danger) 18%,var(--surface))}.tip{border-left:4px solid var(--accent);padding-left:10px}label.field{display:flex;align-items:center;gap:10px;min-height:var(--tap)}.seg{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.seg button[aria-pressed=true]{background:var(--accent);color:var(--accent-text);border-color:var(--accent);font-weight:700}.toast{position:fixed;left:50%;bottom:80px;transform:translate(-50%);background:var(--text);color:var(--bg);padding:10px 16px;border-radius:999px;z-index:30;max-width:90vw}.notice{background:var(--surface-2);border-radius:10px;padding:8px 12px;font-size:.9rem}@media(min-width:560px){main{padding-bottom:100px}}@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}.coachbar{display:grid;gap:8px;margin:10px 0}.cb{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:8px 12px;min-height:72px}.cb-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:2px}.cb p{margin:4px 0}button.switch{display:inline-flex;align-items:center;gap:8px;min-height:36px;padding:2px 10px 2px 4px;border-radius:999px;font-size:.85rem}button.switch .knob{width:34px;height:20px;border-radius:999px;background:var(--border);position:relative;transition:background .15s}button.switch .knob:after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:var(--surface);transition:transform .15s}button.switch[aria-checked=true] .knob{background:var(--accent)}button.switch[aria-checked=true] .knob:after{transform:translate(14px)}button.mini{min-height:36px;padding:4px 12px;font-size:.9rem}.hintline{display:flex;align-items:center;gap:8px;margin:4px 0}.hintline .rank{font-weight:700;width:22px}.hintline code{flex:1}.judge{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.badge{display:inline-flex;align-items:center;gap:6px;padding:5px 12px 5px 8px;border-radius:999px;font-weight:800;font-size:1rem;color:#fff;white-space:nowrap}.badge .bicon{font-size:1.2rem;line-height:1}.b-geniale{background:#0e8f86}.b-ottima{background:#2e7d32}.b-buona{background:#5a8f29}.b-imprecisione{background:#b07d00}.b-errore{background:#c2571a}.b-grave{background:#b3261e}.b-libro{background:#6b4a32}.b-obbligata{background:#5d574b}details.legend{margin-top:8px}details.legend summary{cursor:pointer;color:var(--accent);font-size:.9rem;min-height:32px;display:flex;align-items:center}details.legend ul{list-style:none;padding:0;margin:6px 0;display:grid;gap:8px}details.legend li{display:flex;flex-direction:column;align-items:flex-start;gap:2px}.togglerow{display:flex;gap:8px;flex-wrap:wrap}@media(min-width:900px){#app{max-width:1060px}nav.tabs .inner{max-width:1060px}main{padding:16px 20px 96px}main>section:not(.game){max-width:640px;margin:0 auto}.game-grid{display:grid;grid-template-columns:minmax(0,540px) minmax(0,1fr);gap:24px;align-items:start}svg.board{max-height:calc(100dvh - 330px)}.game-side{position:sticky;top:12px}.game-side .coachbar{margin-top:0}}ul.why{margin:6px 0 0;padding-left:1.2em}ul.why li{margin:4px 0}
