/* ==================================================================
   OncheChat — feuille de style
   ================================================================== */

:root {
  --bg: #0b0c0f;
  --bg-glow: #14161c;
  --surface: #131419;
  --surface-2: #191a21;
  --surface-3: #1f2028;
  --line: #23242c;
  --line-soft: #1b1c23;
  --text: #e9eaee;
  --text-dim: #a6a9b4;
  --muted: #767a86;
  --accent: #5b8ed9;
  --accent-hover: #6c9be2;
  --accent-soft: rgba(91, 142, 217, 0.13);
  --brand: #f0d264;
  --ok: #3ddc84;
  --danger: #e5534b;
  --warn: #e0a44f;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(900px 480px at 50% -10%, var(--bg-glow), transparent 70%);
  color: var(--text);
  font-family: 'Rubik', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.is-hidden { display: none !important; }

::selection { background: var(--accent-soft); color: #fff; }

/* ---------------------------------------------------------------- */
/* Logo + mot-symbole (le logo remplace le « O »)                    */
/* ---------------------------------------------------------------- */

.wordmark { display: inline-flex; align-items: center; gap: 1px; user-select: none; }

.wordmark-o {
  width: 26px; height: 26px;
  border-radius: 27%;
  display: block;
  flex: none;
  transform: translateY(0.5px);
}

.wordmark-text { font-size: 21px; font-weight: 700; letter-spacing: -0.015em; line-height: 1; }
.wordmark-accent { color: var(--accent); }

.wordmark-lg { gap: 2px; }
.wordmark-lg .wordmark-o { width: 42px; height: 42px; }
.wordmark-lg .wordmark-text { font-size: 33px; }

.wordmark-center .wordmark-o { width: 27px; height: 27px; }
.wordmark-center .wordmark-text { font-size: 22px; }

/* ---------------------------------------------------------------- */
/* Écran d'entrée                                                    */
/* ---------------------------------------------------------------- */

.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }

.login-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px 32px 30px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-sub { margin: 14px 0 24px; color: var(--muted); font-size: 14px; }
.login-error { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: 13px; }

/* ---------------------------------------------------------------- */
/* Champs, boutons, sliders                                          */
/* ---------------------------------------------------------------- */

.input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.input::placeholder { color: var(--muted); }

.input:focus {
  border-color: var(--accent);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.06s;
}

.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }

.btn-neutral { background: var(--surface-2); border-color: var(--line); }
.btn-neutral:hover { background: var(--surface-3); }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-muted {
  background: rgba(229, 83, 75, 0.14);
  border-color: rgba(229, 83, 75, 0.35);
  color: #f08a83;
}

.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.login-card .btn-block { margin-top: 12px; }

.ico {
  width: 17px; height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: #2c2d36;
  outline: none;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px; height: 13px;
  border: none;
  border-radius: 50%;
  background: #d8dae0;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

input[type='range']::-moz-range-thumb {
  width: 13px; height: 13px;
  border: none;
  border-radius: 50%;
  background: #d8dae0;
  cursor: pointer;
}

input[type='range']:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  flex: none;
}

.volume-value {
  font-size: 11.5px;
  color: var(--muted);
  min-width: 34px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- */
/* Salon : structure                                                 */
/* ---------------------------------------------------------------- */

.app { display: flex; flex-direction: column; height: 100dvh; }

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 60px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(11, 12, 15, 0.72);
  backdrop-filter: blur(12px);
  flex: none;
}

.topbar-side { display: flex; align-items: center; gap: 10px; }
.topbar-left { justify-self: start; }
.topbar-right { justify-self: end; }
.wordmark-center { justify-self: center; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-dim);
}

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.14); }

.layout {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 14px 20px 18px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 280px;
  gap: 14px;
}

/* ---------------------------------------------------------------- */
/* Panneaux                                                          */
/* ---------------------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  flex: none;
}

.panel-head h2 {
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.panel-meta { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- */
/* Vocal (colonne gauche)                                            */
/* ---------------------------------------------------------------- */

.voice-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 16px 8px;
  align-content: start;
  justify-items: center;
}

.voice-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 18px 6px;
  line-height: 1.6;
}

.voice-empty strong { display: block; color: var(--text-dim); font-weight: 500; margin-bottom: 4px; }

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 6px 4px 7px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
  animation: pop 0.22s ease-out;
}

.tile:not(.is-me) { cursor: pointer; }
.tile:not(.is-me):hover { background: var(--surface-2); border-color: var(--line-soft); }
.tile.is-selected { background: var(--surface-2); border-color: var(--line); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

@keyframes pop {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.tile-avatar {
  position: relative;
  width: 52px; height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 600;
  color: #0e0f13;
  background: var(--c, #5b8ed9);
  transition: box-shadow 0.12s ease, transform 0.12s ease;
}

.tile.is-speaking .tile-avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4.5px var(--ok); }

.tile-name {
  font-size: 11.5px;
  color: var(--text-dim);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.tile.is-me .tile-name { color: var(--text); font-weight: 500; }

.tile-badge {
  position: absolute;
  right: -3px; bottom: -2px;
  width: 21px; height: 21px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 2px solid var(--surface);
  color: var(--danger);
}

.tile-badge.is-other { color: var(--warn); }
.tile-badge .ico { width: 11px; height: 11px; stroke-width: 2.2; }

.tile-you {
  position: absolute;
  top: -5px; right: -6px;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 2px 5px;
}

.voice-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  flex: none;
}

/* Sélecteur de mode micro */
.mode-switch {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.mode-btn {
  flex: 1;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 12.5px;
  padding: 7px 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.mode-btn:hover { color: var(--text); }

.mode-btn.is-active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* Push-to-talk */
.ptt-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 12px;
  border: 1px solid rgba(91, 142, 217, 0.45);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: #a8c6f0;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.ptt-button:hover { background: rgba(91, 142, 217, 0.2); }

.ptt-button.is-pressed {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.ptt-button kbd {
  font: inherit;
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, color 0.15s;
}

.switch:hover { border-color: #33353f; color: var(--text); }

.switch input {
  appearance: none;
  width: 30px; height: 17px;
  margin: 0;
  border-radius: 999px;
  background: #2c2d36;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  flex: none;
}

.switch input::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #9a9ea8;
  transition: transform 0.15s, background 0.15s;
}

.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(13px); background: #fff; }

/* ---------------------------------------------------------------- */
/* Chat                                                              */
/* ---------------------------------------------------------------- */

.chat { flex: 1; min-height: 0; }

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 16px 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  scroll-behavior: smooth;
}

.msg {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 7px;
  font-size: 14.5px;
  line-height: 1.45;
}

.msg:hover { background: rgba(255, 255, 255, 0.02); }

.msg-time {
  flex: none;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  transform: translateY(-1px);
}

.msg-author { flex: none; font-weight: 600; font-size: 14px; }

.msg-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.msg-text {
  color: #d6d8e0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-width: 0;
}

.msg-text a { color: var(--accent); text-decoration: none; }
.msg-text a:hover { text-decoration: underline; }

.msg.is-mine .msg-author { color: var(--accent); }

.msg-embeds { display: flex; flex-wrap: wrap; gap: 8px; }

.msg-embed {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  width: min(420px, 100%);
  background: #000;
}

.msg-embed iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }

.msg-image {
  display: block;
  max-width: min(260px, 100%);
  max-height: 220px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: zoom-in;
}

.msg-image.is-zoom { max-width: min(640px, 100%); max-height: 70vh; cursor: zoom-out; }

.msg-system { display: block; text-align: center; color: var(--muted); font-size: 12px; padding: 7px 0; }

.composer {
  display: flex;
  gap: 9px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line-soft);
  flex: none;
}

.composer-input { flex: 1; }
.composer-media, .composer-send { width: 44px; padding: 0; flex: none; }

.audio-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0 14px 12px;
  padding: 11px 14px;
  border: 1px solid rgba(240, 210, 100, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(240, 210, 100, 0.1);
  color: var(--brand);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  flex: none;
}

.audio-notice:hover { background: rgba(240, 210, 100, 0.18); border-color: rgba(240, 210, 100, 0.55); }

/* ---------------------------------------------------------------- */
/* Utilisateurs                                                      */
/* ---------------------------------------------------------------- */

.users { min-height: 0; }

.user-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s, box-shadow 0.12s;
  position: relative;
}

.user:hover { background: var(--surface-2); }

.user.is-selected { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }

.user-avatar {
  position: relative;
  width: 32px; height: 32px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #0e0f13;
  background: var(--c, #5b8ed9);
}

.user.is-speaking .user-avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ok); }

.user-body { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }

.user-name { font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-status { font-size: 11px; color: var(--muted); }
.user-status.is-voice { color: var(--ok); }
.user-status.is-muted { color: var(--danger); }
.user-status.is-ignored { color: var(--warn); }

.user-icons { display: flex; align-items: center; gap: 4px; color: var(--muted); flex: none; }
.user-icons .ico { width: 14px; height: 14px; }
.user-icons .ico.is-ignored { color: var(--warn); }

/* ---------------------------------------------------------------- */
/* Popover de réglage utilisateur                                    */
/* ---------------------------------------------------------------- */

.popover {
  position: fixed;
  z-index: 60;
  width: 252px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
  padding: 12px;
}

.popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.popover-name {
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.popover-close {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex: none;
}

.popover-close:hover { color: var(--text); }

.popover .volume-row { border-top: 0; padding: 4px 0 10px; }
.popover .btn-block { font-size: 13px; padding: 9px 12px; }

/* ---------------------------------------------------------------- */
/* Modale Risibank                                                   */
/* ---------------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-card {
  width: min(940px, 100%);
  height: min(680px, 90dvh);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  flex: none;
}

.modal-head h3 { margin: 0; font-size: 14px; font-weight: 600; }

#risibank-frame { flex: 1; width: 100%; border: 0; background: #121317; }

/* ---------------------------------------------------------------- */
/* Toast                                                             */
/* ---------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13.5px;
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 80;
  max-width: min(560px, calc(100vw - 32px));
  text-align: center;
  pointer-events: none; /* un message transitoire ne doit pas bloquer les clics */
}

/* ---------------------------------------------------------------- */
/* Scrollbars                                                        */
/* ---------------------------------------------------------------- */

* { scrollbar-width: thin; scrollbar-color: #2c2d36 transparent; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2c2d36; border-radius: 99px; border: 2px solid var(--surface); }
::-webkit-scrollbar-thumb:hover { background: #383a45; }

/* ---------------------------------------------------------------- */
/* Responsive                                                        */
/* ---------------------------------------------------------------- */

@media (max-width: 1180px) {
  .layout { grid-template-columns: 264px minmax(0, 1fr) 246px; padding: 12px 16px 16px; }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 10px;
    gap: 10px;
  }

  .voice { order: 1; }
  .chat { order: 2; min-height: 0; }
  .users { order: 3; max-height: 168px; }

  .voice-body {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    max-height: 152px;
    padding: 12px;
    gap: 10px 6px;
  }

  .voice-actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .voice-actions .btn-block { width: auto; flex: 1 1 auto; }
  .mode-switch { order: -1; width: 100%; }
  .ptt-button { flex: 1 1 100%; }
  .volume-row { padding: 8px 12px 10px; }

  .user-list { flex-direction: row; flex-wrap: wrap; align-content: flex-start; }
  .user { width: calc(50% - 2px); }
}

@media (max-width: 620px) {
  .topbar { padding: 0 12px; }
  .wordmark-center .wordmark-text { font-size: 19px; }
  .wordmark-center .wordmark-o { width: 23px; height: 23px; }
  .pill { display: none; }
  .msg-text { font-size: 14px; }
  .tile-avatar { width: 46px; height: 46px; font-size: 17px; }
  .composer { padding: 10px; gap: 7px; }
  .modal { padding: 10px; }
  .modal-card { height: 86dvh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------------------------------------------------------------- */
/* Champ de saisie riche (texte + stickers)                          */
/* ---------------------------------------------------------------- */

.composer-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  max-height: 132px;
  overflow-y: auto;
  padding: 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  overflow-wrap: anywhere;
}

.composer-input:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}

.composer-input:focus {
  border-color: var(--accent);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.composer-chip {
  display: inline-block;
  height: 36px;
  max-width: 120px;
  object-fit: contain;
  vertical-align: middle;
  margin: 0 3px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  user-select: none;
}

/* ---------------------------------------------------------------- */
/* Bandeau « nouvelle version »                                      */
/* ---------------------------------------------------------------- */

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: center;
  min-width: 0;
}

.update-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(240, 210, 100, 0.5);
  background: rgba(240, 210, 100, 0.12);
  color: var(--brand);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  animation: update-blink 1.5s ease-in-out infinite;
  transition: background 0.15s, border-color 0.15s;
}

.update-btn:hover {
  background: rgba(240, 210, 100, 0.22);
  border-color: rgba(240, 210, 100, 0.85);
}

.update-btn .ico { width: 14px; height: 14px; }

@keyframes update-blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(240, 210, 100, 0.4); }
  50% { opacity: 0.5; box-shadow: 0 0 0 7px rgba(240, 210, 100, 0); }
}

@media (max-width: 860px) {
  .update-btn span { display: none; }
  .update-btn { padding: 7px 9px; }
  .brand-cluster { gap: 8px; }
}

/* ---------------------------------------------------------------- */
/* Booster et options de couleur                                     */
/* ---------------------------------------------------------------- */

.btn-booster {
  background: linear-gradient(135deg, #8b5cf6, #6d3ff0);
  border-color: rgba(139, 92, 246, 0.55);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.18), 0 6px 18px rgba(109, 63, 240, 0.22);
}

.btn-booster:hover {
  background: linear-gradient(135deg, #9b71f8, #7c4df5);
}

.btn-booster:disabled {
  background: linear-gradient(135deg, #3a3350, #2e2a40);
  border-color: var(--line);
  color: var(--text-dim);
  box-shadow: none;
  opacity: 1;
}

.modal-card-sm { width: min(460px, 100%); height: auto; max-height: 90dvh; }

.modal-body { padding: 20px 22px 22px; overflow-y: auto; }

.booster-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(109, 63, 240, 0.12));
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.booster-mark svg {
  width: 30px;
  height: 30px;
  fill: #a78bfa;
  stroke: none;
}

.booster-title {
  margin: 0 0 8px;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
}

.booster-sub {
  margin: 0 0 16px;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
}

.booster-list {
  margin: 0 0 20px;
  padding: 14px 16px 14px 30px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.7;
}

.booster-list strong { color: #b9a1ff; }

.booster-note {
  margin: 12px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
}

.options-label {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-dim);
}

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 9px;
  margin-bottom: 18px;
}

.swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s, border-color 0.15s;
}

.swatch:hover { transform: scale(1.08); }
.swatch.is-active { border-color: #fff; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(255, 255, 255, 0.25); }

.options-custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.options-custom input[type='color'] {
  width: 46px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

.options-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-size: 15px;
  font-weight: 600;
}

.options-preview-label { font-size: 11.5px; font-weight: 400; color: var(--muted); }

.user-badge-booster {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: rgba(139, 92, 246, 0.18);
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.user-badge-booster svg { width: 10px; height: 10px; fill: #a78bfa; stroke: none; }

/* ---------------------------------------------------------------- */
/* Menu « … »                                                        */
/* ---------------------------------------------------------------- */

.menu {
  position: fixed;
  z-index: 65;
  min-width: 190px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover { background: var(--surface-2); }
.menu-item .ico { color: var(--text-dim); }

.field-label {
  display: block;
  margin: 14px 0 6px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.field-label:first-child { margin-top: 0; }

.poll-inputs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

/* ---------------------------------------------------------------- */
/* Sondage                                                           */
/* ---------------------------------------------------------------- */

.msg-poll .poll,
.msg-click .clicker {
  width: min(380px, 100%);
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.poll-question {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.poll-options { display: flex; flex-direction: column; gap: 6px; }

.poll-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-dim);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, color 0.15s;
}

.poll-option:hover { border-color: #3a3c48; color: var(--text); }
.poll-option.is-mine { border-color: var(--accent); color: var(--text); }

.poll-bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent-soft);
  pointer-events: none;
  transition: width 0.3s ease;
}

.poll-option.is-mine .poll-bar { background: rgba(91, 142, 217, 0.28); }

.poll-label, .poll-score { position: relative; z-index: 1; }
.poll-score { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--muted); }

.poll-total {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------------------------------------------------------------- */
/* 1 clic =                                                          */
/* ---------------------------------------------------------------- */

.clicker-label {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.clicker-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(91, 142, 217, 0.5);
  border-radius: 10px;
  background: var(--accent-soft);
  color: #a8c6f0;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, transform 0.06s;
}

.clicker-btn:hover { background: rgba(91, 142, 217, 0.22); }
.clicker-btn:active { transform: scale(0.98); }
.clicker-btn:disabled { cursor: default; opacity: 0.6; }

.clicker-count { font-variant-numeric: tabular-nums; font-size: 17px; color: #fff; }

.clicker-foot {
  margin: 9px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* paliers de 10 clics */
@keyframes burst-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.12); box-shadow: 0 0 0 8px rgba(91, 142, 217, 0.25); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(91, 142, 217, 0); }
}

@keyframes burst-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px) rotate(-1.5deg); }
  45% { transform: translateX(5px) rotate(1.5deg); }
  70% { transform: translateX(-3px); }
}

@keyframes burst-glow {
  0% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.6); }
  50% { box-shadow: 0 0 0 12px rgba(167, 139, 250, 0); }
  100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0); }
}

.clicker.burst-1 .clicker-btn { animation: burst-pop 0.6s ease; }
.clicker.burst-2 .clicker-btn { animation: burst-shake 0.6s ease; }
.clicker.burst-3 .clicker-btn { animation: burst-glow 0.9s ease; border-color: rgba(167, 139, 250, 0.7); }

/* Résultat en rouge */
.msg-clickresult {
  display: block;
  padding: 6px 8px;
  font-size: 13.5px;
  color: #ff6b61;
  font-weight: 600;
}

.msg-clickresult strong { color: #ff9a92; font-size: 15px; }

/* Annonce Booster */
.msg-boost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  margin: 3px 0 3px 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.09);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c4b1ff;
  font-size: 13px;
  line-height: 1.4;
}

.msg-boost .ico, .msg-boost svg { width: 13px; height: 13px; }

.msg-boost strong { color: #d8caff; }
.msg-boost .ico { width: 15px; height: 15px; fill: #a78bfa; stroke: none; flex: none; }
