/* ============================================================
   TorneoBook — Concept B "Lavagna del Circolo"
   Header navy · griglia numeri · bianco su mobile
   ============================================================ */
:root {
  --navy:       #0f3460;
  --navy2:      #0a2844;
  --navy3:      #061a30;
  --blue-mid:   #1a4a7a;
  --blue-light: #4a8abf;
  --blue-pale:  #7abde8;
  --accent:     #f0a830;
  --accent2:    #fac040;
  --live:       #d42b2b;
  --green:      #1c8040;
  --green-bg:   #e8f8ee;
  --green-text: #1a6a3a;

  --bg:         #ffffff;
  --surface:    #f6f9fc;
  --surface2:   #edf2f8;
  --border:     #dce8f2;
  --border2:    #c8d8e8;

  --text:       #1c1c2e;
  --text2:      #4a6070;
  --text3:      #8090a0;
  --text4:      #b0bcc8;

  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--surface);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ── HEADER ── */
.tb-header {
  background: var(--navy);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 100;
}
.tb-header__logo {
  height: 42px; width: auto; flex-shrink: 0;
  border-radius: 8px;
}
.tb-header__logo-placeholder {
  width: 42px; height: 42px; border-radius: 8px;
  background: var(--blue-mid); border: 1px solid var(--blue-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--blue-pale); flex-shrink: 0;
}
.tb-header__info { flex: 1; min-width: 0; }
.tb-header__club {
  font-size: 17px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tb-header__sub { font-size: 11px; color: var(--blue-pale); margin-top: 1px; }
.tb-header__desc {
  font-size: 11px; color: var(--blue-light); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 1;
  -webkit-box-orient: vertical; overflow: hidden;
}
.tb-header__chips {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px;
}
.tb-chip {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 10px; border: 1px solid; white-space: nowrap;
}
.tb-chip i { font-size: 10px; }
.tb-chip--blue {
  background: rgba(122,189,232,.12);
  border-color: rgba(122,189,232,.25);
  color: var(--blue-pale);
}
.tb-chip--acc {
  background: rgba(240,168,48,.12);
  border-color: rgba(240,168,48,.25);
  color: var(--accent);
}
.tb-header__prog {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
}
.tb-header__prog-bar {
  flex: 1; height: 3px;
  background: rgba(255,255,255,.12);
  border-radius: 2px; overflow: hidden;
}
.tb-header__prog-fill {
  height: 100%; border-radius: 2px;
  background: #4adb7a;
  transition: width .4s ease;
}
.tb-header__prog-lbl {
  font-size: 10px; font-weight: 700;
  color: #4adb7a; flex-shrink: 0;
  white-space: nowrap;
}
.tb-header__btn {
  padding: 6px 10px; border: 1px solid var(--blue-light);
  border-radius: var(--radius-sm); background: transparent;
  color: var(--blue-pale); font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 5px; flex-shrink: 0;
  transition: background .15s;
}
.tb-header__btn:hover { background: var(--blue-mid); }
.tb-header__btn i { font-size: 16px; }

/* ── NUMERI GRANDI ── */
.tb-nums {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr));
  background: var(--navy2);
  border-bottom: 1px solid var(--navy3);
}
.tb-num {
  padding: 14px 16px;
  border-right: 1px solid var(--navy3);
  border-bottom: 1px solid var(--navy3);
}
.tb-num:nth-child(2) { border-right: none; }
.tb-num:nth-child(3) { border-bottom: none; }
.tb-num:nth-child(4) { border-right: none; border-bottom: none; }
.tb-num__n {
  font-size: 30px; font-weight: 800; color: var(--blue-pale);
  line-height: 1; letter-spacing: -1px;
}
.tb-num__n--accent { color: var(--accent); }
.tb-num__n--green  { color: #4adb7a; }
.tb-num__l {
  font-size: 10px; color: #4a6a8a; text-transform: uppercase;
  letter-spacing: .5px; margin-top: 4px;
}

/* ── LIVE BANNER ── */
.tb-live {
  background: var(--live);
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px; height: 34px; overflow: hidden;
}
.tb-live--hidden { display: none; }
.tb-live__badge {
  display: flex; align-items: center; gap: 4px;
  font-size: 9px; font-weight: 800; color: #fff;
  letter-spacing: .6px; flex-shrink: 0;
}
.tb-live__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.9);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.2} }
.tb-live__ticker { flex: 1; overflow: hidden; }
.tb-live__text {
  white-space: nowrap; color: rgba(255,255,255,.95);
  font-size: 12px; font-weight: 500;
  display: inline-block;
  animation: ticker 22s linear infinite;
}
@keyframes ticker { 0%{transform:translateX(100%)} 100%{transform:translateX(-100%)} }

/* ── SEZIONE ── */
.tb-section { padding: 16px 16px 4px; }
.tb-section__hd {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px;
}
.tb-section__title {
  font-size: 11px; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: .7px;
  display: flex; align-items: center; gap: 5px; flex: 1;
}
.tb-section__title i { font-size: 14px; color: var(--navy); }
.tb-section__link {
  font-size: 12px; color: var(--navy); font-weight: 600;
  display: flex; align-items: center; gap: 3px;
  background: transparent; border: none; cursor: pointer;
}

/* ── PARTITA CARD ── */
.tb-match {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px;
  display: flex; align-items: stretch; overflow: hidden;
  transition: border-color .15s;
}
.tb-match:active { background: var(--surface); }
.tb-match__time-col {
  width: 52px; flex-shrink: 0;
  background: var(--surface2);
  border-right: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; padding: 10px 4px;
}
.tb-match__hour { font-size: 14px; font-weight: 800; color: var(--navy); }
.tb-match__campo {
  font-size: 9px; color: var(--text3); text-align: center;
  margin-top: 3px; line-height: 1.2;
}
.tb-match__body { flex: 1; padding: 10px 12px; min-width: 0; }
.tb-match__players {
  font-size: 13px; font-weight: 600; color: var(--text);
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-word;
}
.tb-match__players--winner1 .p1 { color: var(--green); }
.tb-match__players--winner2 .p2 { color: var(--green); }
.tb-match__meta { font-size: 11px; color: var(--text3); margin-top: 3px; }
.tb-match__result {
  font-size: 13px; font-weight: 800; color: var(--green);
  margin-top: 4px; letter-spacing: .5px;
}
.tb-match__tag {
  display: inline-block; font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 3px; margin-right: 4px;
}
.tb-match__right {
  flex-shrink: 0; display: flex; align-items: center;
  padding: 0 12px;
}
.tb-match__score-big {
  font-size: 16px; font-weight: 800; color: var(--green);
  letter-spacing: 1px;
}
.tb-match--live .tb-match__time-col { background: #fff0f0; }
.tb-match--live .tb-match__hour { color: var(--live); }

/* ── TORNEI GRIGLIA 2 COLONNE ── */
.tb-tgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px 4px;
}

.tb-tcard {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.tb-tcard:active { background: var(--surface); }
.tb-tcard.active {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(15,52,96,.15);
}
.tb-tcard__stripe { height: 3px; }
.tb-tcard__body   { padding: 10px 11px; }
.tb-tcard__nome   {
  font-size: 13px; font-weight: 700; color: var(--text);
  line-height: 1.3; margin-bottom: 3px;
  /* tronca a 2 righe */
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.tb-tcard__info   { font-size: 11px; color: var(--text3); }

/* ── DETTAGLIO TORNEO (espanso) ── */
.tb-detail {
  margin: 0 16px 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  display: none;
}
.tb-detail.open { display: block; }

/* Tab bar nel dettaglio */
.tb-detail-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.tb-detail-tab {
  flex: 1; padding: 10px 4px;
  font-size: 12px; font-weight: 600; color: var(--text3);
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer; text-align: center;
  transition: color .15s, border-color .15s;
}
.tb-detail-tab.active { color: var(--navy); border-bottom-color: var(--navy); }

.tb-detail-panel { display: none; }
.tb-detail-panel.active { display: block; }

/* Classifica nel dettaglio */
.tb-group { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.tb-group:last-child { border-bottom: none; }
.tb-group__title {
  font-size: 10px; font-weight: 800; color: var(--navy);
  text-transform: uppercase; letter-spacing: .8px;
  margin-bottom: 8px; display: flex; align-items: center; gap: 5px;
}
.tb-group__title::before {
  content: ''; width: 3px; height: 12px;
  background: var(--accent); border-radius: 2px; display: inline-block;
}
.tb-ranking { width: 100%; border-collapse: collapse; }
.tb-ranking th {
  font-size: 10px; font-weight: 700; color: var(--text4);
  text-transform: uppercase; letter-spacing: .4px;
  padding: 0 0 5px; text-align: center;
}
.tb-ranking th:first-child { text-align: left; }
.tb-ranking td {
  padding: 6px 0; text-align: center;
  font-size: 12px; color: var(--text2);
  border-top: 1px solid var(--border);
}
.tb-ranking td:first-child { text-align: left; color: var(--text); font-weight: 600; font-size: 13px; }
.tb-ranking tr.qualified td:first-child::before {
  content: ''; display: inline-block;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--green); margin-right: 6px; vertical-align: middle;
}
.tb-ranking .pos { font-size: 11px; color: var(--text4); width: 16px; display: inline-block; }

/* Partite nel dettaglio */
.tb-detail-matches { padding: 10px 14px; }
.tb-grp-label {
  font-size: 10px; font-weight: 700; color: var(--navy);
  text-transform: uppercase; letter-spacing: .7px;
  margin: 8px 0 6px; display: flex; align-items: center; gap: 5px;
}
.tb-grp-label::before {
  content: ''; width: 3px; height: 10px;
  background: var(--accent); border-radius: 2px;
}
.tb-dm {
  display: flex; align-items: center;
  padding: 8px 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 5px; gap: 8px;
}
.tb-dm__time { font-size: 12px; font-weight: 700; color: var(--navy); width: 36px; flex-shrink: 0; }
.tb-dm__names { flex: 1; font-size: 12px; color: var(--text); font-weight: 500; }
.tb-dm__score { font-size: 12px; font-weight: 800; color: var(--green); flex-shrink: 0; }
.tb-dm__pend { font-size: 11px; color: var(--text4); flex-shrink: 0; }

/* Bracket nel dettaglio */
.tb-bracket-nav {
  display: flex; gap: 6px; padding: 12px 14px 0;
  overflow-x: auto; scrollbar-width: none;
}
.tb-bracket-nav::-webkit-scrollbar { display: none; }
.tb-bracket-pill {
  flex-shrink: 0; padding: 5px 13px;
  border-radius: 20px; font-size: 11px; font-weight: 700;
  border: 1px solid var(--border2); background: transparent;
  color: var(--text3); cursor: pointer; transition: all .15s;
}
.tb-bracket-pill.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.tb-bracket-list { padding: 10px 14px; }
.tb-bm {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 8px; overflow: hidden;
}
.tb-bm__row {
  display: flex; align-items: center;
  padding: 8px 10px; gap: 8px;
}
.tb-bm__row + .tb-bm__row { border-top: 1px solid var(--border); background: var(--surface); }
.tb-bm__seed {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface2); font-size: 9px; font-weight: 700;
  color: var(--text3); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tb-bm__row--winner .tb-bm__seed { background: var(--navy); color: #fff; }
.tb-bm__name { flex: 1; font-size: 13px; color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-bm__row--winner .tb-bm__name { color: var(--green); }
.tb-bm__row--loser  .tb-bm__name { color: var(--text4); }
.tb-bm__row--tbd    .tb-bm__name { color: var(--text4); font-style: italic; font-weight: 400; }
.tb-bm__score { font-size: 13px; font-weight: 800; color: var(--text); flex-shrink: 0; }
.tb-bm__row--winner .tb-bm__score { color: var(--green); }
.tb-bm__when {
  font-size: 11px; color: var(--navy); padding: 4px 10px 5px;
  background: var(--surface); border-top: 1px solid var(--border); text-align: center;
}
.tb-bracket-type { display: flex; gap: 6px; padding: 12px 14px 0; }
.tb-bracket-type-btn {
  padding: 4px 12px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 700;
  border: 1px solid var(--border2); background: transparent;
  color: var(--text3); cursor: pointer; transition: all .15s;
}
.tb-bracket-type-btn.active { background: var(--surface2); color: var(--text); }

/* ── ADMIN STYLES ── */
.tb-admin-bar {
  background: var(--navy); padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 100;
}
.tb-admin-back {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--blue-light); background: transparent;
  color: var(--blue-pale); display: flex; align-items: center;
  justify-content: center; font-size: 16px; text-decoration: none;
  flex-shrink: 0;
}
.tb-admin-title { font-size: 15px; font-weight: 700; color: #fff; flex: 1; }
.tb-admin-sub { font-size: 11px; color: var(--blue-pale); margin-top: 1px; }

/* ── BADGE / PILL ── */
.tb-badge {
  display: inline-flex; align-items: center;
  font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: .3px;
}
.tb-badge--gironi  { background: #e8f4fd; color: #1a5a8a; }
.tb-badge--bracket { background: #fdf4e0; color: #8a6010; }
.tb-badge--concluso{ background: #e8f8ee; color: var(--green-text); }
.tb-badge--bozza   { background: var(--surface2); color: var(--text3); }
.tb-badge--tennis  { background: #fff0e0; color: #8a4010; }
.tb-badge--padel   { background: #e8f4fd; color: #1a5a8a; }

/* ── FORM / BOTTONI ── */
.tb-field { margin-bottom: 14px; }
.tb-field label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--text3); text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 5px;
}
.tb-field input, .tb-field select, .tb-field textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text);
  padding: 10px 12px; font-size: 14px;
  transition: border-color .15s; -webkit-appearance: none;
}
.tb-field input:focus, .tb-field select:focus, .tb-field textarea:focus {
  outline: none; border-color: var(--navy);
}
.tb-field textarea { resize: vertical; min-height: 70px; }

.tb-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 18px; border-radius: var(--radius);
  font-size: 14px; font-weight: 700; border: none;
  cursor: pointer; transition: opacity .15s, transform .1s; white-space: nowrap;
}
.tb-btn:active { transform: scale(.97); }
.tb-btn--primary { background: var(--navy); color: #fff; }
.tb-btn--primary:hover { background: var(--blue-mid); }
.tb-btn--accent  { background: var(--accent); color: #1a1a1a; }
.tb-btn--secondary {
  background: var(--surface2); color: var(--navy);
  border: 1px solid var(--border2); font-weight: 700;
}
.tb-btn--secondary:hover { background: var(--border); }
.tb-btn--ghost   {
  background: transparent; color: var(--text);
  border: 1px solid var(--border2); font-weight: 600;
}
.tb-btn--ghost:hover { background: var(--surface2); }
.tb-btn--danger  { background: #d42b2b; color: #fff; font-weight: 700; }
.tb-btn--success { background: var(--green); color: #fff; font-weight: 700; }
.tb-btn--full    { width: 100%; }
.tb-btn--sm      { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }

/* Accordion dash */
.dash-create { margin: 12px 16px; }
.dash-create__toggle {
  width: 100%; background: var(--navy); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 12px 16px; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
}
.dash-create__toggle i { font-size: 18px; }
.dash-create__toggle .spacer { flex: 1; }
.dash-create__toggle .arrow { font-size: 16px; transition: transform .25s; }
.dash-create.open .arrow { transform: rotate(180deg); }
.dash-create__body {
  display: none; background: var(--bg);
  border: 1px solid var(--border2); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius); padding: 16px;
}
.dash-create.open .dash-create__body { display: block; }

/* Admin partita */
.tb-admin-partita { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.tb-admin-partita--scheduled { border-color: var(--accent); border-width: 1.5px; box-shadow: 0 0 0 1px rgba(240,168,48,.15); }
.tb-admin-partita--scheduled .tb-admin-partita__head { background: rgba(240,168,48,.08); }
.tb-admin-partita__head { display: flex; align-items: center; justify-content: space-between; padding: 7px 12px; background: var(--surface2); font-size: 11px; color: var(--text3); }
.tb-score-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tb-score-row__name { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-score-input { width: 40px; height: 38px; text-align: center; background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius-sm); color: var(--text); font-size: 16px; font-weight: 800; }
.tb-score-input:focus { outline: none; border-color: var(--navy); }

/* Stats dash */
.dash-stat { background: var(--surface2); border: none; border-radius: var(--radius); padding: 10px; text-align: center; }
.dash-stat__n { font-size: 20px; font-weight: 800; color: var(--navy); }
.dash-stat__l { font-size: 9px; color: var(--text3); text-transform: uppercase; letter-spacing: .4px; margin-top: 1px; }

/* ── MODAL ── */
.tb-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 200;
  align-items: flex-end; justify-content: center;
}
.tb-modal-overlay.open { display: flex; }
.tb-modal {
  background: var(--bg); border: 1px solid var(--border2);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%; max-width: 600px;
  max-height: 88vh; overflow-y: auto;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom,0));
  animation: modal-up .25s ease;
}
@keyframes modal-up { from{transform:translateY(30px);opacity:0} to{transform:translateY(0);opacity:1} }
.tb-modal__handle { width: 36px; height: 4px; background: var(--border2); border-radius: 2px; margin: 0 auto 16px; }
.tb-modal__title { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 16px; }

/* ── TOAST ── */
.tb-toast-container {
  position: fixed; bottom: calc(16px + env(safe-area-inset-bottom,0));
  left: 50%; transform: translateX(-50%); z-index: 999;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; width: calc(100% - 32px); max-width: 400px;
}
.tb-toast {
  background: var(--navy); color: #fff;
  border-radius: var(--radius); padding: 10px 16px;
  font-size: 13px; font-weight: 600; width: 100%;
  animation: toast-in .25s ease forwards; pointer-events: auto;
  display: flex; align-items: center; gap: 8px;
}
.tb-toast--success { border-left: 3px solid #4adb7a; }
.tb-toast--error   { border-left: 3px solid #ff6060; }
.tb-toast--info    { border-left: 3px solid var(--blue-pale); }
@keyframes toast-in { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

/* ── FOOTER ── */
.tb-footer {
  background: var(--surface2); border-top: 1px solid var(--border);
  padding: 12px 16px;
}
.tb-footer__links {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin-bottom: 6px;
}
.tb-footer__link {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text2); text-decoration: none;
  transition: color .15s;
}
.tb-footer__link:hover { color: var(--navy); }
.tb-footer__link--wa { color: #1a9a40; }
.tb-footer__link i { font-size: 15px; }
.tb-footer__copy { text-align: center; font-size: 10px; color: var(--text4); }

/* ── UTILITÀ ── */
.tb-empty { text-align: center; padding: 28px 16px; color: var(--text3); font-size: 14px; }
.tb-spinner {
  width: 20px; height: 20px; border: 2px solid var(--border2);
  border-top-color: var(--navy); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 24px auto;
}
@keyframes spin { to{transform:rotate(360deg)} }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }


/* ── TAB ADMIN (Giocatori / Partite / Config) ── */
.tb-tabs {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 56px; z-index: 90;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tb-tabs::-webkit-scrollbar { display: none; }

.tb-tab {
  flex: 1; min-width: 80px;
  padding: 12px 8px;
  font-size: 13px; font-weight: 600;
  color: var(--text3);
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap;
  display: flex; align-items: center;
  justify-content: center; gap: 5px;
  transition: color .15s, border-color .15s;
}
.tb-tab i { font-size: 15px; }
.tb-tab:hover { color: var(--text2); }
.tb-tab.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

.tb-tab-content { display: none; }
.tb-tab-content.active { display: block; }

@media (min-width: 600px) {
  body { max-width: 600px; margin: 0 auto; }
}

/* ── Contenuto regolamento nel modal ── */
#regolamentoContent h1,
#regolamentoContent h2,
#regolamentoContent h3 {
  color: var(--navy); font-weight: 700;
  margin: 16px 0 6px; line-height: 1.3;
}
#regolamentoContent h1 { font-size: 17px; }
#regolamentoContent h2 { font-size: 15px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
#regolamentoContent h3 { font-size: 13px; color: var(--text2); }
#regolamentoContent p  { margin-bottom: 10px; }
#regolamentoContent ul,
#regolamentoContent ol { padding-left: 18px; margin-bottom: 10px; }
#regolamentoContent li { margin-bottom: 4px; }
#regolamentoContent strong { color: var(--text); }
#regolamentoContent table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; margin-bottom: 12px;
}
#regolamentoContent th,
#regolamentoContent td {
  border: 1px solid var(--border);
  padding: 6px 8px; text-align: left;
}
#regolamentoContent th { background: var(--surface2); font-weight: 700; color: var(--navy); }
