/* ==========================================================
   La Salle de Jeux — thème « jeu de société »
   Fond crème, encre noire, couleurs franches, ombres dures.
   ========================================================== */

:root {
  /* Palette : light-dark(clair, sombre). Le mode suit le système,
     ou le choix mémorisé posé en data-mode sur <html> (bouton lune/soleil). */
  color-scheme: light dark;
  --paper: light-dark(#f3ead7, #1c1914);   /* la table */
  --card: light-dark(#fffaf0, #2a251e);    /* les cartes */
  --card-2: light-dark(#ece0c6, #362f26);  /* creux, cases */
  --ink: light-dark(#1f1b16, #f1e8d4);     /* texte */
  --ink-2: light-dark(#4d463c, #cdc1a9);
  --ink-3: light-dark(#7b7264, #9e927d);
  --edge: light-dark(#1f1b16, #0d0b08);    /* traits et ombres dures */
  --on-color: #1f1b16;                     /* texte posé sur jaune, vert, etc. */
  --dots: light-dark(rgba(31, 27, 22, 0.09), rgba(241, 232, 212, 0.06));
  --red: light-dark(#e2412f, #f0604f);
  --yellow: #f4b400;
  --blue: light-dark(#2a63c9, #5b8ff0);
  --green: light-dark(#2e9a52, #45b86c);
  --purple: light-dark(#7d4bd1, #a07de8);

  --line: 3px solid var(--edge);
  --shadow: 4px 4px 0 var(--edge);
  --shadow-lg: 6px 6px 0 var(--edge);

  --font-display: 'Bricolage Grotesque', 'Rubik', system-ui, sans-serif;
  --font-sans: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Anciens noms utilisés par les pages de jeu, branchés sur la nouvelle palette */
  --bg-dark: var(--paper);
  --bg-light: var(--card-2);
  --bg-card: var(--card);
  --bg-card-hover: #fff;
  --accent: var(--blue);
  --accent-2: var(--red);
  --accent-3: var(--yellow);
  --accent-soft: light-dark(rgba(42, 99, 201, 0.12), rgba(91, 143, 240, 0.18));
  --accent-glow: transparent;
  --text-main: var(--ink);
  --text-muted: var(--ink-2);
  --text-dim: var(--ink-3);
  --border-subtle: light-dark(rgba(31, 27, 22, 0.22), rgba(241, 232, 212, 0.18));
  --border-hover: var(--edge);
  --font-mono: var(--font-display);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --transition-fast: 0.15s ease;
  --transition-slow: 0.3s ease;
}
:root[data-mode="light"] { color-scheme: light; }
:root[data-mode="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  background-color: var(--paper);
  /* petits points, comme un plateau imprimé */
  background-image: radial-gradient(var(--dots) 1px, transparent 1.2px);
  background-size: 18px 18px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
::selection { background: var(--yellow); color: var(--on-color); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.site-wrapper { min-height: 100vh; display: flex; flex-direction: column; position: relative; }
.site-wrapper > main { flex: 1; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1rem; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--card);
  border-bottom: var(--line);
}
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 1rem; }

.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--ink); }
.brand-logo {
  width: 40px; height: 40px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--yellow); border: var(--line); border-radius: 10px;
  box-shadow: 3px 3px 0 var(--edge);
  font-size: 1.2rem; overflow: hidden;
  transition: transform var(--transition-fast);
}
.brand:hover .brand-logo { transform: rotate(-8deg); }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-text-title { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; line-height: 1.1; letter-spacing: -0.01em; }
.brand-text-sub { font-size: 0.75rem; color: var(--ink-3); }

.site-nav { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.nav-link {
  font-weight: 500; font-size: 0.9rem;
  padding: 0.4rem 0.85rem; border-radius: var(--radius-sm);
  border: 2px solid transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.nav-link:hover, .nav-link.active { background: var(--yellow); border-color: var(--edge); color: var(--on-color); }
.menu-toggle { display: none; } /* 1 ou 2 liens : pas besoin de menu repliable */

/* ---------- Pied de page ---------- */
.site-footer { border-top: var(--line); background: var(--card); margin-top: 3rem; }
.site-footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1.5rem;
  padding: 1.2rem 1rem; font-size: 0.85rem; color: var(--ink-2);
}
.footer-links { display: flex; gap: 1rem; }
.site-footer-link { font-weight: 500; color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.site-footer-link:hover { color: var(--red); }

/* ---------- Éléments communs (page mentions légales) ---------- */
.section { padding: 3rem 0; position: relative; z-index: 1; }
.section-heading, .section-title { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; }
.card {
  background: var(--card); border: var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 2rem;
}
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.3rem; border-radius: var(--radius-md);
  background: var(--yellow); color: var(--on-color);
  border: var(--line); box-shadow: var(--shadow);
  font: 700 0.95rem var(--font-sans); cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--edge); }

.reveal { opacity: 1; }

/* Barre de défilement */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--card-2); }
::-webkit-scrollbar-thumb { background: var(--ink-3); border-radius: 6px; border: 2px solid var(--card-2); }

@media (max-width: 640px) {
  .brand-text-sub { display: none; }
  .brand-text-title { white-space: nowrap; font-size: 1.05rem; }
  .nav-link { padding: 0.35rem 0.6rem; }
  .nav-link--wide { display: none; }
  .site-header-inner { padding: 0.55rem 0.8rem; }
  .card { padding: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition: none !important; }
}

/* ---------- Bouton clair / sombre ---------- */
.mode-toggle {
  width: 40px; height: 40px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--card); color: var(--ink);
  border: 2px solid var(--edge); border-radius: 10px; box-shadow: 3px 3px 0 var(--edge);
  cursor: pointer; transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.mode-toggle:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--edge); }
.mode-toggle:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--edge); }
.mode-toggle svg { width: 20px; height: 20px; }
.mode-toggle .icon-sun { display: none; }
:root[data-mode="dark"] .mode-toggle .icon-sun { display: block; }
:root[data-mode="dark"] .mode-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) .mode-toggle .icon-sun { display: block; }
  :root:not([data-mode="light"]) .mode-toggle .icon-moon { display: none; }
}
