/* ============================================================
   GUESS WHO · THE COVEN — design system v3
   Thème violet : surfaces violettes + bordures violet plus foncé.
   Ombres douces, spacieux, rien ne déborde. Pas de noir pur.
   ============================================================ */

:root {
  /* Surfaces (violet) */
  --bg: #0a0617;
  --bg2: #0f0a20;
  --panel: #1a1136;
  --panel2: #221545;
  --panel3: #2d1c59;

  /* Bordures : violet PLUS FONCÉ (remplace le noir) */
  --line: #120a28;
  --line2: #382970;      /* trait intérieur subtil */

  --ink: #f4f1ff;
  --ink-dim: #cabff0;
  --ink-soft: #9b8fc9;

  --brand: #8b5cf6;
  --brand-2: #a78bfa;
  --brand-3: #6d3ff0;
  --good: #22c55e;
  --good-dark: #15803d;
  --bad: #f43f5e;
  --bad-dark: #be123c;
  --warn: #f5b400;
  --idk: #64748b;
  --me: #8b5cf6;

  --radius: 18px;
  --radius-sm: 13px;
  --gap: 18px;

  --shadow: 0 18px 44px -22px rgba(4, 2, 16, 0.95);
  --shadow-sm: 0 10px 26px -18px rgba(4, 2, 16, 0.95);
  --focus: 0 0 0 3px color-mix(in srgb, var(--me) 34%, transparent);
}

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

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Nunito", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
}

body { position: relative; overflow-x: hidden; }

#bgfx {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 620px at 12% -10%, rgba(139, 92, 246, 0.20), transparent 62%),
    radial-gradient(820px 620px at 112% 8%, rgba(109, 63, 240, 0.16), transparent 62%),
    radial-gradient(1000px 720px at 50% 124%, rgba(167, 139, 250, 0.10), transparent 62%),
    var(--bg);
}
#ambient-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(620px 320px at var(--glow-x, 50%) var(--glow-y, 18%), color-mix(in srgb, var(--me) 22%, transparent), transparent 70%);
  opacity: 0.42;
  transition: background 0.6s ease;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 40px;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
/* Les enfants directs sont des flex-items : sans min-width:0 ils refusent
   de rétrécir sous leur "min-content" et font déborder la page. */
.app > * { min-width: 0; }

h1, h2, h3, .display {
  font-family: "Archivo Black", "Arial Black", Arial, sans-serif;
  letter-spacing: 0.3px;
  line-height: 1.12;
}

.small { font-size: 12.5px; color: var(--ink-soft); font-weight: 700; line-height: 1.5; }
.muted { color: var(--ink-soft); }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.hidden { display: none !important; }
.mt1 { margin-top: 8px; }
.mt2 { margin-top: 16px; }

/* ---------- Boutons ---------- */
.btn {
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: 13.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(180deg, var(--me), color-mix(in srgb, var(--me) 78%, #1a0b3a));
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  max-width: 100%;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); filter: brightness(0.96); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.5); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--panel2); color: var(--ink); }
.btn.dark { background: #170f33; }
.btn.good { background: linear-gradient(180deg, #34d17a, var(--good-dark)); }
.btn.bad { background: linear-gradient(180deg, #fb6d86, var(--bad-dark)); }
.btn.warn { background: linear-gradient(180deg, #ffcb3d, #d99a00); color: #2a1a00; }
.btn.outline { background: transparent; color: var(--ink); }
.btn.small { font-size: 11.5px; padding: 8px 12px; border-radius: 11px; }
.btn.big { font-size: 16px; padding: 15px 24px; border-radius: 15px; }
.btn.icon { padding: 8px 10px; font-size: 15px; }
.btn.danger-ghost { background: transparent; color: #ffbccb; border-color: var(--bad-dark); }

/* ---------- Champs ---------- */
.input, select.input, textarea.input {
  width: 100%;
  font-family: inherit; font-weight: 800;
  font-size: 16px;
  color: var(--ink);
  background: #0c0720;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus { border-color: var(--me); box-shadow: var(--focus); }
.input::placeholder { color: #7264ab; font-weight: 600; }

.field { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Cards / panels ---------- */
.card {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card.pad { padding: 20px; }

.panel { display: flex; flex-direction: column; overflow: hidden; }
.panel > .panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--line2);
  background: color-mix(in srgb, var(--panel3) 70%, transparent);
}
.panel > .panel-head h3 { font-size: 14px; letter-spacing: 1px; text-transform: uppercase; }
.panel > .panel-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel3);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 900;
  font-size: 13px;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 3px 9px; border-radius: 8px; border: 1px solid var(--line);
  background: #170f33; color: #fff; white-space: nowrap;
}
.badge.yellow { background: #ffd60a; color: #241700; }
.badge.green { background: var(--good-dark); color: #fff; }
.badge.red { background: var(--bad-dark); color: #fff; }
.badge.slate { background: #322a55; color: #d7cfef; }

.sec-label {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 2px; color: var(--ink-dim);
  font-weight: 900;
  display: flex; align-items: center; gap: 8px;
}

.divider { display: flex; align-items: center; gap: 14px; color: var(--ink-soft); font-size: 12px; text-transform: uppercase; letter-spacing: 2px; font-weight: 900; }
.divider::before, .divider::after { content: ""; flex: 1; height: 2px; background: var(--line2); border-radius: 999px; }

.dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; }

/* ============================================================
   BRAND (logo toujours visible)
   ============================================================ */
.brand { display: inline-flex; align-items: center; gap: 9px; flex: none; min-width: 0; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  font-family: "Archivo Black", "Arial Black", sans-serif; font-size: 14px; letter-spacing: 0.5px;
  color: #fff;
  background: linear-gradient(140deg, var(--brand-2), var(--brand-3));
  border: 2px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.brand-name {
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: 16px; letter-spacing: 0.5px; white-space: nowrap;
  background: linear-gradient(90deg, #fff, var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 14px;
  position: sticky; top: 10px; z-index: 30;
  backdrop-filter: blur(8px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.progress-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--good); flex: none; }
.progress-dot.lobby { background: var(--warn); animation: pulse 1.4s infinite; }
.progress-dot.playing { background: var(--brand-2); animation: pulse 1.4s infinite; }
.progress-dot.ended { background: var(--bad); }
@keyframes pulse { 50% { transform: scale(1.4); opacity: 0.7; } }

.code-chip {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(120deg, #2f2455, #1b123a);
  border: 1px solid var(--line2); border-radius: var(--radius-sm);
  padding: 8px 10px 8px 15px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  user-select: none;
  max-width: 100%;
}
.code-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--ink-dim); font-weight: 900; }
.code-value {
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: 21px; letter-spacing: 4px;
  filter: blur(7px);
  transition: filter 0.65s ease, opacity 0.65s ease;
}
.code-chip.revealed .code-value { filter: blur(0); }
.code-chip.fading .code-value { filter: blur(7px); opacity: 0.25; }

.lang-toggle {
  display: inline-flex; border: 1px solid var(--line2); border-radius: 11px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.lang-toggle button {
  font-family: "Archivo Black"; font-size: 12px; letter-spacing: 1px;
  padding: 9px 12px; border: none; cursor: pointer;
  background: var(--panel2); color: var(--ink-soft);
}
.lang-toggle button.active { background: var(--brand-3); color: #fff; }

/* ============================================================
   ACCUEIL
   ============================================================ */
.home { display: flex; flex-direction: column; gap: 24px; max-width: 640px; margin: 2vh auto 0; width: 100%; }
.hero { text-align: center; }
.hero-title {
  font-size: clamp(52px, 12vw, 112px);
  background: linear-gradient(105deg, var(--brand-2), var(--brand), #d9caff);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 22px rgba(109, 63, 240, 0.45));
}
.hero-sub { font-size: 15px; font-weight: 900; color: var(--ink-dim); margin-top: 6px; letter-spacing: 3px; text-transform: uppercase; }

.home-card { padding: 26px; display: flex; flex-direction: column; gap: 22px; }

.ongoing { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-left: 4px solid var(--brand-2); }
.ongoing-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--good); animation: pulse 1.4s infinite; flex: none; }
.ongoing-main { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 6px; }
.ongoing-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.code-pill {
  font-family: "Archivo Black", "Arial Black", sans-serif; letter-spacing: 3px; font-size: 15px;
  background: var(--panel3); border: 1px solid var(--line2); border-radius: 9px; padding: 4px 10px;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 11px;
}
.swatch {
  aspect-ratio: 1; border-radius: 13px; border: 2px solid var(--line);
  cursor: pointer; position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease;
}
.swatch:hover { transform: scale(1.07); }
.swatch.selected { outline: 3px solid #fff; outline-offset: 2px; }
.swatch.taken { opacity: 0.3; cursor: not-allowed; filter: grayscale(0.7); }
.swatch.taken:hover { transform: none; }
.swatch .check { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 21px; }

/* ============================================================
   LOBBY & JEU
   ============================================================ */
.lobby { display: grid; gap: var(--gap); align-items: start; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr); }
.game { display: grid; gap: var(--gap); align-items: start; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr); }

/* --- Liste de joueurs (salon) : horizontale --- */
.player-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.player-grid .player-row { flex: 1 1 220px; }

.player-row {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; box-shadow: var(--shadow-sm);
}
.player-row.me { outline: 2px solid var(--me); outline-offset: 1px; }
.pname { font-weight: 900; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-row .btn.small { flex: none; }

.cats-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 13px; font-weight: 900; font-size: 13px; cursor: pointer;
  background: var(--panel2); user-select: none;
  transition: filter 0.15s ease, transform 0.08s ease;
}
.cat-toggle:hover { filter: brightness(1.18); }
.cat-toggle:active { transform: scale(0.97); }
.cat-toggle.off { opacity: 0.4; text-decoration: line-through; }

.range-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; margin: 4px 0; }
.range-row label { font-weight: 800; font-size: 14px; }
.range-row input[type="range"] { width: 100%; accent-color: var(--me); grid-column: 1 / -1; height: 22px; }
.range-val { font-family: "Archivo Black"; font-size: 15px; min-width: 52px; text-align: right; color: var(--brand-2); }

.settings-group { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: color-mix(in srgb, var(--panel2) 80%, transparent); border: 1px solid var(--line); border-radius: var(--radius-sm); }

.exclude-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.exclude-item {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 11px;
  padding: 7px 10px; cursor: pointer; font-size: 14px; font-weight: 800;
}
.exclude-item:hover { filter: brightness(1.18); }
.exclude-item img, .exclude-item .mini { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); flex: none; }
.exclude-item .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exclude-item .ex { margin-left: auto; font-size: 17px; font-weight: 900; flex: none; }
.exclude-item.excluded { opacity: 0.62; }
.exclude-item.excluded .ex { color: var(--good); }

.ready-hint { font-weight: 800; font-size: 14px; color: var(--ink-soft); text-align: center; }

.rules-list { font-size: 13.5px; font-weight: 700; line-height: 1.75; padding-left: 18px; color: var(--ink-dim); }
.rules-list li { margin-bottom: 2px; }

/* ============================================================
   BANDEAU JOUEURS (jeu) — horizontal
   ============================================================ */
.player-strip > .panel-body { padding: 14px; }
.rail { display: flex; flex-wrap: wrap; gap: 12px; }

.player-card {
  position: relative;
  flex: 1 1 210px;
  min-width: 190px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-left: 5px solid var(--pcolor, var(--line2));
  border-radius: var(--radius-sm);
  padding: 11px 12px 11px 13px;
  box-shadow: var(--shadow-sm);
  display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 11px; align-items: center;
  transition: outline-color 0.15s ease;
}
.player-card.me { outline: 2px solid var(--me); outline-offset: 1px; }
.player-card.turn { border-left-color: var(--warn); box-shadow: 0 0 0 2px color-mix(in srgb, var(--warn) 55%, transparent), var(--shadow-sm); }
.player-card.out { opacity: 0.72; }

.identity-face {
  width: 50px; height: 50px; object-fit: cover;
  border-radius: 11px; border: 1px solid var(--line);
  background: #1b1430;
}
.player-card .face-wrap { position: relative; width: 50px; height: 50px; }
.player-card .identity-face.mystery { filter: blur(4px) brightness(0.75); }
.face-mystery-tag {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: "Archivo Black"; font-size: 22px; color: rgba(255,255,255,0.92);
  text-shadow: 0 2px 6px rgba(8, 3, 24, 0.65);
}
.pc-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.prow-top { display: flex; align-items: center; gap: 7px; min-width: 0; padding-right: 20px; }
.prow-top .badge { flex: none; }
.prow-name { font-weight: 900; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-pseudo { font-size: 12px; color: var(--ink-soft); font-weight: 800; }
.identity-name { font-size: 13.5px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ident-cat { font-size: 10.5px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kick-btn {
  position: absolute; top: 7px; right: 7px;
  width: 24px; height: 24px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; line-height: 1; cursor: pointer;
  color: #ffc9d4; background: color-mix(in srgb, var(--bad-dark) 34%, transparent);
  border: 1px solid color-mix(in srgb, var(--bad) 55%, transparent);
  transition: background 0.15s ease, color 0.15s ease;
}
.kick-btn:hover { background: var(--bad-dark); color: #fff; }

/* Zone centrale */
.center-col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

.big-question {
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: clamp(21px, 3vw, 30px);
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.answer-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.answer-btn {
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 15px 8px; font-family: "Archivo Black"; font-size: 13.5px; letter-spacing: 1px;
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease, filter 0.15s ease;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 2px rgba(8, 3, 24, 0.45);
}
.answer-btn:hover { filter: brightness(1.12); transform: translateY(-2px); }
.answer-btn:active { transform: translateY(1px); }
.answer-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.answer-btn.yes { background: linear-gradient(180deg, #2fbf6b, var(--good-dark)); }
.answer-btn.no { background: linear-gradient(180deg, #fb6d86, var(--bad-dark)); }
.answer-btn.maybe { background: linear-gradient(180deg, #ffcb3d, #dc9e00); color: #2a1a00; text-shadow: none; }
.answer-btn.idk { background: linear-gradient(180deg, #7c8aa5, var(--idk)); }
.answer-btn .emo { display: block; font-size: 23px; margin-bottom: 4px; }

.timer-bar { height: 10px; background: #0b0716; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.timer-fill { height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); width: 100%; transition: width 0.25s linear, background 0.2s ease; border-radius: 999px; }
.timer-txt { font-size: 12px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-soft); display: flex; justify-content: space-between; margin-top: 6px; }

.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.result-col { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 8px; text-align: center; }
.result-col .rc-label { font-family: "Archivo Black"; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.result-col .rc-count { font-family: "Archivo Black"; font-size: 27px; margin: 4px 0; }
.result-col.yes .rc-count { color: #4ade80; }
.result-col.no .rc-count { color: #fb7185; }
.result-col.maybe .rc-count { color: #fbbf24; }
.result-col.idk .rc-count { color: #cbd5e1; }
.result-people { display: flex; justify-content: center; gap: 5px; flex-wrap: wrap; margin-top: 6px; min-height: 15px; }
.result-people .mini-dot { width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--line); }
.result-people .none { color: var(--ink-soft); font-size: 12px; }

.points-flash { font-family: "Archivo Black"; font-size: 18px; color: #4ade80; animation: pop-in 0.35s ease; }
@keyframes pop-in { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.tpl-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.tpl {
  border: 1px solid var(--line); background: var(--panel2); color: var(--ink);
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 800; cursor: pointer;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tpl:hover { background: var(--panel3); }

/* log */
.log-line { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line2); }
.log-line:last-child { border-bottom: none; }
.log-tag { flex: none; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 14px; background: var(--panel3); }
.log-q { font-weight: 900; min-width: 0; }
.log-q .qtext { font-size: 15px; overflow-wrap: anywhere; }
.log-answers { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.log-a { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 900; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.log-a.yes { background: rgba(34,197,94,0.22); color: #b7ffd2; }
.log-a.no { background: rgba(244,63,94,0.22); color: #ffc4cf; }
.log-a.maybe { background: rgba(245,158,11,0.22); color: #ffe3ae; }
.log-a.idk { background: rgba(124,141,166,0.22); color: #d3dae6; }
.log-score { font-family: "Archivo Black"; font-size: 13px; color: #4ade80; margin-top: 5px; }
.log-sys { color: var(--ink-soft); font-weight: 800; font-size: 13px; }
.log-msg { font-size: 14px; font-weight: 800; overflow-wrap: anywhere; }
.log-ok { color: #4ade80; }
.log-bad { color: #fb7185; }

/* ============================================================
   CHAT (délimité)
   ============================================================ */
.chat-panel > .panel-body { padding: 14px; }
.chat-list {
  background: #0a0518;
  border: 1px solid var(--line2);
  border-radius: var(--radius-sm);
  overflow-y: auto; display: flex; flex-direction: column; gap: 9px; padding: 13px;
  height: 380px;
  box-shadow: inset 0 2px 14px rgba(6, 2, 20, 0.55);
}
.chat-msg { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.chat-msg .dot { margin-top: 4px; }
.chat-bubble {
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 4px 13px 13px 13px; padding: 8px 12px;
  font-weight: 700; font-size: 14px; overflow-wrap: anywhere; max-width: 100%;
}
.chat-bubble .who { font-weight: 900; font-size: 12px; margin-bottom: 3px; }
.chat-sys { align-self: center; font-size: 12px; color: var(--ink-soft); font-weight: 800; text-align: center; max-width: 92%; }
.chat-row { display: flex; gap: 8px; }
.chat-row input { flex: 1; min-width: 0; }

.tabs { display: flex; gap: 8px; }
.tab {
  flex: 1; text-align: center; font-family: "Archivo Black"; font-size: 13px; letter-spacing: 1px;
  border: 1px solid var(--line); border-radius: 11px; padding: 10px; cursor: pointer;
  background: var(--panel2); text-transform: uppercase; color: var(--ink-soft);
}
.tab.active { background: var(--brand-3); color: #fff; }

/* guess / giveup / host actions */
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; }
.action-btn {
  border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 13px 18px;
  font-family: "Archivo Black"; font-size: 14.5px; letter-spacing: 0.5px; cursor: pointer; color: #fff;
  box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 8px;
  transition: transform 0.08s ease, filter 0.15s ease;
  max-width: 100%;
}
.action-btn:hover { filter: brightness(1.1); }
.action-btn:active { transform: translateY(1px); }
.action-btn.guess { background: linear-gradient(120deg, #ffd60a, #ff9f1c); color: #271500; }
.action-btn.giveup { background: #171225; }
.action-btn.dark { background: linear-gradient(180deg, var(--panel3), var(--panel2)); }
.action-btn.end { background: linear-gradient(180deg, #fb6d86, var(--bad-dark)); }
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.action-btn .nudge { font-size: 11px; background: var(--brand-3); color: #fff; border-radius: 8px; padding: 2px 8px; margin-left: 4px; }

.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
.cast-item { text-align: center; min-width: 0; }
.cast-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.cast-item .ci-name { font-size: 12px; font-weight: 900; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cast-item .ci-cat { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   SCOREBOARD
   ============================================================ */
.podium { display: flex; flex-direction: column; gap: 12px; }
.podium-row {
  display: flex; align-items: center; gap: 14px; min-width: 0;
  background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: 16px;
  padding: 13px 15px; box-shadow: var(--shadow-sm);
}
.podium-row.p1 { background: linear-gradient(120deg, #3a2f10, var(--panel2)); border-color: #ffd60a; }
.podium-rank { font-family: "Archivo Black"; font-size: 25px; width: 52px; text-align: center; flex: none; }
.podium-ident { flex: none; }
.podium-ident img { width: 60px; height: 60px; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.podium-main { flex: 1; min-width: 0; }
.podium-score { font-family: "Archivo Black"; font-size: 21px; flex: none; text-align: right; }
.podium-pts { font-size: 12px; color: var(--ink-soft); font-weight: 800; }
.confetti { position: fixed; width: 12px; height: 12px; z-index: 5; pointer-events: none; animation: confetti-fall linear infinite; }
@keyframes confetti-fall {
  from { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.6; }
}

/* ============================================================
   MODALES / TOASTS / TOOLTIP
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(6, 3, 14, 0.76);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  backdrop-filter: blur(4px);
  animation: fade-in 0.15s ease;
}
.modal {
  width: min(660px, 100%);
  max-height: 88vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line2); border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex; flex-direction: column; gap: 16px;
  animation: modal-pop 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modal-pop { from { transform: scale(0.88) translateY(14px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
.modal h2 { font-size: 21px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-close { background: var(--bad-dark); border: 1px solid var(--line); border-radius: 10px; width: 36px; height: 36px; cursor: pointer; color: #fff; font-weight: 900; font-size: 15px; flex: none; }
.legal { display: flex; flex-direction: column; gap: 12px; }
.legal p { font-size: 13.5px; font-weight: 700; line-height: 1.65; color: var(--ink-dim); }

#toasts { position: fixed; top: 14px; right: 14px; z-index: 90; display: flex; flex-direction: column; gap: 10px; width: min(360px, 86vw); pointer-events: none; }
.toast {
  background: linear-gradient(180deg, var(--panel3), var(--panel2)); border: 1px solid var(--line2); border-radius: 13px;
  padding: 12px 14px; font-weight: 900; font-size: 14px;
  box-shadow: var(--shadow); animation: toast-in 0.25s cubic-bezier(0.34,1.56,0.64,1);
  display: flex; gap: 9px; align-items: center;
}
.toast.out { animation: toast-out 0.3s ease forwards; }
.toast .t-icon { font-size: 19px; flex: none; }
.toast.success { border-color: var(--good); }
.toast.error { border-color: var(--bad); }
@keyframes toast-in { from { transform: translateX(120%); opacity: 0; } }
@keyframes toast-out { to { transform: translateX(120%); opacity: 0; } }

/* Tooltip global (position:fixed → jamais coupé) */
.gw-tip {
  position: fixed; z-index: 120; pointer-events: none;
  background: #150e2e; color: #fff; font-family: "Nunito", sans-serif; font-weight: 800; font-size: 12.5px;
  padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line2);
  max-width: 260px; text-align: center;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.gw-tip.show { opacity: 1; transform: translateY(0); }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #3a2f63; border: 2px solid var(--line); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* shake pour erreur */
.shake { animation: shake 0.3s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.sound-toggle {
  position: fixed; bottom: 16px; right: 16px; z-index: 40;
  width: 46px; height: 46px; border-radius: 13px;
  border: 1px solid var(--line2); background: var(--panel2); color: #fff;
  font-size: 19px; cursor: pointer; box-shadow: var(--shadow-sm);
}
.sound-toggle.muted { opacity: 0.55; }

.spin { display: inline-block; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  max-width: 1200px;
  margin: 8px auto 0;
  padding: 20px 20px 28px;
  border-top: 1px solid var(--line2);
  display: flex; flex-direction: column; gap: 8px;
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.footer-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.footer-left strong { font-family: "Archivo Black"; letter-spacing: 0.3px; }
.footer-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.footer-link {
  background: transparent; border: 1px solid var(--line2); border-radius: 9px;
  color: var(--ink-dim); font-family: inherit; font-weight: 800; font-size: 12.5px;
  padding: 6px 11px; cursor: pointer;
}
.footer-link:hover { background: var(--panel2); color: #fff; }
.footer-note { font-size: 11.5px; color: var(--ink-soft); font-weight: 700; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .game { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .lobby { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --gap: 14px; }
  .app { padding: 14px 12px 32px; }
  .site-footer { padding: 16px 12px 24px; }
  .home-card { padding: 18px; }
  .answer-buttons { grid-template-columns: repeat(2, 1fr); }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { position: static; }
  .brand-name { display: none; }
  .player-card { flex: 1 1 160px; min-width: 150px; }
  .chat-list { height: 300px; }
  /* les gros boutons passent à la ligne au lieu de déborder */
  #end-actions .btn, .actions-row .action-btn { flex: 1 1 100%; white-space: normal; }
  .btn.big { font-size: 14px; padding: 13px 16px; }
}
@media (max-width: 400px) {
  .player-card { flex: 1 1 100%; }
}
