:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #1c2128; --muted: #636c76; --line: #e3e6ea;
  --accent: #1a7f37; --accent-ink: #ffffff; --up: #1a7f37; --down: #cf222e; --warn: #9a6700;
  --chip: #eef1f4; --shadow: 0 1px 2px rgba(0,0,0,.05);
  --t-bronzo: #a0643c; --t-argento: #8c959f; --t-oro: #bf8700; --t-platino: #3a8fb7; --t-diamante: #8250df; --t-leggenda: #cf222e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116; --panel: #161b22; --ink: #e6edf3; --muted: #8d96a0; --line: #2a313a;
    --accent: #3fb950; --accent-ink: #0e1116; --up: #3fb950; --down: #f85149; --warn: #d29922;
    --chip: #21262d; --shadow: none;
    --t-bronzo: #c58a5e; --t-argento: #adbac7; --t-oro: #e3b341; --t-platino: #6cb6ff; --t-diamante: #b083f0; --t-leggenda: #ff7b72;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; }
.brand { font-weight: 700; font-size: 18px; text-decoration: none; }
.nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 8px; padding-top: 8px; scrollbar-width: none; }
.nav a { text-decoration: none; padding: 6px 10px; border-radius: 8px; color: var(--muted); white-space: nowrap; font-weight: 500; }
.nav a.on { background: var(--chip); color: var(--ink); }
.pill { font-size: 12px; padding: 4px 10px; border-radius: 99px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.pill.open { color: var(--accent); }
main { padding-top: 20px; padding-bottom: 40px; }
h1 { font-size: 24px; margin: 4px 0 16px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 14px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
th.sort { cursor: pointer; user-select: none; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tr.link { cursor: pointer; }
tr.link:hover td { background: var(--chip); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.role { display: inline-block; width: 20px; text-align: center; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 1px 0; color: #fff; }
.r-GK { background: #bf8700; } .r-DEF { background: #1a7f37; } .r-MID { background: #0969da; } .r-FWD { background: #cf222e; }
.tier { font-size: 12px; font-weight: 600; }
.t-Bronzo { color: var(--t-bronzo); } .t-Argento { color: var(--t-argento); } .t-Oro { color: var(--t-oro); }
.t-Platino { color: var(--t-platino); } .t-Diamante { color: var(--t-diamante); } .t-Leggenda { color: var(--t-leggenda); }
.up { color: var(--up); } .down { color: var(--down); }
.vote { display: inline-block; min-width: 34px; text-align: center; border-radius: 6px; padding: 1px 4px; font-weight: 700; font-variant-numeric: tabular-nums; }
.v-hi { background: color-mix(in srgb, var(--up) 22%, transparent); }
.v-lo { background: color-mix(in srgb, var(--down) 20%, transparent); }
.v-mid { background: var(--chip); }
.score { font-size: 34px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.teams .h { text-align: right; font-weight: 700; } .teams .a { font-weight: 700; }
.bars .row { display: grid; grid-template-columns: 48px 1fr 48px; gap: 8px; align-items: center; margin: 6px 0; font-size: 13px; }
.bars .lab { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 12px; margin-bottom: -4px; }
.bar2 { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--chip); }
.bar2 span { display: block; height: 100%; }
.attr { display: grid; grid-template-columns: 110px 1fr 36px; gap: 8px; align-items: center; margin: 5px 0; font-size: 13px; }
.meter { height: 8px; background: var(--chip); border-radius: 4px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: 4px 12px; font-size: 13px; cursor: pointer; color: var(--ink); }
.chip.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
input, select, button, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
.row-flex { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ev { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.ev.away { text-align: left; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; }
.kv code, code { font-size: 12px; word-break: break-all; }
.code-out { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 13px; min-height: 60px; }
.notice { border-left: 3px solid var(--warn); padding: 8px 12px; background: var(--chip); border-radius: 6px; font-size: 14px; }
.foot { color: var(--muted); font-size: 12px; padding-bottom: 30px; }
.pick td:first-child { width: 36px; }
.fx { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.fx:last-child { border-bottom: 0; }
.fx .r { text-align: right; }
.fx .sc { font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; min-width: 56px; }
.sub { font-size: 12px; color: var(--muted); }
svg.spark { width: 100%; height: 120px; display: block; }
@media (max-width: 600px) {
  h1 { font-size: 20px; }
  .score { font-size: 26px; }
  .grid { grid-template-columns: 1fr; }
  .attr { grid-template-columns: 90px 1fr 30px; }
}
a.nolink { text-decoration: none; }
.owner { font-size: 11px; border: 1px solid; border-radius: 99px; padding: 0 6px; margin-left: 4px; color: var(--muted); white-space: nowrap; }
pre { background: var(--chip); padding: 10px 12px; border-radius: 8px; }
/* ---- Mondo: mappamondo + pannello ---- */
:root { --ocean: #dbe7f3; --land: #cfd6de; --land-on: #7fb58d; --land-sel: #1a7f37; --land-hi: #e3b341; --border: #ffffff; }
@media (prefers-color-scheme: dark) { :root { --ocean: #0b1d33; --land: #2b3440; --land-on: #2f6b45; --land-sel: #3fb950; --land-hi: #d29922; --border: #0e1116; } }
.world { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .world { grid-template-columns: 1fr; } }
.globe-box { position: relative; }
.globe-box canvas { width: 100%; aspect-ratio: 1; display: block; touch-action: none; cursor: grab; }
.globe-box canvas:active { cursor: grabbing; }
.globe-tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; font-size: 12px; display: none; white-space: nowrap; }
.globe-ctrl { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.globe-ctrl button { width: 34px; height: 34px; padding: 0; font-size: 18px; line-height: 1; }
.comp-list a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); text-decoration: none; }
.comp-list a:hover { color: var(--accent); }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.tag.league { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--ink); }
.tag.cup { background: color-mix(in srgb, #0969da 20%, transparent); color: var(--ink); }
.tag.continental { background: color-mix(in srgb, #8250df 22%, transparent); color: var(--ink); }
.tag.international { background: color-mix(in srgb, #e3b341 30%, transparent); color: var(--ink); }
.tag.playoff { background: color-mix(in srgb, #cf222e 18%, transparent); color: var(--ink); }
/* ---- calendario ---- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .dow { font-size: 11px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal .day { min-height: 58px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 5px; font-size: 12px; background: var(--panel); cursor: default; overflow: hidden; }
.cal .day.has { cursor: pointer; }
.cal .day.has:hover { border-color: var(--accent); }
.cal .day.sel { outline: 2px solid var(--accent); }
.cal .day.done { background: var(--chip); }
.cal .day.today { border-color: var(--accent); }
.cal .day .n { font-weight: 700; font-size: 13px; }
.cal .day .dots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 3px; }
.cal .day .dots i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.cal .blank { border: 0; background: transparent; }
.k-league { background: #1a7f37; } .k-cup { background: #0969da; } .k-continental { background: #8250df; } .k-international { background: #e3b341; } .k-playoff { background: #cf222e; }
/* ---- tabellone ---- */
.bracket { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.bracket .col { min-width: 190px; display: flex; flex-direction: column; justify-content: space-around; gap: 8px; }
.bracket .col h3 { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.tie { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 13px; background: var(--panel); }
.tie .t { display: flex; justify-content: space-between; gap: 6px; }
.tie .t.win { font-weight: 700; }
.tie .sc { font-variant-numeric: tabular-nums; color: var(--muted); }
.me-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.me-pick button { padding: 10px 16px; }
.zbar { position: relative; height: 8px; background: var(--chip); border-radius: 4px; min-width: 70px; }
.zbar span { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.zbar .mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--muted); opacity: .5; }
.barright { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.login { max-width: 380px; margin: 40px auto; }
.login form { display: grid; gap: 12px; margin: 16px 0 8px; }
.login label { display: grid; gap: 4px; font-size: 14px; }
.nav[hidden] { display: none; }
