/* ─────────────────────────────────────────────────────────────
   Arcanum — feuille de style
   Thème : grimoire nocturne · or patiné · lueur arcanique
   ───────────────────────────────────────────────────────────── */
:root {
  --ink: #0b0912;
  --ink-2: #110e1a;
  --panel: rgba(22, 18, 32, 0.86);
  --panel-solid: #171320;
  --panel-2: #1e1929;
  --panel-3: #272033;
  --line: rgba(216, 178, 106, 0.16);
  --line-2: rgba(255, 255, 255, 0.07);
  --gold: #d8b26a;
  --gold-2: #f0d391;
  --gold-dim: #8f7444;
  --arcane: #8b5cf6;
  --arcane-2: #b794ff;
  --ember: #f97316;
  --blood: #e5484d;
  --ok: #3ecf6e;
  --warn: #e6b93c;
  --text: #ece4d3;
  --text-2: #b9b0c7;
  --muted: #847b96;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 2px 0 rgba(255, 255, 255, 0.03) inset;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Cinzel', Georgia, serif;
  --serif: 'Crimson Pro', Georgia, serif;
  --side-w: 380px;
  --top-h: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--ink); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--gold-2); }
button { font: inherit; color: inherit; }
::selection { background: rgba(139, 92, 246, 0.45); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(216, 178, 106, 0.18); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(216, 178, 106, 0.35); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.center { justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pad { padding: 16px; }
kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 5px; background: var(--panel-3); border: 1px solid var(--line); border-bottom-width: 2px; font: 600 11px var(--font); color: var(--gold-2); text-align: center; }
code { background: rgba(255, 255, 255, 0.06); padding: 1px 5px; border-radius: 4px; font-size: 0.92em; }

/* ── Boutons & champs ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: linear-gradient(180deg, #2a2338, #201a2c); color: var(--text); cursor: pointer; font-weight: 600; text-decoration: none; transition: transform .12s, border-color .15s, box-shadow .15s, background .15s; white-space: nowrap; }
.btn:hover { border-color: rgba(216, 178, 106, 0.45); box-shadow: 0 0 0 3px rgba(216, 178, 106, 0.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #e3c27c, #b98d45); color: #1a1208; border-color: #f0d391; text-shadow: 0 1px 0 rgba(255, 255, 255, .25); }
.btn-primary:hover { box-shadow: 0 0 0 3px rgba(216, 178, 106, 0.25), 0 6px 22px rgba(216, 178, 106, 0.25); }
.btn-danger { background: linear-gradient(180deg, #5a1d24, #3d1218); border-color: rgba(229, 72, 77, .45); color: #ffd4d6; }
.btn-ok { background: linear-gradient(180deg, #1d4a30, #133322); border-color: rgba(62, 207, 110, .45); color: #c8ffd9; }
.btn-ghost { background: transparent; border-style: dashed; color: var(--text-2); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-xs { padding: 3px 8px; font-size: 12px; border-radius: 6px; }
.btn.active { border-color: var(--gold); color: var(--gold-2); }
.btn-glow { animation: glow 2.2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 26px rgba(240, 211, 145, .55); } }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; cursor: pointer; display: inline-grid; place-items: center; font-size: 15px; color: var(--text-2); transition: background .15s, color .15s, border-color .15s; flex: none; }
.icon-btn:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.icon-btn.active { background: rgba(216, 178, 106, .15); border-color: rgba(216, 178, 106, .4); color: var(--gold-2); }
.icon-btn.danger:hover, .icon-btn.danger.active { background: rgba(229, 72, 77, .15); color: #ff8e91; }
.link { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; text-align: left; }
.link.roll:hover, .roll:hover { color: var(--gold-2); text-shadow: 0 0 12px rgba(240, 211, 145, .5); }
.input { width: 100%; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: rgba(0, 0, 0, .28); color: var(--text); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.input:focus { border-color: rgba(216, 178, 106, .55); box-shadow: 0 0 0 3px rgba(216, 178, 106, .12); background: rgba(0, 0, 0, .4); }
.input:disabled { opacity: .7; }
.input.big { font-size: 18px; padding: 12px 14px; }
.input.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.input.num { width: 72px; text-align: center; }
.input.num.sm { width: 60px; }
.input.num.xs { width: 48px; padding: 3px 4px; }
textarea.input { resize: vertical; min-height: 40px; line-height: 1.5; }
select.input { cursor: pointer; }
input[type=color] { width: 36px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
input[type=range] { accent-color: var(--gold); }
input[type=checkbox] { accent-color: var(--gold); width: 16px; height: 16px; cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; background: rgba(255, 255, 255, .015); }
legend { font: 700 12px var(--display); letter-spacing: .1em; color: var(--gold); padding: 0 6px; text-transform: uppercase; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.hint.bad { color: var(--blood); }
.seg { display: inline-flex; background: rgba(0, 0, 0, .3); border: 1px solid var(--line-2); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.active { background: linear-gradient(180deg, #3a3048, #2c2438); color: var(--gold-2); box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset; }
.seg.small button { padding: 3px 8px; font-size: 12px; }
.chip { border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); padding: 4px 10px; border-radius: 999px; cursor: pointer; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.chip:hover { border-color: var(--line); color: var(--text); }
.chip.active { background: rgba(216, 178, 106, .16); border-color: rgba(216, 178, 106, .5); color: var(--gold-2); }
.chip-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2); color: var(--text-2); }
.badge.tag { color: var(--arcane-2); }
.empty-hint { padding: 18px 12px; text-align: center; color: var(--muted); font-style: italic; font-size: 13px; }
.list-group-title { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 16px 0 8px; font: 700 11.5px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.list-group-title:first-child { margin-top: 4px; }
.list-group-title .count { font: 600 11px var(--font); color: var(--muted); letter-spacing: 0; text-transform: none; }

/* ── Avatars ── */
.avatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--gold-dim); background: radial-gradient(circle at 35% 30%, #3a3150, #1b1626) center/cover no-repeat; display: grid; place-items: center; font: 700 16px var(--display); color: #fff; flex: none; overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.avatar.sm { width: 28px; height: 28px; font-size: 13px; border-width: 1.5px; }
.avatar.big { width: 96px; height: 96px; font-size: 44px; }

/* ── Mise en page de la table ── */
.table-page { overflow: hidden; }
#app { position: fixed; inset: 0; display: grid; grid-template-columns: 52px 1fr auto; grid-template-rows: var(--top-h) 1fr; grid-template-areas: 'top top top' 'tools board side'; }
#topbar { grid-area: top; display: flex; align-items: center; gap: 14px; padding: 0 12px; background: linear-gradient(180deg, rgba(20, 16, 30, .98), rgba(14, 11, 22, .96)); border-bottom: 1px solid var(--line); z-index: 30; position: relative; }
#topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(216, 178, 106, .5), transparent); }
.brand { font: 900 18px var(--display); color: var(--gold-2); text-decoration: none; letter-spacing: .06em; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.camp-info { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; max-width: 260px; }
.camp-name { font: 700 14px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-name { background: none; border: 0; padding: 0; color: var(--muted); font-size: 12px; cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-name::before { content: '🗺️ '; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.conn { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.conn.off { background: var(--blood); box-shadow: 0 0 10px var(--blood); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

#toolbar { grid-area: tools; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; background: rgba(14, 11, 22, .96); border-right: 1px solid var(--line); z-index: 20; overflow-y: auto; }
.tool-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; font-size: 18px; display: grid; place-items: center; transition: all .15s; flex: none; }
.tool-btn:hover { background: rgba(255, 255, 255, .06); transform: scale(1.06); }
.tool-btn.active { background: radial-gradient(circle at 50% 30%, rgba(216, 178, 106, .35), rgba(216, 178, 106, .08)); border-color: rgba(216, 178, 106, .55); box-shadow: 0 0 18px rgba(216, 178, 106, .25); }
.tool-sep { width: 26px; height: 1px; background: var(--line); margin: 6px 0; flex: none; }

.board-wrap { grid-area: board; position: relative; overflow: hidden; background: radial-gradient(ellipse at center, #15111f, #07060b); }
#board { display: block; touch-action: none; }
#board[data-tool=pan], #board[data-space] { cursor: grab; }
#board[data-tool=ruler], #board[data-tool=template], #board[data-tool=wall], #board[data-tool=light], #board[data-tool=place] { cursor: crosshair; }
#board[data-tool=pen], #board[data-tool=line], #board[data-tool=rect], #board[data-tool=ellipse] { cursor: crosshair; }
#board[data-tool=text] { cursor: text; }
#board[data-tool=eraser], #board[data-tool=wallerase] { cursor: not-allowed; }
.tool-options { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 7px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(12px); box-shadow: var(--shadow); z-index: 10; max-width: calc(100% - 20px); flex-wrap: wrap; font-size: 13px; }
.opt { display: inline-flex; align-items: center; gap: 6px; }
.opt-label { color: var(--muted); font-size: 12px; }
.opt-hint { color: var(--muted); font-size: 12px; }
.mini-palette { display: flex; gap: 3px; }
.mini-palette button { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); cursor: pointer; padding: 0; }
.view-controls { position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(12px); z-index: 10; }
.coords { font: 600 11px var(--font); color: var(--muted); padding: 0 6px; min-width: 52px; text-align: center; }
.macro-bar { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; max-width: calc(100% - 420px); z-index: 10; }
.macro-btn { padding: 6px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(10px); cursor: pointer; font-weight: 600; font-size: 12.5px; transition: all .15s; }
.macro-btn:hover { border-color: var(--gold); color: var(--gold-2); transform: translateY(-2px); }
.macro-btn.add { border-style: dashed; color: var(--muted); }

/* ── Barre latérale ── */
#sidebar { grid-area: side; width: var(--side-w); display: grid; grid-template-columns: 50px 1fr; background: var(--panel-solid); border-left: 1px solid var(--line); position: relative; transition: width .25s ease; z-index: 25; }
#sidebar.collapsed { width: 50px; }
#sidebar.collapsed #side-panels { display: none; }
.side-toggle { position: absolute; left: -14px; top: 50%; transform: translateY(-50%); width: 14px; height: 54px; border: 1px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; background: var(--panel-solid); cursor: pointer; color: var(--gold); font-size: 11px; padding: 0; }
#sidebar.collapsed .side-toggle { transform: translateY(-50%) scaleX(-1); }
#side-tabs { display: flex; flex-direction: column; gap: 4px; padding: 10px 5px; background: rgba(0, 0, 0, .25); border-right: 1px solid var(--line-2); overflow-y: auto; }
.side-tab { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; font-size: 18px; flex: none; transition: all .15s; }
.side-tab:hover { background: rgba(255, 255, 255, .06); }
.side-tab.active { background: rgba(216, 178, 106, .14); border-color: rgba(216, 178, 106, .45); }
.badge-dot { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--blood); color: #fff; font: 700 10px/16px var(--font); padding: 0 4px; }
#side-panels { position: relative; min-width: 0; overflow: hidden; }
.side-panel { position: absolute; inset: 0; display: none; flex-direction: column; }
.side-panel.active { display: flex; }
.panel-title { padding: 14px 16px 10px; font: 700 14px var(--display); letter-spacing: .08em; color: var(--gold-2); border-bottom: 1px solid var(--line-2); flex: none; }
.panel-content { flex: 1; overflow-y: auto; padding: 10px 14px 18px; min-height: 0; }
.side-panel[data-panel=chat] .panel-content { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.panel-toolbar { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }

/* ── Chat ── */
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--line-2); flex: none; }
.chat-log { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.msg { animation: none; }
.msg.live { animation: msgIn .35s ease-out; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } }
.msg-head { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.msg-name { font-weight: 700; font-size: 13px; }
.msg-player { color: var(--muted); font-size: 11.5px; }
.msg-time { margin-left: auto; color: var(--muted); font-size: 11px; }
.bubble { background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); border-radius: 4px 12px 12px 12px; padding: 7px 11px; margin-left: 35px; word-wrap: break-word; }
.mine .bubble { background: rgba(139, 92, 246, .08); border-color: rgba(139, 92, 246, .2); }
.bubble.ooc { color: var(--text-2); font-style: italic; font-size: 13px; }
.bubble.whisper { background: rgba(192, 132, 252, .1); border-color: rgba(192, 132, 252, .35); }
.whisper-to { margin-left: 35px; font-size: 11.5px; color: #d4b0ff; margin-bottom: 3px; }
.sys { text-align: center; color: var(--muted); font-size: 12px; font-style: italic; padding: 2px 10px; }
.emote { font-style: italic; text-align: center; font-family: var(--serif); font-size: 16px; padding: 2px 8px; }
.desc { font-family: var(--serif); font-size: 17px; line-height: 1.5; color: #f3e3bf; background: linear-gradient(135deg, rgba(216, 178, 106, .12), rgba(216, 178, 106, .02)); border-left: 3px solid var(--gold); padding: 10px 14px; border-radius: 0 10px 10px 0; font-style: italic; }
.inline-roll { display: inline-block; padding: 0 7px; border-radius: 6px; background: rgba(216, 178, 106, .18); border: 1px solid rgba(216, 178, 106, .4); color: var(--gold-2); font-weight: 700; font-style: normal; cursor: help; }
.inline-roll.crit { background: rgba(255, 211, 106, .3); box-shadow: 0 0 10px rgba(255, 211, 106, .5); }
.inline-roll.fum { background: rgba(229, 72, 77, .25); border-color: var(--blood); color: #ffb3b5; }
.roll-card { position: relative; margin-left: 35px; padding: 10px 12px; border-radius: 4px 12px 12px 12px; background: linear-gradient(160deg, #241d31, #1a1524); border: 1px solid rgba(216, 178, 106, .22); box-shadow: 0 4px 18px rgba(0, 0, 0, .3); overflow: hidden; }
.roll-card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 100% 0%, rgba(216, 178, 106, .12), transparent 60%); pointer-events: none; }
.roll-card.is-crit { border-color: rgba(255, 211, 106, .8); box-shadow: 0 0 24px rgba(255, 211, 106, .25); }
.roll-card.is-fumble { border-color: rgba(229, 72, 77, .7); box-shadow: 0 0 20px rgba(229, 72, 77, .2); }
.roll-label { font: 700 12px var(--display); letter-spacing: .08em; color: var(--gold); text-transform: uppercase; margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.hidden-badge { font: 600 10px var(--font); letter-spacing: 0; }
.roll-main { display: flex; align-items: center; gap: 10px; }
.roll-formula { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.rf-op { color: var(--muted); font-weight: 600; font-size: 13px; }
.rf-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.rf-not { font-size: 10.5px; color: var(--muted); margin-right: 2px; }
.die { min-width: 24px; height: 24px; padding: 0 4px; border-radius: 6px; display: inline-grid; place-items: center; font: 700 12.5px var(--font); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); }
.die.d20 { clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); border-radius: 0; background: rgba(139, 92, 246, .3); min-width: 26px; height: 26px; }
.die.dropped { opacity: .35; text-decoration: line-through; }
.die.crit { background: linear-gradient(180deg, #f8d77a, #c79a30); color: #2a1a00; border-color: #ffe9a8; }
.die.fum { background: linear-gradient(180deg, #e5484d, #9a1d22); color: #fff; }
.die.exploded { box-shadow: 0 0 0 1px var(--ember) inset; }
.die.success { background: rgba(62, 207, 110, .3); border-color: var(--ok); }
.die.failure { background: rgba(229, 72, 77, .3); border-color: var(--blood); }
.roll-total { font: 900 30px var(--display); color: var(--gold-2); min-width: 52px; text-align: center; text-shadow: 0 0 18px rgba(240, 211, 145, .35); cursor: help; }
.is-crit .roll-total { color: #ffe9a8; animation: critPulse 1.6s ease-in-out infinite; }
.is-fumble .roll-total { color: #ff7b7f; }
@keyframes critPulse { 50% { text-shadow: 0 0 28px rgba(255, 211, 106, .9); } }
.crit-banner, .fumble-banner { margin-top: 6px; text-align: center; font: 900 11px var(--display); letter-spacing: .3em; padding: 3px; border-radius: 6px; }
.crit-banner { background: linear-gradient(90deg, transparent, rgba(255, 211, 106, .3), transparent); color: #ffe9a8; }
.fumble-banner { background: linear-gradient(90deg, transparent, rgba(229, 72, 77, .3), transparent); color: #ffb3b5; }
.roll-extra { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(216, 178, 106, .2); }
.rx-label { font-size: 11.5px; font-weight: 700; color: var(--ember); min-width: 64px; text-transform: uppercase; letter-spacing: .04em; }
.rx-total { margin-left: auto; font: 800 20px var(--display); color: #ffc49a; }
.check-badge { margin-top: 6px; padding: 4px 8px; border-radius: 6px; font-weight: 700; font-size: 12px; text-align: center; }
.lvl-critique { background: rgba(255, 211, 106, .25); color: #ffe9a8; }
.lvl-extreme { background: rgba(139, 92, 246, .3); color: #dccbff; }
.lvl-hard { background: rgba(96, 165, 250, .25); color: #c8e0ff; }
.lvl-success { background: rgba(62, 207, 110, .22); color: #b9ffd2; }
.lvl-fail { background: rgba(255, 255, 255, .06); color: var(--text-2); }
.lvl-fumble { background: rgba(229, 72, 77, .3); color: #ffc0c2; }
.reroll { position: absolute; top: 6px; right: 6px; border: 0; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s; font-size: 14px; }
.roll-card:hover .reroll { opacity: 1; }
.table-card, .help-card { margin-left: 35px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.help-card { margin-left: 0; font-size: 13px; }
.help-card ul { padding-left: 18px; margin: 6px 0; }
.playing-card-row { margin-left: 35px; display: flex; align-items: center; gap: 10px; }
.playing-card { width: 52px; height: 72px; border-radius: 6px; background: linear-gradient(180deg, #fbf8f0, #e8e0cc); color: #1a1a1a; display: grid; place-items: center; font: 800 18px var(--serif); box-shadow: 0 4px 12px rgba(0, 0, 0, .4); animation: flipIn .5s ease-out; text-align: center; line-height: 1; padding: 2px; }
.playing-card.red { color: #b3141b; }
@keyframes flipIn { from { transform: rotateY(90deg); } }
.coin-flip { margin-left: 35px; font-size: 15px; }
.coin-flip .coin { display: inline-block; font-size: 26px; animation: coinSpin .8s ease-out; }
@keyframes coinSpin { from { transform: rotateY(1440deg) translateY(-20px); } }
.chat-compose { border-top: 1px solid var(--line); padding: 8px 10px 10px; background: rgba(0, 0, 0, .25); display: flex; flex-direction: column; gap: 6px; flex: none; }
.quick-dice { display: flex; gap: 3px; align-items: center; }
.qd { flex: 1 1 0; min-width: 0; padding: 5px 0; border-radius: 7px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); cursor: pointer; font: 700 11.5px var(--font); color: var(--text-2); transition: all .15s; }
.qd:hover { background: rgba(139, 92, 246, .2); border-color: rgba(139, 92, 246, .5); color: #fff; transform: translateY(-1px); }
.qd.d20 { color: var(--gold-2); border-color: rgba(216, 178, 106, .35); }
.qd.adv { color: #9af7bd; } .qd.dis { color: #ffabad; }
.as-select { padding: 5px 8px; font-size: 12.5px; max-width: 220px; }
.compose-row { display: flex; gap: 6px; align-items: flex-end; }
.chat-input { flex: 1; resize: none; min-height: 40px; max-height: 140px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .35); color: var(--text); font: inherit; outline: none; }
.chat-input:focus { border-color: rgba(216, 178, 106, .5); }
.send { height: 40px; width: 44px; padding: 0; font-size: 16px; }
.cmd-hints { display: none; padding: 4px 10px; border-top: 1px solid var(--line-2); background: rgba(0, 0, 0, .3); flex: none; }
.cmd-hint { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 4px 6px; border-radius: 6px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.cmd-hint:hover { background: rgba(255, 255, 255, .06); }

/* ── Listes ── */
.char-row, .lore-row, .comp-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; transition: background .15s; border: 1px solid transparent; }
.char-row:hover, .lore-row:hover, .comp-row:hover { background: rgba(255, 255, 255, .04); border-color: var(--line-2); }
.char-meta { flex: 1; min-width: 0; }
.char-name, .lore-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.char-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-bar { height: 4px; border-radius: 3px; background: rgba(255, 255, 255, .08); margin-top: 4px; overflow: hidden; }
.mini-bar > div { height: 100%; border-radius: 3px; background: var(--ok); transition: width .3s; }
.mini-bar.big { height: 8px; margin: 8px 0; }
.lore-thumb { width: 42px; height: 42px; border-radius: 9px; background: var(--panel-3) center/cover; flex: none; display: grid; place-items: center; font-size: 20px; border: 1px solid var(--line-2); }
.vis { font-size: 13px; }
.comp-glyph { font-size: 24px; width: 34px; text-align: center; flex: none; }
.rarity-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; }
.lvl-badge { min-width: 26px; height: 26px; border-radius: 7px; background: rgba(139, 92, 246, .25); border: 1px solid rgba(139, 92, 246, .45); display: grid; place-items: center; font: 800 12px var(--font); color: #dccbff; flex: none; }
.feat-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.comp-list { display: flex; flex-direction: column; }

/* ── Timeline lore ── */
.timeline { position: relative; padding-left: 8px; }
.tl-item { display: grid; grid-template-columns: 90px 14px 1fr; gap: 8px; padding: 8px 0; cursor: pointer; align-items: start; }
.tl-item:hover .tl-body b { color: var(--gold-2); }
.tl-date { font: 700 12px var(--display); color: var(--gold); text-align: right; padding-top: 1px; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--arcane); box-shadow: 0 0 12px var(--arcane); margin-top: 3px; position: relative; }
.tl-dot::after { content: ''; position: absolute; left: 5px; top: 14px; width: 2px; height: 40px; background: rgba(139, 92, 246, .25); }

/* ── Modales ── */
.modal-back { position: fixed; inset: 0; background: rgba(5, 3, 10, .6); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 1000; opacity: 0; transition: opacity .2s; padding: 16px; }
.modal-back.in { opacity: 1; }
.modal { background: linear-gradient(180deg, #1d1828, #15111e); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, .4); max-height: calc(100vh - 32px); display: flex; flex-direction: column; transform: translateY(12px) scale(.98); transition: transform .25s cubic-bezier(.2, .9, .3, 1.2); }
.modal-back.in .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font: 700 17px var(--display); color: var(--gold-2); letter-spacing: .04em; }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }

/* ── Fenêtres flottantes ── */
.float-win { position: fixed; display: flex; flex-direction: column; background: linear-gradient(180deg, #1c1727, #15111d); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; opacity: 0; transform: scale(.97); transition: opacity .18s, transform .18s; min-width: 300px; }
.float-win.in { opacity: 1; transform: none; }
.float-win.closing { opacity: 0; transform: scale(.97); }
.float-win.minimized { height: 44px !important; min-height: 0; }
.float-win.minimized .fw-body, .float-win.minimized .fw-resize { display: none; }
.fw-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; background: linear-gradient(180deg, rgba(216, 178, 106, .1), transparent); border-bottom: 1px solid var(--line-2); cursor: move; user-select: none; flex: none; }
.fw-title { flex: 1; font: 700 14px var(--display); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fw-btns { display: flex; }
.fw-body { flex: 1; overflow-y: auto; min-height: 0; }
.fw-resize { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, rgba(216, 178, 106, .35) 50%, transparent 65%, rgba(216, 178, 106, .35) 65%, transparent 80%); }

/* ── Toasts & menus ── */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 3000; pointer-events: none; align-items: center; }
.toast { padding: 10px 16px; border-radius: 10px; background: rgba(28, 23, 39, .96); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 600; font-size: 13.5px; opacity: 0; transform: translateY(14px); transition: all .3s cubic-bezier(.2, .9, .3, 1.2); max-width: min(560px, 92vw); text-align: center; }
.toast.in { opacity: 1; transform: none; }
.toast-ok { border-color: rgba(62, 207, 110, .5); }
.toast-error { border-color: rgba(229, 72, 77, .6); color: #ffc7c9; }
.toast-warn { border-color: rgba(230, 185, 60, .55); color: #ffe8a8; }
.ctx-menu { position: fixed; min-width: 210px; background: rgba(24, 19, 34, .98); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 5px; z-index: 2500; backdrop-filter: blur(14px); animation: pop .14s ease-out; max-height: 80vh; overflow-y: auto; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.ctx-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 7px; cursor: pointer; text-align: left; font-size: 13.5px; color: var(--text); }
.ctx-item:hover:not(:disabled) { background: rgba(216, 178, 106, .12); }
.ctx-item:disabled { opacity: .4; cursor: default; }
.ctx-item.danger { color: #ff9a9d; }
.ctx-item.has-sub::after { content: '›'; margin-left: auto; color: var(--muted); }
.ctx-ico { width: 18px; text-align: center; }
.ctx-sep { height: 1px; background: var(--line-2); margin: 4px 6px; }

/* ── Fiches ── */
.sheet-window .fw-body { background: radial-gradient(ellipse at top, rgba(216, 178, 106, .05), transparent 60%); }
.sheet { height: 100%; }
.sheet-inner { display: flex; flex-direction: column; min-height: 100%; }
.sheet-head { display: flex; gap: 16px; padding: 16px 16px 10px; }
.portrait { cursor: pointer; position: relative; flex: none; }
.portrait .avatar { width: 96px; height: 96px; font-size: 44px; border-width: 3px; box-shadow: 0 0 0 4px rgba(216, 178, 106, .1), 0 8px 24px rgba(0, 0, 0, .5); }
.portrait:hover::after { content: '✎'; position: absolute; right: 2px; bottom: 2px; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #1a1208; display: grid; place-items: center; font-size: 14px; }
.head-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sheet-name { font: 700 22px var(--display); background: transparent; border-color: transparent; padding: 4px 6px; color: var(--gold-2); }
.sheet-name:hover { border-color: var(--line-2); }
.head-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.head-grid .input { padding: 6px 8px; font-size: 13px; }
.head-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.sheet-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.abilities { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 6px 16px; }
.abilities.eight { grid-template-columns: repeat(8, 1fr); }
.abilities.ten { grid-template-columns: repeat(5, 1fr); }
.ability { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 8px; border-radius: 12px; background: linear-gradient(180deg, rgba(216, 178, 106, .09), rgba(255, 255, 255, .02)); border: 1px solid var(--line); position: relative; }
.ab-name { font: 700 11.5px var(--display); letter-spacing: .12em; color: var(--gold); }
.ab-mod { font: 900 24px var(--display); background: none; border: 0; cursor: pointer; color: var(--text); line-height: 1; padding: 2px 6px; border-radius: 8px; transition: all .15s; }
.ab-mod:hover { background: rgba(216, 178, 106, .15); color: var(--gold-2); }
.ab-score { width: 56px !important; text-align: center; padding: 3px !important; font-weight: 700; border-radius: 999px !important; }
.ab-save { display: flex; align-items: center; gap: 4px; font-size: 11.5px; }
.combat-strip { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 16px; }
.stat-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line-2); min-width: 78px; }
.stat-box.clickable { cursor: pointer; transition: all .15s; }
.stat-box.clickable:hover { border-color: rgba(216, 178, 106, .5); background: rgba(216, 178, 106, .08); }
.stat-label { font: 700 10.5px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; }
.big-num { font: 800 22px var(--display); text-align: center; color: var(--text); }
input.big-num { width: 64px; padding: 2px; background: transparent; border-color: transparent; }
input.big-num:hover, input.big-num:focus { border-color: var(--line); }
.mid-num { font: 700 15px var(--font); text-align: center; }
input.mid-num { width: 80px; background: transparent; border-color: transparent; }
.hp-box { min-width: 190px; border-color: rgba(229, 72, 77, .3); background: linear-gradient(180deg, rgba(229, 72, 77, .1), rgba(0, 0, 0, .25)); }
.hp-row { display: flex; align-items: center; gap: 4px; }
.slash { color: var(--muted); font-size: 18px; }
.hp-temp { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.hp-quick-row { display: flex; gap: 4px; align-items: center; }
.hp-quick { width: 52px; padding: 3px; text-align: center; }
.check-box { cursor: pointer; }
.big-check { width: 22px; height: 22px; }
.death { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; justify-content: center; max-width: 90px; font-size: 11px; }
.pip { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--muted); background: transparent; cursor: pointer; padding: 0; }
.pip.ok.on { background: var(--ok); border-color: var(--ok); }
.pip.bad.on { background: var(--blood); border-color: var(--blood); }
.pip.slot { border-color: var(--arcane-2); background: var(--arcane); box-shadow: 0 0 8px rgba(139, 92, 246, .6); }
.pip.slot.used { background: transparent; box-shadow: none; opacity: .5; }
.seg + .sheet-actions { margin-left: auto; }
.sheet-tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; margin-top: 6px; }
.tab { padding: 9px 13px; border: 0; background: none; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold-2); border-bottom-color: var(--gold); }
.sheet-body { padding: 14px 16px 24px; flex: 1; }
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.skills-grid.two { grid-template-columns: 1fr 1fr; }
.skill-row { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-bottom: 1px solid var(--line-2); }
.skill-name { flex: 1; font-weight: 500; }
.skill-val { font-weight: 800; min-width: 32px; text-align: right; color: var(--gold-2); }
.prof-pip { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--gold-dim); background: transparent; cursor: pointer; padding: 0; flex: none; }
.prof-pip.r1 { background: var(--gold); }
.prof-pip.r2 { background: var(--gold); box-shadow: 0 0 0 3px rgba(216, 178, 106, .3); }
.list-editor { display: flex; flex-direction: column; gap: 6px; }
.le-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px; border-radius: 9px; background: rgba(255, 255, 255, .02); border: 1px solid var(--line-2); }
.le-row .input { padding: 5px 7px; font-size: 13px; }
.le-row textarea.input { min-height: 34px; }
.le-row .grow { flex: 1; min-width: 120px; }
.w60 { width: 60px !important; } .w70 { width: 70px !important; } .w80 { width: 80px !important; } .w90 { width: 90px !important; } .w110 { width: 110px !important; } .w160 { width: 160px !important; } .w180 { width: 180px !important; } .w220 { width: 220px !important; }
.slots { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 10px; background: rgba(139, 92, 246, .06); border: 1px solid rgba(139, 92, 246, .2); }
.slot-lvl { display: flex; align-items: center; gap: 5px; }
.slot-label { font-weight: 700; font-size: 12px; min-width: 52px; color: #dccbff; }
.spell-row { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--line-2); }
.spell-name { font-weight: 700; }
.spell-desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
.money { display: flex; gap: 8px; flex-wrap: wrap; }
.coin { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; border: 1px solid var(--line-2); font-weight: 800; font-size: 12px; }
.coin.pc { color: #e3a26a; } .coin.pa { color: #d6dbe3; } .coin.po { color: #f0d391; } .coin.pp { color: #c7f0f5; }
.coin .input { width: 64px; padding: 3px 6px; }
.weight { font-weight: 700; font-size: 13px; color: var(--text-2); }
.weight.over { color: var(--blood); }
.info-card { padding: 10px 12px; border-radius: 10px; background: rgba(216, 178, 106, .06); border: 1px solid var(--line); }
.info-card p { margin: 4px 0 0; font-size: 13px; color: var(--text-2); }
.gm-only > span { color: #d4b0ff !important; }
.limited .head-main h2 { margin: 0; font-family: var(--display); }
.glyph-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.glyph-btn { font-size: 24px; padding: 6px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); cursor: pointer; }
.glyph-btn:hover { background: rgba(216, 178, 106, .15); transform: scale(1.1); }

/* ── Assistant de création ── */
.wizard { display: flex; flex-direction: column; gap: 14px; }
.wiz-steps { display: flex; gap: 4px; overflow-x: auto; }
.wiz-step { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: none; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.wiz-step span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .06); font-size: 11px; }
.wiz-step.active { border-color: var(--gold); color: var(--gold-2); }
.wiz-step.active span, .wiz-step.done span { background: var(--gold); color: #1a1208; }
.wiz-content { min-height: 340px; }
.wiz-nav { display: flex; justify-content: space-between; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.card-grid.small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pick-card { --accent: var(--gold); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px; border-radius: 14px; border: 1px solid var(--line-2); background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .01)); cursor: pointer; text-align: center; transition: all .18s; }
.pick-card:hover { transform: translateY(-3px); border-color: var(--line); box-shadow: 0 10px 26px rgba(0, 0, 0, .35); }
.pick-card.active { border-color: var(--accent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 22%, transparent), rgba(255, 255, 255, .01)); box-shadow: 0 0 0 1px var(--accent), 0 10px 30px color-mix(in srgb, var(--accent) 25%, transparent); }
.pc-glyph { font-size: 36px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); }
.pc-name { font: 700 15px var(--display); color: var(--gold-2); }
.pc-bonus { font-size: 11.5px; font-weight: 700; color: var(--arcane-2); }
.pc-desc { font-size: 12px; color: var(--text-2); }
.pc-traits { font-size: 11px; color: var(--muted); }
.abilities.wiz .ability select { width: 70px; }
.summary h2 { margin: 0; font-family: var(--display); color: var(--gold-2); }
.summary { display: flex; flex-direction: column; gap: 12px; }

/* ── Générateur & scènes ── */
.generator { display: grid; grid-template-columns: 360px 1fr; gap: 16px; }
.gen-left { display: flex; flex-direction: column; gap: 14px; }
.gen-right { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kind-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.kind-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); cursor: pointer; transition: all .15s; }
.kind-card:hover { border-color: var(--line); transform: translateY(-2px); }
.kind-card.active { border-color: var(--gold); background: rgba(216, 178, 106, .14); }
.kc-icon { font-size: 22px; }
.kc-name { font-size: 11px; font-weight: 600; text-align: center; }
.preview-wrap { flex: 1; display: grid; place-items: center; background: #07060b; border-radius: 12px; border: 1px solid var(--line); overflow: auto; min-height: 420px; padding: 10px; }
.gen-preview { max-width: 100%; max-height: 62vh; border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.scene-card { display: flex; gap: 10px; padding: 8px; border-radius: 12px; border: 1px solid var(--line-2); margin-bottom: 8px; background: rgba(255, 255, 255, .02); transition: border-color .15s; }
.scene-card.viewing { border-color: rgba(139, 92, 246, .5); background: rgba(139, 92, 246, .06); }
.scene-card.active { border-color: rgba(216, 178, 106, .55); }
.scene-thumb-wrap { position: relative; width: 112px; height: 76px; border-radius: 8px; overflow: hidden; flex: none; cursor: pointer; background: #000; }
.scene-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.scene-flag { position: absolute; left: 4px; top: 4px; background: var(--gold); color: #1a1208; font: 800 10px var(--font); padding: 1px 6px; border-radius: 999px; }
.scene-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.scene-name { font-weight: 700; }
.scene-info .scene-name::before { content: none; }
.scene-actions { display: flex; gap: 4px; margin-top: auto; flex-wrap: wrap; }
.prop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.prop-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .02); cursor: pointer; font-size: 10.5px; color: var(--text-2); text-align: center; transition: all .15s; }
.prop-btn:hover { border-color: var(--gold); background: rgba(216, 178, 106, .08); transform: translateY(-2px); color: var(--text); }
.prop-btn canvas { width: 46px; height: 46px; }

/* ── Mise en scène / audio ── */
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.fx-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); cursor: pointer; font-size: 20px; transition: all .15s; }
.fx-btn small { font-size: 11px; color: var(--text-2); }
.fx-btn:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }
.fx-btn.active { border-color: var(--gold); background: rgba(216, 178, 106, .16); }
.fx-btn:disabled { cursor: default; opacity: .75; }
.vol-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 8px; font-size: 13px; padding: 2px 0; }
.mixer-wrap summary { cursor: pointer; padding: 8px 0; color: var(--text-2); font-weight: 600; }
.mixer { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; padding: 8px 0; }
.mix-ch { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 16px; }
.mix-ch.on { border-color: rgba(216, 178, 106, .45); background: rgba(216, 178, 106, .06); }
.mix-ch small { font-size: 9.5px; color: var(--muted); text-align: center; }
.mix-ch input[type=range] { writing-mode: vertical-lr; direction: rtl; height: 80px; width: 18px; }
.now-playing { padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line-2); margin-bottom: 8px; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; vertical-align: middle; }
.eq i { width: 3px; height: 4px; background: var(--gold); border-radius: 1px; }
.eq.on i { animation: eq 0.9s ease-in-out infinite; }
.eq.on i:nth-child(2) { animation-delay: .2s; } .eq.on i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 50% { height: 14px; } }
.playlist { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; }
.pl-row { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 8px; }
.pl-row:hover { background: rgba(255, 255, 255, .04); }
.pl-row.active { background: rgba(216, 178, 106, .1); color: var(--gold-2); }

/* ── Vocal ── */
.voice-bar { display: flex; align-items: center; gap: 4px; }
.voice-fx { width: 130px; padding: 4px 6px; font-size: 12px; }
.voice-list { display: flex; gap: 4px; margin-left: 6px; }
.voice-chip { position: relative; cursor: pointer; }
.vdot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 800 11px var(--font); color: #111; border: 2px solid transparent; transition: all .15s; }
.voice-chip.speaking .vdot { border-color: #6effaa; box-shadow: 0 0 0 3px rgba(110, 255, 170, .35), 0 0 16px rgba(110, 255, 170, .7); transform: scale(1.08); }
.vm { position: absolute; right: -4px; bottom: -4px; font-size: 11px; }
#video-dock { position: fixed; left: 62px; top: calc(var(--top-h) + 10px); display: flex; flex-direction: column; gap: 8px; z-index: 40; }
.video-tile { position: relative; width: 168px; height: 126px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: #000; }
.video-tile video { width: 100%; height: 100%; object-fit: cover; }
.video-tile span { position: absolute; left: 6px; bottom: 4px; font: 700 11px var(--font); text-shadow: 0 1px 3px #000; }

/* ── Initiative ── */
#initiative { position: absolute; left: 50%; transform: translateX(-50%); top: 6px; display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: rgba(14, 11, 22, .92); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); max-width: min(760px, calc(100vw - 720px)); z-index: 35; }
.ini-round { display: flex; flex-direction: column; align-items: center; line-height: 1; padding: 0 6px; border-right: 1px solid var(--line-2); }
.ini-round small { font-size: 9px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.ini-round b { font: 900 18px var(--display); color: var(--gold-2); }
.ini-list { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.ini-list::-webkit-scrollbar { display: none; }
.ini-chip { display: flex; align-items: center; gap: 5px; padding: 3px 8px 3px 3px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); cursor: pointer; white-space: nowrap; flex: none; transition: all .2s; }
.ini-chip:hover { border-color: var(--line); }
.ini-chip.current { border-color: var(--gold); background: linear-gradient(90deg, rgba(216, 178, 106, .25), rgba(216, 178, 106, .05)); box-shadow: 0 0 16px rgba(216, 178, 106, .35); }
.ini-chip.hidden-e { opacity: .55; border-style: dashed; }
.ini-chip.dead { opacity: .4; filter: grayscale(1); }
.ini-name { font-size: 12px; font-weight: 600; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.ini-val { font: 800 11px var(--font); color: var(--gold-2); background: rgba(0, 0, 0, .35); padding: 1px 6px; border-radius: 999px; }

/* ── HUD jeton ── */
.token-hud { position: absolute; display: flex; flex-direction: column; gap: 5px; padding: 7px; background: rgba(18, 14, 26, .94); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 15; backdrop-filter: blur(10px); animation: pop .15s ease-out; }
.hud-bar { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.hud-bar.hp > span:first-child { color: #ff7b7f; }
.hud-bar.b2 > span:first-child { color: #7aa8ff; }
.hud-num { width: 56px; padding: 3px 5px; text-align: center; font-weight: 700; font-size: 12.5px; }
.hud-btns { display: flex; gap: 2px; }
.hud-btns .icon-btn { width: 28px; height: 28px; font-size: 13px; }
.status-pop { position: fixed; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 8px; background: rgba(20, 16, 30, .98); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 2600; animation: pop .14s ease-out; width: 380px; }
.status-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 2px; border-radius: 8px; border: 1px solid transparent; background: none; cursor: pointer; font-size: 18px; }
.status-btn small { font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; max-width: 58px; text-overflow: ellipsis; }
.status-btn:hover { background: rgba(255, 255, 255, .06); }
.status-btn.on { border-color: var(--gold); background: rgba(216, 178, 106, .15); }

/* ── Lore ── */
.lore-entry { min-height: 100%; }
.lore-banner { height: 180px; background: center/cover; position: relative; }
.lore-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, #18131f); }
.lore-banner.empty { height: 90px; display: grid; place-items: center; font-size: 46px; background: radial-gradient(circle at 50% 120%, rgba(216, 178, 106, .2), transparent 70%); }
.lore-head { padding: 0 22px; margin-top: -24px; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px; }
.lore-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.lore-h1 { margin: 0; font: 900 30px var(--display); color: var(--gold-2); letter-spacing: .02em; }
.lore-content { padding: 14px 22px 22px; font-family: var(--serif); font-size: 18px; line-height: 1.65; color: #ece2cc; }
.lore-content h2, .lore-content h3 { font-family: var(--display); color: var(--gold-2); margin: 1.1em 0 .4em; }
.lore-content h2 { font-size: 22px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.lore-content h3 { font-size: 18px; }
.lore-content blockquote { margin: 1em 0; padding: 6px 16px; border-left: 3px solid var(--arcane); background: rgba(139, 92, 246, .07); font-style: italic; border-radius: 0 8px 8px 0; }
.lore-content img { max-width: 100%; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.lore-content hr { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dim), transparent); margin: 1.4em 0; }
.wiki-link { color: var(--arcane-2); text-decoration: none; border-bottom: 1px dashed rgba(183, 148, 255, .6); cursor: pointer; }
.wiki-link:hover { color: #fff; text-shadow: 0 0 10px rgba(183, 148, 255, .7); }
.wiki-missing { color: var(--muted); border-bottom: 1px dotted var(--muted); cursor: pointer; }
.backlinks { padding: 0 22px 22px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.backlinks .list-group-title { width: 100%; }
.lore-edit { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.rich-toolbar { display: flex; gap: 2px; flex-wrap: wrap; padding: 4px; border-radius: 10px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line-2); position: sticky; top: 0; z-index: 2; }
.tb { min-width: 32px; height: 30px; border: 0; border-radius: 7px; background: none; cursor: pointer; font-weight: 700; color: var(--text-2); padding: 0 8px; }
.tb:hover { background: rgba(216, 178, 106, .15); color: var(--gold-2); }
.tb-sep { width: 1px; background: var(--line-2); margin: 4px 3px; }
.rich-editor { min-height: 300px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .2); outline: none; padding: 14px 18px !important; }
.rich-editor:focus { border-color: rgba(216, 178, 106, .45); }
.graph-wrap { position: relative; height: 100%; }
.graph-canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.graph-hint { position: absolute; left: 12px; bottom: 10px; font-size: 12px; color: var(--muted); }

/* ── Bestiaire ── */
.stat-block { font-family: var(--serif); font-size: 16px; padding: 14px 16px; background: linear-gradient(180deg, #f1e6cc, #e3d3ad); color: #2a1a0c; border-radius: 10px; box-shadow: 0 8px 26px rgba(0, 0, 0, .45), 0 0 0 3px #7a1f1f inset; margin-bottom: 12px; }
.stat-block h2 { margin: 0; font: 900 22px var(--display); color: #7a1f1f; }
.sb-sub { font-style: italic; margin-bottom: 8px; border-bottom: 2px solid #7a1f1f; padding-bottom: 6px; }
.sb-line { padding: 4px 0; }
.sb-stats { display: grid; grid-template-columns: repeat(6, 1fr); text-align: center; border-top: 2px solid #7a1f1f; border-bottom: 2px solid #7a1f1f; padding: 6px 0; margin: 6px 0; font-size: 14px; }
.sb-stats b { color: #7a1f1f; font-family: var(--display); }
.sb-sec h4 { margin: 8px 0 2px; font: 700 15px var(--display); color: #7a1f1f; border-bottom: 1px solid #7a1f1f; }
.sb-sec p { margin: 4px 0; }
.sb-desc { font-style: italic; margin: 10px 0 0; opacity: .85; }
.flavor { font-family: var(--serif); font-style: italic; font-size: 16px; color: #e4d6b8; }
.item-head h2 { margin: 0; font-family: var(--display); }

/* ── Effets plein écran ── */
.dice-tray { position: fixed; inset: 0; pointer-events: none; z-index: 900; }
.narration { position: fixed; inset: 0; z-index: 1500; display: flex; flex-direction: column; justify-content: center; align-items: center; pointer-events: auto; cursor: pointer; background: radial-gradient(ellipse at center, rgba(5, 3, 10, .55), rgba(5, 3, 10, .85)); opacity: 0; transition: opacity .8s; }
.narration.in { opacity: 1; }
.narr-bar { position: absolute; left: 0; right: 0; height: 0; background: #000; transition: height .9s cubic-bezier(.7, 0, .2, 1); }
.narr-bar.top { top: 0; } .narr-bar.bottom { bottom: 0; }
.narration.in .narr-bar { height: 12vh; }
.narr-text { max-width: 900px; padding: 0 30px; text-align: center; font: italic 400 clamp(22px, 3vw, 36px)/1.5 var(--serif); color: #f7ebd0; text-shadow: 0 2px 20px rgba(0, 0, 0, .9); white-space: pre-wrap; }
.narr-title .narr-text { font: 900 clamp(34px, 5.5vw, 72px)/1.1 var(--display); letter-spacing: .08em; color: var(--gold-2); text-transform: uppercase; text-shadow: 0 0 40px rgba(240, 211, 145, .5); font-style: normal; }
.narr-location .narr-text { font: 700 clamp(26px, 4vw, 48px)/1.2 var(--display); letter-spacing: .2em; text-transform: uppercase; font-style: normal; }
.narr-location .narr-text::before { content: '📍'; display: block; font-size: .7em; margin-bottom: 10px; }
.narr-horror { background: radial-gradient(ellipse at center, rgba(40, 0, 0, .6), rgba(0, 0, 0, .95)); }
.narr-horror .narr-text { color: #ffb3b3; animation: shiver .12s infinite; text-shadow: 0 0 24px rgba(255, 0, 0, .5); }
@keyframes shiver { 50% { transform: translate(1px, -1px); } }
#curtain { position: fixed; inset: 0; background: #000; z-index: 1400; opacity: 0; transition: opacity 1.2s; display: grid; place-items: center; pointer-events: none; }
#curtain.in { opacity: 1; pointer-events: auto; }
.curtain-text { font: italic 32px var(--serif); color: #f3e3bf; max-width: 800px; text-align: center; padding: 20px; }
#pause-screen { position: fixed; inset: 0; z-index: 1450; background: rgba(8, 6, 14, .88); backdrop-filter: blur(10px); display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; transition: opacity .5s; }
#pause-screen.in { opacity: 1; }
#pause-screen h2 { font: 900 64px var(--display); color: var(--gold-2); margin: 8px 0; letter-spacing: .2em; }
#pause-screen p { color: var(--text-2); font-size: 17px; }
.pause-cup { font-size: 80px; animation: steam 2s ease-in-out infinite; }
@keyframes steam { 50% { transform: translateY(-8px) rotate(-4deg); } }
.handout-back { position: fixed; inset: 0; z-index: 1600; background: radial-gradient(ellipse at center, rgba(30, 20, 5, .7), rgba(0, 0, 0, .9)); display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity .4s; }
.handout-back.in { opacity: 1; }
.handout { width: min(720px, 94vw); max-height: 88vh; overflow-y: auto; padding: 28px 30px 22px; border-radius: 6px; background: linear-gradient(180deg, #f3e7c9, #e1cd9e); color: #2b1d0c; box-shadow: 0 30px 90px rgba(0, 0, 0, .8), 0 0 0 2px #a07a3a inset, 0 0 0 8px rgba(160, 122, 58, .15) inset; transform: scale(.85) rotate(-2deg); transition: transform .6s cubic-bezier(.2, 1.2, .3, 1); position: relative; }
.handout-back.in .handout { transform: none; }
.handout h1 { font: 900 32px var(--display); color: #5a1a1a; margin: 4px 0 6px; text-align: center; }
.handout-cat { text-align: center; font: 700 12px var(--display); letter-spacing: .2em; color: #8a6a3a; text-transform: uppercase; }
.handout-img { width: 100%; max-height: 360px; object-fit: cover; border-radius: 4px; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); margin-bottom: 12px; }
.handout .lore-content { color: #2b1d0c; padding: 6px 0 14px; }
.handout .lore-content h2, .handout .lore-content h3 { color: #5a1a1a; border-color: rgba(90, 26, 26, .3); }
.handout .wiki-link, .handout .wiki-missing { color: #5a1a1a; }
#sound-banner { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); z-index: 2000; padding: 10px 18px; border-radius: 999px; background: var(--gold); color: #1a1208; font-weight: 800; border: 0; cursor: pointer; box-shadow: 0 8px 30px rgba(216, 178, 106, .5); animation: glow 2s infinite; }
.kicked { position: fixed; inset: 0; z-index: 5000; background: rgba(5, 3, 10, .95); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.kicked h1 { font-size: 80px; margin: 0; }

/* ── Chargement ── */
#loading { position: fixed; inset: 0; z-index: 4000; background: radial-gradient(ellipse at center, #1b1428, #07060b); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; transition: opacity .7s; }
#loading.done { opacity: 0; pointer-events: none; }
#loading h1 { font: 900 32px var(--display); color: var(--gold-2); margin: 10px 0 0; letter-spacing: .08em; text-align: center; }
.loading-sub { color: var(--muted); font-style: italic; }
.loader-d20 { position: relative; width: 110px; height: 110px; animation: d20spin 2.4s cubic-bezier(.6, 0, .4, 1) infinite; filter: drop-shadow(0 0 30px rgba(139, 92, 246, .55)); }
.loader-d20 svg { width: 100%; height: 100%; }
.loader-d20 polygon { fill: rgba(139, 92, 246, .25); stroke: var(--gold); stroke-width: 2; }
.loader-d20 polygon.inner { fill: rgba(139, 92, 246, .45); }
.loader-d20 line { stroke: var(--gold); stroke-width: 1.5; opacity: .7; }
.loader-d20 span { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-20%); text-align: center; font: 900 22px var(--display); color: #fff; }
@keyframes d20spin { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(200deg) scale(.9); } 100% { transform: rotate(360deg) scale(1); } }
.fatal { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px; }
.fatal-d20 { font-size: 70px; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatch.active { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .2); }
.invite-card { padding: 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(216, 178, 106, .14), rgba(139, 92, 246, .08)); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.invite-code { font: 900 30px var(--display); letter-spacing: .3em; text-align: center; color: var(--gold-2); text-shadow: 0 0 20px rgba(240, 211, 145, .4); }
.player-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line-2); opacity: .6; }
.player-row.online { opacity: 1; }
.pdot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 800 12px var(--font); color: #111; flex: none; position: relative; }
.player-row.online .pdot::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid var(--panel-solid); }
.shortcuts { display: grid; grid-template-columns: 1fr; gap: 6px; font-size: 13px; color: var(--text-2); }
.tips { padding-left: 4px; list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 0; }

/* ── Responsive ── */
@media (max-width: 1200px) { :root { --side-w: 340px; } #initiative { max-width: calc(100vw - 560px); } .camp-info { max-width: 160px; } }
@media (max-width: 900px) {
  :root { --side-w: min(92vw, 380px); --top-h: 52px; }
  #app { grid-template-columns: 46px 1fr 0; }
  #sidebar { position: fixed; right: 0; top: var(--top-h); bottom: 0; box-shadow: -20px 0 50px rgba(0, 0, 0, .5); }
  #sidebar.collapsed { width: 50px; box-shadow: none; }
  .brand span, .camp-info { display: none; }
  #initiative { position: fixed; top: calc(var(--top-h) + 6px); max-width: calc(100vw - 120px); }
  .tool-btn { width: 36px; height: 36px; font-size: 16px; }
  .macro-bar { max-width: calc(100% - 80px); bottom: 60px; }
  .generator { grid-template-columns: 1fr; }
  .abilities { grid-template-columns: repeat(3, 1fr); }
  .abilities.eight { grid-template-columns: repeat(4, 1fr); }
  .skills-grid, .skills-grid.two { grid-template-columns: 1fr; }
  .sheet-head { flex-direction: column; align-items: center; }
  .voice-fx { display: none; }
  .tool-options { top: auto; bottom: 60px; }
}
/* ── Comptes ── */
.auth-box .btn-lg { width: 100%; }
.auth-err { padding: 8px 12px; border-radius: 8px; background: rgba(229, 72, 77, .15); border: 1px solid rgba(229, 72, 77, .5); color: #ffc7c9; font-size: 13px; }
.auth-switch { text-align: center; color: var(--muted); font-size: 13.5px; }
.link.gold { color: var(--gold-2); font-weight: 700; text-decoration: underline; }
.account-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .02); margin-bottom: 8px; }
