:root {
  --bg: #2b1a5e;
  --bg2: #3d2685;
  --ink: #1d1638;
  --muted: #6c6788;
  --card: #ffffff;
  --line: #e4e1f0;
  --soft: #f5f3fb;
  --brand: #6d3df5;
  --brand-ink: #ffffff;
  --ok: #1fa65a;
  --bad: #e0384f;
  --warn: #f2a516;
  --a0: #e0384f;
  --a1: #2f6fe0;
  --a2: #e89a0c;
  --a3: #1f9d55;
  --a4: #9341d6;
  --a5: #0f9aa8;
  --picked: #ffe9a6;
  --radius: 14px;
  --shadow: 0 4px 0 rgba(0, 0, 0, .18);
  color-scheme: light;
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
}

/* ── Tema scuro: automatico (preferenza di sistema) o scelto con il pulsante 🌙/☀️ ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #120b2c; --bg2: #24174f; --ink: #ece9f8; --muted: #a59fc4; --card: #221a3f; --line: #3a3060;
    --soft: #150f2b; --brand: #7d55ff; --picked: #6b5310; --shadow: 0 4px 0 rgba(0, 0, 0, .45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #120b2c; --bg2: #24174f; --ink: #ece9f8; --muted: #a59fc4; --card: #221a3f; --line: #3a3060;
  --soft: #150f2b; --brand: #7d55ff; --picked: #6b5310; --shadow: 0 4px 0 rgba(0, 0, 0, .45); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--soft); -webkit-tap-highlight-color: transparent; }
body.game { background: radial-gradient(circle at 20% 0%, var(--bg2), var(--bg) 60%); color: #fff; min-height: 100vh; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* ── Bottoni e campi ───────────────────────────────────────────── */
.btn {
  border: 0; border-radius: 10px; padding: 12px 20px; font-weight: 800; cursor: pointer;
  background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow);
  transition: transform .06s, filter .15s; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .18); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; color: inherit; box-shadow: none; border: 2px solid currentColor; opacity: .85; }
.btn.light { background: var(--card); color: var(--ink); }
.btn.danger { background: var(--bad); }
.btn.ok { background: var(--ok); }
.btn.small { padding: 7px 12px; font-size: 14px; border-radius: 8px; }
.btn.big { padding: 16px 28px; font-size: 20px; }
.btn.block { width: 100%; }
.icon-btn { background: none; border: 0; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--muted); font-size: 16px; line-height: 1; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }

.input, select.input, textarea.input {
  width: 100%; border: 2px solid var(--line); border-radius: 10px; padding: 11px 13px; background: var(--card); outline: none;
  color: var(--ink);
}
.input:focus { border-color: var(--brand); }
.label { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 6px; display: block; }
.error { color: var(--bad); font-weight: 700; min-height: 1.3em; margin: 8px 0 0; }
.muted { color: var(--muted); }

/* ── Schermate giocatore ───────────────────────────────────────── */
.center-screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; text-align: center; }
.logo { font-weight: 900; font-size: 44px; letter-spacing: -.02em; margin: 0 0 24px; }
.logo span { color: #ffcf3f; }
.join-card { background: var(--card); color: var(--ink); border-radius: 16px; padding: 20px; width: 100%; max-width: 360px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.join-card .input { text-align: center; font-size: 24px; font-weight: 800; letter-spacing: .08em; margin-bottom: 12px; }
.join-card .btn { width: 100%; font-size: 20px; padding: 14px; }
.footer-link { margin-top: 28px; color: rgba(255, 255, 255, .6); font-size: 14px; }
.footer-link a { color: inherit; }

.p-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: rgba(0, 0, 0, .2); font-weight: 800; gap: 10px; }
.p-top .pill { background: rgba(255, 255, 255, .15); border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.p-bottom { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 10px 14px; background: var(--card); color: var(--ink); font-weight: 800; }
.p-bottom .score { background: var(--ink); color: var(--card); padding: 2px 12px; border-radius: 8px; }
.p-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: 56px; }
.p-main { flex: 1; display: flex; flex-direction: column; padding: 14px; gap: 12px; max-width: 760px; width: 100%; margin: 0 auto; }
.p-question { background: var(--card); color: var(--ink); border-radius: 12px; padding: 14px; font-weight: 800; font-size: 19px; text-align: center; }
.p-image { max-height: 30vh; object-fit: contain; border-radius: 10px; align-self: center; background: rgba(255,255,255,.1); }
.timerbar { height: 8px; background: rgba(255, 255, 255, .15); border-radius: 99px; overflow: hidden; }
.timerbar > i { display: block; height: 100%; background: #ffcf3f; border-radius: 99px; transform-origin: left; }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1; min-height: 240px; }
.answers.one-col { grid-template-columns: 1fr; }
.ans {
  border: 0; border-radius: 12px; color: #fff; font-weight: 800; font-size: 18px; padding: 14px; cursor: pointer;
  display: flex; align-items: center; gap: 12px; text-align: left; box-shadow: var(--shadow); min-height: 72px; position: relative;
  transition: transform .06s, opacity .2s;
}
.ans:active { transform: translateY(3px); }
.ans .shape { font-size: 26px; flex: none; width: 34px; text-align: center; }
.ans .txt { flex: 1; word-break: break-word; }
.ans img { max-height: 90px; border-radius: 8px; }
.ans.c0 { background: var(--a0); } .ans.c1 { background: var(--a1); } .ans.c2 { background: var(--a2); }
.ans.c3 { background: var(--a3); } .ans.c4 { background: var(--a4); } .ans.c5 { background: var(--a5); }
.ans.only-shape { justify-content: center; } .ans.only-shape .shape { font-size: 54px; width: auto; }
.ans.selected { outline: 5px solid #fff; outline-offset: -5px; }
.ans.selected::after { content: '✓'; position: absolute; top: 6px; right: 10px; font-size: 22px; }
.ans.dim { opacity: .35; }

.order-list { display: flex; flex-direction: column; gap: 8px; }
.order-item { display: flex; align-items: center; gap: 12px; background: var(--card); color: var(--ink); border: 0; border-radius: 12px; padding: 14px; font-weight: 800; font-size: 17px; text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.order-item .num { width: 32px; height: 32px; border-radius: 50%; background: var(--line); display: grid; place-items: center; flex: none; }
.order-item.picked { background: var(--picked); }
.order-item.picked .num { background: var(--ink); color: var(--card); }

.big-input { font-size: 24px; text-align: center; padding: 16px; }
.range-wrap { background: var(--card); color: var(--ink); border-radius: 12px; padding: 20px; text-align: center; }
.range-wrap output { font-size: 44px; font-weight: 900; display: block; }
.range-wrap input[type=range] { width: 100%; accent-color: var(--brand); height: 32px; }

.result { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 16px 80px; gap: 10px; }
.result.correct { background: var(--ok); }
.result.wrong { background: var(--bad); }
.result.none, .result.poll { background: #4b4470; }
.result h1 { font-size: 40px; margin: 0; font-weight: 900; }
.result .icon { font-size: 76px; line-height: 1; }
.result .delta { font-size: 30px; font-weight: 900; background: rgba(0, 0, 0, .22); border-radius: 12px; padding: 8px 22px; }
.result .sub { font-size: 18px; font-weight: 700; opacity: .92; max-width: 520px; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 6px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pop { animation: pop .35s cubic-bezier(.2, 1.4, .5, 1); }

.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 900; font-size: 14px; background: #ffcf3f; color: var(--ink); }
.badge.x3 { background: #ff7a3f; color: #fff; }
.badge.poll { background: #9fd8ff; }

.conn { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); background: var(--bad); color: #fff; padding: 6px 14px; border-radius: 99px; font-weight: 800; font-size: 14px; z-index: 50; }

/* ── Area host: layout generale ────────────────────────────────── */
.h-header { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.h-header .brand { font-weight: 900; font-size: 22px; color: var(--ink); text-decoration: none; }
.h-header .brand span { color: var(--brand); }
.h-header .spacer { flex: 1; }
.h-container { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.h-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.h-title-row h2 { margin: 0; flex: 1; font-size: 26px; }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.tab { border: 0; background: none; padding: 9px 16px; border-radius: 99px; font-weight: 800; cursor: pointer; color: var(--muted); }
.tab.active { background: var(--ink); color: var(--card); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); padding: 18px; }
.quiz-card { display: flex; flex-direction: column; gap: 10px; }
.quiz-card h3 { margin: 0; font-size: 19px; word-break: break-word; }
.quiz-card .meta { color: var(--muted); font-size: 14px; }
.quiz-card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }

.login-box { max-width: 380px; margin: 10vh auto; }
.login-box .card { display: flex; flex-direction: column; gap: 12px; padding: 26px; }

.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 15px; }
.table th { background: var(--soft); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tr.click { cursor: pointer; } .table tr.click:hover td { background: var(--soft); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }

.modal-back { position: fixed; inset: 0; background: rgba(20, 12, 50, .55); display: grid; place-items: center; padding: 16px; z-index: 100; }
.modal { background: var(--card); color: var(--ink); border-radius: 16px; padding: 24px; width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 14px; max-height: 90vh; overflow: auto; }
.modal h3 { margin: 0; font-size: 22px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 700; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); margin-top: 2px; flex: none; }
.check small { display: block; color: var(--muted); font-weight: 600; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--card); padding: 12px 20px; border-radius: 12px; font-weight: 700; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.25); }

/* ── Editor ────────────────────────────────────────────────────── */
.editor { display: grid; grid-template-columns: 290px 1fr; gap: 20px; align-items: start; }
.q-list { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; padding-bottom: 8px; }
.q-item { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; }
.q-item.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109, 61, 245, .15); }
.q-item .n { font-weight: 900; color: var(--muted); min-width: 22px; }
.q-item .body { flex: 1; min-width: 0; }
.q-item .t { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-item .k { font-size: 12px; color: var(--muted); font-weight: 700; }
.q-item .warn { color: var(--bad); font-size: 12px; font-weight: 800; }
.add-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.add-menu button { border: 2px dashed var(--line); background: var(--card); border-radius: 10px; padding: 8px; font-weight: 800; font-size: 13px; cursor: pointer; color: var(--muted); }
.add-menu button:hover { border-color: var(--brand); color: var(--brand); }
.q-edit { display: flex; flex-direction: column; gap: 16px; }
.q-edit textarea.qtext { font-size: 20px; font-weight: 800; text-align: center; min-height: 90px; resize: vertical; }
.img-drop { border: 2px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); cursor: pointer; background: var(--soft); font-weight: 700; }
.img-drop:hover { border-color: var(--brand); }
.img-prev { position: relative; display: inline-block; }
.img-prev img { max-height: 220px; border-radius: 10px; display: block; }
.img-prev .icon-btn { position: absolute; top: 6px; right: 6px; background: var(--card); box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.ans-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ans-row { display: flex; align-items: center; gap: 8px; border-radius: 12px; padding: 8px 10px; color: #fff; }
.ans-row .shape { font-size: 20px; width: 24px; text-align: center; }
.ans-row input.input { border: 0; padding: 9px 10px; }
.ans-row .correct-toggle { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; background: transparent; color: #fff; cursor: pointer; font-weight: 900; flex: none; }
.ans-row .correct-toggle.on { background: #fff; color: var(--ok); }
.ans-row .icon-btn { color: #fff; }
.ans-row .icon-btn:hover { background: rgba(255,255,255,.2); color: #fff; }
.ans-row img { height: 34px; border-radius: 6px; }
.list-edit { display: flex; flex-direction: column; gap: 8px; }
.list-edit .item { display: flex; gap: 8px; align-items: center; }
.list-edit .item .n { font-weight: 900; color: var(--muted); width: 22px; }
.tf-pick { display: flex; gap: 10px; }
.tf-pick button { flex: 1; padding: 18px; border-radius: 12px; border: 3px solid transparent; font-weight: 900; font-size: 20px; color: #fff; cursor: pointer; opacity: .45; }
.tf-pick button.on { opacity: 1; border-color: var(--ink); }
.save-state { font-size: 14px; font-weight: 700; color: var(--muted); }

/* ── Schermo di gioco host ─────────────────────────────────────── */
.stage { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.stage-top { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: rgba(0, 0, 0, .22); font-weight: 800; flex-wrap: wrap; }
.stage-top .spacer { flex: 1; }
.stage-top .pill { background: rgba(255, 255, 255, .14); padding: 6px 14px; border-radius: 99px; }
.stage-main { flex: 1; display: flex; flex-direction: column; padding: 20px; gap: 18px; max-width: 1400px; width: 100%; margin: 0 auto; }
.stage-actions { display: flex; justify-content: flex-end; gap: 10px; }

.lobby-head { display: flex; gap: 20px; align-items: stretch; flex-wrap: wrap; }
.join-info { flex: 1; min-width: 300px; background: var(--card); color: var(--ink); border-radius: 18px; padding: 20px 26px; display: flex; flex-direction: column; justify-content: center; }
.join-info .url { font-size: clamp(18px, 2.4vw, 30px); font-weight: 800; }
.join-info .code { font-size: clamp(56px, 9vw, 120px); font-weight: 900; letter-spacing: .04em; line-height: 1; }
.qr-box { background: #fff; border-radius: 18px; padding: 14px; display: grid; place-items: center; }
.qr-box canvas, .qr-box img { width: 190px !important; height: 190px !important; }
.lobby-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lobby-count { font-size: 26px; font-weight: 900; background: rgba(0,0,0,.25); padding: 6px 18px; border-radius: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-content: flex-start; }
.chip { background: var(--card); color: var(--ink); padding: 8px 14px; border-radius: 10px; font-weight: 800; font-size: 18px; display: inline-flex; align-items: center; gap: 6px; animation: pop .35s; }
.chip.off { opacity: .5; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 16px; padding: 0 2px; display: none; }
.chip:hover button { display: inline; }
.waiting-msg { text-align: center; opacity: .75; font-size: 22px; font-weight: 700; margin-top: 30px; }

.s-question { background: var(--card); color: var(--ink); border-radius: 16px; padding: 18px 24px; font-size: clamp(22px, 3vw, 40px); font-weight: 900; text-align: center; }
.s-middle { flex: 1; display: grid; grid-template-columns: 140px 1fr 140px; align-items: center; gap: 20px; min-height: 160px; }
.s-middle .img { display: grid; place-items: center; }
.s-middle .img img { max-height: 42vh; border-radius: 12px; }
.big-timer { width: 120px; height: 120px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; font-size: 46px; font-weight: 900; box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.big-timer.low { background: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.answered-box { text-align: center; font-weight: 900; }
.answered-box b { font-size: 50px; display: block; line-height: 1; }
.s-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.s-answers .ans { cursor: default; font-size: clamp(18px, 2vw, 28px); min-height: 80px; }
.s-answers .ans .count { font-size: 26px; font-weight: 900; }
.intro-box { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center; }
.intro-box .s-question { max-width: 1100px; font-size: clamp(28px, 4vw, 54px); }
.intro-bar { width: min(600px, 80%); height: 10px; background: rgba(255,255,255,.2); border-radius: 99px; overflow: hidden; }
.intro-bar i { display: block; height: 100%; background: #ffcf3f; }

.chart { display: flex; align-items: flex-end; justify-content: center; gap: 18px; height: 34vh; min-height: 180px; padding-top: 30px; }
.bar { width: min(120px, 18vw); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar .fill { width: 100%; border-radius: 10px 10px 0 0; min-height: 8px; transition: height .6s cubic-bezier(.2,.8,.3,1); }
.bar .n { font-size: 26px; font-weight: 900; margin-bottom: 6px; }
.bar .lab { margin-top: 8px; font-size: 26px; font-weight: 900; }
.bar.dim .fill { opacity: .35; }
.stat-pills { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.stat-pills span { background: rgba(0,0,0,.25); padding: 8px 16px; border-radius: 10px; font-weight: 800; font-size: 18px; }
.solution-box { background: var(--card); color: var(--ink); border-radius: 16px; padding: 20px; font-size: 24px; font-weight: 800; text-align: center; }
.solution-box ol { text-align: left; display: inline-block; margin: 6px 0; }
.text-answers { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.text-answers span { background: rgba(255,255,255,.15); padding: 8px 14px; border-radius: 10px; font-weight: 800; font-size: 20px; }
.text-answers span.ok { background: var(--ok); }

.board { display: flex; flex-direction: column; gap: 10px; max-width: 900px; width: 100%; margin: 0 auto; }
.board-row { display: flex; align-items: center; gap: 14px; background: var(--card); color: var(--ink); border-radius: 12px; padding: 12px 18px; font-size: 24px; font-weight: 900; animation: pop .4s backwards; }
.board-row .r { width: 40px; color: var(--muted); }
.board-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-row .d { font-size: 17px; color: var(--ok); } .board-row .d.neg { color: var(--bad); }
.board-row .mv { font-size: 15px; width: 44px; text-align: center; }
.board-row .mv.up { color: var(--ok); } .board-row .mv.down { color: var(--bad); }
.s-title { text-align: center; font-size: 38px; font-weight: 900; margin: 0; }

.podium { display: flex; align-items: flex-end; justify-content: center; gap: 16px; margin-top: 10px; }
.podium .place { display: flex; flex-direction: column; align-items: center; width: min(230px, 28vw); animation: rise .9s cubic-bezier(.2,.8,.3,1) backwards; }
.podium .place:nth-child(1) { animation-delay: .9s; } .podium .place:nth-child(2) { animation-delay: 1.8s; } .podium .place:nth-child(3) { animation-delay: 0s; }
@keyframes rise { from { transform: translateY(80px); opacity: 0; } }
.podium .who { font-size: clamp(18px, 2.4vw, 30px); font-weight: 900; text-align: center; word-break: break-word; }
.podium .pts { font-weight: 800; opacity: .85; margin-bottom: 8px; }
.podium .block { width: 100%; border-radius: 12px 12px 0 0; display: grid; place-items: center; font-size: 60px; font-weight: 900; color: #fff; }
.podium .p1 .block { height: 240px; background: #f2b705; }
.podium .p2 .block { height: 170px; background: #a9b4c2; }
.podium .p3 .block { height: 120px; background: #cd7f32; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .editor { grid-template-columns: 1fr; }
  .q-list { position: static; max-height: none; }
  .ans-edit { grid-template-columns: 1fr; }
  .s-middle { grid-template-columns: 90px 1fr 90px; }
  .big-timer { width: 80px; height: 80px; font-size: 32px; }
  .s-answers { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .answers { grid-template-columns: 1fr; }
  .answers.tf, .answers.shapes { grid-template-columns: 1fr 1fr; }
  .h-container { padding: 16px 16px 60px; }
  .h-header { padding: 10px 16px; }
}

/* ── Pulsante tema ─────────────────────────────────────────────── */
.theme-btn { background: none; border: 2px solid currentColor; border-radius: 99px; width: 38px; height: 34px; cursor: pointer; font-size: 16px; line-height: 1; opacity: .8; color: inherit; flex: none; }
.theme-btn:hover { opacity: 1; }
.theme-float { position: fixed; top: 12px; right: 12px; z-index: 20; color: #fff; }

/* ── Classifica generale ───────────────────────────────────────── */
.standings-setup { color: var(--ink); max-width: 560px; width: 100%; display: flex; flex-direction: column; gap: 16px; text-align: left; font-size: 18px; }
.standings { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; align-content: start; overflow: auto; max-height: calc(100vh - 230px); padding: 2px; }
.st-row { display: flex; align-items: center; gap: 10px; background: var(--card); color: var(--ink); border-radius: 10px; padding: 8px 12px; font-weight: 800; font-size: 17px; animation: pop .35s backwards; }
.st-row .r { width: 34px; color: var(--muted); font-weight: 900; }
.st-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-row .sc { font-weight: 900; }
.st-row .mv { font-size: 13px; } .st-row .mv.up { color: var(--ok); } .st-row .mv.down { color: var(--bad); }
.st-row.secret { background: repeating-linear-gradient(-45deg, #ffcf3f, #ffcf3f 10px, #f2b705 10px, #f2b705 20px); color: #1d1638; }
.st-row.secret .r { color: #1d1638; }
