:root { --bg:#262421; --card:#302e2b; --fg:#e8e6e3; --muted:#a8a29e; --acc:#7fa650; --red:#c33; --blue:#3b7dd8; }
* { box-sizing: border-box; }
html, body { margin:0; background:var(--bg); color:var(--fg); font:16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust:100%; }
header { display:flex; align-items:center; justify-content:space-between; padding:6px 8px; padding-top:max(6px, env(safe-area-inset-top)); background:#1f1d1b; position:sticky; top:0; z-index:5; }
nav { display:flex; gap:4px; }
.tab { background:none; border:0; color:var(--muted); font-size:16px; padding:8px 10px; border-radius:6px; }
.tab.on { color:var(--fg); background:#3a3835; }
#where { font-size:12px; color:var(--muted); }
main { max-width:640px; margin:0 auto; padding:8px; }
.card { background:var(--card); border-radius:10px; padding:14px; margin-bottom:10px; }
.hidden { display:none !important; }
h2 { margin:0 0 10px; font-size:18px; }
label { display:block; margin:10px 0; }
input[type=range] { width:100%; }
select, input[type=text], input[type=password], input[type=number], textarea { width:100%; padding:10px; font-size:16px; background:#1f1d1b; color:var(--fg); border:1px solid #4a4744; border-radius:8px; }
.row { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:10px 0; }
.row > select { width:auto; min-width:55%; }
.seg { display:flex; border:1px solid #4a4744; border-radius:8px; overflow:hidden; }
.seg button { background:none; color:var(--fg); border:0; padding:9px 12px; font-size:15px; }
.seg button.on { background:var(--acc); color:#fff; }
.chk { display:flex; align-items:center; gap:8px; }
.chk input { width:20px; height:20px; }
button { font-size:15px; cursor:pointer; }
.big { width:100%; padding:14px; font-size:18px; background:var(--acc); color:#fff; border:0; border-radius:8px; margin-top:8px; }
.muted { color:var(--muted); } .small { font-size:13px; }
.opts summary { cursor:pointer; padding:6px 0; color:var(--muted); }
.stats { display:flex; gap:14px; flex-wrap:wrap; margin:8px 0; }
.stats div { background:#1f1d1b; padding:8px 10px; border-radius:8px; font-size:14px; }
.stats b { display:block; font-size:18px; }
.tema { background:#3a3835; border-left:4px solid var(--acc); border-radius:6px; padding:10px 12px; margin:10px 0; }
.tema h3 { margin:0 0 6px; font-size:16px; }
.tema p { margin:6px 0; }

#play { max-width:640px; margin:0 auto; }
.bar { display:flex; justify-content:space-between; align-items:center; padding:4px 2px; font-size:15px; }
.clock { font: 600 20px ui-monospace, monospace; background:#1f1d1b; padding:2px 8px; border-radius:6px; }
.clock.run { background:#fff; color:#000; }
.clock.low { background:var(--red); color:#fff; }
.board-box { display:flex; gap:4px; }
.board { width:100%; aspect-ratio:1/1; max-height:calc(100vh - 230px); max-height:calc(100dvh - 230px); margin:0 auto; touch-action:none; }
.board .cg-wrap { width:100%; height:100%; }
.evalbar { width:10px; background:#000; border-radius:3px; position:relative; overflow:hidden; }
#evalfill { position:absolute; bottom:0; left:0; right:0; background:#fff; height:50%; transition:height .3s; }
.status { min-height:24px; padding:6px 2px; color:var(--muted); }
.alert { background:#5a1f1f; border:1px solid var(--red); padding:10px; border-radius:8px; margin:4px 0; }
.alert.info { background:#1f3a5a; border-color:var(--blue); }
.alert .acts { display:flex; gap:8px; margin-top:8px; }
.alert button, .controls button { flex:1; padding:11px 6px; border:0; border-radius:8px; background:#4a4744; color:var(--fg); }
.controls { display:flex; gap:6px; margin:6px 0; }
.controls button:disabled { opacity:.35; }
.danger { background:#6b2a2a !important; }
.moves { font: 14px ui-monospace, monospace; color:var(--muted); line-height:1.7; padding:4px 2px 40px; }
.moves .bl { color:#ff6b6b; font-weight:600; } .moves .er { color:#f0a040; } .moves .im { color:#e0d060; }
#fine p { margin:8px 0; }
.lista-item { padding:10px 4px; border-bottom:1px solid #3e3b38; display:flex; justify-content:space-between; gap:8px; cursor:pointer; }
.lista-item small { color:var(--muted); }
.vinta { color:var(--acc); } .persa { color:#ff6b6b; } .patta { color:var(--muted); }
pre { white-space:pre-wrap; word-break:break-word; background:#1f1d1b; padding:8px; border-radius:6px; font-size:13px; }
.modal { position:fixed; inset:0; background:rgba(0,0,0,.6); display:flex; align-items:center; justify-content:center; z-index:20; }
.promo-box { background:var(--card); padding:16px; border-radius:10px; display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.promo-box p { grid-column:1/3; margin:0 0 4px; text-align:center; }
.promo-box button { padding:16px; font-size:17px; border:0; border-radius:8px; background:#4a4744; color:var(--fg); }
.login { max-width:380px; margin:40px auto; }
.err { color:#ff6b6b; min-height:20px; }
#qr svg { background:#fff; display:block; margin:10px auto; max-width:100%; height:auto; }
a { color:#8fb8ff; }
.commento { white-space:pre-wrap; }
.keymoves { display:flex; flex-direction:column; gap:6px; margin:8px 0; }
.keymoves .km { text-align:left; padding:9px 10px; border:0; border-radius:8px; background:#4a4744; color:var(--fg); font-size:14px; }
/* revisione mossa per mossa (16/11 sera) */
.rinfo { background:#1f1d1b; border-radius:8px; padding:8px 10px; margin:4px 0 8px; font-size:15px; line-height:1.5; }
.rinfo .nota { margin:6px 0 0; font-style:italic; }
.graph { display:block; width:100%; height:80px; border-radius:6px; margin:6px 0; cursor:pointer; touch-action:manipulation; }
.moves.rv { padding-bottom:8px; line-height:2.1; }
.moves.rv .mv { background:none; border:0; color:var(--muted); font:14px ui-monospace, monospace; padding:2px 3px; border-radius:4px; }
.moves.rv .mv.me { color:var(--fg); }
.moves.rv .mv.sel { background:#4a4744; }
.legenda { margin:4px 0; font-family:system-ui, sans-serif; }
.ok-best, .moves.rv .mv.ok-best { color:#8fd16a; }
.bl, .moves.rv .mv.bl { color:#ff6b6b; font-weight:600; } .er, .moves.rv .mv.er { color:#f0a040; } .im, .moves.rv .mv.im { color:#e0d060; }
/* box Alfio mossa per mossa sopra il commento automatico (16/11 22:00) */
.alfio-box { border-left-color:#8fb8ff; font-size:15px; line-height:1.45; min-height:96px; }
.alfio-box p { margin:4px 0; }
.alfio-box .riga { font-size:16px; }
.alfio-box .nota { font-style:italic; background:#2e2c29; border-radius:6px; padding:6px 8px; }
