/* ============================================================
   JDR Compagnon — Direction artistique « Grimoire & Or »
   Typo : Cinzel (titres gravés) + Alegreya (texte de manuel)
   Palette : encre profonde, or vieilli, rouge héraldique
   ============================================================ */
:root {
  --bg: #131019;
  --bg2: #1a1524;
  --panel: #221b30;
  --panel2: #2a2140;
  --border: #3d3355;
  --border-gold: #6e5a33;
  --text: #ece5d8;
  --muted: #9c92b8;
  --accent: #d4a24c;
  --accent-bright: #eec575;
  --accent2: #9b7fd4;
  --danger: #a4333f;
  --danger-bright: #c94f5c;
  --ok: #5fae7d;
  --gold-grad: linear-gradient(160deg, #eec575 0%, #d4a24c 45%, #a87b2e 100%);
  --serif: 'Alegreya', Georgia, serif;
  --display: 'Cinzel', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.45;
}
h1, h2, h3 { font-family: var(--display); letter-spacing: 0.03em; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); text-decoration: underline; }

/* ---- Barres de défilement assorties ---- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-gold); }

/* ---- Boutons ---- */
button {
  background: var(--gold-grad);
  color: #241a08;
  border: none;
  border-radius: 7px;
  padding: 8px 15px;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--serif);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform .08s ease, box-shadow .08s ease, filter .08s ease;
}
button:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.25); }
button:active { transform: translateY(0); }
button:disabled { filter: grayscale(0.7) brightness(0.8); cursor: default; transform: none; }
button.secondary {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  font-weight: 600;
}
button.secondary:hover { border-color: var(--border-gold); color: var(--accent-bright); }
button.danger { background: linear-gradient(160deg, #c94f5c, #a4333f 70%); color: #fff; }

input, select, textarea {
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: var(--serif);
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(212,162,76,0.18);
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }

/* ============ Page connexion ============ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(155,127,212,0.14) 0%, transparent 60%),
    radial-gradient(ellipse 60% 45% at 50% 105%, rgba(212,162,76,0.10) 0%, transparent 60%),
    var(--bg);
}
.auth-card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg2) 100%);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.5), inset 0 1px 0 rgba(238,197,117,0.12);
  padding: 34px 32px;
  width: 370px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.auth-card::before {
  content: '❖';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  color: var(--accent);
  padding: 0 12px;
  font-size: 16px;
}
.auth-card h1 {
  margin: 0 0 2px;
  text-align: center;
  font-size: 27px;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-card .subtitle { text-align: center; margin: 0 0 12px; font-style: italic; }
.error-msg { color: var(--danger-bright); font-size: 13px; min-height: 18px; margin: 0; }

/* ---- Choix de rôle ---- */
.role-choice { display: flex; gap: 10px; margin-bottom: 6px; }
.role-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
  background: var(--bg2);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 12px 8px;
  font-weight: normal;
  box-shadow: none;
}
.role-btn .role-icon { font-size: 27px; }
.role-btn .muted { font-size: 11px; }
.role-btn.selected {
  border-color: var(--accent);
  background: var(--panel2);
  box-shadow: 0 0 14px rgba(212,162,76,0.25);
}
.recovery-code {
  font-family: Consolas, monospace;
  font-size: 30px;
  letter-spacing: 6px;
  text-align: center;
  color: var(--accent-bright);
  background: var(--bg2);
  border: 1px dashed var(--accent);
  border-radius: 8px;
  padding: 14px;
  margin: 8px 0;
  user-select: all;
}

/* ============ Barre du haut ============ */
header.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg2) 100%);
  border-bottom: 1px solid var(--border-gold);
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
header.topbar h1 {
  font-size: 19px;
  margin: 0;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
header.topbar .spacer { flex: 1; }
.badge {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 13px;
  font-size: 13px;
  color: var(--muted);
}
.badge b { color: var(--accent); }

/* ============ Lobby ============ */
.lobby-main {
  max-width: 900px;
  margin: 26px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg2) 130%);
  border: 1px solid var(--border);
  border-top: 1px solid var(--border-gold);
  border-radius: 11px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}
.card h2 { margin: 0 0 12px; font-size: 16px; color: var(--accent); }
.card.full { grid-column: 1 / -1; }
.game-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.game-row:last-child { border-bottom: none; }
.game-row .name { flex: 1; font-size: 16px; }
.tag {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 10px;
  background: var(--accent2);
  color: #fff;
  font-family: var(--serif);
}
.tag.done { background: var(--ok); color: #0d2417; }
table.board { width: 100%; border-collapse: collapse; }
table.board td, table.board th { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--border); }
table.board th { font-family: var(--display); font-size: 12px; color: var(--accent); font-weight: 600; }
table.board tr:first-child + tr td { color: var(--accent-bright); }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; }

/* ============ Page de jeu ============ */
.game-body { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.game-main { flex: 1; display: flex; min-height: 0; }
#board-wrap { flex: 1; position: relative; background: #0d0a14; }
#board-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 60px 18px rgba(0,0,0,0.55);
}
#board { width: 100%; height: 100%; display: block; cursor: grab; }

/* ---- Panneau latéral gauche ---- */
.left-panel {
  width: 272px;
  min-width: 272px;
  overflow-y: auto;
  background: var(--bg2);
  border-right: 1px solid var(--border-gold);
}
.left-panel.collapsed { display: none; }
.left-panel details { border-bottom: 1px solid var(--border); }
.left-panel summary {
  cursor: pointer;
  padding: 12px 14px;
  font-family: var(--display);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
  user-select: none;
  transition: background .1s ease;
}
.left-panel summary:hover { background: rgba(212,162,76,0.06); color: var(--accent-bright); }
.left-panel summary::-webkit-details-marker { display: none; }
.left-panel summary::after { content: '❖'; float: right; color: var(--border-gold); font-size: 11px; transition: transform .15s; }
.left-panel details[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.panel-body {
  padding: 4px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.panel-body label { display: flex; flex-direction: column; gap: 3px; color: var(--muted); }
.panel-body label.row { flex-direction: row; align-items: center; gap: 8px; }
.panel-body .row { display: flex; align-items: center; gap: 6px; }
.panel-body .row input[type="text"] { flex: 1; min-width: 0; }
.panel-body hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }
.panel-body p.muted { margin: 0; font-size: 11.5px; font-style: italic; }
.file-btn {
  display: inline-block;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
  color: var(--text) !important;
  text-align: center;
  transition: border-color .1s ease;
}
.file-btn:hover { border-color: var(--accent); }
.file-btn input[type="file"] { display: none; }

/* ---- Panneau droit ---- */
aside.sidebar.collapsed { display: none; }
aside.sidebar {
  width: 360px;
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border-left: 1px solid var(--border-gold);
  min-height: 0;
}
.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tabs button {
  flex: 1;
  background: none;
  color: var(--muted);
  border: none;
  border-radius: 0;
  padding: 11px 6px;
  font-size: 13.5px;
  font-family: var(--display);
  font-weight: 600;
  box-shadow: none;
}
.tabs button:hover { transform: none; color: var(--text); }
.tabs button.active { color: var(--accent); border-bottom: 2px solid var(--accent); background: rgba(212,162,76,0.05); }
.tab-content { flex: 1; overflow-y: auto; padding: 12px; min-height: 0; }

/* ---- Chat & dés ---- */
#tab-chat { display: flex; flex-direction: column; }
#messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.msg {
  padding: 7px 11px;
  border-radius: 8px;
  background: var(--panel);
  word-wrap: break-word;
  border-left: 2px solid var(--border);
}
.msg .author { font-weight: 700; color: var(--accent2); }
.msg.roll {
  border: 1px solid var(--border-gold);
  border-left: 3px solid var(--accent);
  background: linear-gradient(100deg, rgba(212,162,76,0.10) 0%, var(--panel) 55%);
  animation: rollIn .45s ease;
}
.msg.roll .total {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--display);
  color: var(--accent-bright);
  text-shadow: 0 0 12px rgba(238,197,117,0.35);
}
@keyframes rollIn {
  0% { transform: translateY(6px); opacity: 0; box-shadow: 0 0 0 rgba(238,197,117,0); }
  55% { box-shadow: 0 0 18px rgba(238,197,117,0.35); }
  100% { transform: translateY(0); opacity: 1; box-shadow: 0 0 0 rgba(238,197,117,0); }
}
.msg.system { background: none; border: none; color: var(--muted); font-style: italic; font-size: 13px; }
#chat-form { display: flex; gap: 6px; margin-top: 8px; }
#chat-form input { flex: 1; }
.dice-bar { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.dice-bar button {
  background: var(--panel2);
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 4px 9px;
  font-size: 12px;
  font-family: var(--display);
  font-weight: 700;
  box-shadow: none;
}
.dice-bar button:hover { border-color: var(--accent); transform: translateY(-1px); }

/* ---- Fiche de personnage ---- */
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.sheet-grid label, .field label {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--display);
}
.sheet-grid input { width: 100%; }
.abilities { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.ability {
  background: linear-gradient(180deg, var(--panel2) 0%, var(--panel) 100%);
  border: 1px solid var(--border);
  border-top-color: var(--border-gold);
  border-radius: 9px;
  padding: 8px;
  text-align: center;
}
.ability .ab-name { font-size: 10px; color: var(--muted); text-transform: uppercase; font-family: var(--display); letter-spacing: 0.05em; }
.ability input { width: 54px; text-align: center; margin: 4px 0; }
.ability .mod { font-weight: 700; font-size: 17px; font-family: var(--display); color: var(--accent-bright); }
.ability .roll-btn { padding: 2px 8px; font-size: 11px; margin-top: 4px; background: var(--bg2); color: var(--accent); border: 1px solid var(--border); box-shadow: none; }
.skills-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.skill-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.skill-row .sk-bonus { color: var(--accent); width: 30px; text-align: right; font-weight: 700; }
.skill-row .sk-roll { padding: 1px 6px; font-size: 11px; background: var(--bg2); color: var(--accent); border: 1px solid var(--border); box-shadow: none; }
.field { margin-bottom: 10px; }
.field textarea { width: 100%; min-height: 70px; resize: vertical; }
.save-row { position: sticky; bottom: 0; background: var(--bg2); padding: 8px 0; }

/* ---- Joueurs ---- */
.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-bottom: 1px solid var(--border);
}
.member-row .m-name { flex: 1; font-size: 15px; }

/* ---- Sons ---- */
.sound-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.sound-row .s-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound-row button { padding: 2px 8px; font-size: 12px; background: var(--panel2); color: var(--accent); border: 1px solid var(--border); box-shadow: none; }
.sound-row button.playing {
  background: var(--gold-grad);
  color: #241a08;
  animation: pulse 1.6s ease infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,162,76,0.4); }
  50% { box-shadow: 0 0 10px 2px rgba(212,162,76,0.4); }
}
#sound-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold-grad);
  color: #241a08;
  padding: 9px 18px;
  border-radius: 20px;
  font-weight: 700;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

/* ---- Modale ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,3,10,0.72);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg2) 130%);
  border: 1px solid var(--border-gold);
  border-radius: 13px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  padding: 20px;
  width: 370px;
  max-height: 88vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal h2 { margin: 0 0 6px; font-size: 16px; color: var(--accent); }
.modal label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.modal label.row { flex-direction: row; align-items: center; gap: 8px; }
.modal .row { display: flex; gap: 8px; }
.modal p.muted { margin: 0; font-size: 11px; font-style: italic; }

/* ---- Visio ---- */
#video-panel { height: 280px; background: #000; border-top: 1px solid var(--border-gold); }
#video-panel iframe { width: 100%; height: 100%; border: none; }

/* ---- Initiative ---- */
.init-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 5px;
  cursor: default;
  background: var(--panel);
}
.init-row.active {
  border-color: var(--accent);
  background: linear-gradient(100deg, rgba(212,162,76,0.15) 0%, var(--panel) 60%);
  box-shadow: 0 0 10px rgba(212,162,76,0.2);
}
.init-row .init-arrow { width: 16px; color: var(--accent-bright); }
.init-row .init-name { flex: 1; font-size: 15px; }
.init-row .init-val {
  font-family: var(--display);
  font-weight: 700;
  color: var(--accent);
  min-width: 26px;
  text-align: right;
}
.init-row .init-del { padding: 1px 7px; font-size: 11px; background: var(--bg2); color: var(--danger-bright); border: 1px solid var(--border); box-shadow: none; }

/* ---- États des pions (modale) ---- */
.status-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.status-cell {
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-direction: row !important;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 0;
  cursor: pointer;
  font-size: 16px;
}
.status-cell input { display: none; }
.status-cell:has(input:checked) { border-color: var(--accent); background: rgba(212,162,76,0.15); }

/* ---- Emplacements de sorts ---- */
.slots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.slot-cell {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 6px;
}
.slot-cell input { width: 34px; padding: 3px 4px; text-align: center; }
.death-saves { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }

/* ---- Jets spéciaux ---- */
.msg.gmroll { border-left: 3px solid var(--accent2); background: linear-gradient(100deg, rgba(155,127,212,0.12) 0%, var(--panel) 55%); }
.msg .crit { color: var(--accent-bright); font-weight: 700; }
.msg .fumble { color: var(--danger-bright); font-weight: 700; }

/* ---- Scènes & documents ---- */
.sound-row.scene-active { background: rgba(212,162,76,0.08); border-radius: 6px; padding-left: 4px; }
.modal.handout-view { width: min(640px, 92vw); }

/* Sélecteur de personnage global */
#charpick-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; margin: 6px 0 10px; }
.charpick-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel2); cursor: pointer; text-align: left; color: var(--text); transition: border-color .12s, transform .12s; }
.charpick-card:hover { border-color: var(--border-gold); transform: translateX(2px); }
.charpick-card img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border-gold); flex: none; }
.charpick-card .cp-ava { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bg2); border: 1px solid var(--border); flex: none; font-size: 18px; }
.charpick-card .cp-info { flex: 1; min-width: 0; }
.charpick-card .cp-name { font-weight: 600; color: var(--accent-bright); }
.charpick-card .cp-sub { font-size: 12px; color: var(--muted); }
.sheet-import-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; margin-bottom: 12px; border: 1px solid var(--border-gold); border-radius: 8px; background: var(--panel2); font-size: 13px; }
.sheet-import-banner button { padding: 5px 10px; font-size: 12px; }
.modal.handout-view img { max-width: 100%; max-height: 62vh; object-fit: contain; border-radius: 8px; border: 1px solid var(--border-gold); }
.modal.handout-view #hm-text {
  white-space: pre-wrap;
  font-size: 16px;
  font-style: italic;
  background: var(--bg2);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 14px;
  max-height: 55vh;
  overflow-y: auto;
}

/* ---- Lecteurs YouTube cachés (audio seulement) ---- */
#yt-holder {
  position: absolute;
  left: -9999px;
  bottom: 0;
  width: 2px;
  height: 2px;
  overflow: hidden;
  opacity: 0.01;
  pointer-events: none;
}

/* ---- Catégories de sons ---- */
.sound-cat {
  margin: 8px 0 2px;
  font-family: var(--display);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.05em;
}

/* ---- Roue de bruitages (MJ) ---- */
#sfx-wheel {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 6;
  width: 190px;
  height: 190px;
  pointer-events: none;
}
#sfx-wheel button { pointer-events: auto; }
#sfx-wheel-toggle {
  position: absolute;
  right: 65px;
  bottom: 65px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 24px;
  padding: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.55);
}
#sfx-wheel-slots { position: absolute; inset: 0; }
.sfx-slot {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  padding: 0;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--panel2);
  color: var(--accent-bright);
  border: 1px solid var(--border-gold);
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
}
.sfx-slot.empty { color: var(--muted); border-color: var(--border); }
/* 6 slots en cercle autour du bouton central */
.sfx-slot[data-i="0"] { right: 69px; bottom: 138px; }
.sfx-slot[data-i="1"] { right: 8px;  bottom: 103px; }
.sfx-slot[data-i="2"] { right: 8px;  bottom: 33px; }
.sfx-slot[data-i="3"] { right: 69px; bottom: 0; }
.sfx-slot[data-i="4"] { right: 130px; bottom: 33px; }
.sfx-slot[data-i="5"] { right: 130px; bottom: 103px; }

/* ---- Assistant de création de personnage ---- */
.modal.wizard { width: min(680px, 94vw); }
.wz-progress { display: flex; gap: 6px; justify-content: center; margin-bottom: 4px; }
.wz-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--border);
}
.wz-dot.on { background: var(--accent-bright); box-shadow: 0 0 8px rgba(238,197,117,0.6); }
.wz-dot.done { background: var(--accent); }
.wz-guide {
  background: linear-gradient(100deg, rgba(155,127,212,0.12) 0%, var(--panel) 60%);
  border-left: 3px solid var(--accent2);
  border-radius: 8px;
  padding: 9px 12px;
  font-style: italic;
  font-size: 13.5px;
}
.wz-step-title { margin: 6px 0; font-size: 14px; color: var(--accent); }
.wz-nav { margin-top: 8px; }
.wz-choice {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 13.5px;
}
.wz-choice:hover { border-color: var(--border-gold); }
.wz-choice.selected { border-color: var(--accent); background: rgba(212,162,76,0.10); }
.wz-choice input { margin-right: 6px; }
.wz-choice .muted { display: block; font-size: 12px; }
.wz-ext { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.wz-ab-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.7fr 0.7fr;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13.5px;
}
.wz-ab-head { color: var(--muted); font-size: 11px; text-transform: uppercase; font-family: var(--display); }
.wz-ab-row input, .wz-ab-row select { width: 74px; }
.wz-ab-final { font-weight: 700; color: var(--accent-bright); font-size: 16px; }
.wz-ab-mod { color: var(--accent); font-weight: 700; }
.wz-ab-bonus { color: var(--muted); }
.wz-ab-prim { background: rgba(212,162,76,0.07); border-radius: 6px; }
.wz-ab-info { color: var(--muted); font-size: 10.5px; line-height: 1.3; display: block; font-style: italic; }
.wz-sk-info { color: var(--muted); font-size: 11px; font-style: italic; }

/* Correctif : dans les modales, les lignes de compétences restent en LIGNE
   (la règle générique .modal label les passait en colonne) */
.modal .skill-row, .modal label.skill-row {
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
}
.wz-skills .wz-skill {
  border-bottom: 1px dashed var(--border);
  padding: 5px 2px;
  cursor: pointer;
  font-size: 13.5px;
}
.wz-skill input { margin: 0; flex-shrink: 0; }
.wz-skill .wz-sk-name { flex: 1; }
.wz-skill-locked { opacity: 0.75; background: rgba(95,174,125,0.06); }
.wz-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  font-family: var(--display);
  letter-spacing: 0.03em;
}
.wz-badge-class { background: var(--accent2); color: #fff; }
.wz-badge-bg { background: var(--ok); color: #0d2417; }
.wz-badge-rec { background: var(--gold-grad); color: #241a08; }
.wz-badge-off { background: var(--bg2); color: var(--muted); border: 1px solid var(--border); }
.wz-rec { display: block; color: var(--accent-bright); font-size: 12px; margin: 2px 0; }
.wz-cat { font-family: var(--display); color: var(--accent); font-size: 13px; margin: 10px 0 4px; }
.wz-spell { align-items: flex-start !important; }
.wz-spell input { margin-top: 4px; }
.wz-ac-display {
  font-size: 15px;
  background: rgba(212,162,76,0.08);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 8px 0;
}
.wz-ac-display b { font-size: 20px; color: var(--accent-bright); }
.wz-hint { padding: 0 7px; font-size: 12px; box-shadow: none; }

/* ---- Boutique d'équipement (assistant) ---- */
.wz-shop-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  background: var(--bg2);
}
.wz-shop-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.wz-shop-row:last-child { border-bottom: none; }
.wz-shop-name { flex: 1; }
.wz-shop-price { white-space: nowrap; }
.wz-shop-qty { color: var(--accent-bright); font-weight: 700; min-width: 26px; text-align: right; }
.wz-shop-plus { padding: 2px 9px; font-size: 13px; }
.wz-equip-detail {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--bg2);
  margin-bottom: 8px;
}
.wz-equip-line { padding: 4px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.wz-equip-line:last-child { border-bottom: none; }

/* ---- Portrait & token (assistant) ---- */
.wz-portrait-zone { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.wz-portrait-previews { display: flex; gap: 8px; align-items: center; }
.wz-portrait-box {
  width: 84px;
  height: 110px;
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  text-align: center;
  font-size: 10px;
}
.wz-portrait-box img { width: 100%; height: 100%; object-fit: cover; }
.wz-token-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  font-size: 9px;
  text-align: center;
}
.wz-token-box img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Verrou de la vue ---- */
#view-lock {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  font-size: 17px;
}
#view-lock.locked { border-color: var(--accent); box-shadow: 0 0 10px rgba(212,162,76,0.4); }

/* ---- Roue en cours de déplacement ---- */
#sfx-wheel.dragging { outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: 50%; }

@media (max-width: 800px) {
  .lobby-main { grid-template-columns: 1fr; }
  aside.sidebar { width: 300px; }
  .left-panel { width: 240px; min-width: 240px; }
}

/* Pastille d'état de connexion temps réel */
.conn-badge { font-weight: 600; letter-spacing: .2px; border: 1px solid transparent; }
.conn-badge.conn-on   { color: #7fe08a; background: rgba(60,180,90,0.12);  border-color: rgba(60,180,90,0.4); }
.conn-badge.conn-wait { color: #f0c674; background: rgba(230,180,60,0.12);  border-color: rgba(230,180,60,0.4); }
.conn-badge.conn-off  { color: #ff8a8a; background: rgba(200,60,60,0.14);   border-color: rgba(200,60,60,0.5); }
.conn-badge.conn-wait { animation: conn-blink 1s ease-in-out infinite; }
@keyframes conn-blink { 50% { opacity: .45; } }

/* Armes (fiche en jeu) */
.wpn-section { border-top:1px solid var(--border-gold); padding-top:8px; }
.weapon-row { display:flex; align-items:center; gap:6px; padding:5px 0; border-bottom:1px solid var(--border); }
.weapon-row:last-child { border-bottom:none; }
.wpn-info { flex:1; min-width:0; font-size:13px; }
.wpn-magic { color: var(--accent-bright); font-size:12px; font-weight:600; }
.weapon-row button { padding:4px 9px; font-size:13px; }
.wpn-add-row { display:flex; gap:6px; margin-top:8px; flex-wrap:wrap; }
.wpn-add-row select { flex:1; min-width:120px; }
.wpn-custom { margin-top:8px; display:flex; flex-direction:column; gap:6px; background:var(--panel2); padding:8px; border-radius:8px; border:1px solid var(--border); }
.wpn-custom .row { display:flex; gap:6px; }
.wpn-custom input, .wpn-custom select { font-size:12px; padding:6px 8px; }

/* Mode ciblage d'attaque */
#target-hint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 40;
  background: rgba(164,51,63,0.92); color: #fff; padding: 8px 16px; border-radius: 20px;
  font-size: 14px; font-weight: 600; box-shadow: 0 3px 12px rgba(0,0,0,0.5); border: 1px solid var(--accent); }
.roll .hit { color: var(--ok); font-weight: 700; }
.roll .miss { color: var(--danger-bright); font-weight: 700; }

/* Bannière de cible persistante */
#target-banner { position: absolute; top: 12px; left: 12px; z-index: 40;
  background: rgba(34,27,48,0.94); color: var(--text); padding: 7px 10px 7px 14px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 3px 12px rgba(0,0,0,0.5); border: 1px solid rgba(220,60,60,0.7);
  display: flex; align-items: center; gap: 8px; }
#target-banner b { color: var(--accent-bright); }
#target-banner .tb-stats { color: var(--muted); font-size: 12px; }
#target-banner #tb-clear { padding: 2px 8px; font-size: 12px; background: var(--panel2); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
#target-banner #tb-clear:hover { border-color: var(--danger-bright); color: var(--danger-bright); }
