/* ============================================================
   Tornei (Components/Pages/TorneiHub.razor + Tornei/*)
   Riusa i pattern di zp-drophub.css (dh-*): qui solo ciò che è
   specifico dei tornei. Prefisso tn-.
   ============================================================ */

/* ── Colore per gioco ─────────────────────────────────────── */
.tn-game--onepiece   { --g-fg: #DC2626; --g-bg: #FEE2E2; }
.tn-game--digimon    { --g-fg: #2563EB; --g-bg: #DBEAFE; }
.tn-game--gundam     { --g-fg: #475569; --g-bg: #E2E8F0; }
.tn-game--riftbound  { --g-fg: #7C3AED; --g-bg: #F3E8FF; }
.tn-game--dragonball { --g-fg: #EA580C; --g-bg: #FFEDD5; }
.tn-game--pokemon    { --g-fg: #B45309; --g-bg: #FEF3C7; }
.tn-game--other      { --g-fg: var(--ember-700); --g-bg: var(--ember-100); }

.tn-game-well { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; font-size: 1.1rem; background: var(--g-bg, var(--ember-100)); color: var(--g-fg, var(--ember-700)); }
.tn-game-well--lg { width: 52px; height: 52px; border-radius: 14px; font-size: 1.45rem; }
.tn-game-mini { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; font-size: .62rem; margin-right: 3px; vertical-align: -3px; background: var(--g-bg); color: var(--g-fg); }

/* Chip filtro gioco (panoramica) e scelta gioco (modulo lega) */
.tn-games, .tn-game-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.tn-games { margin: 16px 0 4px; }
.tn-game-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 7px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-700);
  font: 700 var(--text-xs)/1 var(--font-sans); cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.tn-game-chip:first-child:not([class*="tn-game--"]) { padding-left: 12px; }
.tn-game-chip:hover { background: var(--paper-sunk); }
.tn-game-chip .tn-game-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; background: var(--g-bg); color: var(--g-fg); }
.tn-game-chip.on { border-color: var(--g-fg, var(--ember-500)); background: var(--g-bg, var(--ember-100)); color: var(--g-fg, var(--ember-700)); box-shadow: 0 0 0 1px var(--g-fg, var(--ember-500)) inset; }
.tn-game-chip.on .tn-game-dot { background: var(--g-fg); color: #fff; }
.tn-game-chip.empty:not(.on) { opacity: .55; }
.tn-game-chip:focus-visible { outline: none; box-shadow: var(--ring-ember); }

/* ── Panoramica ───────────────────────────────────────────── */
.tn-overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-top: 16px; }
.tn-overview-grid > .zp-card + .zp-card { margin-top: 0; }

.tn-agenda { display: flex; flex-direction: column; gap: 6px; }
.tn-agenda-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.tn-agenda-item:hover { background: var(--paper-sunk); border-color: var(--line-strong); }
.tn-agenda-main { flex: 1; min-width: 0; }
.tn-agenda-main .dh-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-agenda-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }

.tn-when { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: var(--info-bg); color: var(--info); font-size: .7rem; font-weight: 800; white-space: nowrap; }
.tn-when.today { background: var(--ember-500); color: #fff; }

/* Card lega */
.tn-league-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.tn-league-card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl, 16px);
  padding: 16px; cursor: pointer; position: relative; overflow: hidden;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.tn-league-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--g-fg, var(--ember-500)); }
.tn-league-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.tn-league-card:focus-visible { outline: none; box-shadow: var(--ring-ember); }
.tn-league-card.is-off { opacity: .68; background: var(--surface-2, var(--paper-sunk)); }
.tn-league-top { display: flex; align-items: flex-start; gap: 12px; }
.tn-league-name { font-family: var(--font-display); font-weight: 800; font-size: 1.08rem; color: var(--ink-900); line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; }
.tn-league-season { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border-radius: var(--r-md); background: var(--paper-sunk); }
.tn-league-season-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--ink-500); }
.tn-mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tn-mini-stats > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-md); min-width: 0; }
.tn-mini-stats .l { font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.tn-mini-stats .v { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-mini-stats .v small { font-size: .72rem; color: var(--text-faint); font-weight: 700; }
.tn-league-lines { display: flex; flex-direction: column; gap: 6px; font-size: var(--text-sm); }
.tn-league-line { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink-700); }
.tn-league-line.muted { color: var(--text-faint); }
.tn-ellipsis { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-pts { font-weight: 800; color: var(--gold-500); white-space: nowrap; font-size: var(--text-xs); }
.tn-league-foot { display: flex; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: auto; cursor: default; }
.tn-league-foot a.dh-icon-btn { text-decoration: none; }
.tn-league-new {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 180px; border: 2px dashed var(--line-strong); border-radius: var(--r-xl, 16px);
  background: transparent; color: var(--text-soft); font: 700 var(--text-sm)/1 var(--font-sans); cursor: pointer;
}
.tn-league-new i { font-size: 1.8rem; color: var(--ember-500); }
.tn-league-new:hover { border-color: var(--ember-400); color: var(--ember-700); background: var(--ember-100); }

/* Barre di avanzamento */
.tn-progress { height: 5px; border-radius: 3px; background: var(--bg-900); overflow: hidden; width: 100%; }
.tn-progress > div { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--ember-400), var(--ember-500)); }
.tn-progress--wide { max-width: 420px; margin-top: 8px; }

/* ── Mini-calendario ──────────────────────────────────────── */
.tn-date {
  width: 54px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface);
  line-height: 1; text-align: center;
}
.tn-date .m { width: 100%; padding: 4px 0 3px; background: var(--ember-500); color: #fff; font-size: .62rem; font-weight: 800; letter-spacing: .08em; }
.tn-date .d { padding: 6px 0 2px; font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; color: var(--ink-900); }
.tn-date .w { padding: 0 0 6px; font-size: .62rem; font-weight: 700; color: var(--text-faint); text-transform: uppercase; }
.tn-date--sm { width: 42px; border-radius: 10px; }
.tn-date--sm .m { font-size: .56rem; padding: 3px 0 2px; }
.tn-date--sm .d { font-size: 1.05rem; padding: 4px 0 5px; }
.tn-date--lg { width: 64px; }
.tn-date--lg .d { font-size: 1.7rem; }
.tn-date--none .m { display: none; }
.tn-date--none .d { color: var(--ink-300, var(--text-faint)); font-size: 1.1rem; padding-top: 10px; }
.tn-date--hl { border-color: var(--ember-400); box-shadow: 0 0 0 3px var(--ember-100); }

/* ── Testata lega / evento ────────────────────────────────── */
.tn-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; align-items: center; }
.tn-tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  background: var(--g-bg, var(--paper-sunk)); color: var(--g-fg, var(--ink-700));
  border: 1px solid var(--line); font-size: .72rem; font-weight: 700; white-space: nowrap;
}
.tn-public { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: var(--text-xs); color: var(--text-soft); min-width: 0; }
.tn-public-url { color: var(--info); font-weight: 700; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-family: var(--font-mono); font-size: .74rem; }
.tn-public-url:hover { text-decoration: underline; }
.tn-desc { margin-top: 10px; font-size: var(--text-sm); color: var(--ink-500); white-space: pre-line; max-width: 760px; }

/* Stagioni: barra con chip + scheda della stagione scelta */
.tn-season-bar { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.tn-season-label { font-size: var(--text-eyebrow); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-400); flex-shrink: 0; }
.tn-season-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.tn-season-chip {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-700); font: 700 var(--text-xs)/1 var(--font-sans); cursor: pointer; white-space: nowrap;
}
.tn-season-chip:hover { background: var(--paper-sunk); }
.tn-season-chip.on { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.tn-season-chip--add { border-style: dashed; color: var(--ember-700); }
.tn-season-chip--add:hover { background: var(--ember-100); border-color: var(--ember-400); }
.tn-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--ink-300, #C9BBAA); }
.tn-dot--ok { background: #3FA860; box-shadow: 0 0 0 3px rgba(63,168,96,.18); }
.tn-dot--info { background: #5FA8BF; }
.tn-dot--off { background: var(--text-faint); }
.tn-dot--draft { background: transparent; border: 2px dashed var(--text-faint); width: 9px; height: 9px; }

.tn-season-card { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--paper-sunk); }
.tn-season-info { flex: 1; min-width: 240px; }
.tn-season-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: var(--ink-900); }
.tn-season-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Stato evento: stepper + azione */
.tn-status-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.tn-status-actions { display: flex; gap: 6px; flex-shrink: 0; }

.tn-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tn-tabs::-webkit-scrollbar { display: none; }
.tn-tabs .zp-tabline-item { flex-shrink: 0; white-space: nowrap; }
/* Su telefono le tab vanno a capo: con lo scroll orizzontale (barra nascosta) "Montepremi" finiva fuori schermo e sembrava sparita. */
@media (max-width: 640px) {
  .tn-tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 4px; }
}

/* ── Lista eventi della stagione ──────────────────────────── */
.tn-events { display: flex; flex-direction: column; gap: 8px; }
.tn-event-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  cursor: pointer; transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.tn-event-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow-xs); transform: translateX(2px); }
.tn-event-row:focus-visible { outline: none; box-shadow: var(--ring-ember); }
.tn-event-row.is-next { border-color: var(--ember-300); background: linear-gradient(90deg, var(--ember-100), var(--surface) 45%); }
.tn-event-row.is-done .tn-date .m { background: var(--ink-500); }
.tn-event-main { flex: 1; min-width: 0; }
.tn-event-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tn-event-stats { display: flex; gap: 18px; flex-shrink: 0; }
.tn-event-stat { display: flex; flex-direction: column; gap: 3px; min-width: 76px; }
.tn-event-stat .l { font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.tn-event-stat .v { font-weight: 800; color: var(--ink-900); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 4px; }
.tn-event-stat .v small { color: var(--text-faint); font-weight: 700; }
.tn-event-stat .v.ok { color: var(--success); }
.tn-event-stat .v.warn { color: var(--warning); font-size: var(--text-xs); }
.tn-event-stat .v.muted { color: var(--text-faint); }
.tn-chevron { color: var(--text-faint); flex-shrink: 0; }

/* ── Classifica ───────────────────────────────────────────── */
.tn-podium { display: grid; grid-template-columns: 1fr 1.12fr 1fr; gap: 12px; align-items: end; margin-bottom: 16px; }
.tn-podium-step {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 18px 12px 0; border: 1px solid var(--line); border-radius: var(--r-xl, 16px) var(--r-xl, 16px) var(--r-md) var(--r-md);
  background: var(--surface); overflow: hidden; min-width: 0;
}
.tn-podium-step--1 { order: 2; border-color: var(--gold-300); background: linear-gradient(180deg, var(--gold-100), var(--surface) 70%); padding-top: 24px; }
.tn-podium-step--2 { order: 1; }
.tn-podium-step--3 { order: 3; }
.tn-medal { position: absolute; top: 10px; right: 12px; font-size: 1.1rem; }
.tn-podium-step--1 .tn-medal { color: #D4A017; font-size: 1.35rem; }
.tn-podium-step--2 .tn-medal { color: #94A3B8; }
.tn-podium-step--3 .tn-medal { color: #B87333; }
.tn-podium-name { font-weight: 800; color: var(--ink-900); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.tn-podium-pts { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--ink-900); line-height: 1.1; }
.tn-podium-pts small { font-size: .75rem; color: var(--text-faint); }
.tn-podium-base { width: calc(100% + 24px); margin-top: 10px; padding: 8px 0; font-family: var(--font-display); font-weight: 800; color: #fff; background: #B87333; }
.tn-podium-step--1 .tn-podium-base { background: #D4A017; padding: 14px 0; }
.tn-podium-step--2 .tn-podium-base { background: #94A3B8; padding: 10px 0; }

.tn-table-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px 12px; }
.tn-standings .c, .tn-results .c { text-align: center; }
.tn-standings .muted { color: var(--text-faint); }
.tn-standings tr.tn-top td { background: color-mix(in srgb, var(--gold-100) 35%, transparent); }
.tn-rank {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 9px;
  background: var(--paper-sunk); color: var(--ink-700); font-weight: 800; font-size: var(--text-xs); font-variant-numeric: tabular-nums;
}
.tn-rank--1 { background: #D4A017; color: #fff; }
.tn-rank--2 { background: #94A3B8; color: #fff; }
.tn-rank--3 { background: #B87333; color: #fff; }
.tn-rank-mobile { display: none; }
.tn-wdl { display: inline-block; min-width: 26px; padding: 2px 6px; border-radius: 6px; font-weight: 800; font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.tn-wdl--w { background: var(--success-bg); color: var(--success); }
.tn-wdl--d { background: var(--paper-sunk); color: var(--ink-500); }
.tn-wdl--l { background: var(--danger-bg); color: var(--danger); }
.tn-pts-big { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; color: var(--ink-900); }
.tn-rounds-note { display: flex; gap: 8px; align-items: flex-start; font-size: var(--text-xs); color: var(--text-soft); margin-bottom: 12px; }

.tn-audit { display: flex; flex-direction: column; }
.tn-audit-row { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--text-sm); }
.tn-audit-row:first-child { border-top: none; padding-top: 0; }
.tn-audit-row > i { color: var(--text-faint); margin-top: 2px; }

/* ── Risultati evento ─────────────────────────────────────── */
.tn-results-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tn-results-top > .zp-card + .zp-card { margin-top: 0; }
.tn-import-head { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.tn-import-body { margin-top: 14px; }
.tn-drop {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 22px 16px; border: 2px dashed var(--line-strong); border-radius: var(--r-md);
  background: var(--paper-sunk); color: var(--ink-500); font-size: var(--text-sm); cursor: pointer; text-align: center;
}
.tn-drop i { font-size: 1.5rem; color: var(--ember-500); }
.tn-drop:hover { border-color: var(--ember-400); background: var(--ember-100); }
.tn-drop.disabled { opacity: .6; cursor: not-allowed; }
.tn-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.tn-drop.disabled input[type=file] { cursor: not-allowed; }
.tn-help { font-size: var(--text-xs); color: var(--text-soft); margin: 0 0 12px; line-height: 1.5; }

.tn-results tr.is-dirty td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
.tn-results tr.no-result .dh-name { color: var(--ink-500); }
.tn-num { width: 82px; text-align: center; padding-left: 6px; padding-right: 6px; }

/* Ricerca giocatore con suggerimenti */
.tn-picker { position: relative; display: flex; width: 100%; }
.tn-picker .dh-search { flex: 1 1 auto; }
.tn-picker-menu {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  box-shadow: var(--shadow-md); padding: 4px; max-height: 320px; overflow-y: auto;
}
.tn-picker-item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: none; border-radius: 8px;
  background: none; text-align: left; font: inherit; font-size: var(--text-sm); cursor: pointer; color: var(--ink-700);
}
.tn-picker-item:hover { background: var(--paper-sunk); }
.tn-picker-new { color: var(--ember-700); }
.tn-picker-new i { font-size: 1rem; }
.tn-picker-empty { padding: 8px 10px; font-size: var(--text-xs); color: var(--text-faint); }

/* ── Iscritti & quote ─────────────────────────────────────── */
.tn-chip-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tn-chip-stat {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: var(--text-xs); color: var(--ink-500);
}
.tn-chip-stat b { color: var(--ink-900); font-size: var(--text-sm); }
.tn-chip-stat.ok { background: var(--success-bg); border-color: var(--success-line); color: var(--success); }
.tn-chip-stat.ok b { color: var(--success); }
.tn-chip-stat.warn { background: var(--warning-bg); border-color: var(--warning-line); color: var(--warning); }
.tn-chip-stat.warn b { color: var(--warning); }
.tn-chip-stat.muted { background: transparent; border-style: dashed; }

.tn-list { display: flex; flex-direction: column; gap: 6px; }
.tn-list-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.tn-list-row.is-ok { box-shadow: inset 3px 0 0 var(--success); }
.tn-list-row.is-warn { box-shadow: inset 3px 0 0 var(--warning-line); }
.tn-list-badge { flex-shrink: 0; }
.tn-pay { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* ── Montepremi / cassa ───────────────────────────────────── */
.tn-cash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tn-cash-tile { padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.tn-cash-tile .l { font-size: var(--text-xs); font-weight: 700; color: var(--ink-500); display: flex; align-items: center; gap: 6px; }
.tn-cash-tile .v { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; color: var(--ink-900); margin-top: 4px; letter-spacing: -.02em; }
.tn-cash-tile .s { font-size: var(--text-xs); color: var(--text-faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-cash-tile--ember { background: linear-gradient(135deg, var(--inverse-surface), #3a2618); border-color: transparent; }
.tn-cash-tile--ember .l { color: var(--ember-300); }
.tn-cash-tile--ember .v { color: #fff; }
.tn-cash-tile--ember .s { color: var(--inverse-text-muted); }
.tn-cash-tile--info { background: var(--info-bg); border-color: var(--info-line); }
.tn-cash-tile--info .l { color: var(--info); }
.tn-cash-tile--edit { border-color: var(--line-ember); }
.tn-inline-edit { display: flex; gap: 6px; margin-top: 8px; }
.tn-inline-edit .zp-select { flex: 1; min-width: 0; }
.tn-inline-edit .zp-input { width: 90px; }

.tn-cash-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.tn-cash-forms > .zp-card + .zp-card { margin-top: 0; }
.tn-form-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.tn-split {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0;
  padding: 10px 14px; border-radius: var(--r-md); background: var(--ember-100); border: 1px solid var(--line-ember);
}
.tn-split > div { display: flex; flex-direction: column; }
.tn-split span { font-size: .66rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ember-700); }
.tn-split b { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink-900); }
.tn-split > i { color: var(--ember-600); }

.tn-money-input { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.tn-money-input span { padding: 0 4px 0 11px; color: var(--text-faint); font-weight: 700; }
.tn-money-input .zp-input { border: none; width: 100px; padding-left: 4px; box-shadow: none; }
.tn-money-input:focus-within { border-color: var(--ember-400); box-shadow: var(--ring-ember); }

.tn-stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.tn-stepper button { width: 38px; border: none; background: var(--paper-sunk); color: var(--ink-700); cursor: pointer; font-size: 1rem; }
.tn-stepper button:hover:not(:disabled) { background: var(--bg-900); }
.tn-stepper button:disabled { opacity: .45; cursor: not-allowed; }
.tn-stepper input { width: 64px; border: none; text-align: center; font: 700 var(--text-sm)/1 var(--font-sans); color: var(--ink-900); background: var(--surface); -moz-appearance: textfield; }
.tn-stepper input::-webkit-outer-spin-button, .tn-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tn-stepper input:focus { outline: none; }

.tn-ledger { display: flex; flex-direction: column; }
.tn-ledger-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--line); }
.tn-ledger-row:first-child { border-top: none; }
.tn-ledger-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.tn-ledger-icon.league { background: var(--ember-100); color: var(--ember-700); }
.tn-ledger-icon.event { background: var(--info-bg); color: var(--info); }
.tn-ledger-icon.neg { background: var(--danger-bg); color: var(--danger); }
.tn-ledger-main { flex: 1; min-width: 0; }
.tn-ledger-amount { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tn-ledger-amount.pos { color: var(--success); }
.tn-ledger-amount.neg { color: var(--danger); }

/* Ricalcolo montepremi lega: ultimo esito sotto il bottone + righe dell'anteprima */
.tn-recalc-last { display: flex; gap: 6px; margin-top: 8px; font-size: var(--text-xs); color: var(--text-soft); line-height: 1.4; }
.tn-recalc-last i { color: var(--ink-500); margin-top: 1px; }
.tn-recalc-note { font-size: var(--text-xs); color: var(--text-soft); margin-top: 3px; line-height: 1.4; }
.tn-recalc-note.warn { color: var(--warning); font-weight: 600; }
.tn-recalc-amount { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tn-recalc-amount s { font-size: var(--text-xs); color: var(--text-faint); }
.tn-recalc-amount b { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; color: var(--ink-900); }

/* ── Moduli ───────────────────────────────────────────────── */
.tn-form-section {
  display: flex; align-items: center; gap: 8px; margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
  font-size: var(--text-eyebrow); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ember-700);
}
.tn-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--paper-sunk); border-radius: 10px; }
.tn-seg button { padding: 7px 12px; border: none; border-radius: 7px; background: transparent; color: var(--ink-500); font: 700 var(--text-xs)/1 var(--font-sans); cursor: pointer; white-space: nowrap; }
.tn-seg button.on { background: var(--surface); color: var(--ink-900); box-shadow: var(--shadow-xs); }
.tn-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--text-sm); color: var(--ink-700); user-select: none; }
.tn-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tn-switch-track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--bg-900); border: 1px solid var(--line-strong); flex-shrink: 0; transition: background var(--dur-fast) var(--ease); }
.tn-switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: transform var(--dur-fast) var(--ease); }
.tn-switch input:checked + .tn-switch-track { background: var(--success); border-color: var(--success); }
.tn-switch input:checked + .tn-switch-track::after { transform: translateX(16px); }
.tn-switch input:focus-visible + .tn-switch-track { box-shadow: var(--ring-ember); }

/* ── Tablet ───────────────────────────────────────────────── */
@media (max-width: 980px) {
  .tn-results-top { grid-template-columns: minmax(0, 1fr); }
  .tn-event-stats { gap: 12px; }
}

/* ── Telefono ─────────────────────────────────────────────── */
@media (max-width: 760px) {
  .tn-games { flex-wrap: nowrap; overflow-x: auto; margin-left: -4px; margin-right: -4px; padding: 0 4px 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tn-games::-webkit-scrollbar { display: none; }
  .tn-game-chip { flex-shrink: 0; padding-top: 8px; padding-bottom: 8px; }
  .tn-overview-grid { grid-template-columns: minmax(0, 1fr); }
  .tn-league-grid { grid-template-columns: minmax(0, 1fr); }
  .tn-league-new { min-height: 90px; flex-direction: row; }

  .dh-head .tn-date--lg { width: 56px; }
  .dh-head .tn-date--lg .d { font-size: 1.4rem; }
  .tn-season-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .tn-season-actions { width: 100%; }
  .tn-season-actions .zp-btn { flex: 1; justify-content: center; }
  .tn-status-row { flex-direction: column; align-items: stretch; }
  .tn-status-actions .zp-btn { width: 100%; justify-content: center; padding-top: 10px; padding-bottom: 10px; }

  .tn-event-row { flex-wrap: wrap; gap: 10px 12px; padding: 12px; align-items: flex-start; }
  .tn-event-row:hover { transform: none; }
  .tn-event-main { flex: 1 1 calc(100% - 80px); }
  .tn-event-stats { width: 100%; padding-top: 10px; border-top: 1px dashed var(--line); justify-content: flex-start; }
  .tn-event-stat { flex: 1; }
  .tn-chevron { display: none; }

  .tn-podium { gap: 6px; }
  .tn-podium-step { padding: 14px 6px 0; }
  .tn-podium-step .dh-avatar--lg { width: 36px; height: 36px; font-size: .74rem; }
  .tn-podium-pts { font-size: 1.15rem; }
  .tn-podium-step .dh-sub { display: none; }
  .tn-medal { top: 6px; right: 6px; font-size: .9rem; }

  .tn-table-head { padding: 12px; }
  .tn-table-head .dh-search { flex-basis: 100% !important; }
  .tn-standings tbody tr td[data-label="Posizione"],
  .tn-results tbody tr td[data-label="Posizione"] { display: none !important; }
  .tn-standings tbody tr td:nth-child(2),
  .tn-results tbody tr td:nth-child(2) { border-top: 0; padding-top: 0 !important; grid-template-columns: 1fr; }
  .tn-standings tbody tr.tn-top { border-color: var(--gold-300); }
  .tn-rank-mobile { display: inline-grid; margin-right: 2px; }
  .tn-num { width: 100% !important; }
  .tn-results tbody tr td[data-label="Azioni"] .dh-actions { justify-content: stretch; }
  .tn-results tbody tr td[data-label="Azioni"] .dh-icon-btn { flex: 1; height: 38px; }

  .tn-list-row { align-items: stretch; }
  .tn-pay { width: 100%; margin-left: 0; }
  .tn-pay .tn-money-input { flex: 1; }
  .tn-pay .tn-money-input .zp-input { width: 100%; }

  .tn-cash-forms { grid-template-columns: minmax(0, 1fr); }
  .tn-cash-tile .v { font-size: 1.45rem; }
  .tn-form-row > div { flex: 1 1 100%; }
  .tn-form-row .zp-select, .tn-form-row .tn-money-input { width: 100%; }
  .tn-form-row .tn-money-input .zp-input { width: 100%; }
  .tn-cash-forms .zp-card > .zp-btn { width: 100%; justify-content: center; }
  .tn-ledger-row { flex-wrap: wrap; }
  .tn-ledger-main { flex: 1 1 calc(100% - 160px); }

}
