/* ==========================================================================
   LudoSport Roma — modalità scura. Si attiva con <html data-theme="dark">
   (script in testa alla pagina + pulsante luna/sole nel menu, in js/app.js).
   Qui solo i colori: forme e animazioni restano in site.css.
   ========================================================================== */

/* ---------- Pulsante luna/sole (visibile in entrambe le modalità) ---------- */
.theme-toggle { flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; transition: color .3s var(--ease), background .3s var(--ease); -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .theme-toggle:hover { color: var(--ink); background: rgba(0, 0, 0, .05); } }
.theme-toggle svg { grid-area: 1 / 1; width: 19px; height: 19px; transition: transform .5s var(--ease), opacity .3s var(--ease); }
.theme-toggle .tt-sun { opacity: 0; transform: rotate(-90deg) scale(.5); }
:where(:root[data-theme="dark"]) .theme-toggle .tt-moon { opacity: 0; transform: rotate(90deg) scale(.5); }
:where(:root[data-theme="dark"]) .theme-toggle .tt-sun { opacity: 1; transform: none; }
@media (hover: hover) { :where(:root[data-theme="dark"]) .theme-toggle:hover { background: rgba(255, 255, 255, .08); } }
@media (max-width: 860px) { .theme-toggle { width: 40px; height: 40px; } .theme-toggle svg { width: 21px; height: 21px; } }
/* durante il cambio i colori sfumano insieme */
.theme-switching, .theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: background-color .35s ease, color .35s ease, border-color .35s ease, fill .35s ease, stroke .35s ease !important; }

/* ---------- Palette scura ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0e10;
  --black: #0e0e10;
  --white: #1b1b1e;          /* schede */
  --paper: #141416;          /* sezioni alterne */
  --ink: #f2f2f4;
  --ink-2: #a8a8ae;
  --ink-3: #8c8c92;
  --line: rgba(255, 255, 255, .1);
  --on-dark: #f2f2f4;
  --on-dark-2: #a8a8ae;
  --on-dark-3: #8c8c92;
  --red-deep: #ff7656;       /* testo rosso su fondo scuro (contrasto AA) */
  --ember-soft: #2b1711;
}
:root[data-theme="dark"] body,
:where(:root[data-theme="dark"]) .light { background-color: var(--bg); }
:where(:root[data-theme="dark"]) .light.alt { background-color: var(--paper); }

/* ---------- Fondi bianchi, bordi chiari e testo scuro fissi in site.css ----------
   Il prefisso :where(...) non aggiunge peso al selettore: così le varianti di stato di site.css
   (.on, .done, :hover, [aria-pressed]) continuano a vincere sulla regola base, come in chiaro. */
:where(:root[data-theme="dark"]) .nav { background: rgba(27, 27, 30, .8); }
:where(:root[data-theme="dark"]) .nav.is-light { background: rgba(27, 27, 30, .78); }
:where(:root[data-theme="dark"]) .btn-line { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .16); }
:where(:root[data-theme="dark"]) .gym-art { background: var(--white); }
:where(:root[data-theme="dark"]) .chip { border: 1px solid rgba(255, 255, 255, .14); }
:where(:root[data-theme="dark"]) .chip:hover { border-color: rgba(255, 255, 255, .14); }
:where(:root[data-theme="dark"]) .slot label { box-shadow: 0 0 0 1px rgba(255, 255, 255, .16); }
:where(:root[data-theme="dark"]) .slots-empty { box-shadow: 0 0 0 1px rgba(255, 255, 255, .16); }
:where(:root[data-theme="dark"]) .field input, :where(:root[data-theme="dark"]) .field textarea, :where(:root[data-theme="dark"]) .field select { border: 1px solid rgba(255, 255, 255, .14); }
:where(:root[data-theme="dark"]) .press-badge { background: rgba(27, 27, 30, .94); }
:where(:root[data-theme="dark"]) .lightbox { background: rgba(27, 27, 30, .96); }
:where(:root[data-theme="dark"]) .prose { color: var(--ink); }
:where(:root[data-theme="dark"]) .toast { background: rgba(27, 27, 30, .86); }
:where(:root[data-theme="dark"]) .toast span { color: var(--ink); }
:where(:root[data-theme="dark"]) .tornei-photo figcaption { background: rgba(27, 27, 30, .92); }
:where(:root[data-theme="dark"]) .fc-cover { background: var(--white); }
:where(:root[data-theme="dark"]) .ring { box-shadow: 0 0 0 6px var(--bg), 0 14px 30px -10px rgba(255,74,28,.7); }
:where(:root[data-theme="dark"]) .safety-steps li { background: var(--white); }
:where(:root[data-theme="dark"]) .tz-ladder li { background: var(--white); }
:where(:root[data-theme="dark"]) .t-toc a { background: var(--white); }
:where(:root[data-theme="dark"]) .zone-card { background: var(--white); }
:where(:root[data-theme="dark"]) .vote { background: var(--white); }
:where(:root[data-theme="dark"]) .sc-bar { background: var(--white); }
:where(:root[data-theme="dark"]) .sc-mark { background: var(--white); }
:where(:root[data-theme="dark"]) .phase { background: var(--white); }
:where(:root[data-theme="dark"]) .rr-nodes .rr-name { fill: var(--ink); }
:where(:root[data-theme="dark"]) .rr-list text { fill: var(--ink); }
:where(:root[data-theme="dark"]) .rank { background: var(--white); }
:where(:root[data-theme="dark"]) .rank-facts li { background: var(--white); }
:where(:root[data-theme="dark"]) .securi li:hover .ring, :where(:root[data-theme="dark"]) .securi li:focus-within .ring, :where(:root[data-theme="dark"]) .securi li.is-active .ring { box-shadow: 0 0 0 6px var(--bg), 0 0 0 9px rgba(255,90,30,.45), 0 18px 40px -8px rgba(255,74,28,.85); }
:where(:root[data-theme="dark"]) .securi li > span:last-child { background: var(--white); }
:where(:root[data-theme="dark"]) .eq-chip[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px rgb(var(--c)), 0 8px 22px -6px rgb(var(--c)); }
:where(:root[data-theme="dark"]) .eq-toc a { background: var(--white); }
:where(:root[data-theme="dark"]) .eq-badge { background: rgba(27, 27, 30, .9); }
:where(:root[data-theme="dark"]) .eq-kit-fig { background: var(--white); }
:where(:root[data-theme="dark"]) .eq-kit-fig figcaption { background: rgba(27, 27, 30, .92); }
:where(:root[data-theme="dark"]) .eq-part-in { background: var(--white); }
:where(:root[data-theme="dark"]) .eq-part figure { background: var(--white); }
:where(:root[data-theme="dark"]) .cfg-stage { background: var(--white); }
:where(:root[data-theme="dark"]) .cfg-tabs { background: var(--white); }
:where(:root[data-theme="dark"]) .eq-custom { background: var(--white); }
:where(:root[data-theme="dark"]) .uni-steps button::before { background: var(--white); }
:where(:root[data-theme="dark"]) .uni-steps button.done::before { box-shadow: 0 0 0 2px var(--bg), 0 6px 18px -4px rgba(255,74,28,.7); }
:where(:root[data-theme="dark"]) .uni-steps button[aria-pressed="true"]::before { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px rgba(255,74,28,.35), 0 8px 24px -4px rgba(255,74,28,.8); }
:where(:root[data-theme="dark"]) .uni-photos { background: var(--white); }
:where(:root[data-theme="dark"]) .gl-main { background: var(--white); }
:where(:root[data-theme="dark"]) .gl-thumbs button { background: var(--white); }
:where(:root[data-theme="dark"]) .gl-thumbs button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ember); }
:where(:root[data-theme="dark"]) .gl-meta span { background: var(--white); }
:where(:root[data-theme="dark"]) .shop-links a { background: var(--white); }
:where(:root[data-theme="dark"]) .tease-card { background: var(--white); }
:where(:root[data-theme="dark"]) .tease-card figure { background: var(--white); }
:where(:root[data-theme="dark"]) .uni-items li { background: var(--white); }
:where(:root[data-theme="dark"]) .eq-chip.eq-blade[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px rgb(var(--c)), 0 0 22px 2px rgb(var(--c) / .75); }
:where(:root[data-theme="dark"]) .ldl { background: rgba(27, 27, 30, .8); }
:where(:root[data-theme="dark"]) .eq-fin img { background: var(--white); }
:where(:root[data-theme="dark"]) .eq-fin[aria-pressed="true"] img { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #ff4a1c, 0 10px 24px -10px rgba(255,74,28,.7); }
:where(:root[data-theme="dark"]) .eq-parts-toggle { background: var(--white); }
@media (max-width: 860px) {
  :where(:root[data-theme="dark"]) .nav-links { background: rgba(27, 27, 30, .97); }
}
@media (max-width: 640px) {
  :where(:root[data-theme="dark"]) .net-toggle { background: var(--white); }
}

/* ---------- Ritocchi a mano, sezione per sezione ---------- */
:root[data-theme="dark"] { --plate: #f3f2f1; }   /* fondo chiaro delle foto prodotto scontornate su bianco */

/* Hero e testate */
:where(:root[data-theme="dark"]) .hero { background: radial-gradient(70% 55% at 50% 45%, #2a1610 0%, var(--bg) 70%); }
:where(:root[data-theme="dark"]) .hero::before { background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 40%), rgba(255, 90, 28, .12), transparent 60%); }
:where(:root[data-theme="dark"]) .hero-video::after { background: radial-gradient(80% 70% at 50% 45%, rgba(14,14,16,.55), rgba(14,14,16,.9)), linear-gradient(180deg, rgba(14,14,16,.5), transparent 30%, transparent 70%, var(--bg)); }
:where(:root[data-theme="dark"]) .hero-video video.ready { opacity: .5; }
:where(:root[data-theme="dark"]) .scroll-cue { border-color: rgba(255, 255, 255, .25); }
:where(:root[data-theme="dark"]) .page-head { background: radial-gradient(70% 80% at 50% 0%, #2a1610, var(--bg) 70%); }
:where(:root[data-theme="dark"]) .statement .sw { color: #3d3d43; }
:where(:root[data-theme="dark"]) .logo-orb img { box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }

/* Pulsanti, chip, form */
:where(:root[data-theme="dark"]) .btn-dark { color: var(--ink); background: #2c2c30; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
:where(:root[data-theme="dark"]) .btn-dark:hover { background: #3a3a3f; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 14px 40px -12px rgba(0, 0, 0, .6); }
:where(:root[data-theme="dark"]) .btn-line:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
:where(:root[data-theme="dark"]) .chip:hover { border-color: rgba(255, 255, 255, .3); }
:where(:root[data-theme="dark"]) .chip[aria-pressed="true"] { color: #1d1d1f; background: var(--ink); border-color: var(--ink); }
:where(:root[data-theme="dark"]) .slot label:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, .3), 0 10px 24px -14px rgba(0, 0, 0, .6); }
:where(:root[data-theme="dark"]) .skeleton { background: linear-gradient(90deg, #1b1b1e, #242428, #1b1b1e); background-size: 200% 100%; }
:where(:root[data-theme="dark"]) .form-card { box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06); }
:where(:root[data-theme="dark"]) .form-card::before { background: linear-gradient(90deg, transparent, var(--ember) 50%, transparent); }
:where(:root[data-theme="dark"]) .field input::placeholder, :where(:root[data-theme="dark"]) .field textarea::placeholder { color: #6e6e74; }
:where(:root[data-theme="dark"]) .form-error { background: #3a1412; color: #ffb4a8; }
:where(:root[data-theme="dark"]) .todo { background: #4a3c00; color: #ffe27a; }

/* Schede: in scuro l'ombra non si vede, serve un filo di bordo */
:where(:root[data-theme="dark"]) .tile, :where(:root[data-theme="dark"]) .gym-card, :where(:root[data-theme="dark"]) .post-card, :where(:root[data-theme="dark"]) .fc-card { box-shadow: 0 0 0 1px rgba(255, 255, 255, .07), 0 20px 40px -24px rgba(0, 0, 0, .8); }
:where(:root[data-theme="dark"]) .tile.dark-tile { box-shadow: 0 24px 50px -26px rgba(255, 74, 28, .6); }
:where(:root[data-theme="dark"]) .gym-card:hover, :where(:root[data-theme="dark"]) .post-card:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 30px 60px -28px rgba(0, 0, 0, .9), 0 0 40px -14px rgba(255, 74, 28, .4); }
:where(:root[data-theme="dark"]) .tilt .glare { background: radial-gradient(400px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .08), transparent 50%); }
:where(:root[data-theme="dark"]) .tl-year { box-shadow: 0 0 0 1px var(--line), 0 6px 16px -10px rgba(0, 0, 0, .8); }
:where(:root[data-theme="dark"]) .timeline li.in:hover, :where(:root[data-theme="dark"]) .timeline li.in:focus-visible { box-shadow: 0 22px 50px -22px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 74, 28, .3); }
:where(:root[data-theme="dark"]) .roma-kicker { color: #fff; opacity: .85; }
:where(:root[data-theme="dark"]) .post-cover, :where(:root[data-theme="dark"]) .fc-cover { background: radial-gradient(90% 70% at 50% 120%, rgba(255, 74, 28, .22), transparent 60%), #1f1613; }
:where(:root[data-theme="dark"]) .press-cover { background: repeating-linear-gradient(0deg, transparent 0 22px, rgba(255, 255, 255, .04) 22px 23px), #1d1a17; }
:where(:root[data-theme="dark"]) .fc-dots button { background: rgba(255, 255, 255, .22); }
:where(:root[data-theme="dark"]) .tornei-list li:hover, :where(:root[data-theme="dark"]) .forms li:hover, :where(:root[data-theme="dark"]) .arms li:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, .07), 0 18px 40px -24px rgba(0, 0, 0, .8); }

/* Il corso: valori Se.Cu.Ri. */
:where(:root[data-theme="dark"]) .values { background: linear-gradient(160deg, #22150f 0%, #18181b 60%); box-shadow: 0 0 0 1px rgba(255, 74, 28, .2), 0 30px 60px -40px rgba(255, 74, 28, .5); }
:where(:root[data-theme="dark"]) .securi::after { background-color: var(--white); }
:where(:root[data-theme="dark"]) .safety .shield .ck { stroke: #fff; }

/* CTA finale e articoli */
:where(:root[data-theme="dark"]) .cta { background: linear-gradient(180deg, var(--bg) 0%, #1f120d 100%); }
:where(:root[data-theme="dark"]) .cta::before { background: radial-gradient(50% 50% at 50% 30%, rgba(255, 74, 28, .14), transparent 70%); }
:where(:root[data-theme="dark"]) .socials a:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, .3), 0 8px 20px -10px rgba(0, 0, 0, .6); }
:where(:root[data-theme="dark"]) .article-cta { background: radial-gradient(120% 90% at 100% 0%, rgba(255, 74, 28, .2), transparent 60%), #1f1411; }

/* I Tornei */
:where(:root[data-theme="dark"]) .a-floor { fill: #2a1a14; }
:where(:root[data-theme="dark"]) .a-dim { stroke: #6e6e74; }
:where(:root[data-theme="dark"]) .a-pop rect { fill: #2c2c30; }
:where(:root[data-theme="dark"]) .as-via { background: #2c2c30; }
:where(:root[data-theme="dark"]) .call.dbl { background: #2c2c30; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
:where(:root[data-theme="dark"]) .mq-sw.no { background: repeating-linear-gradient(45deg, #5a5a5e 0 3px, #3a3a3e 3px 5px); }
:where(:root[data-theme="dark"]) .tz-figure { background: radial-gradient(70% 60% at 50% 40%, #2a1610, var(--white) 70%); box-shadow: 0 0 0 1px rgba(255, 74, 28, .18); }
:where(:root[data-theme="dark"]) .sc-bar { background: #2c2c30; }
:where(:root[data-theme="dark"]) .rr-nodes circle { fill: #3a3a3f; stroke: var(--white); }
:where(:root[data-theme="dark"]) .br-dots circle { fill: #5a5a60; }
:where(:root[data-theme="dark"]) .avg span { background: #5c2c1c; }
:where(:root[data-theme="dark"]) .podium .p3 { background: #b8693e; }
:where(:root[data-theme="dark"]) .stairs li { background: linear-gradient(180deg, #33201a, #24160f); box-shadow: inset 0 0 0 1px rgba(255, 74, 28, .15); }
:where(:root[data-theme="dark"]) .t-videos { background: linear-gradient(180deg, var(--bg) 0%, #1f120d 100%); }

/* Attrezzatura: le foto dei prodotti sono su fondo bianco, restano su una "lastra" chiara */
:where(:root[data-theme="dark"]) .eq-hero { background: radial-gradient(60% 50% at 75% 45%, rgb(var(--sab-rgb) / .12), transparent 70%), var(--bg); }
/* la foto dell'elsa è su bianco: resta su un disco chiaro, con l'alone del colore della lama */
:where(:root[data-theme="dark"]) .eq-orb { background: radial-gradient(circle at 50% 46%, var(--plate) 0 38%, rgb(var(--sab-rgb) / .28) 62%, rgb(var(--sab-rgb) / 0) 71%); }
:where(:root[data-theme="dark"]) .eq-orb::after { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
:where(:root[data-theme="dark"]) .eq-chip { box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 6px 14px -6px rgb(var(--c) / .9); }
:where(:root[data-theme="dark"]) .cfg-stage, :where(:root[data-theme="dark"]) .gl-main, :where(:root[data-theme="dark"]) .gl-thumbs button, :where(:root[data-theme="dark"]) .eq-part figure,
:where(:root[data-theme="dark"]) .uni-photos, :where(:root[data-theme="dark"]) .eq-fin img, :where(:root[data-theme="dark"]) .tease-card figure, :where(:root[data-theme="dark"]) .eq-kit-fig { background: var(--plate); }
:where(:root[data-theme="dark"]) .tease-card figure.t-sab { background: radial-gradient(circle at 50% 50%, var(--plate) 0 40%, rgb(var(--sab-rgb) / .14) 75%, var(--plate) 100%); }
:where(:root[data-theme="dark"]) .eq-tease { background: radial-gradient(60% 50% at 50% 0%, rgb(var(--sab-rgb) / .1), transparent 70%), linear-gradient(180deg, var(--bg), #1a120e); }
:where(:root[data-theme="dark"]) .shop-card { background: radial-gradient(80% 120% at 50% 0%, #2a1610, var(--white) 62%); box-shadow: 0 0 0 1px rgba(255, 74, 28, .22), 0 50px 90px -60px rgba(255, 74, 28, .6); }
:where(:root[data-theme="dark"]) .eq-parts-toggle { box-shadow: 0 0 0 1px var(--line), 0 18px 40px -28px rgba(0, 0, 0, .8); }

/* Footer */
:where(:root[data-theme="dark"]) .foot { background: #0a0a0b; }

/* Banner cookie (stili scritti da js/consent.js) */
:root[data-theme="dark"] .ls-cc { background: #1b1b1e; color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .08); }
:root[data-theme="dark"] .ls-ov { background: rgba(0, 0, 0, .55); }
:root[data-theme="dark"] .ls-cc .x { background: #2c2c30; color: var(--ink); }
:root[data-theme="dark"] .ls-cc .x:hover { background: #3a3a3f; }
:root[data-theme="dark"] .ls-cc p { color: var(--ink-2); }
:root[data-theme="dark"] .ls-cc a { color: var(--red-deep); }
:root[data-theme="dark"] .ls-cc .no { border-color: var(--ink); color: var(--ink); background: transparent; }
:root[data-theme="dark"] .ls-cc .no:hover { background: rgba(255, 255, 255, .06); }
:root[data-theme="dark"] .ls-cc .fine { color: var(--ink-3); }

/* Simboli ufficiali di forme e armi: disegnati in nero, in scuro diventano chiari */
:where(:root[data-theme="dark"]) .forms img, :where(:root[data-theme="dark"]) .arms img { filter: invert(.92); }
:where(:root[data-theme="dark"]) .forms li:hover img { filter: invert(.92) drop-shadow(0 0 6px rgba(255, 90, 30, .65)); }
:where(:root[data-theme="dark"]) .arms li:hover img { filter: invert(.92) drop-shadow(0 0 7px rgba(255, 90, 30, .65)); }

/* Telefono: con il pulsante luna/sole il nome accanto al logo non ci sta più, resta solo il logo */
@media (max-width: 480px) { .nav .brand { font-size: 0; gap: 0; } }
@media (max-width: 360px) { .nav-right { gap: 4px; } .theme-toggle, .nav-burger { width: 34px; } }

/* Animazioni: binari, pallini e tracce disegnati in nero trasparente, invisibili sul fondo scuro */
:where(:root[data-theme="dark"]) .uni-track { background: rgba(255, 255, 255, .12); }
:where(:root[data-theme="dark"]) .uni-steps button::before { box-shadow: 0 0 0 2px rgba(255, 255, 255, .22); }
:where(:root[data-theme="dark"]) .as-line.is-live { background: rgba(255, 255, 255, .12); }
:where(:root[data-theme="dark"]) .as-via.on { box-shadow: 0 0 0 4px rgba(255, 255, 255, .18); }
