/* Team Sassari Basket App
   Layout: one-column match-day app, sticky top bar on desktop, fixed bottom bar on phones.
   Look: the club's Instagram graphics — near-black court, blue underline bars, red slanted ribbons,
   big condensed italic type. Single dark look on purpose (club identity). */
:root {
  --bg: #06080d;
  --surface: #0d121d;
  --surface-2: #141b2b;
  --line: rgba(196, 214, 255, 0.10);
  --fg: #f3f6fb;
  --muted: #8e9ab3;
  --blue: #0160e1;
  --blue-hi: #2f83ff;
  --red: #df1421;
  --win: #16c172;
  --warn: #f5b13d;
  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --font-body: "Barlow", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --nav-h: 64px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
h1, h2, h3, h4, p, figure, pre { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 60;
  background: var(--bg);
}
/* Court atmosphere: faint key/arc lines and a warm floor glow, like the Instagram backgrounds. */
.ts-court {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(1, 96, 225, 0.18), transparent 60%),
    radial-gradient(80% 50% at 85% 100%, rgba(223, 20, 33, 0.10), transparent 60%),
    var(--bg);
}
.ts-court::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 140px;
  width: 760px;
  height: 760px;
  transform: translateX(-50%);
  border: 2px solid rgba(255, 255, 255, 0.035);
  border-radius: 50%;
  box-shadow: 0 0 0 120px rgba(255, 255, 255, 0.012);
}

.ts-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.ts-display {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  line-height: 0.92;
  text-wrap: balance;
}
.ts-label {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--muted);
}
.ts-num { font-variant-numeric: tabular-nums; }

/* Blue underline bar under section titles (as under "CONFERMATO"). */
.ts-title {
  display: inline-block;
  font-size: clamp(34px, 7vw, 54px);
  padding-bottom: 6px;
  background: linear-gradient(90deg, var(--blue), var(--blue) 70%, transparent) bottom left / 100% 5px no-repeat;
}

/* Red slanted ribbon (as the "Campionato DR2" strip). */
.ts-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
  padding: 4px 14px;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.ts-ribbon.blue { background: var(--blue); }

/* Header */
.ts-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
  background: rgba(6, 8, 13, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.ts-header-row { display: flex; align-items: center; gap: 16px; height: 64px; }
.ts-brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; min-width: 0; }
.ts-brand img { width: 42px; height: 42px; flex: none; }
.ts-brand small { display: block; font-size: 11px; color: var(--muted); font-family: var(--font-body); font-style: normal; font-weight: 600; letter-spacing: 0.04em; text-transform: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ts-topnav { display: none; margin-left: auto; gap: 4px; }
.ts-topnav button {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font-family: var(--font-display); font-style: italic; font-weight: 800; text-transform: uppercase;
  font-size: 18px; letter-spacing: 0.02em; padding: 8px 14px; position: relative;
}
.ts-topnav button[aria-current="page"] { color: var(--fg); }
.ts-topnav button[aria-current="page"]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 4px; background: var(--blue);
  transform: skewX(-20deg);
}
.ts-topnav button:hover { color: var(--fg); }

.ts-iconbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer;
  font: 600 13px var(--font-body);
}
.ts-iconbtn:hover { border-color: rgba(255, 255, 255, 0.25); }
.ts-header .ts-iconbtn { margin-left: auto; }

.ts-bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(10, 13, 21, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.ts-bottomnav-row { display: grid; grid-template-columns: repeat(4, 1fr); height: var(--nav-h); }
.ts-bottomnav button {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  position: relative;
}
.ts-bottomnav button svg { width: 22px; height: 22px; }
.ts-bottomnav button[aria-current="page"] { color: var(--fg); }
.ts-bottomnav button[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; background: var(--blue); transform: skewX(-20deg);
}
.ts-main { padding-block: 24px calc(var(--nav-h) + 40px + env(safe-area-inset-bottom, 0px)); }

@media (min-width: 860px) {
  .ts-topnav { display: flex; }
  .ts-header .ts-iconbtn { margin-left: 8px; }
  .ts-bottomnav { display: none; }
  .ts-main { padding-block: 36px 64px; }
}

/* Generic blocks */
.ts-panel {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: 14px;
}
.ts-notice {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px dashed rgba(245, 177, 61, 0.45);
  background: rgba(245, 177, 61, 0.07);
  color: #f6dcae;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13.5px;
}
.ts-notice svg { flex: none; margin-top: 2px; color: var(--warn); }

.ts-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.ts-chip.home { color: #cfe0ff; border-color: rgba(1, 96, 225, 0.6); background: rgba(1, 96, 225, 0.18); }
.ts-chip.away { color: #ffd4d7; border-color: rgba(223, 20, 33, 0.5); background: rgba(223, 20, 33, 0.12); }
.ts-chip.tbc { color: #f6dcae; border-color: rgba(245, 177, 61, 0.45); border-style: dashed; }
.ts-chip.win { color: #062b19; background: var(--win); border-color: var(--win); font-style: italic; font-weight: 800; }
.ts-chip.loss { color: #fff; background: var(--red); border-color: var(--red); font-style: italic; font-weight: 800; }
.ts-chip.post { color: #fff; background: #5b6478; border-color: #5b6478; }

.ts-seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 2px; max-width: 100%; overflow-x: auto; }
.ts-seg button {
  background: none; border: 0; color: var(--muted); cursor: pointer; white-space: nowrap;
  font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 7px 14px; border-radius: 9px;
}
.ts-seg button[aria-pressed="true"] { background: var(--blue); color: #fff; }

/* Hero */
.ts-hero { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .ts-hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.ts-final { position: relative; overflow: hidden; padding: 22px 20px 20px; cursor: pointer; text-align: left; color: inherit; font: inherit; width: 100%; }
.ts-final:hover { border-color: rgba(255, 255, 255, 0.22); }
.ts-final::before {
  content: ""; position: absolute; inset: auto -10% -40% 40%; height: 120%;
  background: radial-gradient(closest-side, rgba(1, 96, 225, 0.25), transparent);
  pointer-events: none;
}
.ts-score-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; margin-top: 10px; }
.ts-score-team { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.1; text-transform: none; min-width: 0; overflow-wrap: anywhere; }
.ts-score-team.right { text-align: right; }
.ts-score-big { font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: clamp(64px, 15vw, 104px); line-height: 0.85; font-variant-numeric: tabular-nums; }
.ts-score-big.dim { color: rgba(243, 246, 251, 0.45); }
.ts-score-dash { width: 28px; height: 8px; background: var(--fg); transform: skewX(-20deg); margin-bottom: 30px; }

.ts-next { padding: 20px; position: relative; overflow: hidden; }
.ts-next .vs { font-family: var(--font-display); font-weight: 800; font-style: italic; color: var(--muted); font-size: 20px; }
.ts-countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.ts-countdown div { background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; text-align: center; }
.ts-countdown b { display: block; font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 32px; line-height: 1; font-variant-numeric: tabular-nums; }
.ts-countdown span { font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }

/* Game cards */
.ts-games { display: grid; gap: 10px; }
@media (min-width: 860px) { .ts-games { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ts-game {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  padding: 14px; text-align: left; color: inherit; font: inherit; width: 100%; min-width: 0; box-sizing: border-box;
}
.ts-game.click { cursor: pointer; }
.ts-game.click:hover { border-color: rgba(255, 255, 255, 0.24); }
.ts-date { text-align: center; border-right: 1px solid var(--line); padding-right: 12px; }
.ts-date .d { font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 34px; line-height: 0.9; }
.ts-date .m, .ts-date .w { font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.ts-game .opp { font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 21px; line-height: 1.05; text-transform: uppercase; overflow-wrap: anywhere; }
.ts-game .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.ts-game .venue { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.ts-res { text-align: right; display: grid; justify-items: end; gap: 6px; }
.ts-res .sc { font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 30px; line-height: 0.9; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ts-res .time { font-family: var(--font-display); font-weight: 800; font-size: 22px; font-style: italic; }
@media (max-width: 420px) {
  .ts-game { grid-template-columns: 52px 1fr; }
  .ts-res { grid-column: 1 / -1; grid-template-columns: auto auto; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 8px; }
}

/* Standings */
.ts-table-wrap { overflow-x: auto; }
.ts-table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; min-width: 560px; }
.ts-table th {
  font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  text-align: right; padding: 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.ts-table td { padding: 12px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ts-table th:nth-child(2), .ts-table td:nth-child(2) { text-align: left; }
.ts-table th:first-child, .ts-table td:first-child { text-align: center; width: 40px; }
.ts-table td.team { font-weight: 600; white-space: normal; min-width: 160px; }
.ts-table td.pt { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.ts-table td.pos { font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 18px; color: var(--muted); }
.ts-table tr.me td { background: rgba(1, 96, 225, 0.22); }
.ts-table tr.me td:first-child { box-shadow: inset 4px 0 0 var(--red); color: var(--fg); }
.ts-table tr:last-child td { border-bottom: 0; }
.ts-table .pos-diff { color: var(--win); }
.ts-table .neg-diff { color: #ff6b74; }

/* Roster */
.ts-roster { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.ts-player {
  position: relative; overflow: hidden; padding: 0; cursor: pointer; text-align: left; color: inherit; font: inherit;
  display: flex; flex-direction: column;
}
.ts-player:hover { border-color: rgba(255, 255, 255, 0.24); }
.ts-player .photo {
  position: relative; aspect-ratio: 4 / 3; max-width: 100%;
  background: radial-gradient(closest-side at 50% 70%, rgba(1, 96, 225, 0.35), transparent), linear-gradient(180deg, #121a2c, #0a0e17);
  display: flex; align-items: flex-end; justify-content: center; overflow: hidden;
}
.ts-player .photo img { width: 100%; height: 100%; object-fit: cover; }
.ts-player .photo .ghost { width: 62%; height: auto; color: rgba(255, 255, 255, 0.10); }
.ts-player .jersey {
  position: absolute; right: 10px; bottom: -8px; font-family: var(--font-display); font-weight: 800; font-style: italic;
  font-size: 96px; line-height: 1; color: var(--blue); text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.08);
}
.ts-player .cap { position: absolute; top: 10px; left: 10px; }
.ts-player .body { padding: 12px 14px 14px; display: grid; gap: 10px; }
.ts-player .name { font-size: 28px; }
.ts-player .name small { display: block; font-size: 17px; color: var(--muted); }
.ts-stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ts-stats div { padding: 6px 4px; text-align: center; }
.ts-stats div + div { border-left: 1px solid var(--line); }
.ts-stats b { display: block; font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 24px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.ts-stats span { font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: 0.1em; color: var(--muted); }

/* Sponsors */
.ts-sponsors { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.ts-sponsors.main { grid-template-columns: 1fr; }
.ts-sponsor { padding: 18px; display: grid; gap: 12px; align-content: start; }
.ts-sponsor.slot { background: transparent; border-style: dashed; border-color: rgba(255, 255, 255, 0.18); }
.ts-logo {
  height: 96px; border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; padding: 12px; overflow: hidden;
}
.ts-logo img { max-height: 100%; max-width: 100%; object-fit: contain; }
.ts-logo.mono { background: linear-gradient(135deg, var(--blue), #00337a); color: #fff; font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 40px; }
.ts-sponsor.slot .ts-logo.mono { background: rgba(255, 255, 255, 0.04); color: rgba(255, 255, 255, 0.35); border: 1px dashed rgba(255, 255, 255, 0.18); font-size: 15px; letter-spacing: 0.08em; }
.ts-main-sponsor .ts-logo { height: 140px; }
.ts-cta {
  display: grid; gap: 14px; padding: 24px; position: relative; overflow: hidden;
  background: linear-gradient(110deg, var(--blue) 0%, #003d94 55%, var(--red) 140%);
  border-radius: 16px;
}
.ts-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none;
  font-family: var(--font-display); font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: 0.03em; font-size: 17px;
  border-radius: 10px; padding: 11px 18px; border: 1px solid transparent; background: var(--blue); color: #fff;
}
.ts-btn:hover { filter: brightness(1.12); }
.ts-btn.red { background: var(--red); }
.ts-btn.light { background: #fff; color: #001e4a; }
.ts-btn.ghost { background: transparent; border-color: var(--line); color: var(--fg); }
.ts-btn.danger { background: transparent; border-color: rgba(223, 20, 33, 0.6); color: #ff8890; }
.ts-btn.danger.armed { background: var(--red); color: #fff; }
.ts-btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.ts-btn.sm { font-size: 14px; padding: 7px 12px; border-radius: 8px; }
.ts-link { color: #9cc3ff; text-decoration: none; font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.ts-link:hover { text-decoration: underline; }

/* Modal */
.ts-modal-back {
  position: fixed; inset: 0; z-index: 80; background: rgba(2, 4, 8, 0.72); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  padding-top: env(safe-area-inset-top, 0px);
}
.ts-modal {
  width: 100%; max-width: 640px; max-height: calc(100% - 24px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 0 0;
  padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  animation: ts-up 0.22s ease-out;
}
.ts-modal.wide { max-width: 880px; }
@media (min-width: 700px) {
  .ts-modal-back { align-items: center; padding: 24px; }
  .ts-modal { border-radius: 18px; max-height: calc(100% - 48px); padding: 24px; }
}
@keyframes ts-up { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.ts-modal-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.ts-modal-head .ts-iconbtn { margin-left: auto; flex: none; }

.ts-bar { height: 10px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.ts-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--blue-hi)); transform-origin: left; }
.ts-boxrow { display: grid; grid-template-columns: 40px 1fr 44px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ts-boxrow:last-child { border-bottom: 0; }
.ts-boxrow .n { font-family: var(--font-display); font-weight: 800; font-style: italic; color: var(--blue-hi); font-size: 20px; text-align: center; }
.ts-boxrow .p { font-family: var(--font-display); font-weight: 800; font-size: 24px; text-align: right; font-variant-numeric: tabular-nums; }

/* Forms (admin) */
.ts-form { display: grid; gap: 12px; }
.ts-grid2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.ts-grid3 { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 480px) { .ts-grid3 { grid-template-columns: 1fr 1fr; } }
.ts-field { display: grid; gap: 5px; min-width: 0; }
.ts-field > span { font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ts-input, .ts-field input:not([type="checkbox"]):not([type="file"]), .ts-field select, .ts-field textarea {
  width: 100%; box-sizing: border-box; background: var(--bg); color: var(--fg); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font: 500 16px var(--font-body); min-height: 44px;
}
.ts-field textarea { min-height: 110px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.ts-field input[type="file"] { font: 500 14px var(--font-body); color: var(--muted); max-width: 100%; }
.ts-check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; min-height: 44px; }
.ts-check input { width: 22px; height: 22px; accent-color: var(--blue); }
.ts-admin-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.ts-admin-tabs button {
  flex: none; background: var(--bg); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 7px 14px; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase;
}
.ts-admin-tabs button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.ts-list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ts-list-row > div { min-width: 0; flex: 1; }
.ts-list-row .t { font-weight: 700; overflow-wrap: anywhere; }
.ts-list-row .s { font-size: 12.5px; color: var(--muted); }
.ts-stepper { display: grid; grid-template-columns: 40px 64px 40px; align-items: center; }
.ts-stepper button {
  height: 44px; background: var(--surface-2); color: var(--fg); border: 1px solid var(--line); font-size: 20px; font-weight: 700; cursor: pointer;
}
.ts-stepper button:first-child { border-radius: 10px 0 0 10px; }
.ts-stepper button:last-child { border-radius: 0 10px 10px 0; }
.ts-stepper input {
  height: 44px; width: 100%; box-sizing: border-box; text-align: center; background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-left: 0; border-right: 0; font: 800 20px var(--font-display); font-variant-numeric: tabular-nums;
}
.ts-sum { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ts-sum.ok { background: rgba(22, 193, 114, 0.14); color: #7cf0b8; border: 1px solid rgba(22, 193, 114, 0.4); }
.ts-sum.ko { background: rgba(245, 177, 61, 0.10); color: #f6dcae; border: 1px solid rgba(245, 177, 61, 0.4); }
.ts-progress { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.ts-progress i { display: block; height: 100%; width: 0; background: var(--blue); transition: width 0.2s; }
.ts-preview-img { max-height: 220px; width: auto; max-width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; }

.ts-toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 100;
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); max-width: calc(100% - 32px);
}
.ts-toast.err { background: var(--red); color: #fff; }
@media (min-width: 860px) { .ts-toast { bottom: 24px; } }

.ts-empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.ts-skel { height: 120px; border-radius: 14px; background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface)); background-size: 200% 100%; animation: ts-sk 1.2s infinite linear; }
@keyframes ts-sk { to { background-position: -200% 0; } }

:focus-visible { outline: 2px solid var(--blue-hi); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.ts-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ts-section { display: grid; gap: 18px; }
.ts-section + .ts-section { margin-top: 36px; }
.ts-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ts-between { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.ts-muted { color: var(--muted); }
.ts-small { font-size: 13px; }

/* Utility di riserva (uguali a Tailwind) se il CDN non risponde. */
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; } .mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; }
.hidden { display: none; }
@media (min-width: 640px) { .sm\:inline { display: inline; } }

.ts-preview-strip { background: rgba(1, 96, 225, 0.16); border-bottom: 1px solid rgba(1, 96, 225, 0.4); color: #cfe0ff; font-size: 13px; padding-block: 8px; }

/* Admin: modifica rapida, schede squadra, miniature foto */
.ts-editchip { cursor: pointer; background: var(--fg); color: var(--bg); border-color: var(--fg); min-height: 28px; }
.ts-thumb {
  width: 44px; height: 44px; flex: none; border-radius: 10px; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--line); font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 18px; color: var(--blue-hi);
}
.ts-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ts-teamlist { display: grid; gap: 10px; }
.ts-teamedit { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.ts-teamedit.me { border-color: rgba(1, 96, 225, 0.6); background: rgba(1, 96, 225, 0.12); }
.ts-teamedit.warn { border-color: rgba(245, 177, 61, 0.5); }
.ts-numgrid { display: grid; gap: 8px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ts-numgrid input { text-align: center; padding: 8px 4px !important; font-variant-numeric: tabular-nums; }
.ts-numgrid .ts-field > span { text-align: center; }
.ts-numgrid b { text-align: center; display: block; }
@media (max-width: 520px) { .ts-numgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ts-staff { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.ts-staffcard { display: flex; align-items: center; gap: 12px; padding: 12px; }
.ts-staffcard .ts-thumb { width: 56px; height: 56px; font-size: 24px; }
.ts-list-row .ts-iconbtn { flex: none; }
