/* ─── MODE FOSC (retocs a mà) ───
   Els colors automàtics són a css/fosc-auto.css (eines/genera-fosc.py).
   Aquí: les variables, el botó 🌙/☀️ i els casos que l'automàtic no encerta. */

html[data-tema="fosc"] {
  color-scheme: dark;
  /* web principal (estils.css) */
  --blue: #1c4382;
  --blue-dark: #163a73;
  --blue-light: #1c2a44;
  --blue-mid: #2c5aa8;
  --white: #18202e;
  --off-white: #0f1520;
  --gray: #9aa3b5;
  --gray-light: #2a3446;
  --text: #e6e9f1;
  --text-muted: #b3bccd;
  --shadow: 0 4px 20px rgba(0,0,0,.45);
  --shadow-card: 0 2px 12px rgba(0,0,0,.35);
  /* El Vici i pàgines petites */
  --bg: #0f1520;
  --card: #18202e;
  --muted: #a9b2c6;
  --line: #2a3446;
  --line-soft: #222b3b;
  --bar: #4f86e0;
  --bar-hover: #77a2ef;
  --bar-track: #263043;
  --good: #8fd694;
  /* versions per a text (genera-fosc.py hi apunta) */
  --fosc-blau-text: #9dbcf5;
  --fosc-blanc-text: #ffffff;
  --fosc-or-text: #f0c96a;
  --fosc-verd-text: #8fd694;
}

/* ─── Botó 🌙/☀️ ─── */
.boto-tema {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid var(--gray-light, #e5e7eb); background: transparent;
  font-size: 18px; line-height: 1; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.boto-tema:hover { background: var(--blue-light, #e6edf8); }
.boto-tema:focus-visible { outline: 3px solid #f0c030; outline-offset: 2px; }
html[data-tema="fosc"] .boto-tema { border-color: #33405a; }
/* Pàgines petites (legal, subscriu, gràcies): el botó al costat del «Tornar» */

/* ─── Retocs ─── */
html[data-tema="fosc"] img { color-scheme: normal; }
html[data-tema="fosc"] ::placeholder { color: #8b95aa; }
/* Nota rodona de les fitxes de ressenya (color de la categoria) */
html[data-tema="fosc"] { --fosc-fb-text: #9dbcf5; }
html[data-tema="fosc"] .card.fitxa-b.fitxa-b-daurada { --fosc-fb-text: #f0c96a; --fb: #c58a2a; }
html[data-tema="fosc"] .card.fitxa-b.fitxa-b-gris { --fosc-fb-text: #c3c9d4; --fb: #7b8496; }
html[data-tema="fosc"] .card.fitxa-b { --fb: #3a6cc4; }

/* Camps de formulari sense fons propi */
html[data-tema="fosc"] input, html[data-tema="fosc"] select, html[data-tema="fosc"] textarea { background-color: #141a24; color: var(--text); }
/* Botons de compartir (navegacio.js els pinta amb style.cssText) */
html[data-tema="fosc"] .share-copy-btn { background: #1c2a44 !important; color: #9dbcf5 !important; }
html[data-tema="fosc"] { --hover-fila: #1c2a44; }

/* El Vici */
html[data-tema="fosc"] .thumb { background: linear-gradient(135deg, #1c2a44, #24365a) !important; } /* vici.js posa el fons de la lletra amb style */
html[data-tema="fosc"] .buckets button b { color: #fff; }
html[data-tema="fosc"] .buckets button[data-r="3"] b { color: #3a2a00; }
/* Logo «Powered by BGG» (té text fosc): sobre una peça clara perquè es llegeixi */
html[data-tema="fosc"] .powered-bgg img, html[data-tema="fosc"] img[src*="powered-by-bgg"] { background: #f4f5fa; border-radius: 8px; padding: 4px 8px; box-sizing: content-box; }

/* Els daus de càrrega són daus: es queden blancs */
html[data-tema="fosc"] .daus-carrega .dau { background-color: #fff; }
html[data-tema="fosc"] .daus-carrega .dau + .dau { background-color: #f0c030; }
/* Pàgines petites: el «Tornar» i el botó junts a la dreta */
.cap .cap-in .tornar { margin-left: auto; }
.cap .cap-in .boto-tema { margin-left: 0; }
