:root {
  --bg: #f3f6f1; --surface: #fcfcfb; --fg: #18201a; --muted: #5b665c; --line: #dbe2d7;
  --accent: #2e7d32; --accent-soft: #e3f0e1; --jaune: #e0a92b; --rouge: #c0442f;
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #111412; --surface: #161a17; --fg: #e6ece5; --muted: #9daa9d;
    --line: #2a322b; --accent: #4caf50; --accent-soft: #1d2a1e; --jaune: #e8b945; --rouge: #e06a52; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #111412; --surface: #161a17; --fg: #e6ece5; --muted: #9daa9d;
  --line: #2a322b; --accent: #4caf50; --accent-soft: #1d2a1e; --jaune: #e8b945; --rouge: #e06a52; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--font-display); font-size: 15px; line-height: 1.5; padding-inline: 16px; }
.wrap { max-width: 1160px; margin: 0 auto; padding-block: 36px 56px; }
a { color: var(--accent); }
.fil { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
h1 { margin: 0 0 8px; font-weight: 800; font-stretch: 122%; font-size: clamp(30px, 5vw, 50px); line-height: 1; letter-spacing: -.02em; }
.lede { margin: 0 0 26px; font-size: 17px; color: var(--muted); max-width: 70ch; }
h2 { font-size: 22px; font-stretch: 112%; font-weight: 750; margin: 34px 0 10px; }
h3 { font-size: 15px; margin: 0 0 4px; }
.carte { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.reglages { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 12px; }
label { display: grid; gap: 3px; font-size: 12.5px; color: var(--muted); }
select, .bouton { font: inherit; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); min-height: 38px; }
.bouton { cursor: pointer; font-weight: 650; }
.bouton:hover { border-color: var(--accent); }
.etat { font-family: var(--font-mono); font-size: 13px; margin-top: 10px; min-height: 2.6em; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; font-weight: 650; }
thead th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
tbody tr:hover { background: var(--accent-soft); }
.tableau-defile { overflow-x: auto; }
.ic { color: var(--muted); font-size: 12px; font-family: var(--font-mono); }
td .ic { white-space: nowrap; }
.grille3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.grille3 p { margin: 0; font-size: 14px; color: var(--muted); }
figure { margin: 0; }
figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.legende { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; font-family: var(--font-mono); margin-top: 8px; }
.legende span { display: inline-flex; align-items: center; gap: 5px; }
.pastille { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.avis { border-left: 3px solid var(--accent); padding: 10px 14px; background: var(--accent-soft); border-radius: 0 8px 8px 0; font-size: 14px; }
footer { margin-top: 40px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }
footer a { color: inherit; }
.attente { color: var(--muted); font-style: italic; }
/* commun aux jeux à un joueur */
.jeu { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 820px) { .jeu { grid-template-columns: 1fr; } }
.scene { position: relative; background: var(--accent-soft); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; touch-action: none; }
.scene canvas { display: block; width: 100%; height: auto; }
.classement { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-family: var(--font-mono); font-size: 13px; }
.classement li { display: flex; gap: 8px; align-items: center; }
.classement .val { margin-left: auto; }
.classement .hors { color: var(--muted); text-decoration: line-through; }
.commandes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.commandes button { font: inherit; font-weight: 700; min-height: 48px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); touch-action: none; user-select: none; -webkit-user-select: none; }
.commandes button.actif { border-color: var(--accent); background: var(--accent-soft); }
.choix { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.choix label { display: inline-flex; flex-direction: row; gap: 6px; align-items: center; color: var(--fg); font-size: 13px; }
.explication p { max-width: 75ch; }
.explication code { font-family: var(--font-mono); font-size: 13px; }
.commandes[hidden] { display: none; }
