/* ---------- Palettes ---------- */
:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --ink: #1d2420;
  --muted: #666c64;
  --card: #ffffff;
  --line: #e1dccf;
  --green: #2e9e5b;
  --green-dark: #1f7a43;
  --black: #17191a;
  --black-line: #17191a;
  --neutral: #d8ceb5;
  --neutral-soft: #ece5d3;
  --neutral-soft-line: #ddd3b9;
  --neutral-ink: #7a725e;
  --p1: #3b6fd4;
  --p1-bg: #3b6fd4;
  --p2: #c9692a;
  --p2-bg: #d4793b;
  --danger: #c0392b;
  --danger-soft: #f0d3ce;
  --btn-bg: #1d2420;
  --btn-ink: #ffffff;
  --scrim: rgba(244, 241, 234, .92);
  --radius: 12px;
  --gap: 6px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121513;
  --ink: #e8ece9;
  --muted: #9aa29c;
  --card: #1d2220;
  --line: #303733;
  --green: #2a9d5c;
  --green-dark: #4fd18b;
  --black: #050606;
  --black-line: #6b736d;
  --neutral: #4a4636;
  --neutral-soft: #2c2a22;
  --neutral-soft-line: #3d3a2d;
  --neutral-ink: #b5ad93;
  --p1: #8aaefc;
  --p1-bg: #3b6fd4;
  --p2: #f0a36a;
  --p2-bg: #c9692a;
  --danger: #ff8574;
  --danger-soft: #4a2622;
  --btn-bg: #e8ece9;
  --btn-ink: #121513;
  --scrim: rgba(18, 21, 19, .92);
}

/* Mode daltonien : agents en bleu (+ formes et motifs, voir plus bas) */
html[data-cb="1"] {
  --green: #0072b2;
  --green-dark: #005a8e;
  --p1: #7b5cd6;
  --p1-bg: #7b5cd6;
}
html[data-cb="1"][data-theme="dark"] {
  --green: #2b8fd6;
  --green-dark: #6bb8f0;
  --p1: #b39df5;
  --p1-bg: #6a4cc4;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}
button, input, select { font-family: inherit; }

/* Écran pivoté à 180° (tablette posée entre deux joueurs) */
html[data-flip="1"] body { transform: rotate(180deg); }

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(6px + env(safe-area-inset-top)) 12px calc(10px + env(safe-area-inset-bottom));
  gap: 8px;
}

/* ---------- En-tête ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
.brand { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.icons { display: flex; gap: 2px; margin-right: -8px; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:active { background: var(--line); }

.status { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.turn { display: flex; flex-direction: column; min-width: 0; }
.turn-count { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.turn-label { font-size: 15px; font-weight: 600; }
.turn-label .p1 { color: var(--p1); }
.turn-label .p2 { color: var(--p2); }
.score { font-size: 15px; color: var(--muted); white-space: nowrap; }
.score strong { font-size: 26px; color: var(--green-dark); font-variant-numeric: tabular-nums; }

.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 6px; }
#progress-bar { height: 100%; width: 0; background: var(--green); transition: width .3s ease; }

.tokens-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.tokens { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.token {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  transition: background .25s, box-shadow .25s;
}
.token.used { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }

#app.sudden .turn-count,
#app.sudden .tokens-row span { color: var(--danger); font-weight: 700; }
#app.sudden .progress { background: var(--danger-soft); }

/* ---------- Plateau ---------- */
main { flex: 1; min-height: 0; display: flex; }
.board {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: var(--gap);
  min-height: 0;
  perspective: 900px;
  container-type: inline-size;
}

.card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-weight: 600;
  font-size: clamp(10px, 3.3vw, 15px);
  font-size: clamp(9px, 3.5cqw, 24px);
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .01em;
  overflow: hidden;
  overflow-wrap: anywhere;
  hyphens: auto;
  cursor: pointer;
  transition: transform .08s ease, background .2s ease, color .2s ease;
}
.card:active:not(:disabled) { transform: scale(.95); }
.card:disabled { cursor: default; }

.card.green { background: var(--green); border-color: var(--green); color: #fff; }
.card.black { background: var(--black); border-color: var(--black-line); color: #fff; }
/* Passant innocent révélé avec une seule clé : la carte reste en jeu pour l'autre clé */
.card.neutral { background: var(--neutral-soft); border-color: var(--neutral-soft-line); color: var(--neutral-ink); }
/* Passant innocent pour les deux clés : carte définitivement éliminée */
.card.neutral.dead {
  background: var(--neutral);
  border-color: var(--neutral);
  color: var(--neutral-ink);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.mk { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; }
.mk.p1 { background: var(--p1); }
.mk.p2 { background: var(--p2); right: 13px; }

/* Animations de révélation */
.card.flip { animation: flip .55s cubic-bezier(.2, .7, .2, 1) both; }
.card.pop { animation: pop .38s ease both; }
.card.deal { animation: deal .4s ease both; animation-delay: calc(var(--i, 0) * 18ms); }
.card.shake { animation: shake .3s; }
@keyframes flip {
  0% { transform: rotateY(-90deg) scale(.92); }
  60% { transform: rotateY(8deg) scale(1.04); }
  100% { transform: none; }
}
@keyframes pop {
  0% { transform: scale(.88); }
  60% { transform: scale(1.05); }
  100% { transform: none; }
}
@keyframes deal {
  from { opacity: 0; transform: translateY(10px) scale(.92); }
  to { opacity: 1; transform: none; }
}
@keyframes shake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
html[data-anim="0"] *, html[data-anim="0"] *::before, html[data-anim="0"] *::after {
  animation: none !important;
  transition: none !important;
}

/* ---------- Commandes ---------- */
.controls { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 8px; }
.config-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.config-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.config-btn svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.btn {
  flex: 1;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.1;
  cursor: pointer;
  transition: transform .08s ease, opacity .2s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.secret { color: #fff; }
.btn.secret.p1 { background: var(--p1-bg); }
.btn.secret.p2 { background: var(--p2-bg); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost.danger { color: var(--danger); }
.btn.primary { background: var(--btn-bg); color: var(--btn-ink); }
.btn:focus-visible, .card:focus-visible, .icon-btn:focus-visible, .config-btn:focus-visible,
.chip:focus-visible, .seg button:focus-visible, .link:focus-visible { outline: 3px solid #8ab4ff; outline-offset: 2px; }

/* ---------- Disposition paysage (tablette posée) ---------- */
html[data-layout="landscape"] #app {
  max-width: 1280px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(270px, 34vw, 400px);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "main top" "main controls";
  gap: 10px 16px;
  padding-left: calc(14px + env(safe-area-inset-left));
  padding-right: calc(14px + env(safe-area-inset-right));
}
html[data-layout="landscape"] main { grid-area: main; }
html[data-layout="landscape"] .top { grid-area: top; }
html[data-layout="landscape"] .controls { grid-area: controls; align-self: end; max-height: 100%; overflow-y: auto; }
html[data-layout="landscape"] .turn-label { font-size: 17px; }

@media (max-height: 520px) {
  .btn { min-height: 40px; }
  .config-btn { min-height: 34px; }
  .icon-btn { width: 36px; height: 36px; }
  .bar { min-height: 36px; }
  .score strong { font-size: 22px; }
  .tokens-row { margin-top: 4px; }
}

/* ---------- Fenêtres plein écran ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
  overflow-y: auto;
}

/* Vue secrète (toujours sombre pour limiter les regards indiscrets) */
.secret-overlay { background: #101412; color: #fff; }
.secret-inner {
  width: 100%;
  max-width: 560px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
html[data-layout="landscape"] .secret-inner { max-width: 1000px; }
.secret-inner h2 { margin: 0; text-align: center; font-size: 20px; }
.secret-overlay.p1 h2 { color: #8fb1ff; }
.secret-overlay.p2 h2 { color: #ffb482; }
.cover {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
  color: #b9c0bb;
  line-height: 1.5;
}
.cover .btn { flex: none; width: 100%; max-width: 320px; background: #fff; color: #101412; }
#secret-content { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.legend { display: flex; justify-content: center; gap: 18px; font-size: 13px; color: #b9c0bb; }
.legend > span { display: inline-flex; align-items: center; }
.dot {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border-radius: 4px;
  font-style: normal;
}
.dot.g { background: var(--green); }
.dot.b { background: #000; box-shadow: inset 0 0 0 2px #fff; }

.secret-board .cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  min-width: 0;
  border-radius: var(--radius);
  background: #2a302d;
  color: #c4cbc6;
  font-weight: 600;
  font-size: clamp(10px, 3.3vw, 15px);
  font-size: clamp(9px, 3.5cqw, 24px);
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  overflow: hidden;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.secret-board .cell.g { background: var(--green); color: #fff; }
.secret-board .cell.b { background: #000; color: #fff; box-shadow: inset 0 0 0 2px #fff; }
.secret-board .cell.done { opacity: .35; }
.secret-inner > .btn.primary { flex: none; background: #fff; color: #101412; }

/* Daltonisme : formes + motifs en plus des couleurs */
html[data-cb="1"] .card.green::after,
html[data-cb="1"] .secret-board .cell.g::after,
html[data-cb="1"] .dot.g::after {
  content: "\2713";
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}
html[data-cb="1"] .card.black::after,
html[data-cb="1"] .secret-board .cell.b::after,
html[data-cb="1"] .dot.b::after {
  content: "\2715";
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}
html[data-cb="1"] .dot.g::after, html[data-cb="1"] .dot.b::after { top: 1px; left: 3px; font-size: 10px; }
html[data-cb="1"] .card.black,
html[data-cb="1"] .secret-board .cell.b,
html[data-cb="1"] .dot.b {
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .22) 0 3px, transparent 3px 7px);
}
html[data-cb="1"] .card.green,
html[data-cb="1"] .secret-board .cell.g,
html[data-cb="1"] .dot.g {
  background-image: radial-gradient(rgba(255, 255, 255, .32) 1.3px, transparent 1.4px);
  background-size: 8px 8px;
}

/* Résultat */
.result-overlay { background: var(--scrim); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.result-card {
  width: 100%;
  max-width: 360px;
  margin: auto;
  padding: 26px 22px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .15);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result-card h2 { margin: 0; font-size: 24px; }
.result-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.result-card .result-meta { margin: 0 0 6px; font-size: 12px; letter-spacing: .04em; }
.result-card .btn { flex: none; width: 100%; }
.share-row { display: flex; gap: 8px; }
.share-row .btn { flex: 1; min-height: 44px; font-size: 14px; }
.result-icon { width: 56px; height: 56px; margin: 0 auto 4px; border-radius: 16px; }
.result-icon.win { background: var(--green); }
.result-icon.lose { background: var(--black); box-shadow: inset 0 0 0 2px var(--black-line); }

/* ---------- Feuilles (réglages, statistiques) ---------- */
.sheet-overlay { z-index: 15; background: rgba(0, 0, 0, .5); align-items: flex-end; padding: 0; }
.sheet {
  width: 100%;
  max-width: 560px;
  max-height: min(92dvh, 920px);
  overflow-y: auto;
  padding: 0 14px calc(16px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .3);
  overscroll-behavior: contain;
}
@media (min-width: 640px) {
  .sheet-overlay { align-items: center; padding: 20px; }
  .sheet { border-radius: 20px; }
}
.sheet-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 8px;
  background: var(--bg);
}
.sheet-head h2 { margin: 0; font-size: 18px; }

.group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 0 14px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.group h3 { margin: 0; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-head { display: flex; justify-content: space-between; align-items: center; }
.field-label { font-size: 14px; font-weight: 600; }
.hint { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.hint.warn { color: var(--danger); font-weight: 600; }
.link { padding: 6px 4px; border: 0; background: none; color: var(--p1); font-size: 13px; font-weight: 600; cursor: pointer; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.chip .n { font-size: 11px; font-weight: 500; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .7; }

.seg { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.seg button {
  flex: 1;
  min-height: 38px;
  padding: 0 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.seg button[aria-checked="true"] { background: var(--btn-bg); color: var(--btn-ink); }

.switch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.switch small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--muted); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: var(--line);
  transition: background .2s;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  transition: transform .2s;
}
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 3px solid #8ab4ff; outline-offset: 2px; }
input[type="range"] { width: 100%; accent-color: var(--green); }

/* Statistiques */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.tile { padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.tile strong { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.tile span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.facts { margin: 0 0 14px; padding: 0; list-style: none; font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
.facts b { color: var(--ink); }
.stats-block { margin: 0 0 16px; }
.stats-block h3 { margin: 0 0 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
table.stats { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table.stats th, table.stats td { padding: 8px 8px; text-align: right; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--line); }
table.stats th:first-child, table.stats td:first-child { text-align: left; font-weight: 600; }
table.stats thead th { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
table.stats tbody tr:last-child td { border-bottom: 0; }
#btn-stats-reset { width: 100%; margin-top: 4px; }
.note { margin: 6px 0 12px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.empty { margin: 8px 0 18px; padding: 18px; text-align: center; line-height: 1.5; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: 14px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(150px + env(safe-area-inset-bottom));
  transform: translate(-50%, 10px);
  max-width: 90vw;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 30;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
html[data-layout="landscape"] .toast { bottom: calc(20px + env(safe-area-inset-bottom)); }

@media (min-width: 600px) {
  #app { padding-top: 14px; padding-bottom: 20px; }
  :root { --gap: 8px; }
}

/* ---------- Saisie de l'indice ---------- */
input { -webkit-user-select: text; user-select: text; }

.clue-bar { margin-top: 8px; }
.clue-bar.attn { animation: shake .3s; }
.clue-form { display: flex; align-items: center; gap: 6px; margin: 0; }
.clue-form input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font-size: 16px; /* 16px minimum : évite le zoom automatique sur iOS */
  font-weight: 700;
  text-transform: uppercase;
}
.clue-form input[type="text"]::placeholder { color: var(--muted); font-weight: 400; text-transform: none; }
.clue-form input[type="text"]:focus-visible { outline: 3px solid #8ab4ff; outline-offset: 1px; }
.stepper {
  display: flex;
  align-items: center;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.stepper button {
  width: 34px;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
}
.stepper button:active { background: var(--line); }
.stepper button:focus-visible { outline: 3px solid #8ab4ff; outline-offset: -3px; border-radius: 10px; }
.stepper output { min-width: 20px; text-align: center; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.clue-form .btn { flex: none; min-height: 44px; padding: 0 16px; }

.clue-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.clue-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.clue-main small { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.clue-main strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clue-left {
  flex: none;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.clue-left.done { background: var(--green); color: #fff; }
.icon-btn.small { width: 34px; height: 34px; flex: none; }
.icon-btn.small svg { width: 18px; height: 18px; }

/* ---------- Historique ---------- */
.hist-group { margin: 0 0 14px; }
.hist-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.hist-head .p1 { color: var(--p1); }
.hist-head .p2 { color: var(--p2); }
.hist-list { margin: 0; padding: 0; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.hist-list li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.hist-list li:last-child { border-bottom: 0; }
.hist-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}
.hist-ico.agent { background: var(--green); }
.hist-ico.bystander { background: var(--neutral); color: var(--neutral-ink); }
.hist-ico.assassin { background: var(--black); box-shadow: inset 0 0 0 1px var(--black-line); }
.hist-ico.clue { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); color: var(--ink); }
.hist-ico.end, .hist-ico.sudden { background: var(--line); color: var(--ink); }
.hist-ico.win { background: var(--green); }
.hist-ico.lose { background: var(--black); box-shadow: inset 0 0 0 1px var(--black-line); }
.hist-w { min-width: 0; font-weight: 700; text-transform: uppercase; overflow-wrap: anywhere; }
.hist-w.plain { font-weight: 600; text-transform: none; }
.hist-note { margin-left: auto; padding-left: 8px; font-size: 12px; text-align: right; color: var(--muted); }
li.hist-result { background: var(--bg); }

@media (max-width: 380px) {
  .turn-label { font-size: 13.5px; }
  .clue-form .btn { padding: 0 12px; }
}