/*!
 * Pionniers — feuille de style (identité « carte marine moderne »)
 * Papier de carte, encre bleu nuit, mer lagon, tuiles plates. Mode sombre automatique.
 */
:root {
  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-2: #e9efec;
  --line: #d5dee3;
  --text: #10243a;
  --muted: #5b6f80;
  --action: #10243a;
  --on-action: #ffffff;
  --accent: #ff6b35;
  --sea: #bfe0ea;
  --sea-line: #9cc8d6;
  --tile-gap: #ffffff;
  --token: #ffffff;
  --token-ink: #10243a;
  --token-red: #d7384b;
  --good: #1e9e6a;
  --bad: #d7384b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 36, 58, 0.06), 0 10px 30px rgba(16, 36, 58, 0.1);
  --font: "Avenir Next", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1722;
    --surface: #12222f;
    --surface-2: #192e3f;
    --line: #243b4e;
    --text: #e8f0f5;
    --muted: #8ca3b5;
    --action: #e8f0f5;
    --on-action: #0b1722;
    --sea: #123e56;
    --sea-line: #1f5878;
    --tile-gap: #0b1722;
    --token: #f3f6f4;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.5;
}
h1, h2, h3, h4 { letter-spacing: -0.02em; line-height: 1.15; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.muted { color: var(--muted); font-size: 0.9rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- En-tête ---------- */
.header {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.8rem 1.4rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; min-width: 0; }
.brand img { width: 40px; height: 34px; display: block; flex: none; }
.brand__name { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.03em; }
.brand__tagline { display: block; font-size: 0.72rem; color: var(--muted); white-space: nowrap; line-height: 1.2; }

.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; padding: 0; flex: none;
}
.nav-toggle__bar { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text); transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle--active .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle--active .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle--active .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav {
  position: absolute; top: 100%; right: 1rem; margin-top: 0.5rem;
  display: flex; flex-direction: column; gap: 0.2rem; min-width: 200px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 0.4rem; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.nav--open { opacity: 1; visibility: visible; transform: translateY(0); }
.nav a { text-decoration: none; padding: 0.6rem 0.8rem; border-radius: 10px; font-weight: 600; font-size: 0.95rem; }
.nav a:hover { background: var(--surface-2); }
.nav__link--active { background: var(--action); color: var(--on-action); }
.nav__link--active:hover { background: var(--action); }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .nav { position: static; margin: 0; flex-direction: row; min-width: 0; padding: 0; border: 0; background: transparent; box-shadow: none; opacity: 1; visibility: visible; transform: none; gap: 0.3rem; }
  .nav a { padding: 0.5rem 0.95rem; border-radius: 999px; }
}

main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 2rem 1.2rem 3rem; }
main.play { max-width: 1180px; padding-top: 1rem; }

.footer {
  text-align: center;
  padding: 1.1rem 1rem calc(1.4rem + env(safe-area-inset-bottom, 0px));
  font-size: 0.78rem; color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ---------- Boutons ---------- */
.btn {
  font: inherit; font-weight: 700; border: 1px solid transparent; border-radius: 12px;
  padding: 0.75rem 1.4rem; min-height: 46px; cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn--primary { background: var(--action); color: var(--on-action); }
.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--big { width: 100%; font-size: 1.02rem; }
.btn--small { padding: 0.3rem 0.9rem; min-height: 34px; font-size: 0.85rem; border-radius: 10px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Accueil ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 2rem; align-items: center; padding: 1rem 0 2rem; }
.hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; margin: 0 0 1rem; }
.hero p { font-size: 1.08rem; color: var(--muted); max-width: 30em; margin: 0 0 1.6rem; }
.hero .actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.hero__board { display: block; width: 100%; height: auto; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.5rem; margin: 1rem 0 0; border-top: 1px solid var(--line); }
.facts > div { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 800; font-size: 1.02rem; letter-spacing: -0.01em; margin-bottom: 0.2rem; }
.facts dd { margin: 0; color: var(--muted); font-size: 0.95rem; max-width: 34em; }

/* ---------- Dés ---------- */
.dice-row { display: flex; gap: 0.9rem; justify-content: center; min-height: 76px; flex-wrap: wrap; perspective: 700px; }
.die {
  position: relative; width: 66px; height: 66px; border-radius: 16px;
  background: #ffffff; border: 1px solid #c9d5db; box-shadow: 0 2px 0 #c9d5db, 0 8px 16px rgba(16, 36, 58, 0.16);
  padding: 0; display: grid; place-items: center; transform-style: preserve-3d;
}
.die--rolling { box-shadow: 0 12px 20px rgba(16, 36, 58, 0.22); }
.die--settle { animation: dieSettle 0.28s ease; }
@keyframes dieSettle { 0% { transform: scale(1.18); } 55% { transform: scale(0.93) rotate(-3deg); } 100% { transform: scale(1); } }
.die__face { width: 50px; height: 50px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 4px; }
.pip { width: 10px; height: 10px; border-radius: 50%; background: #10243a; align-self: center; justify-self: center; }
.pip--tl { grid-area: 1 / 1; } .pip--tr { grid-area: 1 / 3; } .pip--ml { grid-area: 2 / 1; }
.pip--mid { grid-area: 2 / 2; } .pip--mr { grid-area: 2 / 3; } .pip--bl { grid-area: 3 / 1; } .pip--br { grid-area: 3 / 3; }

/* ---------- Configuration ---------- */
.setup-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 1.8rem; max-width: 640px; margin: 1rem auto; box-shadow: var(--shadow); }
.setup-card h2 { margin: 0 0 0.2rem; font-size: 1.7rem; }
.stepper { display: flex; align-items: center; gap: 1rem; justify-content: center; margin: 1rem 0 1.4rem; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 1.3rem; cursor: pointer; }
.stepper__count { font-size: 2rem; font-weight: 800; min-width: 2ch; text-align: center; letter-spacing: -0.03em; }
.seat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.6rem; margin-bottom: 1.2rem; }
.seat-row { display: flex; gap: 0.5rem; align-items: center; }
.seat-chip { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.seat-row .seat-name {
  flex: 1; min-width: 0; padding: 0.55rem 0.8rem; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; font-weight: 600; min-height: 46px;
}
.seat-type-toggle {
  flex: none; padding: 0.5rem 0.8rem; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 0.85rem; cursor: pointer; min-height: 46px; white-space: nowrap;
}
.seat-type-toggle--ai { background: var(--action); color: var(--on-action); border-color: var(--action); }
.setup-options { display: grid; gap: 0.7rem; margin-top: 0.4rem; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; font-size: 0.95rem; }
.opt select { font: inherit; padding: 0.5rem 0.7rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); min-height: 42px; }
.opt--check { justify-content: flex-start; align-items: flex-start; font-size: 0.88rem; color: var(--muted); }
.opt--check input { margin-top: 0.2rem; width: 18px; height: 18px; flex: none; accent-color: var(--action); }

/* ---------- Écran de jeu ---------- */
.players-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; margin-bottom: 0.7rem; }
.pl {
  --pc: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 0.5rem 0.75rem; min-width: 0; position: relative; overflow: hidden;
}
.pl::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--pc); }
.pl--active { box-shadow: 0 0 0 2px var(--text); }
.pl:not(.pl--turn) { opacity: 0.78; }
.pl__head { display: flex; align-items: center; gap: 0.4rem; min-width: 0; padding-left: 0.2rem; }
.pl__dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: none; background: var(--pc); }
.pl__name { font-weight: 700; font-size: 0.93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.pl__badge { font-size: 0.9rem; }
.pl__pts { font-size: 1.15rem; padding-left: 0.2rem; letter-spacing: -0.02em; }
.pl__hidden { font-size: 0.78rem; color: var(--muted); font-weight: 400; }
.pl__stats { display: flex; gap: 0.65rem; flex-wrap: wrap; font-size: 0.78rem; color: var(--muted); padding-left: 0.2rem; font-variant-numeric: tabular-nums; }

.turn-banner {
  --pc: var(--text);
  position: sticky; top: 0.4rem; z-index: 12;
  font-weight: 700; font-size: 1rem; text-align: center;
  padding: 0.65rem 1rem; margin-bottom: 0.8rem;
  background: var(--action); color: var(--on-action);
  background: linear-gradient(90deg, var(--pc) 0 8px, var(--action) 8px);
  border-radius: 14px; box-shadow: var(--shadow);
}

.game-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 1.2rem; align-items: start; }
.board-wrap { background: transparent; padding: 0; }
.board { display: block; width: 100%; height: auto; max-height: 82vh; }
.side { display: grid; gap: 0.8rem; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.panel h3 { margin: 0 0 0.7rem; font-size: 1rem; font-weight: 800; display: flex; align-items: center; gap: 0.45rem; }
.hint { margin: 0.5rem 0 0; font-size: 0.88rem; color: var(--muted); line-height: 1.45; }

.dice-panel { text-align: center; }
.dice-panel .dice-row { min-height: 70px; }
.dice-panel .die { width: 58px; height: 58px; border-radius: 14px; }
.dice-panel .die__face { width: 44px; height: 44px; }
.dice-panel .pip { width: 9px; height: 9px; }
.dice-info { margin-top: 0.6rem; min-height: 2.6rem; }
.dice-total { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.dice-total--idle { color: var(--muted); font-weight: 500; font-size: 0.92rem; }
.dice-gain { font-size: 0.95rem; font-weight: 600; margin-top: 0.1rem; }
.dice-gain--seven { color: var(--bad); }

/* ---------- Main ---------- */
.hand-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; }
.res-tile {
  display: grid; justify-items: center; gap: 0.05rem; padding: 0.5rem 0.2rem 0.4rem; border-radius: 12px;
  background: var(--surface-2); min-width: 0; border-bottom: 4px solid var(--muted);
}
.res-tile--bois { border-bottom-color: #2e7d5b; }
.res-tile--argile { border-bottom-color: #d9643a; }
.res-tile--laine { border-bottom-color: #a7d36b; }
.res-tile--ble { border-bottom-color: #f2c14e; }
.res-tile--pierre { border-bottom-color: #8a97a8; }
.res-tile--zero { opacity: 0.45; }
.res-tile__icon { font-size: 1.3rem; line-height: 1; }
.res-tile__count { font-size: 1.4rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.res-tile__label { font-size: 0.66rem; color: var(--muted); }
.reserve { margin-top: 0.6rem; font-size: 0.8rem; color: var(--muted); text-align: center; }
.warn { margin-top: 0.4rem; font-size: 0.82rem; color: var(--bad); text-align: center; font-weight: 600; }

/* ---------- Actions ---------- */
.actions-panel { display: grid; gap: 0.6rem; }
.act-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.act {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon label" "icon cost";
  align-items: center; column-gap: 0.65rem; text-align: left;
  padding: 0.5rem 0.75rem; min-height: 58px; border-radius: 12px; cursor: pointer;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line); font: inherit;
}
.act:hover:not(:disabled) { border-color: var(--text); }
.act:disabled { opacity: 0.4; cursor: not-allowed; }
.act--active { background: var(--action); color: var(--on-action); border-color: var(--action); }
.act__icon { grid-area: icon; font-size: 1.5rem; }
.act__label { grid-area: label; font-weight: 700; font-size: 0.97rem; }
.act__cost { grid-area: cost; font-size: 0.78rem; opacity: 0.75; }

/* ---------- Cartes développement ---------- */
.dev-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.dev-row:last-child { border-bottom: none; }
.dev-row__icon { font-size: 1.2rem; }
.dev-row__name { flex: 1; font-weight: 600; font-size: 0.92rem; }
.dev-row__note { font-size: 0.78rem; color: var(--muted); }

/* ---------- Journal ---------- */
.log-panel ul { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; font-size: 0.86rem; -webkit-overflow-scrolling: touch; }
.log-panel li { padding: 0.35rem 0; border-bottom: 1px solid var(--line); color: var(--muted); line-height: 1.35; }
.log-panel li.log-new { color: var(--text); font-weight: 700; }
.game-footer { display: flex; justify-content: center; gap: 0.8rem; margin-top: 1.4rem; flex-wrap: wrap; }

/* ---------- Plateau (SVG) ---------- */
.sea { fill: var(--sea); }
.sea-ring { fill: none; stroke: var(--sea-line); stroke-width: 2; }
.hex { stroke: var(--tile-gap); stroke-width: 3; stroke-linejoin: round; }
.hex-icon { pointer-events: none; opacity: 0.92; }
.hex--hot { animation: hexHot 0.9s ease-in-out 3; }
@keyframes hexHot {
  0%, 100% { stroke: var(--tile-gap); stroke-width: 3; filter: brightness(1); }
  50% { stroke: var(--accent); stroke-width: 6; filter: brightness(1.12); }
}
.hex-focus { fill: none; stroke: var(--accent); stroke-width: 5; pointer-events: none; }
.token { pointer-events: none; }
.token--blocked { opacity: 0.4; }
.token-disc { fill: var(--token); stroke: rgba(16, 36, 58, 0.18); stroke-width: 1; }
.token-num { fill: var(--token-ink); font-weight: 800; font-family: var(--font); letter-spacing: -0.03em; }
.token-num--red { fill: var(--token-red); }
.token-pip { fill: var(--token-ink); opacity: 0.8; }
.token-pip--red { fill: var(--token-red); opacity: 1; }
.port-line { stroke: var(--text); stroke-width: 1.6; stroke-dasharray: 2 4; stroke-linecap: round; opacity: 0.4; }
.port-disc { fill: #ffffff; stroke: var(--sea-line); stroke-width: 2; }
.port-text { fill: #10243a; font-weight: 800; text-anchor: middle; font-family: var(--font); }
.port { pointer-events: none; }
.road-outline { stroke: #ffffff; stroke-width: 11; stroke-linecap: round; }
.road { stroke-width: 6.5; stroke-linecap: round; }
.building { stroke: #ffffff; stroke-width: 2.5; stroke-linejoin: round; }
.building-window { fill: #ffffff; }
.robber-body { fill: #10243a; stroke: #ffffff; stroke-width: 2; }
.robber-base { fill: rgba(16, 36, 58, 0.25); }
.robber { pointer-events: none; }

.pick-hex { fill: rgba(255, 255, 255, 0.22); stroke: #10243a; stroke-opacity: 0.55; stroke-width: 2; stroke-dasharray: 5 7; stroke-linecap: round; cursor: pointer; animation: pickPulse 1.4s ease-in-out infinite; }
.pick-hex:hover, .pick-hex:focus { fill: rgba(255, 255, 255, 0.6); outline: none; }
.pick-edge { cursor: pointer; outline: none; }
.pick-edge__vis { stroke: #ffffff; stroke-width: 9; stroke-linecap: round; animation: pickPulse 1.4s ease-in-out infinite; }
.pick-edge__hit { stroke: transparent; stroke-width: 24; stroke-linecap: round; }
.pick-edge:hover .pick-edge__vis, .pick-edge:focus .pick-edge__vis { stroke: var(--accent); }
.pick-vert { cursor: pointer; outline: none; }
.pick-vert__vis { fill: #ffffff; stroke: #10243a; stroke-width: 2.5; animation: pickPulse 1.4s ease-in-out infinite; }
.pick-vert__hit { fill: transparent; }
.pick-vert:hover .pick-vert__vis, .pick-vert:focus .pick-vert__vis { fill: var(--accent); }
@keyframes pickPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ---------- Modales ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(11, 23, 34, 0.55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 40; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 1.5rem; width: min(100%, 520px); max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal h2 { margin: 0 0 0.6rem; font-size: 1.4rem; }
.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.cover { text-align: center; }
.cover__emoji { font-size: 3rem; }
.res-choice { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; margin: 0.5rem 0 0.9rem; }
.res-btn {
  display: grid; justify-items: center; gap: 0.1rem; padding: 0.55rem 0.2rem; border-radius: 12px; cursor: pointer;
  background: var(--surface-2); color: var(--text); border: 2px solid transparent; font: inherit; min-width: 0;
}
.res-btn:hover:not(:disabled) { border-color: var(--muted); }
.res-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.res-btn--selected { border-color: var(--text); background: var(--surface); }
.res-btn__icon { font-size: 1.5rem; }
.res-btn__label { font-size: 0.78rem; font-weight: 700; }
.tabs { display: flex; gap: 0.3rem; margin: 0.7rem 0; background: var(--surface-2); padding: 0.25rem; border-radius: 12px; }
.tab { flex: 1; padding: 0.5rem; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.tab--on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16, 36, 58, 0.15); }
.trade-hand { display: flex; justify-content: space-between; gap: 0.3rem; background: var(--surface-2); border-radius: 12px; padding: 0.5rem 0.8rem; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.trade-block h4 { margin: 0.3rem 0; font-size: 0.92rem; }
.step-row { display: flex; align-items: center; gap: 0.4rem; margin: 0.25rem 0; }
.step-row__label { flex: 1; font-size: 0.88rem; min-width: 0; }
.step-row__n { min-width: 1.6ch; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.mini-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: 1.1rem; cursor: pointer; }
.mini-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.trade-msg { text-align: center; font-weight: 700; margin: 0.7rem 0 0; }
.offer { font-size: 1.05rem; text-align: center; background: var(--surface-2); border-radius: 12px; padding: 0.8rem; }
.victims { display: grid; gap: 0.5rem; margin-top: 0.6rem; }
.victim { display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem; border-radius: 12px; border: 1px solid var(--line); border-left: 6px solid var(--pc); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.victim .muted { margin-left: auto; }
.victim:hover { border-color: var(--text); border-left-color: var(--pc); }
.help-list { padding-left: 1.1rem; font-size: 0.92rem; line-height: 1.55; }
.score-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; border-radius: 12px; background: var(--surface-2); margin: 0.4rem 0; border-left: 6px solid var(--pc); }
.score-row--win { background: var(--action); color: var(--on-action); }
.score-row__name { min-width: 6.5em; }
.score-row__parts { flex: 1; font-size: 0.84rem; opacity: 0.85; }
.victory { text-align: left; }

.toast {
  position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px);
  background: var(--action); color: var(--on-action); border-radius: 999px;
  padding: 0.65rem 1.2rem; font-weight: 600; font-size: 0.92rem; max-width: 92vw; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; z-index: 60; box-shadow: var(--shadow);
}
.toast--show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Tutoriel ---------- */
.tutorial-shell { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 1.8rem; }
.progress-track { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 1.4rem; }
.progress-bar { height: 100%; background: var(--action); border-radius: 999px; transition: width 0.25s ease; }
.tutorial-step { display: none; line-height: 1.6; max-width: 46rem; }
.tutorial-step--active { display: block; }
.tutorial-step h2 { margin-top: 0; font-size: 1.9rem; letter-spacing: -0.03em; }
.tutorial-step ul, .tutorial-step ol { padding-left: 1.2rem; }
.tutorial-step li { margin-bottom: 0.35rem; }
.num-red { color: var(--bad); }
.res-list { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.5rem; }
.res-list li { display: flex; align-items: center; gap: 0.7rem; background: var(--surface-2); border-radius: 12px; padding: 0.5rem 0.8rem; margin: 0; }
.res-list span { font-size: 1.4rem; }
.demo-board { display: block; width: 100%; max-width: 560px; margin: 1rem auto 0; height: auto; }
.cost-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.95rem; }
.cost-table th, .cost-table td { text-align: left; padding: 0.6rem 0.6rem; border-bottom: 1px solid var(--line); }
.cost-table th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.quiz-q { font-weight: 700; font-size: 1.08rem; }
.quiz-options { display: grid; gap: 0.5rem; margin: 0.8rem 0; }
.quiz-opt { text-align: left; padding: 0.8rem 1rem; border-radius: 12px; font: inherit; cursor: pointer; background: var(--surface-2); color: var(--text); border: 2px solid transparent; min-height: 46px; }
.quiz-opt:hover:not(:disabled) { border-color: var(--muted); }
.quiz-opt:disabled { cursor: default; }
.quiz-opt--correct { border-color: var(--good) !important; background: rgba(30, 158, 106, 0.12); }
.quiz-opt--wrong { border-color: var(--bad) !important; background: rgba(215, 56, 75, 0.1); }
.quiz-feedback { min-height: 1.4rem; font-weight: 600; margin: 0.4rem 0 0.8rem; }
.quiz-score { font-size: 1.15rem; font-weight: 700; }
.tutorial-nav { display: flex; justify-content: space-between; gap: 0.8rem; margin-top: 1.6rem; }
.tutorial-nav .btn { flex: 1 1 auto; }

/* ---------- Responsive ---------- */
.dock { display: grid; gap: 0.8rem; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero__board { max-width: 480px; margin: 0 auto; }
  .game-layout { display: flex; flex-direction: column; align-items: stretch; gap: 0.7rem; }
  .side { display: contents; }
  .dice-panel { order: 1; display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 0.5rem 0.8rem; }
  .dice-panel .dice-row { min-height: 0; flex-wrap: nowrap; gap: 0.6rem; }
  .dice-panel .die { width: 44px; height: 44px; border-radius: 11px; }
  .dice-panel .die__face { width: 34px; height: 34px; padding: 3px; }
  .dice-panel .pip { width: 7px; height: 7px; }
  .dice-info { margin-top: 0; min-height: 0; text-align: left; }
  .board-wrap { order: 2; }
  .board { max-height: none; }
  .dev-panel { order: 3; }
  .log-panel { order: 4; }
  .dock {
    order: 9; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; gap: 0;
    background: var(--surface); border-top: 1px solid var(--line); border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 30px rgba(16, 36, 58, 0.14);
    padding: 0.5rem 0.7rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
    max-height: 60vh; overflow-y: auto;
  }
  .dock .panel { background: transparent; border: none; padding: 0.15rem 0; }
  .dock .hand-panel h3 { margin: 0 0 0.25rem; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
  .dock .reserve { display: none; }
  .dock .warn { margin-top: 0.2rem; font-size: 0.74rem; }
  .dock .res-tile { padding: 0.25rem 0.1rem 0.2rem; border-bottom-width: 3px; }
  .dock .res-tile__icon { font-size: 1.05rem; }
  .dock .res-tile__count { font-size: 1.05rem; }
  .dock .res-tile__label { display: none; }
  .dock .act-grid { grid-template-columns: repeat(5, 1fr); gap: 0.3rem; }
  .dock .act { grid-template-columns: 1fr; grid-template-areas: "icon" "label"; justify-items: center; text-align: center; min-height: 52px; padding: 0.3rem 0.1rem; row-gap: 0; }
  .dock .act__icon { font-size: 1.3rem; }
  .dock .act__label { font-size: 0.7rem; }
  .dock .act__cost { display: none; }
  .dock .actions-panel { gap: 0.4rem; }
  .dock .btn--big { min-height: 44px; padding: 0.5rem 1rem; }
  .dock .hint { margin: 0.2rem 0 0; font-size: 0.82rem; }
  main.play { padding-bottom: 15rem; }
}
@media (max-width: 720px) {
  main, main.play { padding: 0.9rem 0.7rem 2.4rem; }
  main.play { padding-bottom: 15rem; }
  .players-strip { grid-template-columns: repeat(2, 1fr); }
  .setup-card { padding: 1.2rem; }
  .facts { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .header { padding: 0.7rem 1rem; gap: 0.6rem; }
  .brand__name { font-size: 1.15rem; }
  .brand__tagline { display: none; }
  .die { width: 54px; height: 54px; }
  .die__face { width: 40px; height: 40px; }
  .tutorial-nav { flex-direction: column; }
  .tutorial-shell { padding: 1.1rem; }
  .hand-grid { gap: 0.25rem; }
  .res-tile__count { font-size: 1.15rem; }
  .res-tile__label { font-size: 0.6rem; }
  .trade-cols { grid-template-columns: 1fr; }
  .score-row { flex-wrap: wrap; }
  .score-row__parts { flex-basis: 100%; order: 3; }
  .turn-banner { font-size: 0.92rem; }
}
@media (max-width: 380px) {
  .die { width: 48px; height: 48px; }
  .die__face { width: 36px; height: 36px; }
  .pip { width: 8px; height: 8px; }
  .dock .act__label { font-size: 0.64rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
