/* ==========================================================================
   Las Chicas — design system
   --------------------------------------------------------------------------
   REGOLA: i colori si scrivono SOLO nei blocchi di variabili qui sotto
   (:root e :root[data-theme="dark"]). Nel resto del file e nei moduli si usano
   le variabili. I colori squadra arrivano dal DB come --team / --team-text
   (vedi stileSquadra() in app/lib/util.php).
   Catalogo dei componenti con gli snippet: _docs/CONVENZIONI.md
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABILI — tema chiaro
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Outfit", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* superfici e testo */
  --bg: #f2f5fa;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --surface-3: #e8edf5;
  --text: #13213a;
  --text-muted: #5b6980;
  --text-faint: #8a96a8;
  --border: #dfe5ee;
  --border-strong: #c7d0de;

  /* marchio: blu Las Chicas */
  --brand: #074d95;
  --brand-strong: #053a72;
  --brand-soft: #e4edf8;
  --brand-solid: #074d95;
  --brand-solid-hover: #0b5cb0;
  --brand-solid-active: #053a72;
  --on-brand: #ffffff;
  --hero-to: #0a6fb8;

  /* accento: verde golf */
  --accent: #128a52;
  --accent-strong: #0c6b3f;
  --accent-soft: #e0f3e8;
  --accent-solid: #15965a;
  --accent-solid-hover: #12844f;
  --on-accent: #ffffff;

  /* premi e podio */
  --gold: #c99a1a;
  --gold-strong: #7d5b00;
  --gold-soft: #fcf1d2;
  --on-gold: #2b1f00;
  --silver: #8592a6;
  --silver-soft: #edf0f5;
  --bronze: #b06b36;
  --bronze-soft: #f7e7da;

  /* stati */
  --danger: #c4314b;
  --danger-soft: #fbe6ea;
  --danger-solid: #c4314b;
  --warning: #9a6512;
  --warning-soft: #fdf2df;
  --success: var(--accent);
  --success-soft: var(--accent-soft);
  --info: var(--brand);
  --info-soft: var(--brand-soft);

  /* involucri */
  --topbar-bg: #074d95;
  --topbar-text: #ffffff;
  --topbar-text-muted: rgba(255, 255, 255, .74);
  --topbar-hover: rgba(255, 255, 255, .14);
  --tabbar-bg: rgba(255, 255, 255, .94);
  --sidebar-bg: #0a2747;
  --sidebar-text: #dbe5f3;
  --sidebar-text-muted: #8fa3c0;
  --sidebar-hover: rgba(255, 255, 255, .07);
  --sidebar-active-bg: rgba(255, 255, 255, .12);
  --sidebar-active-text: #ffffff;
  --sidebar-mark: #4cc38a;
  --logo-plate: #ffffff;

  /* squadra senza colore valido */
  --team-default: #8a96a8;
  --team-text-default: #111111;

  /* bordo di ambiente (solo fuori produzione) */
  --env-dev: #d00000;
  --env-stg: #198754;
  --env-text: #ffffff;

  /* ombre, raggi, misure */
  --shadow-sm: 0 1px 2px rgba(16, 32, 64, .06), 0 1px 3px rgba(16, 32, 64, .07);
  --shadow: 0 6px 18px rgba(16, 32, 64, .08);
  --shadow-lg: 0 14px 36px rgba(16, 32, 64, .16);
  --focus-ring: 0 0 0 3px rgba(7, 77, 149, .32);
  --overlay: rgba(8, 18, 36, .5);

  --radius-sm: .5rem;
  --radius: .875rem;
  --radius-lg: 1.25rem;
  --radius-pill: 999px;
  --topbar-h: 3.75rem;
  --tabbar-h: 4.1rem;
  --sidebar-w: 16rem;

  /* Bootstrap: le utility e i componenti seguono le variabili */
  --bs-primary-rgb: 7, 77, 149;
  --bs-success-rgb: 18, 138, 82;
  --bs-danger-rgb: 196, 49, 75;
  --bs-warning-rgb: 154, 101, 18;
  --bs-info-rgb: 7, 77, 149;
}

/* --------------------------------------------------------------------------
   1b. VARIABILI — tema scuro
   -------------------------------------------------------------------------- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0b1220;
  --surface: #121b2d;
  --surface-2: #172239;
  --surface-3: #1f2c46;
  --text: #e6ecf5;
  --text-muted: #9cabc2;
  --text-faint: #6f7f99;
  --border: #24324c;
  --border-strong: #33466a;

  --brand: #6ea9ee;
  --brand-strong: #a0c8f6;
  --brand-soft: #14294a;
  --brand-solid: #2a6fc0;
  --brand-solid-hover: #3a80d2;
  --brand-solid-active: #2160aa;
  --on-brand: #ffffff;
  --hero-to: #184f8e;

  --accent: #46c886;
  --accent-strong: #79dca7;
  --accent-soft: #0f3020;
  --accent-solid: #1c9a5c;
  --accent-solid-hover: #22ab67;
  --on-accent: #ffffff;

  --gold: #e8bb3c;
  --gold-strong: #f4d47c;
  --gold-soft: #33290c;
  --on-gold: #2b1f00;
  --silver: #aab5c7;
  --silver-soft: #222d40;
  --bronze: #d6935d;
  --bronze-soft: #35251a;

  --danger: #f27a8f;
  --danger-soft: #3b1821;
  --danger-solid: #c93b55;
  --warning: #f0b45a;
  --warning-soft: #36280f;

  --topbar-bg: #0e1e36;
  --topbar-text: #ffffff;
  --topbar-text-muted: rgba(255, 255, 255, .7);
  --topbar-hover: rgba(255, 255, 255, .1);
  --tabbar-bg: rgba(18, 27, 45, .94);
  --sidebar-bg: #0d172a;
  --sidebar-text: #d6e0ef;
  --sidebar-text-muted: #7f92b0;
  --sidebar-hover: rgba(255, 255, 255, .05);
  --sidebar-active-bg: rgba(110, 169, 238, .16);
  --sidebar-active-text: #ffffff;
  --sidebar-mark: #46c886;
  --logo-plate: #ffffff;

  --team-default: #6f7f99;
  --team-text-default: #ffffff;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 6px 18px rgba(0, 0, 0, .35);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, .5);
  --focus-ring: 0 0 0 3px rgba(110, 169, 238, .45);
  --overlay: rgba(0, 0, 0, .6);

  --bs-primary-rgb: 110, 169, 238;
  --bs-success-rgb: 70, 200, 134;
  --bs-danger-rgb: 242, 122, 143;
  --bs-warning-rgb: 240, 180, 90;
  --bs-info-rgb: 110, 169, 238;
}

/* Collegamento con le variabili di Bootstrap (specificità più alta di [data-bs-theme]) */
:root[data-bs-theme], :root[data-theme] {
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-body-font-family: var(--font-sans);
  --bs-emphasis-color: var(--text);
  --bs-secondary-color: var(--text-muted);
  --bs-tertiary-color: var(--text-faint);
  --bs-secondary-bg: var(--surface-3);
  --bs-tertiary-bg: var(--surface-2);
  --bs-border-color: var(--border);
  --bs-border-color-translucent: var(--border);
  --bs-heading-color: var(--text);
  --bs-primary: var(--brand);
  --bs-focus-ring-color: var(--brand-soft);
  --bs-border-radius: var(--radius-sm);
  --bs-border-radius-lg: var(--radius);
}

/* --------------------------------------------------------------------------
   2. BASE
   -------------------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: .95rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 768px) { body { font-size: 1rem; } }

h1, h2, h3, h4, h5, h6, .lc-display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
}
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-strong); }
hr { border-color: var(--border); opacity: 1; }
small, .small { color: inherit; }

.lc-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.lc-muted { color: var(--text-muted) !important; }
.lc-faint { color: var(--text-faint) !important; }
.lc-text-brand { color: var(--brand) !important; }
.lc-text-accent { color: var(--accent) !important; }
.lc-text-danger { color: var(--danger) !important; }
.lc-nowrap { white-space: nowrap; }
.lc-skip {
  position: absolute; left: .5rem; top: -3rem; z-index: 2000;
  background: var(--brand-solid); color: var(--on-brand);
  padding: .5rem .9rem; border-radius: var(--radius-sm); text-decoration: none;
}
.lc-skip:focus { top: .5rem; color: var(--on-brand); }

/* Bootstrap: correzioni di tema */
.text-body-secondary, .text-muted { color: var(--text-muted) !important; }
.border, .border-top, .border-bottom { border-color: var(--border) !important; }
.dropdown-menu {
  --bs-dropdown-bg: var(--surface);
  --bs-dropdown-color: var(--text);
  --bs-dropdown-border-color: var(--border);
  --bs-dropdown-link-color: var(--text);
  --bs-dropdown-link-hover-bg: var(--surface-2);
  --bs-dropdown-link-hover-color: var(--text);
  --bs-dropdown-link-active-bg: var(--brand-solid);
  --bs-dropdown-link-active-color: var(--on-brand);
  box-shadow: var(--shadow);
  border-radius: var(--radius-sm);
}
.tooltip { --bs-tooltip-bg: var(--text); --bs-tooltip-color: var(--surface); --bs-tooltip-font-size: .8rem; }
.offcanvas { --bs-offcanvas-bg: var(--surface); --bs-offcanvas-color: var(--text); }
.modal { --bs-modal-bg: var(--surface); --bs-modal-color: var(--text); --bs-modal-border-color: var(--border); }
.btn-close { filter: none; }
:root[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* Focus visibile ovunque, solo da tastiera */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible {
  outline: none; box-shadow: var(--focus-ring);
}

/* Barra di ambiente (fuori produzione) */
body.app-env-dev { border: 4px solid var(--env-dev); min-height: 100vh; }
body.app-env-stg { border: 4px solid var(--env-stg); min-height: 100vh; }
.app-banner-ambiente {
  position: fixed; top: 0; right: 0; z-index: 1090;
  padding: .15rem .6rem; font-size: .7rem; font-weight: 700; letter-spacing: .05em;
  background: var(--env-dev); color: var(--env-text); border-bottom-left-radius: .35rem;
}

/* --------------------------------------------------------------------------
   3. INVOLUCRO PUBBLICO — barra superiore + barra a schede in basso (mobile)
   -------------------------------------------------------------------------- */
.lc-topbar {
  position: sticky; top: 0; z-index: 1030;
  background: var(--topbar-bg);
  color: var(--topbar-text);
  padding-top: env(safe-area-inset-top, 0px);
  box-shadow: var(--shadow-sm);
}
.lc-topbar__inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: var(--topbar-h);
}
.lc-topbar__brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.lc-topbar__logo { height: 2.25rem; width: auto; display: block; }
.lc-topbar__actions { margin-left: auto; display: flex; align-items: center; gap: .25rem; }

.lc-topnav { display: flex; gap: .25rem; margin-left: 1rem; }
.lc-topnav__link {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .45rem .85rem; border-radius: var(--radius-pill);
  color: var(--topbar-text-muted); text-decoration: none; font-weight: 600; font-size: .95rem;
  transition: background-color .15s ease, color .15s ease;
}
.lc-topnav__link:hover { background: var(--topbar-hover); color: var(--topbar-text); }
.lc-topnav__link.is-active { background: var(--topbar-hover); color: var(--topbar-text); }

/* pulsante solo icona, usato in entrambe le barre */
.lc-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: var(--radius-pill);
  border: 0; background: transparent; color: inherit; font-size: 1.05rem;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease;
}
.lc-topbar .lc-icon-btn { color: var(--topbar-text); }
.lc-topbar .lc-icon-btn:hover { background: var(--topbar-hover); color: var(--topbar-text); }
.lc-icon-btn:hover { background: var(--surface-3); color: inherit; }

.lc-main { padding-top: 1.25rem; padding-bottom: 2rem; }
@media (min-width: 768px) { .lc-main { padding-top: 2rem; padding-bottom: 3rem; } }

.lc-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  /* una colonna per voce di menu (oggi 4: Classifica, Individuale, Gare, Squadre) */
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  background: var(--tabbar-bg);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.lc-tabbar__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
  height: var(--tabbar-h);
  color: var(--text-muted); text-decoration: none;
  font-size: .72rem; font-weight: 600; letter-spacing: .01em;
  position: relative;
}
.lc-tabbar__item i { font-size: 1.25rem; }
.lc-tabbar__item.is-active { color: var(--brand); }
.lc-tabbar__item.is-active::before {
  content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--brand);
}
.lc-area-pubblico { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 768px) {
  .lc-tabbar { display: none; }
  .lc-area-pubblico { padding-bottom: 0; }
}

.lc-footer {
  color: var(--text-faint); font-size: .8rem; text-align: center;
  padding: 1.5rem 1rem 2rem;
}

/* --------------------------------------------------------------------------
   4. INVOLUCRO ADMIN — barra laterale (≥ lg) / offcanvas (mobile)
   -------------------------------------------------------------------------- */
.lc-admin { display: flex; min-height: 100vh; }
.lc-sidebar-wrap { flex: 0 0 auto; }
.lc-sidebar {
  --bs-offcanvas-bg: var(--sidebar-bg);
  --bs-offcanvas-color: var(--sidebar-text);
  --bs-offcanvas-width: 17rem;
  color: var(--sidebar-text);
}
.lc-sidebar__inner {
  display: flex; flex-direction: column; height: 100%; width: 100%;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) .85rem 1rem;
}
.lc-sidebar__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .25rem .4rem 1.25rem; }
.lc-sidebar__logo { height: 2.1rem; width: auto; display: block; }
.lc-sidebar__label {
  font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--sidebar-text-muted); padding: .25rem .75rem .5rem;
}
.lc-sidebar__nav { display: flex; flex-direction: column; gap: .15rem; }
.lc-sidebar__link {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .75rem; border-radius: var(--radius-sm);
  color: var(--sidebar-text); text-decoration: none; font-weight: 500;
  position: relative;
}
.lc-sidebar__link i { width: 1.25rem; text-align: center; color: var(--sidebar-text-muted); }
.lc-sidebar__link:hover { background: var(--sidebar-hover); color: var(--sidebar-active-text); }
.lc-sidebar__link.is-active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600; }
.lc-sidebar__link.is-active i { color: var(--sidebar-mark); }
.lc-sidebar__link.is-active::before {
  content: ""; position: absolute; left: -.85rem; top: .5rem; bottom: .5rem; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--sidebar-mark);
}
.lc-sidebar__foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--sidebar-hover); }
.lc-sidebar .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

@media (min-width: 992px) {
  .lc-sidebar-wrap {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
  }
  .lc-sidebar { height: 100%; }
}

.lc-admin__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.lc-admin-topbar {
  position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: .5rem;
  min-height: var(--topbar-h);
  padding: env(safe-area-inset-top, 0px) 1rem 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.lc-admin-topbar__title {
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lc-admin-topbar__actions { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.lc-admin-main { padding: 1.25rem 1rem 3rem; width: 100%; max-width: 88rem; }
@media (min-width: 768px) { .lc-admin-main { padding: 1.75rem 2rem 3rem; } }

.lc-user {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 600; font-size: .9rem; color: var(--text);
}
.lc-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: var(--radius-pill);
  background: var(--brand-soft); color: var(--brand);
  font-family: var(--font-display); font-weight: 700; font-size: .8rem;
}

/* --------------------------------------------------------------------------
   5. INTESTAZIONE DI PAGINA E SEZIONI
   -------------------------------------------------------------------------- */
.lc-page-header {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: .75rem 1rem; margin-bottom: 1.25rem;
}
.lc-page-header__eyebrow {
  font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .25rem;
}
.lc-page-title { font-size: 1.6rem; font-weight: 800; margin: 0; line-height: 1.15; }
@media (min-width: 768px) { .lc-page-title { font-size: 2rem; } }
.lc-page-header__sub { color: var(--text-muted); margin: .35rem 0 0; }
.lc-page-header__actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.lc-section { margin-top: 2rem; }
.lc-section__title {
  font-size: 1.05rem; font-weight: 700; margin: 0 0 .75rem;
  display: flex; align-items: center; gap: .5rem;
}
.lc-section__title i { color: var(--brand); }

/* Banner di apertura (home / gara) */
.lc-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--brand-solid), var(--hero-to));
  color: var(--on-brand);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
.lc-hero::after {
  content: ""; position: absolute; right: -3rem; top: -3rem; width: 11rem; height: 11rem;
  border-radius: 50%; border: 1.5rem solid var(--topbar-hover);
}
.lc-hero__eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.lc-hero__title { color: inherit; font-size: 1.5rem; font-weight: 800; margin: .2rem 0 .35rem; }
.lc-hero__meta { opacity: .88; font-size: .9rem; margin: 0; }
.lc-hero a { color: inherit; }

/* --------------------------------------------------------------------------
   6. CARD
   -------------------------------------------------------------------------- */
.lc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.lc-card__header {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .9rem 1.1rem; border-bottom: 1px solid var(--border);
}
.lc-card__title { font-size: 1rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .5rem; }
.lc-card__body { padding: 1.1rem; }
.lc-card__footer { padding: .8rem 1.1rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.lc-card--flush .lc-card__body { padding: 0; }
.lc-card--team { border-left: 5px solid var(--team, var(--team-default)); }
.lc-card + .lc-card { margin-top: 1rem; }
.lc-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }

/* --------------------------------------------------------------------------
   7. SQUADRA: pastiglia, pallino, striscia
   -------------------------------------------------------------------------- */
.lc-team {
  display: inline-flex; align-items: center; gap: .45rem; max-width: 100%;
  padding: .2rem .7rem .2rem .45rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--team, var(--team-default)) 16%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--team, var(--team-default)) 45%, var(--surface));
  color: var(--text);
  font-weight: 600; font-size: .85rem; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lc-team__dot, .lc-team-dot {
  flex: 0 0 auto; width: .7rem; height: .7rem; border-radius: 50%;
  background: var(--team, var(--team-default));
  box-shadow: 0 0 0 2px var(--surface);
}
.lc-team--solid {
  background: var(--team, var(--team-default));
  border-color: var(--team, var(--team-default));
  color: var(--team-text, var(--team-text-default));
  padding-left: .7rem;
}
.lc-team--solid .lc-team__dot { display: none; }
.lc-team--lg { font-size: 1rem; padding: .35rem .9rem .35rem .55rem; }
.lc-team--lg .lc-team__dot { width: .9rem; height: .9rem; }

/* --------------------------------------------------------------------------
   8. TESSERE NUMERICHE (stat) e TABELLONE SQUADRE
   -------------------------------------------------------------------------- */
.lc-stats { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 1.25rem; }
@media (min-width: 768px) { .lc-stats { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; } }
.lc-stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .9rem 1rem; box-shadow: var(--shadow-sm); min-width: 0;
}
.lc-stat__label {
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
  display: flex; align-items: center; gap: .4rem;
}
.lc-stat__value {
  font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; line-height: 1.1; margin-top: .25rem;
  font-variant-numeric: tabular-nums;
}
.lc-stat__meta { font-size: .82rem; color: var(--text-muted); margin-top: .15rem; }
.lc-stat--brand { background: linear-gradient(135deg, var(--brand-solid), var(--hero-to)); border-color: transparent; color: var(--on-brand); }
.lc-stat--brand .lc-stat__label, .lc-stat--brand .lc-stat__meta { color: var(--on-brand); opacity: .82; }
.lc-stat--team {
  background: var(--team, var(--team-default)); border-color: transparent;
  color: var(--team-text, var(--team-text-default));
}
.lc-stat--team .lc-stat__label, .lc-stat--team .lc-stat__meta { color: inherit; opacity: .85; }

/* Posizione (podio oro/argento/bronzo per 1-2-3) */
.lc-pos {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--surface-3); color: var(--text-muted);
  font-family: var(--font-display); font-weight: 800; font-size: .95rem;
  font-variant-numeric: tabular-nums;
}
.lc-pos--1 { background: var(--gold); color: var(--on-gold); }
.lc-pos--2 { background: var(--silver); color: var(--on-gold); }
.lc-pos--3 { background: var(--bronze); color: var(--on-brand); }
.lc-pos--sm { width: 1.7rem; height: 1.7rem; font-size: .8rem; }

/* Riga squadra del tabellone, espandibile */
.lc-scoreboard { display: flex; flex-direction: column; gap: .65rem; }
.lc-score {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
  border-left: 6px solid var(--team, var(--team-default));
}
.lc-score__head {
  display: flex; align-items: center; gap: .8rem; width: 100%;
  padding: .85rem 1rem; background: transparent; border: 0; text-align: left; color: inherit;
  cursor: pointer;
}
.lc-score__head:hover { background: var(--surface-2); }
.lc-score__team { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.lc-score__name {
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lc-score__sub { font-size: .8rem; color: var(--text-muted); }
.lc-score__total { display: flex; flex-direction: column; align-items: flex-end; flex: 0 0 auto; }
.lc-score__value {
  font-family: var(--font-display); font-weight: 800; font-size: 1.65rem; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.lc-score__gap { font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; margin-top: .2rem; }
.lc-score__gap--leader { color: var(--accent); font-weight: 700; }
.lc-score__chevron { color: var(--text-faint); transition: transform .2s ease; flex: 0 0 auto; }
.lc-score__head[aria-expanded="true"] .lc-score__chevron { transform: rotate(180deg); }
.lc-score__detail { border-top: 1px solid var(--border); background: var(--surface-2); padding: .5rem .5rem .75rem; }
.lc-score--leader { box-shadow: var(--shadow); }
@media (min-width: 768px) {
  .lc-score__head { padding: 1rem 1.25rem; gap: 1rem; }
  .lc-score__value { font-size: 2rem; }
}

/* Scarto dal primo, segno grafico */
.lc-gap { font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: .85rem; }
.lc-gap--up { color: var(--accent); }
.lc-gap--down { color: var(--danger); }

/* --------------------------------------------------------------------------
   9. CLASSIFICA A RIGHE (giocatrici) — conteggiata / non conteggiata
   -------------------------------------------------------------------------- */
.lc-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.lc-rank__row {
  display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto auto; align-items: center; gap: .6rem;
  padding: .55rem .75rem; border-radius: var(--radius-sm);
  background: var(--surface);
}
.lc-rank__pos { font-family: var(--font-display); font-weight: 700; color: var(--text-muted); text-align: center; font-variant-numeric: tabular-nums; }
.lc-rank__name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-rank__first { font-weight: 400; color: var(--text-muted); }
.lc-rank__meta { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.lc-rank__score { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; min-width: 2.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.lc-rank__row.is-counted { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.lc-rank__row.is-counted .lc-rank__score { color: var(--accent-strong); }
.lc-rank__row.is-not-counted { background: transparent; color: var(--text-muted); }
.lc-rank__row.is-not-counted .lc-rank__name { font-weight: 500; }
.lc-rank__row.is-not-counted .lc-rank__score { color: var(--text-faint); font-weight: 500; text-decoration: line-through; text-decoration-thickness: 1px; }
.lc-rank__cut {
  display: flex; align-items: center; gap: .6rem; margin: .4rem .75rem;
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint);
}
.lc-rank__cut::before, .lc-rank__cut::after { content: ""; flex: 1; border-top: 1px dashed var(--border-strong); }

/* Legenda */
.lc-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .8rem; color: var(--text-muted); margin: .5rem 0 1rem; }
.lc-legend__item { display: inline-flex; align-items: center; gap: .4rem; }
.lc-legend__swatch { width: .9rem; height: .9rem; border-radius: 3px; background: var(--surface-3); }
.lc-legend__swatch--counted { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.lc-legend__swatch--prize { background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold); }

/* --------------------------------------------------------------------------
   10. PREMIO (oro, con tooltip) — CAPITANA — BADGE
   -------------------------------------------------------------------------- */
.lc-prize {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .12rem .5rem; border-radius: var(--radius-pill);
  background: var(--gold-soft); color: var(--gold-strong);
  border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent);
  font-size: .75rem; font-weight: 700; line-height: 1.4; white-space: nowrap; cursor: help;
}
.lc-prize i { color: var(--gold); font-size: .8em; }
.lc-prize__pts { font-variant-numeric: tabular-nums; }
.lc-prize--sm { padding: 0 .35rem; font-size: .68rem; }
.lc-prize--solid { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.lc-prize--solid i { color: var(--on-gold); }

.lc-captain {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.15rem; height: 1.15rem; border-radius: 50%; vertical-align: .1em; margin-left: .25rem;
  background: var(--brand-solid); color: var(--on-brand);
  font-size: .62rem; font-weight: 800; font-family: var(--font-display);
}

.lc-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .15rem .55rem; border-radius: var(--radius-pill);
  font-size: .75rem; font-weight: 600; line-height: 1.4; white-space: nowrap;
  background: var(--surface-3); color: var(--text-muted);
}
.lc-badge--brand { background: var(--brand-soft); color: var(--brand); }
.lc-badge--accent { background: var(--accent-soft); color: var(--accent-strong); }
.lc-badge--gold { background: var(--gold-soft); color: var(--gold-strong); }
.lc-badge--danger { background: var(--danger-soft); color: var(--danger); }
.lc-badge--warning { background: var(--warning-soft); color: var(--warning); }
.lc-badge--outline { background: transparent; border: 1px solid var(--border-strong); }

/* --------------------------------------------------------------------------
   11. SELETTORI: chip scorrevoli e controllo segmentato
   -------------------------------------------------------------------------- */
.lc-chips {
  position: relative; display: flex; gap: .5rem; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  padding: .25rem .1rem .6rem; margin: 0 0 1rem;
  scrollbar-width: thin;
}
.lc-chip {
  flex: 0 0 auto; scroll-snap-align: center;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 3.6rem; padding: .45rem .7rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  text-decoration: none; line-height: 1.15; box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, background-color .15s ease;
}
.lc-chip:hover { border-color: var(--brand); color: var(--text); }
.lc-chip__num { font-family: var(--font-display); font-weight: 700; font-size: .95rem; }
.lc-chip__date { font-size: .72rem; color: var(--text-muted); }
.lc-chip.is-active { background: var(--brand-solid); border-color: var(--brand-solid); color: var(--on-brand); box-shadow: var(--shadow); }
.lc-chip.is-active .lc-chip__date { color: var(--on-brand); opacity: .85; }
.lc-chip.is-disabled { opacity: .45; pointer-events: none; box-shadow: none; }

.lc-segmented {
  display: inline-flex; padding: .25rem; gap: .25rem; max-width: 100%; overflow-x: auto;
  background: var(--surface-3); border-radius: var(--radius-pill);
}
.lc-segmented__item {
  flex: 0 0 auto; border: 0; background: transparent; color: var(--text-muted);
  padding: .4rem .95rem; border-radius: var(--radius-pill);
  font-weight: 600; font-size: .88rem; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.lc-segmented__item:hover { color: var(--text); }
.lc-segmented__item.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* --------------------------------------------------------------------------
   12. TABELLE — elenco e matrice gara per gara (colonne e intestazione fisse)
   -------------------------------------------------------------------------- */
.lc-table-wrap {
  overflow: auto; -webkit-overflow-scrolling: touch;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.lc-table-wrap--tall { max-height: 75vh; }
.lc-table-wrap--plain { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.lc-table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 0;
  font-size: .9rem; color: var(--text);
}
.lc-table th, .lc-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.lc-table thead th {
  background: var(--surface-2); color: var(--text-muted);
  font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.lc-table tbody tr:last-child > * { border-bottom: 0; }
.lc-table--list tbody tr:hover > * { background: var(--surface-2); }
.lc-table .lc-num, .lc-table td.lc-num, .lc-table th.lc-num { text-align: right; font-variant-numeric: tabular-nums; }
.lc-table .lc-actions { text-align: right; white-space: nowrap; width: 1%; }

.lc-table--matrix { font-size: .85rem; }
.lc-table--matrix th, .lc-table--matrix td { padding: .45rem .55rem; white-space: nowrap; }
.lc-table--matrix thead th { position: sticky; top: 0; z-index: 2; text-align: center; }
.lc-table--matrix thead th small { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-faint); }
.lc-table--matrix td { text-align: center; font-variant-numeric: tabular-nums; }
.lc-sticky-col, .lc-sticky-col-2 {
  position: sticky; left: 0; z-index: 1;
  background: var(--surface); text-align: left !important;
}
.lc-sticky-col { width: var(--lc-sticky-w, 11rem); min-width: var(--lc-sticky-w, 11rem); max-width: var(--lc-sticky-w, 11rem); overflow: hidden; text-overflow: ellipsis; }
.lc-sticky-col-2 { left: var(--lc-sticky-w, 11rem); box-shadow: 1px 0 0 var(--border); }
.lc-table--matrix .lc-sticky-col:not(:has(+ .lc-sticky-col-2)) { box-shadow: 1px 0 0 var(--border); }
.lc-table--matrix thead .lc-sticky-col, .lc-table--matrix thead .lc-sticky-col-2 { z-index: 3; background: var(--surface-2); }
@media (max-width: 575.98px) { .lc-table--matrix { --lc-sticky-w: 8.5rem; } }

.lc-cell.is-counted { background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; }
.lc-cell.is-not-counted { color: var(--text-faint); }
.lc-cell.is-empty { color: var(--text-faint); }
.lc-cell.has-prize { box-shadow: inset 0 -3px 0 var(--gold); }
.lc-col-total { font-weight: 800; font-family: var(--font-display); background: var(--surface-2); }
.lc-row-team > * { background: color-mix(in srgb, var(--team, var(--team-default)) 12%, var(--surface)) !important; font-weight: 700; }
.lc-row-team > .lc-sticky-col { box-shadow: inset 4px 0 0 var(--team, var(--team-default)), 1px 0 0 var(--border); }

/* Bootstrap .table, se usata */
.table {
  --bs-table-bg: transparent; --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
  --bs-table-striped-bg: var(--surface-2); --bs-table-striped-color: var(--text);
  --bs-table-hover-bg: var(--surface-2); --bs-table-hover-color: var(--text);
}

/* --------------------------------------------------------------------------
   13. MODULI
   -------------------------------------------------------------------------- */
.form-control, .form-select {
  background-color: var(--surface); color: var(--text); border-color: var(--border-strong);
  border-radius: var(--radius-sm); padding: .55rem .8rem; min-height: 2.75rem;
}
.form-control:focus, .form-select:focus {
  background-color: var(--surface); color: var(--text);
  border-color: var(--brand); box-shadow: var(--focus-ring);
}
.form-control:disabled, .form-select:disabled { background-color: var(--surface-3); color: var(--text-muted); }
.form-label { font-weight: 600; font-size: .88rem; margin-bottom: .35rem; color: var(--text); }
.form-text, .lc-help { color: var(--text-muted); font-size: .8rem; }
.form-check-input { background-color: var(--surface); border-color: var(--border-strong); }
.form-check-input:checked { background-color: var(--brand-solid); border-color: var(--brand-solid); }
.form-check-input:focus { box-shadow: var(--focus-ring); border-color: var(--brand); }
.input-group-text { background: var(--surface-2); color: var(--text-muted); border-color: var(--border-strong); }
.is-invalid, .form-control.is-invalid { border-color: var(--danger) !important; }
.invalid-feedback { color: var(--danger); }

/* placeholder: "es. …" grigio corsivo, distinto da un valore inserito */
::placeholder, .form-control::placeholder { color: var(--text-faint) !important; font-style: italic; opacity: 1; }

.lc-form { max-width: 40rem; }
.lc-form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.lc-field { margin-bottom: 1rem; }
.lc-required::after { content: " *"; color: var(--danger); }

.lc-input-score {
  width: 4.75rem; min-width: 4.75rem; text-align: center;
  font-variant-numeric: tabular-nums; font-weight: 600; padding-left: .4rem; padding-right: .4rem;
}
.lc-input-score::-webkit-outer-spin-button, .lc-input-score::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.lc-input-score { -moz-appearance: textfield; appearance: textfield; }

/* barra azioni dei moduli: in basso e sempre visibile su schermi stretti */
.lc-form-actions {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: flex-end;
  margin-top: 1.5rem;
}
.lc-form-actions--sticky {
  position: sticky; bottom: 0; z-index: 10;
  margin: 1.5rem -1rem 0; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px));
  background: var(--tabbar-bg);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}
@media (min-width: 768px) { .lc-form-actions--sticky { margin-left: 0; margin-right: 0; border-radius: var(--radius) var(--radius) 0 0; } }

.lc-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.lc-toolbar__grow { flex: 1 1 14rem; min-width: 0; }
.lc-search { position: relative; }
.lc-search i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.lc-search .form-control { padding-left: 2.4rem; }

/* --------------------------------------------------------------------------
   14. PULSANTI
   -------------------------------------------------------------------------- */
.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: var(--radius-sm);
  --bs-btn-padding-y: .55rem; --bs-btn-padding-x: 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 2.75rem;
}
.btn-sm { --bs-btn-padding-y: .3rem; --bs-btn-padding-x: .65rem; min-height: 2.1rem; font-size: .85rem; }
.btn-lg { --bs-btn-padding-y: .75rem; --bs-btn-padding-x: 1.3rem; min-height: 3.25rem; }
.btn-primary {
  --bs-btn-bg: var(--brand-solid); --bs-btn-border-color: var(--brand-solid); --bs-btn-color: var(--on-brand);
  --bs-btn-hover-bg: var(--brand-solid-hover); --bs-btn-hover-border-color: var(--brand-solid-hover); --bs-btn-hover-color: var(--on-brand);
  --bs-btn-active-bg: var(--brand-solid-active); --bs-btn-active-border-color: var(--brand-solid-active); --bs-btn-active-color: var(--on-brand);
  --bs-btn-disabled-bg: var(--brand-solid); --bs-btn-disabled-border-color: var(--brand-solid); --bs-btn-disabled-color: var(--on-brand);
}
.btn-accent {
  --bs-btn-bg: var(--accent-solid); --bs-btn-border-color: var(--accent-solid); --bs-btn-color: var(--on-accent);
  --bs-btn-hover-bg: var(--accent-solid-hover); --bs-btn-hover-border-color: var(--accent-solid-hover); --bs-btn-hover-color: var(--on-accent);
  --bs-btn-active-bg: var(--accent-strong); --bs-btn-active-border-color: var(--accent-strong); --bs-btn-active-color: var(--on-accent);
  --bs-btn-disabled-bg: var(--accent-solid); --bs-btn-disabled-border-color: var(--accent-solid); --bs-btn-disabled-color: var(--on-accent);
}
.btn-outline-primary {
  --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-soft); --bs-btn-hover-border-color: var(--brand); --bs-btn-hover-color: var(--brand);
  --bs-btn-active-bg: var(--brand-soft); --bs-btn-active-border-color: var(--brand); --bs-btn-active-color: var(--brand);
}
.btn-light, .btn-secondary {
  --bs-btn-bg: var(--surface-3); --bs-btn-border-color: var(--surface-3); --bs-btn-color: var(--text);
  --bs-btn-hover-bg: var(--border); --bs-btn-hover-border-color: var(--border); --bs-btn-hover-color: var(--text);
  --bs-btn-active-bg: var(--border-strong); --bs-btn-active-border-color: var(--border-strong); --bs-btn-active-color: var(--text);
}
.btn-ghost {
  --bs-btn-bg: transparent; --bs-btn-border-color: transparent; --bs-btn-color: var(--text-muted);
  --bs-btn-hover-bg: var(--surface-3); --bs-btn-hover-border-color: transparent; --bs-btn-hover-color: var(--text);
  --bs-btn-active-bg: var(--surface-3); --bs-btn-active-color: var(--text);
}
.btn-danger {
  --bs-btn-bg: var(--danger-solid); --bs-btn-border-color: var(--danger-solid); --bs-btn-color: var(--on-brand);
  --bs-btn-hover-bg: var(--danger); --bs-btn-hover-border-color: var(--danger); --bs-btn-hover-color: var(--on-brand);
  --bs-btn-active-bg: var(--danger); --bs-btn-active-color: var(--on-brand);
}
.btn-outline-danger {
  --bs-btn-color: var(--danger); --bs-btn-border-color: var(--danger);
  --bs-btn-hover-bg: var(--danger-soft); --bs-btn-hover-border-color: var(--danger); --bs-btn-hover-color: var(--danger);
  --bs-btn-active-bg: var(--danger-soft); --bs-btn-active-color: var(--danger);
}
.lc-btn-square { width: 2.75rem; padding-left: 0; padding-right: 0; }
.btn-sm.lc-btn-square { width: 2.1rem; }

/* --------------------------------------------------------------------------
   15. MESSAGGI: toast e avvisi
   -------------------------------------------------------------------------- */
.lc-toasts {
  position: fixed; z-index: 1095; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px) + .5rem);
  left: 50%; transform: translateX(-50%); width: min(26rem, calc(100vw - 1.5rem));
  display: flex; flex-direction: column; gap: .5rem; pointer-events: none;
}
@media (min-width: 768px) { .lc-toasts { left: auto; right: 1.25rem; transform: none; } }
.lc-toast {
  --bs-toast-bg: var(--surface); --bs-toast-color: var(--text); --bs-toast-border-color: var(--border);
  --bs-toast-max-width: 100%;
  width: 100%; pointer-events: auto;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border-left: 5px solid var(--lc-toast-color, var(--brand));
}
.lc-toast .toast-body { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; padding: .8rem .9rem; }
.lc-toast__icon { color: var(--lc-toast-color, var(--brand)); margin-top: .15rem; }
.lc-toast--success { --lc-toast-color: var(--accent); }
.lc-toast--danger  { --lc-toast-color: var(--danger); }
.lc-toast--warning { --lc-toast-color: var(--warning); }
.lc-toast--info    { --lc-toast-color: var(--brand); }

.alert { border-radius: var(--radius); border-width: 1px; }
.alert-success { --bs-alert-bg: var(--accent-soft); --bs-alert-color: var(--accent-strong); --bs-alert-border-color: var(--accent-soft); }
.alert-danger  { --bs-alert-bg: var(--danger-soft); --bs-alert-color: var(--danger); --bs-alert-border-color: var(--danger-soft); }
.alert-warning { --bs-alert-bg: var(--warning-soft); --bs-alert-color: var(--warning); --bs-alert-border-color: var(--warning-soft); }
.alert-info    { --bs-alert-bg: var(--brand-soft); --bs-alert-color: var(--brand); --bs-alert-border-color: var(--brand-soft); }

/* --------------------------------------------------------------------------
   16. STATO VUOTO, ERRORE, ACCESSO
   -------------------------------------------------------------------------- */
.lc-empty {
  text-align: center; padding: 2.5rem 1.25rem;
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
}
.lc-empty__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 4rem; height: 4rem; border-radius: 50%; margin-bottom: 1rem;
  background: var(--brand-soft); color: var(--brand); font-size: 1.6rem;
}
.lc-empty__title { font-size: 1.15rem; font-weight: 700; margin: 0 0 .35rem; }
.lc-empty__text { color: var(--text-muted); max-width: 28rem; margin: 0 auto 1rem; }
.lc-empty__text:last-child { margin-bottom: 0; }

.lc-error { text-align: center; padding: 3rem 1rem; }
.lc-error__code {
  font-family: var(--font-display); font-weight: 800; font-size: 5rem; line-height: 1;
  color: var(--brand); opacity: .25;
}
.lc-error__title { font-size: 1.5rem; margin: .75rem 0 .5rem; }
.lc-error__text { color: var(--text-muted); max-width: 30rem; margin: 0 auto 1.5rem; }

.lc-auth { min-height: calc(100vh - var(--topbar-h) - 8rem); display: flex; align-items: center; justify-content: center; padding: 1rem 0; }
.lc-auth__card {
  width: 100%; max-width: 25rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 1.75rem 1.5rem;
}
.lc-auth__title { font-size: 1.35rem; font-weight: 800; margin: 0 0 .25rem; text-align: center; }
.lc-auth__sub { color: var(--text-muted); text-align: center; margin: 0 0 1.5rem; font-size: .9rem; }
.lc-logo-plate {
  display: block; background: var(--logo-plate); border-radius: var(--radius);
  padding: .6rem 1rem; margin: 0 auto 1.25rem; width: fit-content; max-width: 100%;
}
.lc-logo-plate img { display: block; height: 3.5rem; width: auto; max-width: 100%; }

/* --------------------------------------------------------------------------
   17. ESPANDI / COMPRIMI
   -------------------------------------------------------------------------- */
.lc-collapse-btn { display: inline-flex; align-items: center; gap: .4rem; background: none; border: 0; color: var(--brand); font-weight: 600; padding: .25rem 0; cursor: pointer; }
.lc-collapse-btn i { transition: transform .2s ease; }
.lc-collapse-btn[aria-expanded="true"] i { transform: rotate(180deg); }

/* --------------------------------------------------------------------------
   18. MOVIMENTO RIDOTTO E STAMPA
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

@media print {
  :root, :root[data-theme="dark"] {
    --bg: #ffffff; --surface: #ffffff; --surface-2: #f3f3f3; --surface-3: #e9e9e9;
    --text: #000000; --text-muted: #444444; --text-faint: #666666; --border: #bbbbbb; --border-strong: #999999;
    --shadow-sm: none; --shadow: none; --shadow-lg: none;
  }
  .lc-topbar, .lc-tabbar, .lc-sidebar-wrap, .lc-admin-topbar, .lc-toasts, .lc-footer,
  .lc-chips, .lc-segmented, .lc-form-actions, .lc-page-header__actions, .btn, .app-banner-ambiente { display: none !important; }
  body { padding: 0 !important; border: 0 !important; font-size: 10.5pt; }
  .lc-main, .lc-admin-main { padding: 0 !important; max-width: none; }
  .lc-table-wrap { overflow: visible; max-height: none; box-shadow: none; }
  .lc-sticky-col, .lc-sticky-col-2, .lc-table--matrix thead th { position: static; }
  .lc-score__detail[hidden] { display: block !important; }
  .lc-score, .lc-card, .lc-rank__row { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* ==========================================================================
   AGGIUNTE PUBBLICO — classifica, gara, squadre (agente Pubblico)
   Solo variabili di tema. Catalogo: _docs/CONVENZIONI.md § "Aggiunte pubblico".
   ========================================================================== */

/* Selettore gare a chip con frecce precedente / successiva */
.lc-chipnav { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.25rem; }
.lc-chipnav .lc-chips { flex: 1 1 auto; min-width: 0; margin: 0; }
.lc-chipnav > .btn { flex: 0 0 auto; }
.lc-chipnav > .btn.disabled { opacity: .4; }

/* Pallino squadra dentro un testo (il pallino da solo è un inline senza misura) */
.lc-score__name .lc-team-dot, .lc-dot-inline { display: inline-block; vertical-align: .08em; margin-right: .45rem; }

/* Tabellone: riga di composizione del totale sotto il nome */
.lc-score__sub b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Matrice gara per gara: intestazioni cliccabili, premio nella cella, cella squadra vuota */
.lc-table--matrix thead th a { color: inherit; text-decoration: none; display: block; }
.lc-table--matrix thead th a:hover { color: var(--brand); }
.lc-table--matrix thead th a b { font-family: var(--font-display); font-size: .8rem; color: var(--text); }
.lc-cell .lc-prize { margin-left: .3rem; vertical-align: .05em; }
/* il testo .visually-hidden (position: absolute) nelle celle non deve uscire dal riquadro scorrevole */
.lc-table--matrix .lc-cell { position: relative; }
.lc-row-team .lc-team { max-width: 100%; }

/* Composizione squadra: elenco giocatrici */
.lc-roster { list-style: none; margin: 0; padding: 0; }
.lc-roster__item {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem 1.1rem; border-top: 1px solid var(--border);
}
.lc-roster__item:first-child { border-top: 0; }
.lc-roster__icon { width: 1.1rem; text-align: center; color: var(--text-faint); flex: 0 0 auto; font-size: .8rem; }
.lc-roster__name { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-roster__item--captain { background: var(--gold-soft); }
.lc-roster__item--captain .lc-roster__icon { color: var(--gold); font-size: 1rem; }
.lc-roster__role {
  display: block; font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--gold-strong); line-height: 1.2;
}
.lc-card__head-text { min-width: 0; }
.lc-card__sub { font-size: .8rem; color: var(--text-muted); margin: .15rem 0 0; }

/* Premi speciali di una gara */
.lc-prize-list { list-style: none; margin: 0; padding: 0; }
.lc-prize-list__item { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.1rem; border-top: 1px solid var(--border); }
.lc-prize-list__item:first-child { border-top: 0; }
.lc-prize-list__icon {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--gold-soft); color: var(--gold);
}
.lc-prize-list__body { flex: 1 1 auto; min-width: 0; }
.lc-prize-list__title { font-weight: 600; line-height: 1.3; }
.lc-prize-list__who { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; font-size: .85rem; color: var(--text-muted); margin-top: .15rem; }
.lc-prize-list__pts { flex: 0 0 auto; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: var(--gold-strong); font-variant-numeric: tabular-nums; }

/* Barra a schede (mobile) con 4 voci: l'etichetta non va mai a capo */
.lc-tabbar__item span { max-width: 100%; padding-inline: .15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Classifica individuale (2026-10-11): barra con i controlli segmentati */
.lc-ind-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: 1rem; }

/* Blocchi per categoria: due colonne su schermi larghi */
.lc-ind-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 28rem), 1fr)); align-items: start; }
.lc-ind-grid > .lc-card + .lc-card { margin-top: 0; }

/* Elenco giocatrici: riga espandibile (button) o semplice (div) */
.lc-ind { list-style: none; margin: 0; padding: 0; }
.lc-ind__item { border-top: 1px solid var(--border); }
.lc-ind__item:first-child { border-top: 0; }
.lc-ind__head {
  display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto auto; align-items: center; gap: .65rem;
  width: 100%; padding: .6rem 1rem .6rem .75rem; background: transparent; border: 0; text-align: left; color: inherit;
}
.lc-ind__head--plain { grid-template-columns: 2.6rem minmax(0, 1fr) auto; }
button.lc-ind__head { cursor: pointer; }
button.lc-ind__head:hover { background: var(--surface-2); }
.lc-ind__pos {
  display: inline-flex; align-items: center; justify-content: center; gap: .1rem;
  font-family: var(--font-display); font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.lc-ind__eq { font-size: .75rem; font-weight: 700; color: var(--text-faint); }
.lc-ind__who { min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.lc-ind__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-ind__name b { font-weight: 700; }
.lc-ind__first { color: var(--text-muted); }
.lc-ind__sub { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; font-size: .78rem; color: var(--text-muted); min-width: 0; }
.lc-ind__sub .lc-team { font-size: .74rem; padding-block: .05rem; }
.lc-ind__total { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; min-width: 2.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.lc-ind__chevron { color: var(--text-faint); transition: transform .2s ease; }
.lc-ind__head[aria-expanded="true"] .lc-ind__chevron { transform: rotate(180deg); }
/* Podio: striscia oro/argento/bronzo, la prima anche con lo sfondo */
.lc-ind__item--podio-1 { background: var(--gold-soft); box-shadow: inset 4px 0 0 var(--gold); }
.lc-ind__item--podio-2 { background: var(--silver-soft); box-shadow: inset 4px 0 0 var(--silver); }
.lc-ind__item--podio-3 { background: var(--bronze-soft); box-shadow: inset 4px 0 0 var(--bronze); }
.lc-ind__item--podio-1 .lc-ind__total { color: var(--gold-strong); }
.lc-ind__item--podio-1 button.lc-ind__head:hover, .lc-ind__item--podio-2 button.lc-ind__head:hover,
.lc-ind__item--podio-3 button.lc-ind__head:hover { background: transparent; }
.lc-ind__item--zero { color: var(--text-muted); }
.lc-ind__item--zero .lc-ind__total { color: var(--text-faint); font-weight: 600; }
/* Dettaglio: risultati della giocatrice, conteggiati evidenziati, scartati barrati */
.lc-ind__detail { padding: 0 1rem .8rem calc(.75rem + 2.6rem + .65rem); }
.lc-ind__note { font-size: .78rem; color: var(--text-muted); margin: 0 0 .4rem; }
.lc-ind__results { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.lc-ind__res {
  display: inline-flex; align-items: baseline; gap: .3rem; padding: .15rem .5rem;
  border-radius: var(--radius-sm); background: var(--surface-3); color: var(--text-muted);
  font-size: .8rem; font-variant-numeric: tabular-nums; text-decoration: none;
}
.lc-ind__res b { font-family: var(--font-display); font-size: .72rem; font-weight: 700; }
.lc-ind__res:hover { color: var(--brand); }
.lc-ind__res.is-counted { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 2px 0 0 var(--accent); }
.lc-ind__res.is-dropped .lc-ind__pts { text-decoration: line-through; text-decoration-thickness: 1px; }
@media (max-width: 575.98px) {
  .lc-ind__head { grid-template-columns: 2.3rem minmax(0, 1fr) auto auto; gap: .5rem; padding-right: .75rem; }
  .lc-ind__head--plain { grid-template-columns: 2.3rem minmax(0, 1fr) auto; }
  .lc-ind__detail { padding-left: .75rem; }
}
@media print {
  .lc-ind__item { break-inside: avoid; }
  .lc-ind-bar { display: none !important; }
}

/* ==========================================================================
   AGGIUNTE ADMIN — componenti delle pagine di amministrazione (prefisso lc-adm-)
   Solo variabili di tema; documentate in _docs/CONVENZIONI.md, "Aggiunte admin".
   ========================================================================== */

/* Riga evidenziata in un elenco (prossima gara, giocatrice aperta nel pannello) */
.lc-table--list tbody tr.lc-adm-row-next > * { background: var(--brand-soft); }
.lc-table--list tbody tr.lc-adm-row-next > :first-child { box-shadow: inset 3px 0 0 var(--brand); }

/* Azioni rapide del cruscotto */
.lc-adm-actions { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.lc-adm-action {
  display: flex; align-items: center; gap: .85rem; padding: .9rem 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); color: var(--text); text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.lc-adm-action:hover { border-color: var(--brand); box-shadow: var(--shadow); color: var(--text); }
.lc-adm-action__icon {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
}
.lc-adm-action__title { display: block; font-weight: 700; line-height: 1.25; }
.lc-adm-action__sub { display: block; font-size: .82rem; color: var(--text-muted); }
.lc-adm-action--main { background: var(--accent-soft); border-color: var(--accent); }
.lc-adm-action--main .lc-adm-action__icon { background: var(--accent-solid); color: var(--on-accent); }

/* Elenco semplice a righe (premi, gare perse, squadre) */
.lc-adm-list { list-style: none; margin: 0; padding: 0; }
.lc-adm-list__item { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.lc-adm-list__item:last-child { border-bottom: 0; }
.lc-adm-list__main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.lc-adm-list__title { font-weight: 600; }
.lc-adm-list__sub { font-size: .85rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.lc-adm-list--compact .lc-adm-list__item { padding: .35rem 0; font-size: .9rem; }

/* Pannello in linea (aggiunta/modifica/eliminazione) */
.lc-adm-panel { border-top: 4px solid var(--brand); margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.lc-adm-panel--danger { border-top-color: var(--danger); }
.lc-adm-choice { display: flex; gap: .4rem; flex-wrap: wrap; }
.lc-adm-choice .btn { min-width: 2.9rem; }
.lc-adm-filter { width: auto; flex: 0 1 12rem; }

/* Inserimento risultati: squadre affiancate, righe compatte */
.lc-adm-entry-toolbar { position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); z-index: 5; background: var(--bg); padding: .5rem 0; margin-bottom: .5rem; }
.lc-adm-counter { font-size: .85rem; padding: .4rem .75rem; }
.lc-adm-entry-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); align-items: start; }
.lc-adm-team .lc-card__header { flex-wrap: wrap; padding: .7rem 1rem; }
.lc-adm-team__meta { display: inline-flex; align-items: center; gap: .6rem; font-size: .82rem; color: var(--text-muted); }
.lc-adm-entry th, .lc-adm-entry td { padding: .35rem .6rem; }
.lc-adm-entry thead th { padding-top: .45rem; padding-bottom: .45rem; }
.lc-adm-entry__score { width: 1%; text-align: center; }
.lc-adm-entry__name { font-weight: 600; min-width: 0; }
.lc-adm-entry__who { display: block; line-height: 1.25; }
.lc-adm-entry__tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .15rem; font-weight: 400; }
.lc-adm-entry .lc-input-score { min-height: 2.4rem; }
.lc-adm-entry tr.is-filled > * { background: var(--surface-2); }
.lc-adm-entry tr.is-top > * { background: var(--accent-soft); }
.lc-adm-entry tr.is-top > :first-child { box-shadow: inset 3px 0 0 var(--accent); }
/* Vista "Elenco unico": la squadra compare sulla riga solo lì (nella vista per squadra la dice già la card). */
.lc-adm-entry__squadra { display: none; font-size: .75rem; padding-block: .05rem; }
.is-vista-unica .lc-adm-entry__squadra { display: inline-flex; }
.lc-adm-actions__info { color: var(--text-muted); font-size: .9rem; display: inline-flex; align-items: center; gap: .4rem; }

/* Premi nel modulo risultati */
.lc-adm-prize { padding: .9rem 0; border-bottom: 1px solid var(--border); }
.lc-adm-prize:last-child { border-bottom: 0; padding-bottom: 0; }
.lc-adm-prize__name { display: flex; align-items: center; gap: .5rem; font-weight: 700; margin-bottom: .5rem; }
.lc-adm-prize__name i { color: var(--gold); }
.lc-adm-prize__fields { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; }
.lc-adm-prize__fields > .form-select, .lc-adm-exaequo__list { flex: 1 1 16rem; min-width: 0; max-width: 28rem; }
.lc-adm-prize__pts { width: auto; flex: 0 0 auto; flex-wrap: nowrap; }
.lc-adm-prize__warn { margin-top: .4rem; font-size: .85rem; color: var(--warning); }
.lc-adm-prize .invalid-feedback:empty { display: none !important; }
.lc-adm-exaequo__list { display: flex; flex-direction: column; gap: .4rem; }
.lc-adm-exaequo__item { display: flex; gap: .35rem; align-items: center; }
.lc-adm-exaequo__item .form-select { flex: 1 1 auto; min-width: 0; }

/* Squadre: colore con anteprima */
.lc-adm-color-row { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); align-items: end; }
.lc-adm-color { display: flex; gap: .4rem; align-items: center; }
.lc-adm-color .form-control-color { width: 3rem; min-height: 2.75rem; padding: .25rem; }
.lc-adm-color__hex { flex: 1 1 auto; width: auto; min-width: 6rem; padding-left: .5rem; padding-right: .5rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; }
.lc-adm-card-new { border-style: dashed; }

/* Squadre: colonne della composizione */
.lc-adm-cols { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); align-items: start; }
.lc-adm-col {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  border-top: 5px solid var(--team, var(--team-default)); box-shadow: var(--shadow-sm); padding: .75rem;
}
.lc-adm-col--none { border-top-style: dashed; background: var(--surface-2); }
.lc-adm-col__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.lc-adm-col__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.lc-adm-col__empty { margin: .5rem 0 0; font-size: .85rem; }
.lc-adm-member {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .25rem .5rem;
  padding: .4rem .5rem; border-radius: var(--radius-sm); background: var(--surface-2);
}
.lc-adm-col--none .lc-adm-member { background: var(--surface); }
.lc-adm-member--none { display: flex; background: transparent; margin-bottom: .25rem; font-size: .85rem; cursor: pointer; }
.lc-adm-member .form-check-input { margin: 0; }
.lc-adm-member:has(.form-check-input[data-adm-capitana]:checked) { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.lc-adm-member__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.lc-adm-member__select { grid-column: 2 / -1; min-height: 2.1rem; font-size: .82rem; padding-top: .2rem; padding-bottom: .2rem; }
.lc-adm-member.is-moved { box-shadow: inset 3px 0 0 var(--warning); }

@media print {
  .lc-adm-entry-toolbar, .lc-adm-actions { display: none !important; }
}
