/* =====================================================================
   MATCHORA — Esperienza visiva (caricato su tutte le pagine dopo base.css)
   Movimento, profondità e colore: sfondo vivo, comparse morbide,
   pulsanti con riflesso, card dei tornei per sport, home con hero.
   Tutto rispetta "riduci movimento" del sistema operativo.
   ===================================================================== */

:root {
  --m-grad-brand: linear-gradient(135deg, #7a66f0 0%, #5b4cdb 45%, #3a2fa1 100%);
  --m-grad-gold:  linear-gradient(135deg, #ffd166 0%, #f5b341 50%, #f39c12 100%);
  --m-glow: 0 10px 40px -10px rgba(91, 76, 219, .55);
}

/* ---------- Sfondo e comparsa delle pagine ---------------------------- */
body {
  background:
    radial-gradient(900px 520px at 105% -10%, rgba(122, 102, 240, .13), transparent 60%),
    radial-gradient(700px 420px at -10% 0%, rgba(243, 156, 18, .08), transparent 60%),
    var(--m-bg);
  background-attachment: fixed;
}
.m-page { animation: m-entra .5s var(--m-ease) both; }
@keyframes m-entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Elementi che compaiono quando entrano nello schermo (js/esperienza.js) */
.m-pre { opacity: 0; transform: translateY(22px) scale(.985); }
.m-vis { opacity: 1; transform: none; transition: opacity .65s var(--m-ease), transform .65s var(--m-ease); transition-delay: var(--m-ritardo, 0ms); }

/* ---------- Navbar ---------------------------------------------------- */
.m-navbar { transition: box-shadow .25s var(--m-ease), background .25s var(--m-ease); }
.m-navbar.is-scrolled { box-shadow: 0 8px 30px -12px rgba(29, 24, 86, .25); background: rgba(255, 255, 255, .94); }
.m-navbar__brand-mark { transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.m-navbar__brand:hover .m-navbar__brand-mark { transform: rotate(-8deg) scale(1.08); }
.m-navbar__link { position: relative; }
.m-navbar__link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; border-radius: 2px;
  background: var(--m-grad-brand); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--m-ease);
}
.m-navbar__link:hover::after, .m-navbar__link--active::after { transform: scaleX(1); }

/* ---------- Pulsanti --------------------------------------------------- */
.m-btn--primary, .m-btn--gold { position: relative; overflow: hidden; isolation: isolate; }
.m-btn--primary { background: var(--m-grad-brand); border-color: transparent; }
.m-btn--primary:hover { background: var(--m-grad-brand); transform: translateY(-1px); box-shadow: var(--m-glow); }
.m-btn--gold { background: var(--m-grad-gold); border-color: transparent; }
.m-btn--gold:hover { background: var(--m-grad-gold); transform: translateY(-1px); box-shadow: 0 10px 30px -10px rgba(243, 156, 18, .6); }
.m-btn--primary::after, .m-btn--gold::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .38) 50%, transparent 70%);
  transform: translateX(-130%); transition: transform .7s var(--m-ease);
}
.m-btn--primary:hover::after, .m-btn--gold:hover::after { transform: translateX(130%); }
.m-btn--secondary:hover, .m-btn--ghost:hover { transform: translateY(-1px); }
.m-btn:active { transform: translateY(1px) scale(.98); }

/* ---------- Card, tabelle, badge ------------------------------------- */
.m-card { transition: transform var(--m-t), box-shadow var(--m-t), border-color var(--m-t); }
.m-table tbody tr { transition: background-color .15s ease; }
.m-table tbody tr:hover { background: var(--m-primary-50); }
.m-rank--1 { box-shadow: 0 0 0 3px rgba(245, 179, 65, .25); }

/* Pallino "in diretta" che pulsa */
.m-state-in_corso::before, .t-chip--live > span:first-child { animation: m-pulsa 1.6s ease-in-out infinite; }
@keyframes m-pulsa {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31, 157, 85, .55); }
  50%      { box-shadow: 0 0 0 6px rgba(31, 157, 85, 0); }
}

/* Schede (Info torneo / Struttura) */
.m-tab { transition: color .2s ease, background-color .2s ease; }

/* ---------- Testata dei tornei --------------------------------------- */
.t-hero { isolation: isolate; }
.t-hero::after {
  content: ""; position: absolute; z-index: -1; inset: -40% -10% auto auto; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(243, 156, 18, .28), transparent 65%);
  animation: m-fluttua 14s ease-in-out infinite alternate;
}
.t-hero__emoji {
  position: absolute; right: 4%; bottom: -18px; font-size: clamp(90px, 14vw, 170px); line-height: 1;
  opacity: .18; transform: rotate(-14deg); pointer-events: none; user-select: none;
  animation: m-dondola 7s ease-in-out infinite alternate;
}
@keyframes m-fluttua { from { transform: translate(0, 0) scale(1); } to { transform: translate(-60px, 40px) scale(1.15); } }
@keyframes m-dondola { from { transform: rotate(-16deg) translateY(0); } to { transform: rotate(-8deg) translateY(-10px); } }

/* =====================================================================
   HOME
   ===================================================================== */
.h-hero {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  background: linear-gradient(135deg, #2d2483 0%, #3a2fa1 35%, #5b4cdb 100%);
  padding: clamp(40px, 7vw, 84px) 0 0;
}
.h-hero__bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.h-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: m-fluttua 16s ease-in-out infinite alternate; }
.h-blob--1 { width: 460px; height: 460px; background: #f39c12; top: -160px; right: -80px; opacity: .35; }
.h-blob--2 { width: 520px; height: 520px; background: #7a66f0; bottom: -260px; left: -140px; animation-duration: 19s; }
.h-blob--3 { width: 300px; height: 300px; background: #22c55e; top: 30%; left: 45%; opacity: .18; animation-duration: 23s; }
.h-hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
}
.h-hero__inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.h-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(8px);
}
.h-hero h1 { color: #fff; font-size: clamp(34px, 5.4vw, 62px); line-height: 1.04; letter-spacing: -.035em; margin: 18px 0 16px; }
.h-evidenza {
  background: linear-gradient(90deg, #ffd166, #f39c12, #ffd166); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: m-scorre 6s linear infinite;
}
@keyframes m-scorre { to { background-position: 200% center; } }
.h-hero__testo > p { color: rgba(255, 255, 255, .78); font-size: clamp(16px, 1.6vw, 19px); max-width: 52ch; margin-bottom: 26px; }
.h-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.h-btn-chiaro { background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .3); }
.h-btn-chiaro:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.h-stats { display: flex; gap: clamp(18px, 4vw, 44px); margin-top: 34px; flex-wrap: wrap; }
.h-stats b { display: block; font-family: var(--m-font-display); font-size: clamp(26px, 3vw, 36px); line-height: 1; font-variant-numeric: tabular-nums; }
.h-stats span { font-size: 13px; color: rgba(255, 255, 255, .7); }

/* Anteprima "dal vivo" a destra */
.h-vetrina { position: relative; min-height: 340px; }
.h-live, .h-classifica {
  background: rgba(255, 255, 255, .96); color: var(--m-text); border-radius: 18px; padding: 16px 18px;
  box-shadow: 0 30px 60px -20px rgba(10, 8, 40, .55); position: absolute;
}
.h-live { top: 10px; left: 0; width: min(330px, 92%); animation: m-galleggia 6s ease-in-out infinite alternate; }
.h-classifica { bottom: 0; right: 0; width: min(300px, 86%); animation: m-galleggia 7s ease-in-out -2s infinite alternate; }
@keyframes m-galleggia { from { transform: translateY(0) rotate(-1deg); } to { transform: translateY(-14px) rotate(1deg); } }
.h-live__testa { display: flex; justify-content: space-between; font-size: 12px; color: var(--m-text-mute); margin-bottom: 10px; }
.h-live__badge { color: #dc2626; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.h-live__badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #dc2626; animation: m-pulsa-rosso 1.2s ease-in-out infinite; }
@keyframes m-pulsa-rosso { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .6); } 50% { box-shadow: 0 0 0 7px rgba(220, 38, 38, 0); } }
.h-live__riga { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-weight: 600; }
.h-live__riga b { font-family: var(--m-font-display); font-size: 24px; min-width: 28px; text-align: right; }
.h-live__gol { font-size: 12px; color: var(--m-text-mute); border-top: 1px solid var(--m-border); margin-top: 8px; padding-top: 8px; }
.h-classifica h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--m-primary-600); margin-bottom: 8px; }
.h-classifica ol { margin: 0; padding: 0; list-style: none; }
.h-classifica li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; border-top: 1px solid var(--m-border); }
.h-classifica li:first-child { border-top: 0; }
.h-classifica li span:first-child { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--m-bg-soft); }
.h-classifica li:nth-child(1) span:first-child { background: var(--m-grad-gold); color: #2a1d00; }
.h-classifica li b { margin-left: auto; font-variant-numeric: tabular-nums; }
.h-emoji-volante { position: absolute; z-index: 2; font-size: 30px; animation: m-galleggia 5s ease-in-out infinite alternate; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .3)); }

/* Nastro degli sport */
.h-sport { margin-top: clamp(36px, 6vw, 64px); border-top: 1px solid rgba(255, 255, 255, .14); background: rgba(10, 8, 40, .18); overflow: hidden; }
.h-sport__nastro { display: flex; gap: 10px; width: max-content; padding: 14px 0; animation: m-nastro 45s linear infinite; }
.h-sport:hover .h-sport__nastro { animation-play-state: paused; }
@keyframes m-nastro { to { transform: translateX(-50%); } }
.h-sport a {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; white-space: nowrap;
  color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); font-size: 14px; font-weight: 500;
  transition: background .2s ease, transform .2s ease;
}
.h-sport a:hover { background: rgba(255, 255, 255, .2); color: #fff; transform: translateY(-2px); }

/* Come funziona */
.h-passi { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--m-5); margin: clamp(32px, 5vw, 56px) 0 var(--m-4); }
.h-passo { position: relative; padding: 26px 24px; border-radius: 18px; background: var(--m-surface); border: 1px solid var(--m-border); box-shadow: var(--m-sh-1); overflow: hidden; }
.h-passo:hover { transform: translateY(-4px); box-shadow: var(--m-sh-3); border-color: var(--m-primary-200); }
.h-passo__num {
  position: absolute; right: 16px; top: 4px; font-family: var(--m-font-display); font-size: 72px; font-weight: 700;
  color: var(--m-primary-50); line-height: 1; pointer-events: none;
}
.h-passo__icona { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: var(--m-grad-brand); box-shadow: var(--m-glow); margin-bottom: 14px; position: relative; }
.h-passo h3 { font-size: 18px; margin-bottom: 6px; position: relative; }
.h-passo p { font-size: 14px; margin: 0; position: relative; }

/* =====================================================================
   CARD DEI TORNEI (components/tabella_tornei.php)
   ===================================================================== */
.m-tcard { position: relative; border-radius: 18px; }
.m-tcard:hover { transform: translateY(-5px); box-shadow: 0 22px 44px -18px rgba(29, 24, 86, .35); }
.m-tcard__cover { height: 112px; }
.m-tcard__sport, .m-tcard__state { z-index: 2; }
.m-tcard .m-tcard__cover--squadra   { background: radial-gradient(120% 90% at 85% 10%, rgba(255,255,255,.22), transparent 55%), linear-gradient(135deg, #16a34a, #0f5132); }
.m-tcard .m-tcard__cover--pallavolo { background: radial-gradient(120% 90% at 85% 10%, rgba(255,255,255,.22), transparent 55%), linear-gradient(135deg, #f97316, #b4360a); }
.m-tcard .m-tcard__cover--racchetta { background: radial-gradient(120% 90% at 85% 10%, rgba(255,255,255,.25), transparent 55%), linear-gradient(135deg, #0ea5e9, #1e40af); }
.m-tcard .m-tcard__cover--tavolo    { background: radial-gradient(120% 90% at 85% 10%, rgba(255,255,255,.22), transparent 55%), linear-gradient(135deg, #334155, #0f172a); }
.m-tcard .m-tcard__cover--altro     { background: radial-gradient(120% 90% at 85% 10%, rgba(243,156,18,.30), transparent 55%), linear-gradient(135deg, #7a66f0, #3a2fa1); }
.m-tcard__emoji {
  position: absolute; right: 18px; bottom: -16px; font-size: 66px; line-height: 1; z-index: 0;
  transform: rotate(-14deg); filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .3));
  transition: transform .45s cubic-bezier(.3, 1.6, .5, 1);
}
.m-tcard:hover .m-tcard__emoji { transform: rotate(0deg) scale(1.12) translateY(-6px); }
.m-tcard__chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.m-tcard__chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--m-bg-soft); color: var(--m-text-soft); font-weight: 500; }
.m-tcard__chip--data { background: var(--m-gold-50); color: #8a5300; }
.m-tcard__posti { margin-top: 14px; }
.m-tcard__posti-testo { display: flex; justify-content: space-between; font-size: 12px; color: var(--m-text-mute); margin-bottom: 6px; }
.m-tcard__barra { height: 6px; border-radius: 999px; background: var(--m-bg-soft); overflow: hidden; }
.m-tcard__barra > span { display: block; height: 100%; border-radius: inherit; background: var(--m-grad-brand); transform-origin: left; animation: m-riempi 1s var(--m-ease) both .2s; }
.m-tcard__barra--quasi > span { background: var(--m-grad-gold); }
@keyframes m-riempi { from { transform: scaleX(0); } }
.m-tcard__cta { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.m-tcard__cta::after { content: "→"; transition: transform .2s ease; }
.m-tcard:hover .m-tcard__cta::after { transform: translateX(4px); }

/* =====================================================================
   PAGINE SECONDARIE
   ===================================================================== */

/* Intestazione delle pagine: un "banner" con lo stesso stile della home */
.m-page-head {
  position: relative; overflow: hidden; isolation: isolate; align-items: center;
  padding: clamp(22px, 3.5vw, 34px) clamp(20px, 3.5vw, 36px); border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, #2d2483 0%, #3a2fa1 45%, #5b4cdb 100%);
  box-shadow: 0 26px 50px -30px rgba(45, 36, 131, .75);
}
.m-page-head::before {
  content: ""; position: absolute; z-index: -1; width: 380px; height: 380px; border-radius: 50%; top: -190px; right: -90px;
  background: radial-gradient(circle, rgba(243, 156, 18, .38), transparent 65%); animation: m-fluttua 14s ease-in-out infinite alternate;
}
.m-page-head::after {
  content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1px); background-size: 24px 24px;
  mask-image: linear-gradient(100deg, transparent 30%, #000 100%); -webkit-mask-image: linear-gradient(100deg, transparent 30%, #000 100%);
}
.m-page-head h1, .m-page-head .m-page-head__title { color: #fff; }
.m-page-head .m-page-head__sub, .m-page-head p { color: rgba(255, 255, 255, .78); }
.m-page-head a:not(.m-btn) { color: #ffd166; }
.m-page-head b, .m-page-head strong { color: #ffd166 !important; }
.m-page-head .m-btn--primary { background: var(--m-grad-gold); color: #2a1d00; }
.m-page-head .m-btn--primary:hover { background: var(--m-grad-gold); color: #2a1d00; box-shadow: 0 10px 30px -10px rgba(243, 156, 18, .6); }
.m-page-head .m-btn--secondary, .m-page-head .m-btn--ghost { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .28); color: #fff; }
/* Sotto la testata di un torneo o della home l'intestazione resta leggera */
.t-hero ~ .m-page .m-page-head, .h-hero ~ .m-page .m-page-head {
  background: none; box-shadow: none; padding: 0; border-radius: 0; color: inherit; overflow: visible;
}
.t-hero ~ .m-page .m-page-head::before, .t-hero ~ .m-page .m-page-head::after,
.h-hero ~ .m-page .m-page-head::before, .h-hero ~ .m-page .m-page-head::after { display: none; }
.t-hero ~ .m-page .m-page-head h1, .t-hero ~ .m-page .m-page-head .m-page-head__title, .h-hero ~ .m-page .m-page-head h1 { color: var(--m-text); }
.t-hero ~ .m-page .m-page-head .m-page-head__sub, .h-hero ~ .m-page .m-page-head .m-page-head__sub { color: var(--m-text-mute); }
.h-hero ~ .m-page .m-page-head .m-btn--primary { background: var(--m-grad-brand); color: #fff; }

/* Titoli delle card con una piccola barra colorata */
.m-card__title { display: flex; align-items: center; gap: 10px; }
.m-card__title::before { content: ""; width: 4px; height: 18px; border-radius: 4px; background: var(--m-grad-brand); flex-shrink: 0; }

/* Schede Info / Struttura */
.m-tab--active { background-image: var(--m-grad-brand); background-size: 100% 3px; background-position: bottom; background-repeat: no-repeat; }

/* Passi della creazione del torneo */
.m-step { transition: transform .25s var(--m-ease), box-shadow .25s var(--m-ease); }
.m-step--current { background: var(--m-grad-brand); border-color: transparent; box-shadow: var(--m-glow); transform: translateY(-2px); }
.m-step--current .m-step__num { background: #fff; color: var(--m-primary-600); border-color: #fff; }
.m-step--current .m-step__title, .m-step--current .m-step__label { color: #fff; }
.m-step--done .m-step__num { background: var(--m-success-500); color: #fff; border-color: var(--m-success-500); }

/* Scelte a riquadri (formato, visibilità, pranzo…) */
.m-tile__inner { position: relative; transition: transform .2s var(--m-ease), box-shadow .2s var(--m-ease), border-color .2s ease, background .2s ease; }
.m-tile:hover .m-tile__inner { transform: translateY(-3px); box-shadow: var(--m-sh-3); }
.m-tile input:checked + .m-tile__inner {
  border-color: transparent; box-shadow: var(--m-glow);
  background: linear-gradient(var(--m-primary-50), var(--m-primary-50)) padding-box, var(--m-grad-brand) border-box; border: 2px solid transparent;
}
.m-tile input:checked + .m-tile__inner::after {
  content: "✓"; position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--m-grad-brand);
  animation: m-spunta .3s cubic-bezier(.3, 1.6, .5, 1);
}
.m-tile input:checked + .m-tile__inner .m-tile__icon { background: var(--m-grad-brand); color: #fff; }
.m-tile input:focus-visible + .m-tile__inner { box-shadow: var(--m-ring); }
@keyframes m-spunta { from { transform: scale(0); } to { transform: scale(1); } }

/* Tabelle e avvisi */
.m-table thead th { background: var(--m-surface-2); }
.m-alert { border-left-width: 4px; }

/* Riquadri dei numeri (statistiche torneo e squadra) */
.stat-box, .ds-stat {
  position: relative; overflow: hidden; border-radius: 16px !important;
  transition: transform .25s var(--m-ease), box-shadow .25s var(--m-ease);
}
.stat-box::before, .ds-stat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--m-grad-brand); }
.stat-box:hover, .ds-stat:hover { transform: translateY(-4px); box-shadow: var(--m-sh-3); }

/* Intestazione della pagina squadra */
.ds-hero {
  position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; justify-content: space-between;
  gap: var(--m-3); flex-wrap: wrap; margin-bottom: var(--m-5); padding: clamp(20px, 3vw, 30px); border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, #2d2483 0%, #3a2fa1 45%, #5b4cdb 100%); box-shadow: 0 26px 50px -30px rgba(45, 36, 131, .75);
}
.ds-hero::before {
  content: ""; position: absolute; z-index: -1; width: 360px; height: 360px; border-radius: 50%; top: -180px; right: 10%;
  background: radial-gradient(circle, rgba(243, 156, 18, .35), transparent 65%); animation: m-fluttua 14s ease-in-out infinite alternate;
}
.ds-hero .t-hero__emoji { z-index: -1; font-size: clamp(80px, 11vw, 130px); bottom: -24px; }
.ds-hero h1 { color: #fff; }
.ds-hero .m-muted { color: rgba(255, 255, 255, .75) !important; }
.ds-hero a { color: #ffd166; }
.ds-hero > div:first-of-type > div:first-child { background: rgba(255, 255, 255, .16) !important; border: 2px solid rgba(255, 255, 255, .45); box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .4); }

/* Stati vuoti: l'icona galleggia */
.m-empty__icon { animation: m-galleggia 3.5s ease-in-out infinite alternate; }

/* Accesso e registrazione: pannello colorato più vivo */
.m-auth-shell .m-auth-shell__brand { isolation: isolate; }
.m-auth-shell .m-auth-shell__brand::after {
  content: ""; position: absolute; z-index: -1; width: 460px; height: 460px; border-radius: 50%; bottom: -200px; right: -160px;
  background: radial-gradient(circle, rgba(243, 156, 18, .35), transparent 65%); animation: m-fluttua 13s ease-in-out infinite alternate;
}
.m-auth-shell .m-auth-shell__brand-logo { animation: m-galleggia 5s ease-in-out infinite alternate; }
.m-auth-card { animation: m-entra .55s var(--m-ease) both .05s; }

/* Pagina 404 */
.m-404-emoji { display: inline-block; animation: m-rimbalzo 1.8s ease-in-out infinite; }
@keyframes m-rimbalzo { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-16px) rotate(6deg); } }

/* Piè di pagina scuro, come la testata della home */
.m-footer {
  position: relative; overflow: hidden; border-top: 0; color: rgba(255, 255, 255, .62);
  background: radial-gradient(700px 300px at 100% 0%, rgba(243, 156, 18, .14), transparent 60%), linear-gradient(180deg, #1d1856 0%, #120f38 100%);
}
.m-footer h5 { color: #fff; }
.m-footer a { color: rgba(255, 255, 255, .72); transition: color .2s ease; }
.m-footer a:hover { color: #ffd166; }
.m-footer .m-navbar__brand, .m-footer .m-navbar__brand:hover { color: #fff; }
.m-footer .m-navbar__brand-sub { color: rgba(255, 255, 255, .55); }
.m-footer__brand-block p { color: rgba(255, 255, 255, .62); }
.m-footer__bottom { border-top-color: rgba(255, 255, 255, .1); }

/* =====================================================================
   PIÙ MOVIMENTO
   ===================================================================== */

/* Passaggio morbido tra una pagina e l'altra (browser che lo supportano) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }

/* Card già nello schermo: entrano una dopo l'altra (solo all'inizio, poi l'hover resta libero) */
.m-entra-ora { animation: m-entra .6s var(--m-ease) backwards; animation-delay: var(--m-ritardo, 0ms); }

/* Banner delle pagine: i colori scorrono lentamente */
.m-page-head, .ds-hero, .t-hero {
  background-size: 180% 180%;
  animation: m-sfumatura 14s ease-in-out infinite alternate;
}
.m-page-head { animation: m-sfumatura 14s ease-in-out infinite alternate, m-scende .6s var(--m-ease) backwards; }
@keyframes m-sfumatura { from { background-position: 0% 30%; } to { background-position: 100% 70%; } }
@keyframes m-scende { from { opacity: 0; transform: translateY(-14px) scale(.985); } }

/* Luce che segue il mouse */
.m-luce { position: relative; }
.m-luce::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(122, 102, 240, .11), transparent 45%);
}
/* Leggera inclinazione 3D */
.m-tcard.m-inclina, .pz-piano.m-inclina, .team-card.m-inclina, .h-passo.m-inclina {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-5px);
  transition: transform .12s linear, box-shadow .25s var(--m-ease);
}

/* Onda al clic */
.m-onda {
  position: absolute; border-radius: 50%; pointer-events: none; background: rgba(255, 255, 255, .45);
  transform: scale(0); animation: m-onda .6s ease-out forwards;
}
.m-btn--secondary .m-onda, .m-btn--ghost .m-onda, .tb-btn .m-onda { background: rgba(91, 76, 219, .18); }
@keyframes m-onda { to { transform: scale(1); opacity: 0; } }

/* Pulsante "torna su" */
.m-torna-su {
  position: fixed; right: 18px; bottom: 18px; z-index: 60; width: 46px; height: 46px; border-radius: 50%; border: 0;
  display: grid; place-items: center; color: #fff; background: var(--m-grad-brand); box-shadow: var(--m-glow); cursor: pointer;
  opacity: 0; transform: translateY(16px) scale(.8); pointer-events: none; transition: opacity .25s ease, transform .25s var(--m-ease);
}
.m-torna-su.is-visibile { opacity: 1; transform: none; pointer-events: auto; }
.m-torna-su:hover { transform: translateY(-3px); }

/* Link nei testi: sottolineatura che si allunga */
.m-page p a:not(.m-btn), .m-page .m-doc__corpo li a:not(.m-btn), .m-page td a:not(.m-btn) {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .25s var(--m-ease), color .2s ease;
}
.m-page p a:not(.m-btn):hover, .m-page .m-doc__corpo li a:not(.m-btn):hover, .m-page td a:not(.m-btn):hover { background-size: 100% 1.5px; }

/* =====================================================================
   PAGINE-DOCUMENTO (guida, termini, privacy, note legali)
   ===================================================================== */
.m-doc > .m-container { max-width: 1160px !important; }
.m-doc__griglia { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; align-items: start; }
.m-doc__indice {
  position: sticky; top: calc(var(--m-navbar-h) + 20px); max-height: calc(100vh - var(--m-navbar-h) - 40px); overflow: auto;
  padding: 18px; border-radius: 18px; background: var(--m-surface); border: 1px solid var(--m-border); box-shadow: var(--m-sh-2);
  animation: m-entra .6s var(--m-ease) backwards .15s;
}
.m-doc__indice-titolo { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--m-primary-600); margin-bottom: 10px; }
.m-doc__indice ol { list-style: none; margin: 0; padding: 0; counter-reset: voce; }
.m-doc__indice li { counter-increment: voce; }
.m-doc__indice a {
  display: flex; gap: 10px; align-items: baseline; padding: 7px 10px; border-radius: 10px; font-size: 13px; line-height: 1.35;
  color: var(--m-text-soft); text-decoration: none; transition: background .2s ease, color .2s ease, transform .2s ease;
}
.m-doc__indice a::before { content: counter(voce); font-size: 11px; font-weight: 700; color: var(--m-text-mute); min-width: 14px; }
.m-page .m-doc__indice a:hover { background: var(--m-primary-50); color: var(--m-primary-700); transform: translateX(3px); }
.m-page .m-doc__indice a.is-attivo { background: var(--m-grad-brand); color: #fff; box-shadow: var(--m-glow); }
.m-doc__indice a.is-attivo::before { color: rgba(255, 255, 255, .8); }
.m-doc__avanzamento {
  position: fixed; left: 0; right: 0; top: var(--m-navbar-h); height: 3px; z-index: 49; transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, #7a66f0, #f39c12); box-shadow: 0 0 10px rgba(243, 156, 18, .5);
}
.m-doc__info { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.m-doc__info span { font-size: 13px; padding: 5px 12px; border-radius: 999px; color: #fff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); }
.ha-indice .guide-index { display: none !important; }

/* Sezioni */
.m-doc__sezione { scroll-margin-top: calc(var(--m-navbar-h) + 20px); border-radius: 20px !important; padding: clamp(20px, 3vw, 30px) !important; }
.m-doc__sezione:target, .m-doc__sezione:focus-within { border-color: var(--m-primary-300); }
.m-doc__sezione > h2 { display: flex; align-items: center; gap: 12px; font-size: clamp(18px, 2vw, 22px) !important; padding-bottom: 12px; border-bottom: 1px solid var(--m-border); }
.m-doc__num {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; font-size: 15px; font-weight: 700;
  color: #fff; background: var(--m-grad-brand); box-shadow: var(--m-glow);
}
.m-doc__sezione p, .m-doc__sezione li { line-height: 1.75; }
.m-doc__sezione ul, .m-doc__sezione ol { padding-left: 4px; }
.m-doc__sezione ul > li { list-style: none; position: relative; padding-left: 22px; margin-bottom: 6px; }
.m-doc__sezione ul > li::before {
  content: ""; position: absolute; left: 4px; top: .7em; width: 7px; height: 7px; border-radius: 50%; background: var(--m-grad-brand);
}
.m-doc__sezione .m-table-wrap { border-radius: 14px; border: 1px solid var(--m-border); }
.m-doc__sezione table td:first-child { font-size: 14px; }

/* Testate delle pagine informative: emoji grande sullo sfondo (vedi applica_anteprima.py) */
.t-hero .t-hero__emoji { z-index: 0; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1100px) {
  .m-doc__griglia { grid-template-columns: minmax(0, 1fr); }
  .m-doc__indice { top: var(--m-navbar-h); z-index: 20; order: -1; max-height: none; padding: 10px 12px; border-radius: 0 0 16px 16px; }
  .m-doc__indice-titolo { display: none; }
  .m-doc__indice ol { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .m-doc__indice ol::-webkit-scrollbar { display: none; }
  .m-doc__indice a { white-space: nowrap; background: var(--m-bg-soft); }
}
@media (max-width: 900px) {
  .h-hero__inner { grid-template-columns: 1fr; }
  .h-vetrina { min-height: 300px; margin-top: 8px; }
  .h-passi { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .m-page-head { border-radius: 18px; }
  .h-vetrina { display: none; }
  .h-cta .m-btn { flex: 1 1 100%; }
  .t-hero__emoji { opacity: .12; }
}

/* Chi ha chiesto meno movimento al sistema operativo non vede animazioni */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .m-pre { opacity: 1; transform: none; }
  .m-torna-su { transition: none; }
  .h-sport__nastro { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
}

/* ═══════════ Segnalazioni (components/segnala_modal.php) ═══════════ */
.segn-btn { color: var(--m-danger-700); border-color: #f2c4c4; }
.segn-btn:hover { background: var(--m-danger-50); color: var(--m-danger-700); border-color: var(--m-danger-500); }
.segn-link { background: none; border: 0; padding: 2px 0; font: inherit; font-size: 12.5px; color: var(--m-text-mute); cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.segn-link:hover { color: var(--m-danger-700); text-decoration: underline; }
.segn-dialog { border: 0; padding: 0; border-radius: var(--m-r-lg); width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  box-shadow: 0 30px 80px -20px rgba(29,24,86,.45); background: var(--m-surface); color: var(--m-text); }
.segn-dialog::backdrop { background: rgba(26, 21, 48, .55); backdrop-filter: blur(2px); }
.segn-dialog[open] { animation: segn-entra .22s var(--m-ease); }
@keyframes segn-entra { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.segn-form { margin: 0; display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.segn-dialog__head { display: flex; gap: 12px; align-items: flex-start; padding: 20px 20px 12px; }
.segn-dialog__icona { width: 40px; height: 40px; border-radius: 12px; background: var(--m-danger-50); display: grid; place-items: center; font-size: 20px; flex: 0 0 auto; }
.segn-dialog__head h3 { margin: 2px 0 0; font-size: 18px; }
.segn-dialog__head p { margin: 4px 0 0; font-size: 13.5px; color: var(--m-text-soft); word-break: break-word; }
.segn-dialog__head > div { flex: 1; min-width: 0; }
.segn-dialog__chiudi { background: none; border: 0; font-size: 16px; color: var(--m-text-mute); cursor: pointer; padding: 6px; border-radius: 8px; }
.segn-dialog__chiudi:hover { background: var(--m-bg-soft); }
.segn-dialog__corpo { padding: 0 20px; overflow-y: auto; }
.segn-motivi { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.segn-motivi legend { font-weight: 700; font-size: 14px; margin-bottom: 8px; padding: 0; }
.segn-motivo { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--m-border); border-radius: 12px;
  cursor: pointer; font-size: 14.5px; transition: border-color var(--m-t-fast), background var(--m-t-fast); }
.segn-motivo:hover { border-color: #f2c4c4; background: #fffafa; }
.segn-motivo input { accent-color: var(--m-danger-500); width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }
.segn-motivo:has(input:checked) { border-color: var(--m-danger-500); background: var(--m-danger-50); font-weight: 600; }
.segn-motivo:has(input:focus-visible) { box-shadow: var(--m-ring); }
.segn-testo { width: 100%; min-height: 84px; resize: vertical; margin-top: 4px; }
.segn-conta { text-align: right; font-size: 12px; color: var(--m-text-mute); margin-top: 4px; }
.segn-nota { font-size: 12.5px; color: var(--m-text-mute); background: var(--m-surface-2); border: 1px solid var(--m-border);
  border-radius: 10px; padding: 10px 12px; margin: 10px 0 0; line-height: 1.5; }
.segn-dialog__piede { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 20px; flex-wrap: wrap; }
@media (max-width: 480px) {
  .segn-dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92dvh; }
  .segn-dialog[open] { animation: segn-sale .25s var(--m-ease); }
  .segn-form { max-height: 92dvh; }
  .segn-dialog__piede .m-btn { flex: 1; }
}
@keyframes segn-sale { from { transform: translateY(40px); opacity: .6; } }
.segn-esito { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 9000; display: flex; gap: 10px; align-items: flex-start;
  width: min(520px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 14px; font-size: 14.5px; box-shadow: 0 18px 40px -16px rgba(29,24,86,.45);
  background: var(--m-surface); border: 1px solid var(--m-border); transition: opacity .35s, transform .35s; }
.segn-esito > div { flex: 1; }
.segn-esito--success { border-color: #bfe8cf; background: var(--m-success-50); }
.segn-esito--info    { border-color: #c8dafc; background: var(--m-info-50); }
.segn-esito--warn    { border-color: #f5d9a8; background: var(--m-warn-50); }
.segn-esito--danger  { border-color: #f2c4c4; background: var(--m-danger-50); }
.segn-esito--via { opacity: 0; transform: translate(-50%, 12px); }
.segn-esito__chiudi { background: none; border: 0; cursor: pointer; color: var(--m-text-mute); font-size: 14px; padding: 2px 4px; }

/* ═══════════ Pagine del torneo: testata e azioni (anche su telefono) ═══════════ */
.t-chips { display: flex; gap: 8px; margin-bottom: var(--m-3); flex-wrap: wrap; }
.t-hero h1 { overflow-wrap: anywhere; }
.t-hero__azioni { display: flex; gap: var(--m-2); flex-wrap: wrap; align-items: center; }
.t-hero__segui { display: inline; margin: 0; }
.t-hero__azione { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28); color: #fff; backdrop-filter: blur(6px); }
.t-hero__azione:hover { background: rgba(255,255,255,.22); color: #fff; border-color: rgba(255,255,255,.45); }
.dt-elimina { margin: var(--m-5) 0 0; padding-top: var(--m-4); border-top: 1px dashed var(--m-border-strong); }

@media (max-width: 700px) {
  .t-hero { padding: var(--m-4) 0 var(--m-6); }
  .t-breadcrumb { flex-wrap: nowrap; min-width: 0; }
  .t-breadcrumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  /* le etichette (stato, sport, luogo…) su una riga che scorre, invece di tre righe */
  .t-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--m-4)) var(--m-3); padding: 0 var(--m-4);
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .t-chips::-webkit-scrollbar { display: none; }
  .t-chip { flex: 0 0 auto; white-space: nowrap; }
  .t-hero h1 { font-size: clamp(24px, 7.2vw, 32px); line-height: 1.12; }
  .t-hero .desc { font-size: 14.5px; }
  .dt-hero-inner > div:first-child { width: 100%; min-width: 0; }
  .t-hero__azioni { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .t-hero__azioni .m-btn { justify-content: center; min-height: 42px; }
  .t-hero__segui { grid-column: 1 / -1; }
  .t-hero__segui .m-btn { width: 100%; justify-content: center; min-height: 46px; }

  /* Azioni rapide: griglia compatta a due colonne */
  .dt-azioni { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: var(--m-4); }
  .dt-azioni > * { margin: 0 !important; min-width: 0; }
  .dt-azioni > h4, .dt-azioni > .dt-azioni__condividi, .dt-azioni > .dt-azione--larga, .dt-azioni > .m-alert,
  .dt-azioni > dialog, .dt-azioni > .segn-esito { grid-column: 1 / -1; }
  .dt-azioni > .m-btn, .dt-azioni > details > summary.m-btn {
    font-size: 13px; padding: 10px 8px; min-height: 46px; white-space: normal; text-align: center; justify-content: center; line-height: 1.25; }
  .dt-azioni > .m-btn--ghost, .dt-azioni > .m-btn--secondary, .dt-azioni > details > summary.m-btn {
    background: var(--m-surface); border: 1px solid var(--m-border); color: var(--m-text); box-shadow: var(--m-sh-1); }
  .dt-azioni > .dt-azione--prima { order: -1; font-size: 15px; min-height: 50px; }
  .dt-azioni > h4 { order: -2; margin-bottom: 0; }
  .dt-azioni > .segn-btn { grid-column: 1 / -1; justify-self: center; min-height: 40px; }
  .dt-elimina { margin-top: var(--m-2) !important; }
}

/* Tabelle di testo (privacy, cookie…): su telefono ogni riga diventa una scheda */
@media (max-width: 600px) {
  .m-table--schede thead { display: none; }
  .m-table--schede, .m-table--schede tbody, .m-table--schede tr, .m-table--schede td { display: block; width: 100%; }
  .m-table--schede tr { border: 1px solid var(--m-border); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: var(--m-surface); }
  .m-table--schede td { border: 0 !important; padding: 4px 0 !important; }
  .m-table--schede td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: var(--m-text-mute); margin-bottom: 2px; }
  .m-table-wrap:has(> .m-table--schede) { border: 0; box-shadow: none; overflow: visible; background: transparent; }
}

/* Elenco squadre iscritte (components/squadre_torneo.php) */
.sq-elenco { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.sq-card { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 12px; border-radius: 14px; text-decoration: none; color: inherit;
  background: var(--m-surface-2); border: 1px solid var(--m-border); transition: transform var(--m-t), border-color var(--m-t), box-shadow var(--m-t), background var(--m-t); }
.sq-card:hover { transform: translateY(-2px); border-color: var(--m-primary-200); background: var(--m-surface); box-shadow: var(--m-sh-2); }
.sq-card:focus-visible { outline: none; box-shadow: var(--m-ring); }
.sq-card--mia { border-color: var(--m-gold-200); background: linear-gradient(135deg, var(--m-gold-50), var(--m-surface)); }
.sq-card__avatar { width: 44px; height: 44px; border-radius: 13px; flex: 0 0 auto; display: grid; place-items: center; color: #fff;
  font: 700 15px/1 var(--m-font-display); letter-spacing: .02em; text-shadow: 0 1px 2px rgba(0,0,0,.2);
  background: linear-gradient(135deg, hsl(var(--tinta, 250) 70% 60%), hsl(calc(var(--tinta, 250) + 35) 65% 45%));
  box-shadow: 0 6px 14px -8px hsl(var(--tinta, 250) 60% 40%); }
.sq-card__testo { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.sq-card__nome { font-weight: 700; font-size: 15px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-card__info { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 12.5px; color: var(--m-text-mute); }
.sq-card__mia { color: var(--m-gold-600); font-weight: 700; }
.sq-card__freccia { color: var(--m-text-mute); flex: 0 0 auto; transition: transform var(--m-t), color var(--m-t); }
.sq-card:hover .sq-card__freccia { transform: translateX(3px); color: var(--m-primary-600); }

/* Mappa del torneo: link a Google Maps e indicazioni */
.dt-mappa-link { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--m-3); }
.dt-luogo-mappa { display: inline-flex; align-items: center; gap: 3px; margin: 0 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px;
  font-weight: 600; background: var(--m-primary-50); color: var(--m-primary-700) !important; text-decoration: none !important; background-image: none !important; }
.dt-luogo-mappa:hover { background: var(--m-primary-100); }
@media (max-width: 480px) { .dt-mappa-link .m-btn { flex: 1 1 140px; justify-content: center; } }

/* ═══════════ Sorteggio delle squadre ═══════════ */
.st-barra { height: 8px; border-radius: 999px; background: var(--m-bg-soft); overflow: hidden; }
.st-barra span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--m-primary-400), var(--m-gold-500)); }
.st-iscritti { display: flex; flex-wrap: wrap; gap: 6px; }
.st-iscritto { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; font-size: 13.5px;
  background: var(--m-surface-2); border: 1px solid var(--m-border); }
.st-iscritto__togli { border: 0; background: none; color: var(--m-text-mute); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.st-iscritto__togli:hover { color: var(--m-danger-700); }
.st-iscritto-ok { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px;
  background: var(--m-success-50); border: 1px solid #bfe8cf; font-weight: 600; color: var(--m-success-700); margin: 0; }
.st-pannello { padding: var(--m-5); }
.st-pannello__campi { display: flex; align-items: flex-end; gap: var(--m-5); flex-wrap: wrap; margin-bottom: var(--m-3); }
.st-pannello__campi .m-field { width: 180px; margin: 0; }
.st-pannello__conto { font-size: 15px; padding-bottom: 10px; }
.st-squadre { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.st-squadra { background: var(--m-surface); border: 1px solid var(--m-border); border-radius: 16px; overflow: hidden; box-shadow: var(--m-sh-1);
  animation: st-entra .35s var(--m-ease) both; }
.st-squadra:nth-child(2) { animation-delay: .05s; } .st-squadra:nth-child(3) { animation-delay: .1s; } .st-squadra:nth-child(4) { animation-delay: .15s; }
@keyframes st-entra { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.st-squadra__nome { padding: 12px 14px; color: #fff; font-weight: 700; font-family: var(--m-font-display);
  background: linear-gradient(135deg, hsl(var(--tinta, 250) 70% 58%), hsl(calc(var(--tinta, 250) + 35) 65% 44%)); }
.st-squadra ul { list-style: none; margin: 0; padding: 10px 14px 12px; display: grid; gap: 6px; font-size: 14px; }
.st-conferma { display: flex; align-items: center; justify-content: space-between; gap: var(--m-4); flex-wrap: wrap; padding: var(--m-5);
  border-color: var(--m-primary-200); background: linear-gradient(180deg, var(--m-primary-50), var(--m-surface)); }

/* ═══════════ Formato personalizzato (components/formato_personalizzato_campi.php) ═══════════ */
.pf-box { border: 1px solid var(--m-primary-200); border-radius: var(--m-r-lg); padding: var(--m-5);
  background: linear-gradient(180deg, var(--m-primary-50), var(--m-surface) 60%); }
.pf-box [hidden], #pf-contenitore[hidden], #tipo-partita-campo[hidden] { display: none !important; }
.pf-box__testa { display: flex; gap: 12px; align-items: center; margin-bottom: var(--m-4); }
.pf-box__icona { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--m-surface); box-shadow: var(--m-sh-1); flex: 0 0 auto; }
.pf-struttura { margin-bottom: var(--m-4); }
.pf-fasi { display: grid; gap: 10px; }
.pf-fase { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: 14px; background: var(--m-surface);
  border: 1px solid var(--m-border); }
.pf-fase__num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 15px/1 var(--m-font-display);
  color: #fff; background: linear-gradient(135deg, var(--m-primary-400), var(--m-primary-600)); }
.pf-fase__corpo { display: grid; gap: 8px; min-width: 0; }
.pf-check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.pf-nota { font-size: 12.5px; }
.pf-riassunto { margin: var(--m-4) 0 0; padding: 10px 14px; border-radius: 12px; background: var(--m-surface); border: 1px dashed var(--m-primary-300);
  font-weight: 600; color: var(--m-primary-700); font-size: 14px; }
.m-tile--off { opacity: .55; }
.m-tile--off, .m-tile--off * { cursor: not-allowed; }

/* ── Sponsor del torneo ── */
.sp-loghi { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.sp-loghi li a, .sp-loghi li > span { display: grid; place-items: center; height: 84px; padding: 10px; border: 1px solid var(--m-border);
  border-radius: 12px; background: #fff; text-decoration: none; color: var(--m-text); transition: border-color var(--m-t-fast), transform var(--m-t-fast); }
.sp-loghi li a:hover { border-color: var(--m-primary-300); transform: translateY(-2px); }
.sp-loghi img { max-width: 100%; max-height: 64px; object-fit: contain; }
.sp-nome { font-weight: 700; font-size: 14px; text-align: center; line-height: 1.2; overflow-wrap: anywhere; }
.sp-elenco { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sp-elenco li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--m-border); border-radius: 12px; background: var(--m-surface); }
.sp-elenco__logo { width: 64px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; background: #fff; border-radius: 8px; border: 1px solid var(--m-border); font-size: 20px; }
.sp-elenco__logo img { max-width: 56px; max-height: 40px; object-fit: contain; }
.sp-elenco__testo { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; overflow-wrap: anywhere; }
.sp-elenco__testo a { font-size: 12.5px; }
.sp-elenco__azioni { display: flex; gap: 4px; margin: 0; flex: 0 0 auto; }
@media (max-width: 520px) { .sp-elenco li { flex-wrap: wrap; } .sp-elenco__azioni { width: 100%; justify-content: flex-end; } }

/* ── Club (logo e colori dell'organizzatore) ── */
.club-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--m-5); align-items: start; }
@media (max-width: 860px) { .club-layout { grid-template-columns: 1fr; } }
.club-colore { height: 44px; padding: 4px; cursor: pointer; }
.club-indirizzo { display: flex; align-items: stretch; border: 1px solid var(--m-border); border-radius: var(--m-r-md, 10px); overflow: hidden; background: var(--m-surface); }
.club-indirizzo span { display: flex; align-items: center; padding: 0 10px; background: var(--m-bg-soft); color: var(--m-text-mute); font-size: 13px; white-space: nowrap; }
.club-indirizzo .m-input { border: 0; border-radius: 0; min-width: 0; flex: 1; }
@media (max-width: 520px) { .club-indirizzo { flex-direction: column; } .club-indirizzo span { padding: 6px 10px; white-space: normal; overflow-wrap: anywhere; } }
.club-logo-attuale { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.club-logo-attuale img { width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--m-border); border-radius: 12px; background: #fff; padding: 6px; }
.club-istruzioni { margin-top: 8px; font-size: 13px; }
.club-istruzioni summary { cursor: pointer; color: var(--m-primary-600); font-weight: 600; }
.club-istruzioni ol { margin: 8px 0 0 18px; padding: 0; display: grid; gap: 6px; color: var(--m-text-soft); }
.club-anteprima { background: linear-gradient(135deg, var(--club), var(--club2)); color: #fff; border: 0; }
.club-anteprima p { margin: 12px 0 0; font-size: 13px; color: #fff; opacity: .85; }
.club-anteprima__testa { display: flex; align-items: center; gap: 12px; font-size: 18px; }
.club-anteprima__logo { width: 56px; height: 56px; border-radius: 14px; background: #fff; display: grid; place-items: center; font-size: 26px; flex: 0 0 auto; overflow: hidden; }
.club-anteprima__logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.club-testa { background: linear-gradient(135deg, var(--club), var(--club2)); color: #fff; border: 0; }
.club-testa h1, .club-testa .m-muted, .club-testa [style*="font-weight:700"] { color: #fff !important; }
.club-testa .m-muted { opacity: .85; }
.club-testa [style*="border-left"] { border-color: rgba(255,255,255,.3) !important; }
.club-testa__logo { width: 76px; height: 76px; flex: 0 0 auto; object-fit: contain; background: #fff; border-radius: 18px; padding: 6px; box-shadow: 0 8px 20px -10px rgba(0,0,0,.4); }
.club-badge { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 5px 12px 5px 5px; border-radius: 999px; text-decoration: none;
  background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.25); max-width: 100%; }
.club-badge:hover { background: rgba(255,255,255,.22); }
.club-badge__logo { width: 30px; height: 30px; border-radius: 50%; object-fit: contain; background: #fff; padding: 2px; flex: 0 0 auto; }
.club-badge__logo--vuoto { display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; padding: 0; }
.club-badge span { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.club-badge small { font-size: 10.5px; opacity: .8; }
.club-badge b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Notifiche (notifiche.php) ─────────────────────────────────────── */
.nt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--m-5); align-items: start; }
@media (max-width: 860px) { .nt-layout { grid-template-columns: 1fr; } .nt-impostazioni { order: -1; } }
.nt-impostazioni { display: grid; gap: var(--m-4); }
.nt-elenco { padding: var(--m-2); }
.nt-voci { list-style: none; margin: 0; padding: 0; }
.nt-voce { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; color: var(--m-text); text-decoration: none; }
.nt-voce:hover { background: var(--m-surface-2); }
.nt-voce--nuova { background: var(--m-primary-50); }
.nt-voce__icona { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%; background: var(--m-surface-2); display: grid; place-items: center; font-size: 18px; }
.nt-voce__testo { display: grid; gap: 2px; min-width: 0; flex: 1; }
.nt-voce__testo b { font-size: 14.5px; overflow-wrap: anywhere; }
.nt-voce__testo span { font-size: 13px; color: var(--m-text-soft); overflow-wrap: anywhere; }
.nt-voce__testo time { font-size: 12px; color: var(--m-text-muted, #8a8aa0); }
.nt-voce__nuovo { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: var(--m-primary-700); background: #fff; border: 1px solid var(--m-primary-200); border-radius: 999px; padding: 2px 8px; }
.nt-titolo { font-size: 16px; margin: 0 0 var(--m-2); }
.nt-spiega { font-size: 13px; margin: 0 0 var(--m-3); }
.nt-push__stato { font-size: 13.5px; font-weight: 600; margin: 0 0 var(--m-3); color: var(--m-text-soft); }
.nt-push__stato.is-attivo { color: var(--m-success-600, #15803d); }
.nt-push__stato.is-attivo::before { content: '✓ '; }
.nt-push__pulsanti { display: grid; gap: 8px; }
.nt-push__ios { font-size: 13px; margin-bottom: var(--m-3); }
.nt-push__esito { font-size: 13px; margin: var(--m-3) 0 0; }
.nt-push__esito.is-ok { color: var(--m-success-600, #15803d); }
.nt-push__esito.is-ko { color: var(--m-danger-600, #b91c1c); }
.nt-interruttore { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 14px; margin-bottom: var(--m-2); cursor: pointer; }
.nt-suggerisci { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ── Quota d'iscrizione (pagina del torneo e della squadra) ─────────── */
.qt-importo { font-family: var(--m-font-display); font-size: 26px; font-weight: 800; color: var(--m-text); }
.qt-modi { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 var(--m-3); }
.qt-modo { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--m-surface-2); border: 1px solid var(--m-border); }
.qt-iban { display: grid; gap: 4px; padding: var(--m-3); border-radius: 12px; background: var(--m-surface-2); margin-top: var(--m-3); font-size: 13px; }
.qt-iban__riga { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qt-iban code { font-size: 14.5px; font-weight: 700; letter-spacing: .03em; overflow-wrap: anywhere; }
.qt-nota { font-size: 13px; margin: var(--m-3) 0 0; }
.qt-stato { display: block; margin-top: var(--m-3); padding: 10px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.qt-stato--0 { background: var(--m-warn-50, #fff7e6); color: #92400e; }
.qt-stato--1 { background: var(--m-primary-50); color: var(--m-primary-700); }
.qt-stato--2 { background: var(--m-success-50, #ecfdf3); color: #166534; }

/* ── Pagina del torneo: regolamento, lista d'attesa, pulsante iscrizioni ── */
.dt-regolamento { display: flex; align-items: center; justify-content: space-between; gap: var(--m-3); flex-wrap: wrap; }
.dt-regolamento > div { display: grid; gap: 2px; }
.dt-regolamento span { font-size: 13px; }
.dt-regolamento--vuoto { border-style: dashed; }
.dt-attesa { margin: 0; padding-left: 22px; display: grid; gap: 4px; font-weight: 600; }
.dt-mia-squadra { margin: var(--m-3) 0 0; font-size: 13.5px; padding: 10px 12px; border-radius: 10px; background: var(--m-surface-2); }
.dt-iscrizioni { position: relative; }
.dt-contatore { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--m-danger-500, #dc2626); color: #fff; font-size: 11.5px; font-weight: 700; }

/* ── Iscrizioni (iscrizioni.php) ────────────────────────────────────── */
.is-riepilogo { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--m-4); }
.is-chip { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--m-surface); border: 1px solid var(--m-border); color: var(--m-text); text-decoration: none; }
.is-chip--warn { background: var(--m-warn-50, #fff7e6); border-color: #f5d9a8; }
.is-chip--ok { background: var(--m-success-50, #ecfdf3); border-color: #bfe8cf; }
.is-schede { margin-bottom: var(--m-4); }
.is-elenco { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.is-elenco--numeri { list-style: decimal; padding-left: 22px; }
.is-riga { display: flex; gap: var(--m-3); align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px; border: 1px solid var(--m-border); border-radius: 12px; background: var(--m-surface); }
.is-riga--ok { background: var(--m-success-50, #ecfdf3); border-color: #bfe8cf; }
.is-riga__nome { display: grid; gap: 3px; min-width: 0; flex: 1 1 220px; }
.is-riga__nome a { color: var(--m-text); }
.is-riga__nome .m-muted { font-size: 12.5px; }
.is-riga__azioni { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.is-azione { margin: 0; }
.is-stati { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.is-stato { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.is-stato--ok { background: var(--m-success-50, #ecfdf3); color: #166534; }
.is-stato--warn { background: var(--m-warn-50, #fff7e6); color: #92400e; }
.is-stato--no { background: var(--m-surface-2); color: var(--m-text-soft); }
.is-da-pagare { color: #b45309; }
.is-togli { color: var(--m-danger-600, #b91c1c); }
.is-intestazione-azioni { display: flex; gap: 6px; flex-wrap: wrap; }
.is-checkin .m-input { margin-bottom: var(--m-4); }
.is-elenco--checkin .is-riga { padding: 14px; }
.is-elenco--checkin .is-riga__nome > b { font-size: 16px; }
.is-elenco--checkin .m-btn--primary { min-width: 140px; min-height: 44px; }
.is-suggerimento { display: grid; gap: 6px; justify-items: start; }

/* ── Check-in (checkin.php e pass della squadra) ────────────────────── */
.ci-pass { text-align: center; padding: var(--m-6); display: grid; gap: var(--m-3); }
.ci-pass--ok { border-color: #bfe8cf; background: var(--m-success-50, #ecfdf3); }
.ci-pass__torneo { font-size: 13px; font-weight: 700; color: var(--m-primary-700); text-transform: uppercase; letter-spacing: .06em; }
.ci-pass__squadra { font-size: 28px; margin: 0; }
.ci-stato { font-size: 18px; font-weight: 700; }
.ci-quota { margin: 0; font-weight: 600; }
.ci-quota--da-pagare { color: #b45309; }
.ci-qr { display: grid; place-items: center; padding: 10px; background: #fff; border-radius: 12px; border: 1px solid var(--m-border); }
.ci-qr img, .ci-qr canvas { max-width: 100%; height: auto; }
.ci-fatto { font-weight: 700; color: #166534; margin: 0 0 var(--m-2); }

/* ── Importa squadre (importa_squadre.php) ──────────────────────────── */
.im-passi ol { margin: 0 0 var(--m-3); padding-left: 20px; display: grid; gap: 10px; font-size: 14px; }
.im-passi li b { display: block; }
.im-passi li span { display: block; color: var(--m-text-soft); }
.im-oppure { display: flex; align-items: center; gap: 10px; color: var(--m-text-soft); font-size: 13px; }
.im-oppure::before, .im-oppure::after { content: ''; flex: 1; border-top: 1px solid var(--m-border); }
.im-riga--errore { background: var(--m-danger-50, #fef2f2); border-color: #f2c4c4; }
.im-riga--avviso { background: var(--m-warn-50, #fff7e6); border-color: #f5d9a8; }
.im-messaggio { font-size: 12.5px; font-weight: 600; }

/* ── Metti il torneo nel tuo sito (incorpora.php) ───────────────────── */
.ic-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: var(--m-5); align-items: start; }
@media (max-width: 860px) { .ic-layout { grid-template-columns: 1fr; } }
.ic-scelte { display: grid; gap: var(--m-4); }
.ic-opzione { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--m-border); border-radius: 10px; margin-top: 6px; cursor: pointer; }
.ic-opzione span { display: grid; }
.ic-opzione small { color: var(--m-text-soft); font-size: 12px; }
.ic-opzione:has(input:checked) { border-color: var(--m-primary-400); background: var(--m-primary-50); }
.ic-codice { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ic-anteprima { display: grid; gap: 6px; }
.mt-reg-attuale { display: flex; gap: var(--m-4); align-items: center; flex-wrap: wrap; margin-bottom: var(--m-3); font-size: 14px; }
.pg-box { margin-top: var(--m-3); }
.pg-titoletto { font-weight: 700; font-size: 14px; margin: var(--m-4) 0 var(--m-2); }
.pg-modo { padding: 12px; border: 1px solid var(--m-border); border-radius: 12px; margin-bottom: 8px; display: grid; gap: 8px; }
.pg-modo--riga { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }

.is-dettagli { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.is-pos { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--m-primary-50); color: var(--m-primary-700); }
