/* Colori sociali del Sabazia: granata e arancione. Solo caratteri di sistema: nessuna richiesta a servizi esterni. */
:root {
  --bg: #F6F3EC; --surface: #FFFDF8; --fg: #2A1416; --muted: #6F5E5B;
  --brand: #6E0F17; --on-brand: #FFF4EA; --accent: #C2500A; --line: #DDD6C8;
  --good: #1E6B45; --bad: #7A2E2E; --on-state: #FFF7EE;
  --display: 'Oswald', 'Arial Narrow', 'Roboto Condensed', Impact, Arial, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1C0B0D; --surface: #2B1316; --fg: #F6EDE6; --muted: #C9AFA8;
    --brand: #8E1F2A; --accent: #FFA552; --line: #4A2A2E; --bad: #5A2A2A;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 17px; line-height: 1.45; padding: 20px 16px 32px; }
.app { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.app.wide { max-width: 980px; }
.brand { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.brand b { font-family: var(--display); font-size: 22px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.brand span { font-size: 14px; color: var(--muted); }
.screen { display: flex; flex-direction: column; gap: 18px; }
h1 { font-family: var(--display); font-weight: 600; font-size: clamp(32px, 8vw, 46px); line-height: 1.08; text-transform: uppercase; margin: 0; }
h2 { font-family: var(--display); font-weight: 600; font-size: clamp(26px, 6vw, 38px); line-height: 1.15; margin: 0; }
h3 { font-family: var(--display); font-weight: 600; font-size: 22px; text-transform: uppercase; letter-spacing: .04em; margin: 0; }
p { margin: 0; }
.lead { color: var(--muted); }
.error { color: var(--accent); font-weight: 700; }
label { font-weight: 700; font-size: 15px; display: flex; flex-direction: column; gap: 6px; }
input[type="text"], input[type="password"] { font: inherit; font-size: 20px; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--fg); width: 100%; }
.btn { font: inherit; font-weight: 700; font-size: 18px; border: 0; border-radius: 14px; padding: 16px 20px; background: var(--brand); color: var(--on-brand); cursor: pointer; width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--fg); border: 2px solid var(--line); }
.btn.small { font-size: 14px; padding: 6px 12px; width: auto; }
.btn:focus-visible, .ans:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.step { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.score { font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; }
.timer { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.timer div { height: 100%; width: 100%; background: var(--accent); transform-origin: left; }
.answers { display: flex; flex-direction: column; gap: 12px; }
.ans { font: inherit; font-weight: 700; font-size: 19px; line-height: 1.25; text-align: left; border: 2px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 14px; padding: 18px; cursor: pointer; }
.ans:disabled { cursor: default; opacity: .55; }
.ans.chosen { border-color: var(--accent); opacity: 1; }
.ans.right { background: var(--good); border-color: var(--good); color: var(--on-state); opacity: 1; }
/* Tessere di risposta: tre colori e tre forme, così si riconoscono anche senza leggere il colore. */
.tiles .tile { display: flex; align-items: center; gap: 14px; border: 0; color: #FFF7EE; min-height: 84px; font-size: 20px; }
.tiles .tile span { min-width: 0; }
.tile .shape { width: 34px; height: 34px; flex: none; fill: #FFF7EE; }
.tile.t0 { background: #8E1F2A; }
.tile.t1 { background: #1F5E7A; }
.tile.t2 { background: #8A5A10; }
.tiles .tile:disabled { opacity: .45; }
.tiles .tile.chosen { opacity: 1; outline: 4px solid var(--fg); outline-offset: 2px; }
.tiles.hosted { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tiles.hosted .tile { cursor: default; font-size: 24px; min-height: 110px; }
.tiles.hosted .tile.dim { opacity: .3; }
.tiles.hosted .tile.right { background: var(--good); outline: 4px solid var(--fg); outline-offset: 2px; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; }
.place { flex: 1 1 0; max-width: 240px; min-width: 0; background: var(--brand); color: var(--on-brand); border-radius: 16px 16px 0 0; padding: 18px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.place b { font-family: var(--display); font-size: 40px; line-height: 1; }
.place strong { font-size: 22px; overflow-wrap: anywhere; }
.place.p1 { min-height: 220px; background: var(--accent); color: #1C0B0D; }
.place.p2 { min-height: 170px; }
.place.p3 { min-height: 130px; }
.field { width: 100%; height: min(62vh, 560px); border: 2px solid var(--line); border-radius: 16px; background: var(--bg); touch-action: none; display: block; }
a.link { display: block; text-align: center; text-decoration: none; }
.lesson { font-size: 21px; line-height: 1.5; }
.breath { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 12px 0; }
.ring { width: 150px; height: 150px; border-radius: 50%; background: var(--accent); opacity: .85; transform: scale(.55); }
.ring.in { transform: scale(1); transition: transform 4s ease-in-out; }
.ring.out { transform: scale(.55); transition: transform 6s ease-in-out; }
.cue { font-family: var(--display); font-size: 24px; font-weight: 600; }
.trend { display: flex; flex-direction: column; gap: 18px; }
.flash { border-radius: 18px; padding: 28px 22px; display: flex; flex-direction: column; gap: 10px; color: var(--on-state); }
.flash.good { background: var(--good); }
.flash.bad { background: var(--bad); }
.flash small { text-transform: uppercase; letter-spacing: .08em; font-size: 14px; font-weight: 700; }
.flash strong { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 8vw, 42px); line-height: 1.1; }
.flash em { font-style: normal; font-size: 16px; opacity: .9; }
.big { font-family: var(--display); font-weight: 600; font-size: clamp(56px, 16vw, 96px); line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.stats { display: flex; gap: 24px; flex-wrap: wrap; color: var(--muted); font-size: 15px; }
.stats b { color: var(--fg); font-variant-numeric: tabular-nums; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.list li > span { min-width: 0; overflow-wrap: anywhere; }
.list li b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.list li.me { border: 2px solid var(--accent); }
.list small { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.tag { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; color: var(--accent); }
.note { font-size: 14px; color: var(--muted); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; align-items: start; }
.cols > * { min-width: 0; }
.join { background: var(--brand); color: var(--on-brand); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 6px; }
.join .big { color: var(--on-brand); }
.join span { font-size: 18px; overflow-wrap: anywhere; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row .btn { width: auto; flex: 1 1 200px; }

/* Pagina iniziale e profilo */
.brand a { text-decoration: none; }
.join.light { background: var(--surface); color: var(--fg); border: 2px solid var(--line); }
.menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile-link { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); color: var(--fg); text-decoration: none; min-width: 0; }
.tile-link b { font-family: var(--display); font-size: 21px; text-transform: uppercase; letter-spacing: .03em; color: var(--accent); }
.tile-link span { font-size: 14px; color: var(--muted); }
.tile-link:focus-visible, .chip:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-weight: 600; font-size: 16px; padding: 10px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.row label { flex: 1 1 140px; }

/* Privacy: spunta del genitore, scelta del motivo, collegamenti nelle note */
label.check { flex-direction: row; align-items: flex-start; gap: 12px; font-weight: 600; }
label.check input { width: 26px; height: 26px; flex: none; accent-color: var(--brand); margin: 0; }
select { font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--fg); flex: 1 1 220px; min-width: 0; }
.note a, .lead a { color: var(--accent); font-weight: 700; }
