/* =====================================================================
   SANKI Play — « table de jeu en bois laqué, la nuit »
   Acajou profond, carreaux ivoire, et les quatre couleurs du Ludo.
   ===================================================================== */
:root {
  --bois-950: #120B08;
  --bois-900: #180F0B;
  --bois-800: #20150F;
  --bois-700: #2C1D16;
  --bois-600: #3A281F;
  --bois-500: #4F372B;
  --ivoire: #FBF1DC;
  --ivoire-2: #EBDCBE;
  --ivoire-3: #CDB894;
  --encre: #2A1A10;
  --texte: #FBF1DC;
  --texte-2: #CDB9A0;
  --texte-3: #9A846E;
  --or: #F2C46D;
  --vert: #1FA971;
  --jaune: #FFBE2E;
  --bleu: #2F7DF6;
  --rouge: #E8414B;
  --ligne: rgba(251, 241, 220, 0.1);
  --ligne-2: rgba(251, 241, 220, 0.18);
  --ombre: 0 14px 40px rgba(0, 0, 0, 0.45);
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 24px;
  --f-display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --f-body: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.45;
  color: var(--texte);
  background:
    radial-gradient(900px 520px at 50% -8%, rgba(242, 196, 109, 0.13), transparent 62%),
    repeating-linear-gradient(91deg, rgba(255, 255, 255, 0.014) 0 2px, transparent 2px 9px),
    var(--bois-800);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 400; letter-spacing: 0.01em; margin: 0; line-height: 1.05; }
h1 { font-size: clamp(34px, 7vw, 54px); }
h2 { font-size: clamp(24px, 4.5vw, 32px); }
h3 { font-size: 20px; }
p { margin: 0; }
.muted { color: var(--texte-2); }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--or); }

/* ---------- Barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(var(--bois-900), rgba(24, 15, 11, 0.86));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ligne);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; margin-right: auto; }
.brand .mark { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4)); }
.wordmark { font-family: var(--f-display); font-size: 26px; letter-spacing: 0.04em; line-height: 1; display: flex; align-items: baseline; gap: 6px; }
.wordmark small {
  font-family: var(--f-body); font-weight: 700; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--encre); background: var(--jaune); padding: 3px 7px 2px; border-radius: 6px; transform: translateY(-3px);
}
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; flex: none;
  border-radius: 12px; border: 1px solid var(--ligne-2); background: var(--bois-700);
  font-size: 18px; color: var(--texte);
}
.icon-btn:hover { background: var(--bois-600); }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px;
  border-radius: 999px; border: 1px solid var(--ligne-2); background: var(--bois-700);
  font-weight: 600; font-size: 14px; max-width: 46vw;
}
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Boutons, champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 14px; border: 0;
  font-weight: 700; font-size: 16px; letter-spacing: 0.01em;
  background: var(--bois-600); color: var(--texte);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.08s ease, filter 0.15s ease, background 0.15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--jaune); color: var(--encre); box-shadow: inset 0 -4px 0 #C48A00, 0 8px 22px rgba(255, 190, 46, 0.18); }
.btn.ghost { background: transparent; border: 1px solid var(--ligne-2); box-shadow: none; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn.green { background: var(--vert); color: #fff; box-shadow: inset 0 -4px 0 #127A50; }

.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--texte-2); }
.field input {
  height: 50px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--ligne-2); background: var(--bois-900); color: var(--texte); font-size: 16px;
}
.field input:focus { outline: none; border-color: var(--or); box-shadow: 0 0 0 3px rgba(242, 196, 109, 0.25); }

.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--bois-900); border: 1px solid var(--ligne); }
.seg button { border: 0; background: transparent; padding: 9px 14px; border-radius: 10px; font-weight: 600; color: var(--texte-2); }
.seg button[aria-pressed="true"] { background: var(--ivoire); color: var(--encre); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  border: 1px solid var(--ligne-2); background: var(--bois-700); color: var(--texte-2);
  padding: 8px 13px; border-radius: 999px; font-weight: 600; font-size: 14px;
}
.chips button[aria-pressed="true"] { background: var(--ivoire); border-color: var(--ivoire); color: var(--encre); }

/* ---------- Accueil ---------- */
.home { max-width: 1080px; margin: 0 auto; padding: 28px 16px calc(40px + var(--safe-b)); display: grid; gap: 34px; }
@media (min-width: 900px) {
  .home { grid-template-columns: 1.05fr 1fr; align-items: start; gap: 48px; padding-top: 56px; }
}
.join { display: grid; gap: 18px; justify-items: start; }
.join h1 { max-width: 12ch; }
.join .lede { color: var(--texte-2); max-width: 36ch; font-size: 17px; }
.join-form { display: grid; gap: 16px; width: 100%; max-width: 460px; }

/* Carreaux du code — l'élément signature */
.tiles { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; width: 100%; max-width: 420px; cursor: text; }
.tiles input { position: absolute; inset: 0; opacity: 0; font-size: 16px; width: 100%; height: 100%; border: 0; caret-color: transparent; }
.tile {
  aspect-ratio: 4 / 5; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(#FFF8E9, var(--ivoire-2));
  box-shadow: 0 5px 0 var(--ivoire-3), 0 12px 20px rgba(0, 0, 0, 0.38), inset 0 1px 0 #fff;
  font-family: var(--f-display); font-size: clamp(28px, 7vw, 40px); color: var(--encre);
  transform: rotate(var(--tilt, 0deg));
  transition: box-shadow 0.15s ease;
}
.tile:nth-of-type(1) { --tilt: -2deg; } .tile:nth-of-type(2) { --tilt: 1.5deg; } .tile:nth-of-type(3) { --tilt: -1deg; }
.tile:nth-of-type(4) { --tilt: 2deg; } .tile:nth-of-type(5) { --tilt: -1.5deg; } .tile:nth-of-type(6) { --tilt: 1deg; }
.tile.empty::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ivoire-3); }
.tile.active { box-shadow: 0 5px 0 var(--ivoire-3), 0 0 0 3px var(--or), 0 12px 20px rgba(0, 0, 0, 0.38); }
.tile.drop { animation: tile-drop 0.22s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes tile-drop { from { transform: translateY(-14px) rotate(calc(var(--tilt) * -3)); } to { transform: rotate(var(--tilt)); } }
.tiles.shake { animation: shake 0.35s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.join .hint { font-size: 14px; color: var(--texte-3); }

.create { display: grid; gap: 16px; }
.games { display: grid; gap: 14px; }
@media (min-width: 560px) and (max-width: 899px) { .games { grid-template-columns: 1fr 1fr; } }
.game-card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 92px 1fr; gap: 16px; align-items: center;
  padding: 18px; border-radius: var(--r-l);
  background: linear-gradient(160deg, var(--bois-600), var(--bois-700));
  border: 1px solid var(--ligne-2); box-shadow: var(--ombre);
}
@media (min-width: 560px) and (max-width: 899px) { .game-card { grid-template-columns: 1fr; } }
.game-card h3 { font-size: 24px; margin-bottom: 4px; }
.game-card p { color: var(--texte-2); font-size: 15px; margin-bottom: 14px; }
.game-card .art { width: 92px; height: 92px; }
.online-line { display: flex; align-items: center; gap: 8px; color: var(--texte-3); font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--vert); box-shadow: 0 0 0 4px rgba(31, 169, 113, 0.18); flex: none; }

.install-card {
  display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r-m);
  border: 1px dashed var(--ligne-2); color: var(--texte-2); font-size: 14px;
}
.install-card img { width: 44px; height: 44px; border-radius: 11px; }
.demo-banner {
  max-width: 1080px; margin: 12px auto 0; padding: 10px 14px; border-radius: 12px;
  background: rgba(255, 190, 46, 0.1); border: 1px solid rgba(255, 190, 46, 0.35); color: var(--ivoire-2); font-size: 14px;
}
.demo-banner b { color: var(--jaune); }
.wrap-pad { padding: 0 16px; }

/* ---------- Fenêtres (dialog) ---------- */
dialog.modal {
  width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto;
  padding: 0; border: 1px solid var(--ligne-2); border-radius: var(--r-l);
  background: var(--bois-700); color: var(--texte); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
dialog.modal::backdrop { background: rgba(10, 6, 4, 0.7); backdrop-filter: blur(3px); }
.modal-body { padding: 22px; display: grid; gap: 16px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 14px; background: var(--bois-900); }
.tabs button { border: 0; background: transparent; padding: 10px; border-radius: 10px; font-weight: 700; color: var(--texte-2); }
.tabs button[aria-selected="true"] { background: var(--ivoire); color: var(--encre); }
.form-error { color: #FF9AA0; font-size: 14px; min-height: 1em; }
.form-note { color: var(--texte-3); font-size: 13px; }

/* ---------- Notifications ---------- */
#toasts { position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  padding: 12px 16px; border-radius: 14px; background: var(--ivoire); color: var(--encre); font-weight: 600;
  box-shadow: var(--ombre); animation: toast-in 0.25s ease; text-align: center;
}
.toast.bad { background: #FFD9DB; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

/* ---------- Avatars ---------- */
.avatar {
  --c: var(--bois-500);
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--c); color: #fff; font-weight: 800; font-size: 15px; text-transform: uppercase;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.22);
}
.avatar.sm { width: 26px; height: 26px; font-size: 12px; }
.avatar.off { filter: grayscale(1) brightness(0.7); }
.avatars { display: flex; align-items: center; }
.avatars .avatar { margin-left: -6px; border: 2px solid var(--bois-800); }
.avatars .avatar:first-child { margin-left: 0; }

/* ---------- Salle ---------- */
.room { max-width: 1180px; margin: 0 auto; padding: 12px 12px calc(16px + var(--safe-b)); display: grid; gap: 12px; }
.room-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.room-title { display: grid; line-height: 1.1; margin-right: auto; min-width: 0; }
.room-title b { font-family: var(--f-display); font-weight: 400; font-size: 22px; }
.room-title span { font-size: 13px; color: var(--texte-3); }
.code-pill {
  display: flex; align-items: center; gap: 3px; padding: 5px; border-radius: 12px;
  background: var(--bois-700); border: 1px solid var(--ligne-2);
}
.code-pill i {
  font-style: normal; width: 24px; height: 30px; display: grid; place-items: center; border-radius: 6px;
  background: var(--ivoire); color: var(--encre); font-family: var(--f-display); font-size: 18px;
  box-shadow: 0 2px 0 var(--ivoire-3);
}
.invite {
  display: grid; gap: 14px; padding: 18px; border-radius: var(--r-l);
  background: var(--bois-700); border: 1px solid var(--ligne-2);
}
.invite .tiles { max-width: 340px; pointer-events: none; }
.invite .tile { font-size: 30px; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }

.reactions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.reactions button {
  border: 1px solid var(--ligne); background: var(--bois-700); border-radius: 12px; height: 38px; min-width: 42px;
  padding: 0 10px; font-size: 18px;
}
.reactions button.txt { font-size: 13px; font-weight: 600; color: var(--texte-2); }
.float-react {
  position: fixed; z-index: 90; pointer-events: none; display: grid; justify-items: center; gap: 2px;
  animation: float-up 2.2s ease-out forwards;
}
.float-react .e { font-size: 42px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4)); }
.float-react .t { font-size: 15px; font-weight: 700; background: var(--ivoire); color: var(--encre); padding: 4px 10px; border-radius: 10px; }
.float-react small { font-size: 12px; font-weight: 700; color: var(--ivoire); text-shadow: 0 1px 3px #000; }
@keyframes float-up { 0% { transform: translate(-50%, 0) scale(0.6); opacity: 0; } 12% { transform: translate(-50%, -10px) scale(1.1); opacity: 1; } 75% { opacity: 1; } 100% { transform: translate(-50%, -110px) scale(1); opacity: 0; } }

.panel-card { padding: 18px; border-radius: var(--r-l); background: var(--bois-700); border: 1px solid var(--ligne-2); display: grid; gap: 14px; }
.lobby { display: grid; gap: 14px; max-width: 760px; margin: 0 auto; width: 100%; }
.people { display: flex; flex-wrap: wrap; gap: 8px; }
.person { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; background: var(--bois-800); border: 1px solid var(--ligne); font-weight: 600; font-size: 14px; }
.tag { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: var(--bois-500); color: var(--ivoire-2); }
.tag.host { background: var(--jaune); color: var(--encre); }

/* ---------- Mots croisés ---------- */
.cw { display: grid; gap: 12px; }
.cw-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chrono {
  display: flex; align-items: baseline; gap: 8px; padding: 8px 16px; border-radius: 14px;
  background: var(--encre); border: 1px solid var(--ligne-2); box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}
.chrono .t { font-family: var(--f-mono); font-weight: 700; font-size: 30px; letter-spacing: 0.02em; color: var(--jaune); font-variant-numeric: tabular-nums; }
.chrono .pen { font-family: var(--f-mono); font-size: 13px; color: #FF9AA0; }
.progress { display: grid; gap: 4px; flex: 1; min-width: 120px; }
.progress span { font-size: 13px; color: var(--texte-2); font-weight: 600; }
.bar { height: 8px; border-radius: 99px; background: var(--bois-900); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--vert), var(--jaune)); border-radius: 99px; transition: width 0.4s ease; }
.cw-main { display: grid; gap: 14px; align-items: start; }
@media (min-width: 980px) { .cw-main { grid-template-columns: auto minmax(300px, 1fr); } }
.cw-board { display: grid; justify-content: center; overflow: auto; padding: 4px; }
.grid {
  --cell: 34px;
  display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); grid-auto-rows: var(--cell); gap: 3px;
  padding: 10px; border-radius: 16px; background: rgba(0, 0, 0, 0.22); touch-action: manipulation; user-select: none;
}
.c { position: relative; border-radius: 6px; }
.c.l {
  background: linear-gradient(#FFF8E9, var(--ivoire-2)); box-shadow: 0 2px 0 var(--ivoire-3);
  color: var(--encre); cursor: pointer; display: grid; place-items: center;
}
.c .n { position: absolute; top: 1px; left: 3px; font-size: calc(var(--cell) * 0.27); font-weight: 700; color: #8A6E50; line-height: 1; }
.c .ch { font-weight: 800; font-size: calc(var(--cell) * 0.56); line-height: 1; text-transform: uppercase; }
.c .by { position: absolute; left: 22%; right: 22%; bottom: 3px; height: 3px; border-radius: 2px; background: var(--pc, transparent); }
.c.l.word { background: linear-gradient(#FFF0C2, #FFE08C); box-shadow: 0 2px 0 #D9B45A; }
.c.l.sel { background: var(--jaune); box-shadow: 0 2px 0 #C48A00, 0 0 0 3px var(--encre), 0 0 0 5px var(--jaune); z-index: 2; }
.c.l.ok { background: linear-gradient(#DDF6EA, #B6E6CF); box-shadow: 0 2px 0 #7FC6A4; }
.c.l.ok .ch { color: #0E5A3B; }
.c.l.ok.word { background: linear-gradient(#E9FFF4, #C7F0DC); }
.c.l.hint .ch { color: #B0262F; }
.c.l.pop { animation: pop 0.35s ease; }
@keyframes pop { 40% { transform: scale(1.18); } }
.c .cur { position: absolute; inset: -3px; border-radius: 8px; border: 3px solid var(--cc); pointer-events: none; }
.c .cur b { position: absolute; top: -15px; left: -3px; font-size: 10px; font-weight: 800; background: var(--cc); color: #fff; padding: 0 4px; border-radius: 4px; white-space: nowrap; z-index: 3; }
.clue-bar {
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 6px;
  padding: 6px; border-radius: 14px; background: var(--ivoire); color: var(--encre);
}
.clue-bar button { height: 44px; border: 0; border-radius: 10px; background: var(--ivoire-2); color: var(--encre); font-size: 20px; font-weight: 800; }
.clue-bar p { font-weight: 600; font-size: 16px; line-height: 1.25; }
.clue-bar p b { font-family: var(--f-display); font-weight: 400; margin-right: 6px; }
.cw-dock {
  position: sticky; bottom: 0; z-index: 6; display: grid; gap: 8px;
  padding: 10px 0 calc(8px + var(--safe-b));
  background: linear-gradient(rgba(32, 21, 15, 0), var(--bois-800) 14px);
}
@media (max-width: 560px) {
  .room { padding-top: 8px; gap: 10px; }
  .room-title b { font-size: 18px; }
  .code-pill { padding: 4px; gap: 2px; }
  .code-pill i { width: 18px; height: 24px; font-size: 14px; border-radius: 5px; }
  .cw-head { flex-wrap: nowrap; gap: 8px; }
  .chrono { padding: 6px 10px; }
  .chrono .t { font-size: 22px; }
  .chrono .pen { display: none; }
  .cw-head .btn.small { padding: 0 10px; font-size: 13px; }
  .progress { min-width: 0; }
  .kbd button { height: 44px; font-size: 17px; }
  .clue-bar p { font-size: 15px; }
}
.cw-clues { display: grid; gap: 12px; }
@media (min-width: 640px) and (max-width: 979px) { .cw-clues { grid-template-columns: 1fr 1fr; } }
.cw-clues section { background: var(--bois-700); border: 1px solid var(--ligne); border-radius: var(--r-m); padding: 12px; }
.cw-clues h3 { font-size: 18px; margin: 2px 4px 8px; color: var(--or); }
.cw-clues ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 42vh; overflow: auto; }
.cw-clues li { display: grid; grid-template-columns: 30px 1fr auto; gap: 6px; padding: 7px 8px; border-radius: 9px; cursor: pointer; font-size: 15px; color: var(--texte-2); }
.cw-clues li b { font-family: var(--f-display); font-weight: 400; color: var(--texte); }
.cw-clues li:hover { background: var(--bois-600); }
.cw-clues li.active { background: var(--ivoire); color: var(--encre); }
.cw-clues li.active b { color: var(--encre); }
.cw-clues li.done { color: var(--texte-3); text-decoration: line-through; text-decoration-color: rgba(31, 169, 113, 0.8); }
.cw-clues li .who { width: 10px; height: 10px; border-radius: 50%; align-self: center; background: var(--pc, transparent); }
.kbd { display: grid; gap: 6px; user-select: none; touch-action: manipulation; }
.kbd div { display: flex; gap: 5px; justify-content: center; }
.kbd button {
  flex: 1; max-width: 42px; height: 48px; border: 0; border-radius: 9px; padding: 0;
  background: var(--ivoire); color: var(--encre); font-weight: 800; font-size: 18px; box-shadow: 0 3px 0 var(--ivoire-3);
}
.kbd button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ivoire-3); }
.kbd button.wide { max-width: 64px; flex: 1.5; background: var(--ivoire-3); }
.scores { display: grid; gap: 6px; }
.score-row { display: grid; grid-template-columns: 26px 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--bois-800); text-align: left; }
.score-row .rk { font-family: var(--f-display); font-size: 20px; color: var(--or); text-align: center; }
.score-row .pts { font-family: var(--f-mono); font-weight: 700; }
.done-card { text-align: center; justify-items: center; }
.done-card .big { font-family: var(--f-mono); font-weight: 700; font-size: clamp(44px, 12vw, 72px); color: var(--jaune); line-height: 1; }
.settings-grid { display: grid; gap: 12px; }

/* ---------- Ludo ---------- */
.ludo { display: grid; gap: 10px; justify-items: center; margin: 0 auto; max-width: 100%; }
.ludo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.board-wrap { position: relative; width: 100%; aspect-ratio: 1; touch-action: manipulation; }
.board-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 18px; }
.lp {
  --c: var(--bois-500);
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-height: 64px;
  border-radius: 16px; background: var(--bois-700); border: 1px solid var(--ligne); transition: box-shadow 0.2s, background 0.2s;
}
.lp.right { flex-direction: row-reverse; text-align: right; }
.lp.active { background: linear-gradient(135deg, color-mix(in srgb, var(--c) 34%, var(--bois-700)), var(--bois-700)); box-shadow: 0 0 0 2px var(--c); }
.lp.empty { opacity: 0.35; }
.lp .who { display: grid; min-width: 0; flex: 1; line-height: 1.15; }
.lp .who b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp .who span { font-size: 12px; color: var(--texte-3); }
.lp .ring { position: relative; width: 44px; height: 44px; flex: none; }
.lp .ring svg { position: absolute; inset: -3px; width: 50px; height: 50px; transform: rotate(-90deg); }
.lp .ring .avatar { width: 44px; height: 44px; font-size: 18px; }
.die {
  --s: 46px;
  width: var(--s); height: var(--s); flex: none; border: 0; padding: 7px; border-radius: 12px;
  background: linear-gradient(#FFFBF2, var(--ivoire-2)); box-shadow: 0 4px 0 var(--ivoire-3), 0 8px 16px rgba(0, 0, 0, 0.35);
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 2px;
}
.die i { border-radius: 50%; background: var(--encre); transform: scale(0); transition: transform 0.12s; }
.die[data-f="1"] i:nth-child(5),
.die[data-f="2"] i:nth-child(1), .die[data-f="2"] i:nth-child(9),
.die[data-f="3"] i:nth-child(1), .die[data-f="3"] i:nth-child(5), .die[data-f="3"] i:nth-child(9),
.die[data-f="4"] i:nth-child(1), .die[data-f="4"] i:nth-child(3), .die[data-f="4"] i:nth-child(7), .die[data-f="4"] i:nth-child(9),
.die[data-f="5"] i:nth-child(1), .die[data-f="5"] i:nth-child(3), .die[data-f="5"] i:nth-child(5), .die[data-f="5"] i:nth-child(7), .die[data-f="5"] i:nth-child(9),
.die[data-f="6"] i:nth-child(1), .die[data-f="6"] i:nth-child(3), .die[data-f="6"] i:nth-child(4), .die[data-f="6"] i:nth-child(6), .die[data-f="6"] i:nth-child(7), .die[data-f="6"] i:nth-child(9) { transform: scale(1); }
.die[data-f="6"] i { background: var(--rouge); }
.die.rolling { animation: roll 0.12s linear infinite; }
@keyframes roll { 0% { transform: rotate(0) translateY(0); } 50% { transform: rotate(18deg) translateY(-6px); } 100% { transform: rotate(-12deg) translateY(0); } }
.die.go { animation: nudge 1.1s ease-in-out infinite; box-shadow: 0 4px 0 var(--ivoire-3), 0 0 0 4px var(--jaune), 0 8px 20px rgba(255, 190, 46, 0.45); }
@keyframes nudge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08) rotate(-4deg); } }
.die:disabled { cursor: default; }
.ludo-msg { min-height: 24px; font-weight: 600; color: var(--texte-2); text-align: center; font-size: 15px; }
.ludo-msg b { color: var(--texte); }
.seat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seat {
  --c: #888;
  display: grid; gap: 10px; align-content: space-between; min-height: 132px; padding: 14px; border-radius: 18px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 30%, var(--bois-700)), var(--bois-700) 70%);
  border: 2px solid color-mix(in srgb, var(--c) 55%, transparent);
}
.seat .sc { font-family: var(--f-display); font-size: 20px; color: var(--c); }
.seat .occ { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.seat .occ span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.podium { display: grid; gap: 8px; width: 100%; }
.overlay {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; border-radius: 18px;
  background: rgba(18, 11, 8, 0.78); backdrop-filter: blur(4px); z-index: 5;
}
.overlay .panel-card { width: min(380px, 100%); text-align: center; justify-items: center; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }

/* ---------- Admin ---------- */
.admin { max-width: 1180px; margin: 0 auto; padding: 22px 16px 48px; display: grid; gap: 18px; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.kpi { padding: 16px 18px; border-radius: var(--r-l); background: var(--bois-700); border: 1px solid var(--ligne-2); display: grid; gap: 4px; }
.kpi .lab { font-size: 13px; font-weight: 600; color: var(--texte-2); display: flex; align-items: center; gap: 8px; }
.kpi .val { font-family: var(--f-display); font-size: 44px; line-height: 1; }
.kpi .sub { font-size: 13px; color: var(--texte-3); }
.kpi.live .val { color: var(--vert); }
.admin-grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .admin-grid { grid-template-columns: 1.2fr 1fr; } }
.chart-card { padding: 18px; border-radius: var(--r-l); background: var(--bois-700); border: 1px solid var(--ligne-2); display: grid; gap: 12px; align-content: start; }
.chart-card h3 { font-size: 20px; }
.chart-card .cap { font-size: 13px; color: var(--texte-3); }
.hbar { display: grid; gap: 10px; }
.hbar .row { display: grid; grid-template-columns: 112px 1fr 56px; gap: 10px; align-items: center; font-size: 14px; }
.hbar .track { height: 26px; display: flex; align-items: center; border-left: 1px solid var(--ligne-2); }
.hbar .fill { height: 14px; min-width: 2px; border-radius: 0 4px 4px 0; transition: width 0.5s ease; }
.hbar .num { font-family: var(--f-mono); font-weight: 700; text-align: right; }
.cols { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; align-items: end; height: 150px; padding-top: 18px; }
.cols .col { position: relative; background: var(--or); border-radius: 4px 4px 0 0; min-height: 2px; }
.cols .col:hover { filter: brightness(1.15); }
.cols { border-bottom: 1px solid var(--ligne-2); }
.cols-x { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; font-size: 11px; color: var(--texte-3); text-align: center; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texte-3); font-weight: 600; padding: 6px 8px; }
table.list td { padding: 9px 8px; border-top: 1px solid var(--ligne); }
table.list td.n { font-family: var(--f-mono); }
.feed { display: grid; gap: 6px; max-height: 300px; overflow: auto; font-size: 14px; }
.feed div { padding: 7px 10px; border-radius: 10px; background: var(--bois-800); color: var(--texte-2); }
.feed time { font-family: var(--f-mono); font-size: 12px; color: var(--texte-3); margin-right: 8px; }
.leader { display: flex; align-items: center; gap: 12px; }
.leader .art { width: 54px; height: 54px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
