:root {
  --bg: #0b0b10;
  --surface: #16161f;
  --surface-2: #1e1e2a;
  --border: #2a2a38;
  --text: #f2f2f7;
  --muted: #9a9aad;
  --accent: #ff2d55;
  --accent-soft: rgba(255, 45, 85, 0.14);
  --gold: #ffc83d;
  --role-C: #4dd0e1;
  --role-G: #b388ff;
  --role-H: #ffc83d;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 Inter, system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body.noscroll { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
h1, h2, h3, h4 { font-family: Archivo, Inter, sans-serif; margin: 0; }
h2 { font-size: 22px; font-weight: 900; }
h3 { font-size: 16px; font-weight: 700; margin: 24px 0 10px; }
h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0; }
.error { color: var(--accent); text-align: center; }
.empty { color: var(--muted); text-align: center; padding: 48px 16px; }
.empty.small { padding: 16px; font-size: 14px; }

/* Layout */
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
main { padding: 8px 16px 24px; }
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  position: sticky; top: 0; z-index: 5;
  background: rgba(11, 11, 16, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.logo { font-size: 24px; font-weight: 900; letter-spacing: -.02em; }
.logo span { color: var(--accent); }
.who { text-align: right; font-weight: 600; }
.who small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.banner { background: var(--accent-soft); color: #ffb3c2; font-size: 12px; text-align: center; padding: 6px 16px; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 6;
  display: flex; justify-content: center;
  background: rgba(16, 16, 22, .96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; max-width: 140px; min-height: 56px; background: none; border: 0; padding: 8px 0 10px;
  font-size: 11px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tabbar .tab-icon { font-size: 18px; line-height: 22px; position: relative; }
.badge {
  position: absolute; top: -4px; left: 12px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px;
}
.tabbar button.on { color: var(--text); }
.tabbar button.on .tab-icon { color: var(--accent); }

/* Controls */
.btn {
  display: block; width: 100%; margin-top: 12px; padding: 12px 16px;
  background: var(--accent); border: 0; border-radius: 12px; font-weight: 600; color: #fff;
}
.btn:disabled { opacity: .5; }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { color: var(--accent); }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }
.btn-row.sticky { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); background: var(--surface); padding-bottom: 4px; }
.link { background: none; border: 0; color: var(--accent); padding: 0; }
.icon-btn { background: none; border: 0; font-size: 18px; padding: 6px 8px; color: var(--muted); flex: none; }
.input {
  width: 100%; padding: 11px 12px; margin-top: 6px;
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 10px; font: inherit;
  font-size: 16px; /* sotto i 16px iPhone fa lo zoom quando si tocca il campo */
}
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label { display: block; font-size: 13px; color: var(--muted); margin-top: 10px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; gap: 8px; }
.code { font-family: Archivo, monospace; font-size: 22px; letter-spacing: .12em; color: var(--gold); }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; }
.chip {
  flex: none; padding: 8px 14px; border-radius: 999px; font-size: 14px;
  background: var(--surface); border: 1px solid var(--border);
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Episode header */
.ep-head { margin: 8px 0 10px; }
.deadline { margin-top: 6px; font-size: 13px; color: var(--gold); }
.deadline.closed { color: var(--muted); }

/* Board */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.cell {
  position: relative; aspect-ratio: 1; min-width: 0;
  display: flex; flex-direction: column; justify-content: flex-start; gap: 4px;
  padding: 8px 7px; text-align: left; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  border-top: 3px solid var(--border);
}
.cell:disabled { cursor: default; opacity: 1; }
.cell.missing { border: 2px dashed var(--accent); background: var(--accent-soft); animation: pulse 1.2s ease-in-out 2; }
@keyframes pulse { 50% { transform: scale(.96); } }
.alert-incomplete {
  margin: 8px 0; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45;
  background: var(--accent-soft); border: 1px solid var(--accent); color: #ffd0da;
}
.alert-incomplete b { display: block; color: #fff; margin-bottom: 2px; }
.cell-wrap { position: relative; min-width: 0; }
.cell-wrap > .cell { width: 100%; height: 100%; }
.cell-trash {
  position: absolute; right: 4px; bottom: 4px; z-index: 1;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--border); background: rgba(11, 11, 16, .85); color: var(--muted);
}
.cell-trash:active { color: var(--accent); border-color: var(--accent); }
.cell.tap:active { transform: scale(.97); }
.cell.empty { justify-content: center; align-items: center; border-style: dashed; border-top-width: 1px; }
.cell-plus { font-size: 28px; color: var(--muted); }
.cell.role-C { border-top-color: var(--role-C); }
.cell.role-G { border-top-color: var(--role-G); }
.cell.role-H { border-top-color: var(--role-H); }
.cell-person { font-weight: 700; font-size: 12px; line-height: 1.15; }
.cell.role-C .cell-person { color: var(--role-C); }
.cell.role-G .cell-person { color: var(--role-G); }
.cell.role-H .cell-person { color: var(--role-H); }
.cell-event { font-size: 11px; line-height: 1.25; color: #d6d6e0; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.cell-event em { color: var(--muted); }
.cell.hit { background: var(--accent-soft); border-color: rgba(255, 45, 85, .5); }
.cell.line { box-shadow: 0 0 0 2px var(--gold); }
.cell-x {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 84px; font-weight: 900; color: var(--accent); opacity: .55; pointer-events: none;
}
@media (min-width: 420px) {
  .cell-person { font-size: 13px; }
  .cell-event { font-size: 12px; }
}
.star { color: var(--gold); }

.scorebox { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-top: 12px; }
.scorebox > div { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.scorebox span { color: var(--muted); }
.scorebox .total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; font-size: 17px; }
.scorebox .total span { color: var(--text); font-weight: 600; }
.scorebox .total b { color: var(--gold); }

/* Lists */
.list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  text-align: left; padding: 11px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.list-item small { color: var(--muted); flex: none; }
.list-item.on { border-color: var(--accent); }
.list-item.role-C { border-left: 3px solid var(--role-C); }
.list-item.role-G { border-left: 3px solid var(--role-G); }

/* Sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 560px; max-height: 86vh; max-height: 86dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 18px 18px 0 0; border: 1px solid var(--border); border-bottom: 0;
  animation: up .18s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 8px; }
.sheet-head h3 { margin: 0; font-size: 18px; }
.sheet-body { overflow-y: auto; padding: 0 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet-sub { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }

/* Live */
.live-group { margin-bottom: 12px; }
.live-person { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.live-person.role-C { color: var(--role-C); }
.live-person.role-G { color: var(--role-G); }
.live-person.role-H { color: var(--role-H); }
.live-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; margin-bottom: 6px;
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.live-item .check {
  flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-weight: 900;
}
.live-item .live-text { flex: 1; }
.live-item.on { background: var(--accent-soft); border-color: rgba(255, 45, 85, .5); }
.live-item.on .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.done-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }

/* Live: righe evento grandi, facili da toccare durante la puntata */
.ev-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; text-align: left;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.ev-row:not(:disabled):active { transform: scale(.98); }
.ev-status {
  flex: none; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 16px;
}
.ev-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ev-person { font-weight: 700; font-size: 13px; }
.ev-person.role-C, .role-text-C { color: var(--role-C); }
.ev-person.role-G, .role-text-G { color: var(--role-G); }
.ev-person.role-H, .role-text-H { color: var(--role-H); }
.role-tag { flex: none; min-width: 96px; text-align: center; }
.ev-text { font-size: 15px; line-height: 1.3; }
.ev-label { font-size: 12px; color: var(--muted); }
.ev-row.pending { border-color: rgba(255, 200, 61, .5); }
.ev-row.pending .ev-status { border-color: var(--gold); }
.ev-row.pending .ev-label { color: var(--gold); }
.ev-row.ok { background: var(--accent-soft); border-color: rgba(255, 45, 85, .5); }
.ev-row.ok .ev-status { background: var(--accent); border-color: var(--accent); color: #fff; }
.ev-row.ok .ev-label { color: #ffb3c2; }
.ev-row:disabled:not(.ok) { opacity: .7; }
.ev-row.no .ev-status { border-color: var(--muted); color: var(--muted); }
.ev-row.no .ev-text { text-decoration: line-through; text-decoration-color: var(--muted); }

.explain {
  margin: 4px 0 8px; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45;
  background: var(--surface); border: 1px solid var(--border); color: #d6d6e0;
}
.explain b { color: var(--text); display: block; margin-bottom: 2px; }
.explain-until { display: block; margin-top: 6px; color: var(--gold); font-size: 13px; }
.explain.live { border-color: rgba(255, 45, 85, .5); background: var(--accent-soft); }
.view-toggle { margin: 6px 0 10px; }
.view-toggle button { font-size: 13px; }

.approve-card {
  display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid rgba(255, 200, 61, .5); border-radius: 14px; font-size: 15px;
}
.approve-group { border: 1px solid var(--border); border-radius: 16px; padding: 10px 10px 2px; margin-bottom: 12px; background: rgba(255, 200, 61, .04); }
.approve-group-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; }
.approve-group-head b { font-size: 16px; }
.approve-group-head .btn { width: auto; margin: 0 0 0 auto; padding: 6px 10px; font-size: 13px; }
.approve-group .approve-card { background: var(--surface); }
.approve-group-head .person-line { margin: 0; }
.approve-event { font-weight: 600; }
.approve-top { display: flex; align-items: flex-start; gap: 10px; }
.approve-top .approve-event { flex: 1; }
/* Quante persone hanno segnalato la stessa cosa: più è acceso, più è affidabile. */
.report-count {
  flex: none; min-width: 34px; padding: 2px 8px; border-radius: 999px; text-align: center;
  font: 700 13px Archivo, Inter, sans-serif; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.report-count.lo { color: var(--gold); border-color: rgba(255, 200, 61, .5); }
.report-count.mid { color: #111; background: var(--gold); border-color: var(--gold); }
.report-count.hi { color: #fff; background: #2fbf71; border-color: #2fbf71; }
.count-filter { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.count-filter .chip small { opacity: .7; margin-left: 2px; }
.approve-shown { margin: 0 0 12px; }
.approve-actions { display: flex; gap: 8px; }
.approve-actions .btn { margin-top: 0; }
.btn.small { padding: 10px 12px; font-size: 14px; }
.btn.ok { background: #2fbf71; }
.count {
  display: inline-block; min-width: 22px; padding: 0 7px; margin-left: 6px; border-radius: 11px;
  background: var(--accent); color: #fff; font-size: 13px; line-height: 22px; text-align: center; vertical-align: 2px;
}
details.more { margin-top: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 4px 14px; }
details.more summary { padding: 12px 0; font-weight: 600; color: var(--muted); cursor: pointer; }
details.more[open] { padding-bottom: 14px; }
.cell-pending { position: absolute; right: 6px; bottom: 4px; font-size: 14px; }

.btn.google { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; }
.center { text-align: center; }

/* Avatar personaggi */
.avatar {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; object-fit: cover; object-position: center 20%; background: var(--surface-2);
  border: 2px solid var(--border);
}
.avatar.role-C { border-color: var(--role-C); }
.avatar.role-G { border-color: var(--role-G); }
.avatar.role-H { border-color: var(--role-H); }
.avatar.initials { font-weight: 700; color: var(--text); font-family: Archivo, Inter, sans-serif; letter-spacing: .02em; }
.avatar.initials.role-C { background: rgba(77, 208, 225, .18); }
.avatar.initials.role-G { background: rgba(179, 136, 255, .18); }
.avatar.initials.role-H { background: rgba(255, 200, 61, .18); }
.cell-head { display: flex; align-items: center; gap: 5px; min-width: 0; }
.cell-head .cell-person { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.person-line { display: flex; align-items: center; gap: 10px; }
.ev-person { display: flex; align-items: center; gap: 6px; }
.approve-card .person-line { margin-bottom: 4px; }
.cast-row { padding: 8px 0; border-bottom: 1px solid var(--border); }
.cast-row .edit-row { margin-bottom: 6px; flex-wrap: wrap; }
.cast-row .edit-row > .input:not(.narrow) { flex: 1 1 calc(100% - 50px); min-width: 0; }
.cast-row .narrow { width: auto; flex: 1 1 auto; margin-left: 42px; }
.photo-url { margin-top: 0; padding: 7px 10px; font-size: 16px; color: var(--muted); }
.credits { margin-top: 28px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.credits a { color: var(--muted); }

/* Utenti (super admin) e stato account */
.banner.pending { background: rgba(255, 200, 61, .12); color: var(--gold); }
.pending-note { background: rgba(255, 200, 61, .12); color: var(--gold); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 0 0 12px; }
.user-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.user-card.off { border-color: rgba(255, 200, 61, .5); }
.user-top { display: flex; align-items: center; gap: 10px; }
.user-pic { width: 40px; height: 40px; font-size: 15px; }
.user-info { flex: 1; min-width: 0; }
.user-info .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; color: var(--muted); }
.user-leagues { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { display: inline-block; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--muted); white-space: nowrap; }
.tag.admin { color: var(--gold); border-color: rgba(255, 200, 61, .4); }
.switch { position: relative; flex: none; width: 52px; height: 30px; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; border-radius: 15px; background: var(--border); transition: background .15s; cursor: pointer; }
.slider::before { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .slider { background: #2fbf71; }
.switch input:checked + .slider::before { transform: translateX(22px); }
.log { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.log-row { display: grid; grid-template-columns: 96px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.invite h3 { margin-top: 0; }
.invite-link {
  margin: 8px 0 4px; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px dashed var(--border);
  font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; user-select: all;
}
.invite .btn-row .btn { margin-top: 8px; }
.btn.whatsapp { text-align: center; text-decoration: none; background: #25d366; color: #062; }
.small-row { margin-top: 10px; }
.small-row .code { font-size: 18px; }
.invite-note {
  margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5;
  background: var(--accent-soft); border: 1px solid rgba(255, 45, 85, .4);
}
.code-inline { font-family: Archivo, monospace; letter-spacing: .1em; color: var(--gold); }
/* Caffè */
.coffee-card {
  display: flex; gap: 12px; margin: 20px 0 8px; padding: 14px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 196, 57, .16), rgba(255, 196, 57, .05));
  border: 1px solid rgba(255, 196, 57, .45);
}
.coffee-card.compact { margin: 10px 0 16px; }
.coffee-icon { font-size: 30px; line-height: 1; }
.coffee-body { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: #e8e2cf; }
.coffee-body b { color: var(--text); font-size: 15px; }
.coffee-body .btn { margin-top: 8px; }

/* Bozza e salvataggio griglia */
.save-bar {
  position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 4;
  display: flex; align-items: center; gap: 10px; margin: 6px 0; padding: 10px 12px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.save-bar.dirty { border-color: var(--gold); background: #2a2412; }
.save-status { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; line-height: 1.35; }
.save-status span { color: var(--muted); font-size: 12px; }
.save-bar.dirty .save-status b { color: var(--gold); }
.save-actions { display: flex; gap: 6px; flex: none; }
.save-actions .btn { margin-top: 0; width: auto; padding: 10px 16px; }
.badge.warn { background: var(--gold); color: #111; }
.activation p { font-size: 15px; line-height: 1.5; }
.activation .btn { text-align: center; text-decoration: none; }
.banner .link { color: inherit; text-decoration: underline; font-size: inherit; margin-left: 4px; }
.banner.push { background: var(--surface); color: var(--text, #fff); border-bottom: 1px solid var(--border); font-size: 13px; padding: 10px 16px; line-height: 1.4; }
.banner.push .btn.small { display: block; width: auto; margin: 8px auto 4px; padding: 8px 14px; }

.coffee { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; background: #ffc439; color: #111; }

/* Ranking */
.table-wrap { overflow-x: auto; }
table.rank { width: 100%; border-collapse: collapse; font-size: 14px; }
.rank th { color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--border); }
.rank td { padding: 10px 6px; text-align: center; border-bottom: 1px solid var(--border); }
.rank .left { text-align: left; }
.rank tr.me td { background: rgba(255, 255, 255, .03); }
.rank .pos { font-family: Archivo; font-weight: 900; font-size: 18px; }
.rank .pos.p1 { color: var(--gold); }
.rank .pos.p2 { color: #d0d0dc; }
.rank .pos.p3 { color: #d39a6a; }
.rank .tot { font-weight: 700; font-size: 16px; color: var(--gold); }

/* Manage */
.edit-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.edit-row .input { margin-top: 0; padding: 9px 10px; min-width: 0; }
.edit-row input[type="datetime-local"] { flex: 1 1 0; }
.edit-row .narrow { width: 38%; flex: none; }
.edit-row.ev { flex-wrap: wrap; }
.edit-row.ev .input { flex: 1 1 200px; }
.edit-row .num { width: 22px; text-align: right; font-size: 12px; flex: none; }
.check-label { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 12px; white-space: nowrap; min-width: 56px; }
.roles { display: flex; gap: 4px; }
.role-toggle { width: 32px; height: 32px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); font-weight: 700; font-size: 12px; }
.role-toggle.on { background: var(--surface-2); color: var(--text); border-color: var(--muted); }
.star-toggle.on { color: var(--gold); border-color: var(--gold); }

/* Login */
.login { max-width: 420px; margin: 0 auto; padding: 56px 16px; }
.login .logo { font-size: 44px; text-align: center; }
.tagline { text-align: center; color: var(--muted); margin: 6px 0 28px; }
.tabs2 { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.tabs2 button { flex: 1; background: none; border: 0; padding: 9px; border-radius: 9px; color: var(--muted); }
.tabs2 button.on { background: var(--surface-2); color: var(--text); }
/* Login: come si gioca */
.how { margin: 0 0 24px; padding: 0 0 0 22px; color: var(--muted); font-size: 14px; }
.how li { margin: 6px 0; }
.how b { color: var(--text); }

/* Scheda Lega: lega corrente, "Le tue leghe", gestione, account */
.lead { margin: 4px 0 14px; font-size: 14px; }
.section-title { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); }
.leave-link { display: block; margin: 14px 0 2px; font-size: 14px; color: var(--muted); text-decoration: underline; }
.leagues-panel h4 { margin-top: 4px; }
.leagues-panel .league-list { margin-bottom: 14px; }
.leagues-panel .btn-row .btn { margin-top: 0; }
.btn.ghost.on { border-color: var(--accent); }
.form-card { margin-top: 8px; }
.no-league { margin-top: 24px; text-align: center; }
.account .btn { margin-top: 8px; }
.league-card.here { cursor: default; border-color: var(--border); opacity: .8; }
.league-list { display: flex; flex-direction: column; gap: 8px; }
.league-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
}
.league-card:hover { border-color: var(--accent); }
.league-card-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.league-card-body b { font-size: 16px; }
.league-card .btn.small { width: auto; margin: 0; flex: none; }
.league-card-go { font-size: 24px; color: var(--muted); }
.welcome { margin-top: 8px; }
.who { background: none; border: 0; padding: 4px 0; }
.who-switch { color: var(--accent); }
.toggle-card { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.toggle-card > div { flex: 1; }
.toggle-card .hint { margin: 4px 0 0; }
.rename { margin-top: 12px; }
.world-note { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.player-row { flex-wrap: wrap; border-bottom: 1px solid var(--border); padding: 8px 0; }
.player-row:last-of-type { border-bottom: 0; }
.player-tags { display: block; font-size: 12px; }
.player-actions { display: flex; gap: 6px; }
.player-actions .chip { font-size: 12px; padding: 4px 10px; }
.admin-tabs { margin-bottom: 4px; }
.episode-row { padding: 8px 0; border-bottom: 1px solid var(--border); }
.episode-row .edit-row { margin-bottom: 6px; }
.start-now { border-color: #2fbf71; color: #2fbf71; }
.open-check { white-space: normal; align-items: flex-start; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.open-check input { margin-top: 2px; }

.code-input { font-family: Archivo, monospace; font-size: 22px; letter-spacing: .2em; text-align: center; text-transform: uppercase; }
