/* ─────────────────────────────────────────────────────────────
   Arcanum — direction artistique « encre & aquarelle »
   Couche purement visuelle, chargée APRÈS style.css / landing.css.
   Nuit verte · crème · or · traits tracés à la main.
   ───────────────────────────────────────────────────────────── */
@font-face { font-family: 'Caveat Brush'; font-display: swap; size-adjust: 118%; src: url(/fonts/caveat-brush-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Caveat Brush'; font-display: swap; size-adjust: 118%; src: url(/fonts/caveat-brush-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Patrick Hand'; font-display: swap; size-adjust: 112%; src: url(/fonts/patrick-hand-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Patrick Hand'; font-display: swap; size-adjust: 112%; src: url(/fonts/patrick-hand-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Kalam'; font-display: swap; src: url(/fonts/kalam-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Kalam'; font-display: swap; font-weight: 600 900; src: url(/fonts/kalam-latin-700-normal.woff2) format('woff2'); }

:root {
  --ink: #0f2f2a;            /* fond (nuit verte) */
  --ink-2: #0b2420;
  --panel: rgba(17, 52, 46, .96);
  --panel-solid: #11332e;
  --panel-2: #164039;
  --panel-3: #1c4a42;
  --line: rgba(243, 231, 204, .34);
  --line-2: rgba(243, 231, 204, .16);
  --gold: #f0b93a;
  --gold-2: #ffd36e;
  --gold-dim: #b98a2c;
  --arcane: #7c5cd6;
  --arcane-2: #c4b2ff;
  --ember: #f08a3c;
  --blood: #e2564f;
  --ok: #8bbd56;
  --warn: #f0b93a;
  --text: #f3e7cc;
  --text-2: #d3e4d8;
  --muted: #93b5a8;
  --pen: #1d1813;            /* encre */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 5px 8px 0 rgba(0, 0, 0, .32);
  --font: 'Patrick Hand', 'Kalam', 'Comic Sans MS', cursive;
  --display: 'Caveat Brush', 'Patrick Hand', cursive;
  --serif: 'Kalam', 'Patrick Hand', cursive;
  --hand-a: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --hand-b: 18px 225px 15px 255px / 255px 15px 225px 15px;
  --hand-c: 12px 30px 14px 26px / 28px 12px 30px 14px;
  --hand-d: 30px 12px 26px 14px / 12px 28px 14px 30px;
  --hand-o: 50% 45% 55% 48% / 52% 48% 52% 48%;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .95  0 0 0 0 .9  0 0 0 0 .8  .22 0 0 0 -.07'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .02' numOctaves='3' seed='5'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  .28 0 0 0 -.06'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Base ── */
body { background-color: var(--ink); background-image: var(--grain), var(--grain-dark); font-size: 15px; letter-spacing: .01em; }
::selection { background: rgba(240, 185, 58, .4); color: #fff; }
::-webkit-scrollbar-thumb { background: rgba(243, 231, 204, .2); border-radius: var(--hand-c); }
::-webkit-scrollbar-thumb:hover { background-color: rgba(243, 231, 204, .38); }
a { color: var(--gold-2); text-decoration-style: wavy; text-underline-offset: 3px; }
kbd { font-family: var(--font); background: var(--panel-3); border-radius: var(--hand-c); border-color: var(--line); color: var(--gold-2); }
code { font-family: ui-monospace, Menlo, Consolas, monospace; background: rgba(0, 0, 0, .25); }
.ai { pointer-events: none; }

/* ── Boutons ── */
.btn { font-family: var(--display); font-weight: 400; font-size: 16px; letter-spacing: .03em; background: var(--panel-2); border: 2px solid var(--line); border-radius: var(--hand-a); box-shadow: 2px 3px 0 rgba(0, 0, 0, .3); padding: 7px 15px; }
.btn:hover { border-color: var(--text); box-shadow: 3px 4px 0 rgba(0, 0, 0, .35); transform: rotate(-.6deg); }
.btn:active { transform: translate(1px, 2px); box-shadow: 1px 1px 0 rgba(0, 0, 0, .3); }
.btn-primary { background: var(--gold); color: var(--pen); border-color: var(--pen); text-shadow: none; transform: rotate(-.8deg); }
.btn-primary:hover { background: #ffc94d; box-shadow: 3px 5px 0 rgba(0, 0, 0, .4); transform: rotate(-1.4deg); }
.btn-danger { background: #a8352f; color: #fff1e6; border-color: var(--pen); }
.btn-ok { background: #5f9e4a; color: #10260f; border-color: var(--pen); }
.btn-ghost { background: transparent; border: 2px dashed var(--line); color: var(--text-2); box-shadow: none; }
.btn-sm { padding: 5px 11px; font-size: 15px; }
.btn-xs { padding: 2px 8px; font-size: 14px; border-radius: var(--hand-c); }
.btn.active { border-color: var(--gold); color: var(--gold-2); }
.btn .ai { width: 1.2em; height: 1.2em; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px rgba(240, 185, 58, .35), 3px 5px 0 rgba(0, 0, 0, .4); } }
.icon-btn { border-radius: var(--hand-c); font-size: 17px; color: var(--text-2); }
.icon-btn:hover { background: rgba(243, 231, 204, .08); border-color: var(--line-2); }
.icon-btn.active { background: var(--gold); border-color: var(--pen); color: var(--pen); box-shadow: 2px 2px 0 rgba(0, 0, 0, .35); }
.icon-btn.danger:hover, .icon-btn.danger.active { background: rgba(226, 86, 79, .25); }
.link.roll:hover, .roll:hover { color: var(--gold-2); text-shadow: none; text-decoration: underline wavy; }

/* ── Champs ── */
.input, .chat-input { font-family: var(--font); font-size: 15.5px; background: rgba(5, 22, 19, .45); border: 2px solid var(--line-2); border-radius: var(--hand-c); color: var(--text); }
.input:focus, .chat-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(240, 185, 58, .15); background: rgba(5, 22, 19, .6); }
.input.code { font-family: ui-monospace, Menlo, Consolas, monospace; }
select.input option { background: var(--panel-solid); color: var(--text); }
input[type=checkbox], input[type=range] { accent-color: var(--gold); }
input[type=color] { border-radius: var(--hand-c); border: 2px solid var(--line); }
.field > span { font-family: var(--serif); font-weight: 400; font-size: 13px; letter-spacing: .04em; color: var(--muted); }
fieldset { border: 2px solid var(--line-2); border-radius: var(--hand-b); background: rgba(243, 231, 204, .025); }
legend { font: 400 20px var(--display); letter-spacing: .03em; text-transform: none; color: var(--gold); }
.hint { font-family: var(--serif); font-size: 13.5px; }
.seg { background: rgba(5, 22, 19, .4); border: 2px solid var(--line-2); border-radius: var(--hand-a); }
.seg button { font-family: var(--font); font-weight: 400; font-size: 14.5px; border-radius: var(--hand-c); }
.seg button.active { background: var(--gold); color: var(--pen); box-shadow: 1px 2px 0 rgba(0, 0, 0, .3); }
.chip { font-family: var(--font); font-size: 14px; border: 1.5px solid var(--line-2); border-radius: var(--hand-a); background: rgba(243, 231, 204, .04); }
.chip.active { background: var(--gold); color: var(--pen); border-color: var(--pen); }
.badge { font-family: var(--serif); border-radius: var(--hand-a); background: rgba(243, 231, 204, .07); }
.badge.tag { color: var(--arcane-2); }
.empty-hint { font-family: var(--serif); font-style: normal; }
.list-group-title { font: 400 19px var(--display); letter-spacing: .03em; text-transform: none; color: var(--gold); border-bottom: 2px dashed var(--line-2); padding-bottom: 3px; }
.list-group-title .count { font-family: var(--serif); }

/* ── Avatars ── */
.avatar { border: 2.5px solid var(--text); border-radius: var(--hand-o); background: var(--panel-3) center/cover no-repeat; font-family: var(--display); font-weight: 400; box-shadow: 2px 3px 0 rgba(0, 0, 0, .35); }
.avatar .ai { width: 104%; height: 104%; }

/* ── Table : cadre général ── */
#topbar { background: var(--ink-2) var(--grain); border-bottom: 2px dashed var(--line-2); }
#topbar::after { display: none; }
.brand { font: 400 26px var(--display); color: var(--text); letter-spacing: .02em; }
.brand .ai { width: 30px; height: 30px; }
.camp-name { font: 400 21px var(--display); color: var(--gold); }
.scene-name { font-family: var(--serif); font-size: 13.5px; }
.scene-name::before { content: ''; }
.conn { border: 2px solid var(--pen); box-shadow: none; }
#toolbar { background: var(--ink-2) var(--grain); border-right: 2px dashed var(--line-2); gap: 5px; }
.tool-btn { width: 42px; height: 42px; border-radius: var(--hand-c); border: 2px solid transparent; }
.tool-btn .ai { width: 28px; height: 28px; }
.tool-btn:hover { background: rgba(243, 231, 204, .07); border-color: var(--line-2); transform: rotate(-3deg); }
.tool-btn.active { background: var(--gold); border-color: var(--pen); box-shadow: 2px 3px 0 rgba(0, 0, 0, .4); transform: rotate(-2deg); }
.tool-sep { height: 0; background: none; border-top: 2px dashed var(--line-2); }
.board-wrap { background: radial-gradient(ellipse at center, #123a34, #061714); }
.tool-options, .view-controls { background: var(--panel); border: 2px solid var(--line); border-radius: var(--hand-b); box-shadow: var(--shadow); backdrop-filter: none; font-family: var(--font); }
.opt-label, .opt-hint, .coords { font-family: var(--serif); }
.macro-btn { font-family: var(--display); font-weight: 400; font-size: 16px; background: var(--panel); border: 2px solid var(--line); border-radius: var(--hand-a); box-shadow: 2px 3px 0 rgba(0, 0, 0, .3); backdrop-filter: none; }
.macro-btn:hover { border-color: var(--gold); transform: rotate(-1deg) translateY(-2px); }

/* ── Barre latérale ── */
#sidebar { background: var(--ink-2) var(--grain); border-left: 2px dashed var(--line-2); }
.side-toggle { background: var(--panel-solid); border: 2px solid var(--line); border-right: 0; border-radius: var(--hand-c); }
#side-tabs { background: rgba(0, 0, 0, .15); border-right: 2px dashed var(--line-2); }
.side-tab { border-radius: var(--hand-c); border: 2px solid transparent; }
.side-tab .ai { width: 27px; height: 27px; }
.side-tab:hover { background: rgba(243, 231, 204, .07); transform: rotate(-3deg); }
.side-tab.active { background: var(--panel-3); border-color: var(--line); }
.badge-dot { font-family: var(--display); font-weight: 400; background: var(--blood); border: 1.5px solid var(--pen); border-radius: var(--hand-o); }
.panel-title { font: 400 25px var(--display); letter-spacing: .02em; color: var(--gold); border-bottom: 2px dashed var(--line-2); }

/* ── Chat ── */
.chat-head { border-bottom: 2px dashed var(--line-2); }
.msg-name { font: 400 18px var(--display); color: var(--gold); }
.msg-player, .msg-time { font-family: var(--serif); }
.bubble { font-size: 15.5px; background: rgba(243, 231, 204, .05); border: 1.5px solid var(--line-2); border-radius: var(--hand-c); }
.mine .bubble { background: rgba(139, 189, 86, .1); border-color: rgba(139, 189, 86, .35); }
.bubble.whisper { background: rgba(180, 160, 245, .1); border: 1.5px dashed #b4a0f5; }
.whisper-to { font-family: var(--serif); color: #c9b8ff; }
.sys { font-family: var(--serif); font-style: normal; }
.emote, .desc { font-family: var(--serif); }
.desc { background: rgba(240, 185, 58, .08); border-left: 0; border: 2px solid rgba(240, 185, 58, .4); border-radius: var(--hand-b); color: #f6e7c3; font-style: normal; }
.inline-roll { font-family: var(--display); font-weight: 400; font-size: 1.08em; background: rgba(240, 185, 58, .16); border: 1.5px solid var(--gold); border-radius: var(--hand-c); }
.inline-roll.crit { background: var(--gold); color: var(--pen); box-shadow: none; }
.inline-roll.fum { background: rgba(226, 86, 79, .3); }
.roll-card { background: var(--panel-2); border: 2px solid var(--line); border-radius: var(--hand-b); box-shadow: 3px 4px 0 rgba(0, 0, 0, .3); }
.roll-card::before { display: none; }
.roll-card.is-crit { border-color: var(--gold); box-shadow: 3px 4px 0 rgba(0, 0, 0, .3), 0 0 0 3px rgba(240, 185, 58, .25); }
.roll-card.is-fumble { border-color: var(--blood); box-shadow: 3px 4px 0 rgba(0, 0, 0, .3), 0 0 0 3px rgba(226, 86, 79, .2); }
.roll-label { font: 400 17px var(--display); letter-spacing: .02em; text-transform: none; color: var(--gold); }
.roll-label .ai { width: 20px; height: 20px; }
.hidden-badge { font-family: var(--serif); }
.rf-op { font-family: var(--serif); }
.die { font: 400 17px var(--display); color: var(--pen); background: #e9dcc0; border: 2px solid var(--pen); border-radius: var(--hand-o); min-width: 28px; height: 28px; }
.die.d20 { clip-path: none; border-radius: var(--hand-o); background: #b9a5f0; min-width: 30px; height: 30px; }
.die.dropped { opacity: .4; }
.die.crit { background: var(--gold); color: var(--pen); border-color: var(--pen); }
.die.fum { background: #e2564f; color: #fff; }
.die.exploded { box-shadow: 0 0 0 2px var(--ember); }
.die.success { background: #b9e07a; border-color: var(--pen); }
.die.failure { background: #f2a3a0; border-color: var(--pen); }
.roll-total { font: 400 40px var(--display); color: #ffe39a; text-shadow: 2px 3px 0 rgba(0, 0, 0, .35); }
@keyframes critPulse { 50% { transform: rotate(-4deg) scale(1.08); } }
.is-crit .roll-total { display: inline-block; }
.crit-banner, .fumble-banner { font: 400 17px var(--display); letter-spacing: .14em; background: none; }
.crit-banner { color: #ffe39a; }
.fumble-banner { color: #ff9a95; }
.roll-extra { border-top: 2px dashed var(--line-2); }
.rx-label { font-family: var(--display); font-weight: 400; font-size: 15px; text-transform: none; }
.rx-total { font: 400 26px var(--display); }
.check-badge { font-family: var(--display); font-weight: 400; font-size: 16px; border-radius: var(--hand-a); }
.table-card, .help-card { background: rgba(243, 231, 204, .04); border: 2px solid var(--line-2); border-radius: var(--hand-b); }
.playing-card { font-family: var(--display); border: 2px solid var(--pen); border-radius: var(--hand-c); background: #f6ecd4; }
.chat-compose { background: rgba(0, 0, 0, .15); border-top: 2px dashed var(--line-2); }
.qd { font: 400 15px var(--display); color: var(--text-2); border: 1.5px solid var(--line-2); border-radius: var(--hand-o); background: rgba(243, 231, 204, .04); }
.qd:hover { background: var(--panel-3); border-color: var(--text); color: #fff; transform: rotate(-4deg); }
.qd.d20 { color: var(--gold-2); border-color: rgba(240, 185, 58, .55); }
.cmd-hints { background: rgba(0, 0, 0, .25); border-top: 2px dashed var(--line-2); }
.cmd-hint { font-family: var(--font); border-radius: var(--hand-c); }

/* ── Listes ── */
.char-row, .lore-row, .comp-row { border-radius: var(--hand-c); border-width: 1.5px; }
.char-row:hover, .lore-row:hover, .comp-row:hover { background: rgba(243, 231, 204, .05); border-color: var(--line-2); }
.char-name, .lore-title { font-family: var(--display); font-weight: 400; font-size: 18px; }
.char-sub { font-family: var(--serif); }
.mini-bar { border: 1.5px solid rgba(243, 231, 204, .5); border-radius: var(--hand-a); height: 7px; background: rgba(0, 0, 0, .3); }
.mini-bar > div { background: var(--ok); border-radius: 0; }
.mini-bar.big { height: 12px; }
.lore-thumb { border-radius: var(--hand-c); border: 1.5px solid var(--line); background-color: var(--panel-3); }
.lore-thumb .ai, .comp-glyph .ai { width: 30px; height: 30px; }
.rarity-dot { border: 1.5px solid var(--pen); box-shadow: none; }
.lvl-badge { font: 400 16px var(--display); color: var(--pen); background: var(--arcane-2); border: 1.5px solid var(--pen); border-radius: var(--hand-o); }
.feat-row { border-bottom: 1.5px dashed var(--line-2); }
.tl-date { font: 400 17px var(--display); }
.tl-dot { background: var(--gold); border: 2px solid var(--pen); box-shadow: none; }
.tl-dot::after { background: none; border-left: 2px dashed var(--line); }

/* ── Modales & fenêtres ── */
.modal-back { background: rgba(4, 16, 14, .6); backdrop-filter: blur(3px); }
.modal { background: var(--panel-solid) var(--grain); border: 2.5px solid var(--line); border-radius: var(--hand-b); box-shadow: 8px 12px 0 rgba(0, 0, 0, .35); }
.modal-head { border-bottom: 2px dashed var(--line-2); }
.modal-head h3 { font: 400 27px var(--display); color: var(--gold); letter-spacing: .02em; }
.modal-actions { border-top: 2px dashed var(--line-2); }
.float-win { background: var(--panel-solid) var(--grain); border: 2.5px solid var(--line); border-radius: var(--hand-b); box-shadow: 7px 11px 0 rgba(0, 0, 0, .33); }
.fw-head { background: rgba(0, 0, 0, .14); border-bottom: 2px dashed var(--line-2); }
.fw-title { font: 400 21px var(--display); letter-spacing: .02em; }
.fw-title .ai { width: 22px; height: 22px; }
.fw-resize { background: linear-gradient(135deg, transparent 50%, rgba(243, 231, 204, .45) 50%, transparent 62%, rgba(243, 231, 204, .45) 62%, transparent 74%); }
.toast { font-family: var(--font); font-weight: 400; font-size: 15.5px; background: var(--panel-solid); border: 2px solid var(--line); border-radius: var(--hand-a); box-shadow: var(--shadow); }
.toast-ok { border-color: var(--ok); }
.toast-error { border-color: var(--blood); color: #ffd2cf; }
.toast-warn { border-color: var(--gold); color: #ffe6a8; }
.ctx-menu { background: var(--panel-solid) var(--grain); border: 2px solid var(--line); border-radius: var(--hand-b); box-shadow: 5px 8px 0 rgba(0, 0, 0, .35); backdrop-filter: none; }
.ctx-item { font-family: var(--font); font-size: 15px; border-radius: var(--hand-c); }
.ctx-item:hover:not(:disabled) { background: rgba(240, 185, 58, .16); }
.ctx-item.danger { color: #ff9f99; }
.ctx-ico { width: 22px; display: inline-grid; place-items: center; }
.ctx-ico .ai { width: 20px; height: 20px; }
.ctx-sep { height: 0; background: none; border-top: 1.5px dashed var(--line-2); }

/* ── Fiches ── */
.sheet-window .fw-body { background: none; }
.portrait .avatar { border-width: 3px; box-shadow: 3px 5px 0 rgba(0, 0, 0, .35); }
.portrait:hover::after { content: '✎'; background: var(--gold); color: var(--pen); border: 2px solid var(--pen); border-radius: var(--hand-o); font-family: var(--font); }
.sheet-name { font: 400 32px var(--display); color: var(--text); }
.ability { background: rgba(243, 231, 204, .04); border: 2px solid rgba(243, 231, 204, .6); border-radius: var(--hand-o); }
.ab-name { font: 400 15px var(--serif); letter-spacing: .08em; color: var(--muted); }
.ab-mod { font: 400 30px var(--display); }
.ab-mod:hover { background: rgba(240, 185, 58, .18); border-radius: var(--hand-o); }
.ab-score { font-family: var(--display) !important; font-weight: 400; color: var(--gold-2); }
.ab-save { font-family: var(--serif); }
.stat-box { background: rgba(0, 0, 0, .18); border: 2px solid var(--line-2); border-radius: var(--hand-b); }
.stat-box.clickable:hover { border-color: var(--gold); background: rgba(240, 185, 58, .08); }
.stat-label { font: 400 13px var(--serif); letter-spacing: .05em; }
.big-num { font: 400 30px var(--display); }
.mid-num { font: 400 20px var(--display); }
.hp-box { border-color: rgba(226, 86, 79, .55); background: rgba(226, 86, 79, .08); }
.pip { border: 2px solid var(--muted); border-radius: var(--hand-o); }
.pip.ok.on { background: var(--ok); border-color: var(--pen); }
.pip.bad.on { background: var(--blood); border-color: var(--pen); }
.pip.slot { background: var(--arcane-2); border-color: var(--pen); box-shadow: none; }
.sheet-tabs { border-bottom: 2px dashed var(--line-2); }
.tab { font: 400 18px var(--display); letter-spacing: .02em; border-bottom: 3px solid transparent; }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); border-radius: 0 0 2px 2px; }
.skill-row { border-bottom: 1.5px dashed var(--line-2); }
.skill-name { font-family: var(--font); }
.skill-val { font-family: var(--display); font-weight: 400; font-size: 17px; }
.prof-pip { border-radius: var(--hand-o) !important; }
.slot-lvl, .slot-label { font-family: var(--display); font-weight: 400; }
.spell-name { font-family: var(--display); font-weight: 400; font-size: 17px; }
.spell-desc, .info-card p { font-family: var(--serif); }
.info-card { border-radius: var(--hand-b) !important; }
.coin { border-radius: var(--hand-o) !important; }
.glyph-btn { border-radius: var(--hand-c) !important; }
.glyph-btn .ai { width: 30px; height: 30px; }
.wiz-step span { font-family: var(--display); font-weight: 400; border-radius: var(--hand-o) !important; }
.pick-card, .kind-card, .scene-card, .fx-btn, .prop-btn, .status-btn, .mix-ch, .pl-row, .player-row, .invite-card, .voice-chip { border-radius: var(--hand-c) !important; }
.pick-card.active, .kind-card.active, .fx-btn.active, .status-btn.on { box-shadow: 2px 3px 0 rgba(0, 0, 0, .35) !important; }
.pc-glyph .ai { width: 86px; height: 86px; filter: drop-shadow(3px 5px 0 rgba(0, 0, 0, .3)); }
.pc-glyph { position: relative; display: grid; place-items: center; min-height: 92px; }
.pc-glyph::before { content: ''; position: absolute; width: 74px; height: 62px; border-radius: 50% 44% 56% 48% / 52% 58% 42% 48%; background: radial-gradient(circle at 40% 40%, rgba(243, 231, 204, .16), rgba(243, 231, 204, .03) 70%); transform: rotate(-8deg); }
.pc-glyph .ai { position: relative; }
.pick-card:hover .pc-glyph .ai { transform: rotate(-4deg) scale(1.06); transition: transform .25s; }
.kc-icon .ai { width: 52px; height: 52px; }
.comp-glyph .ai { width: 36px; height: 36px; }
.sb-glyph .ai, .item-glyph .ai { width: 72px; height: 72px; }
.pc-name, .kc-name { font-family: var(--display); font-weight: 400; font-size: 19px; }
.pc-desc, .pc-traits, .pc-bonus { font-family: var(--serif); }
.summary h2 { font-family: var(--display); font-weight: 400; }
.invite-code { font-family: var(--display) !important; font-weight: 400; letter-spacing: .25em; }

/* ── Initiative & HUD jeton ── */
#initiative { font-family: var(--font); }
.ini-round b, .ini-round small { font-family: var(--display); font-weight: 400; }
.ini-chip { border-radius: var(--hand-c) !important; border-width: 2px !important; }
.ini-chip.current { box-shadow: 2px 3px 0 rgba(0, 0, 0, .4), 0 0 0 3px rgba(240, 185, 58, .3) !important; }
.ini-name { font-family: var(--display); font-weight: 400; }
.ini-val { font-family: var(--display); font-weight: 400; }
.token-hud, .status-pop { background: var(--panel-solid) var(--grain) !important; border: 2px solid var(--line) !important; border-radius: var(--hand-b) !important; box-shadow: var(--shadow) !important; }
.hud-bar { border-radius: var(--hand-a) !important; }
.hud-num { font-family: var(--display) !important; font-weight: 400 !important; }

/* ── Lore & stat blocks ── */
.lore-h1, .stat-block h2, .item-head h2, .handout h1 { font-family: var(--display) !important; font-weight: 400 !important; letter-spacing: .02em; }
.lore-content { font-family: var(--serif); }
.lore-content h2, .lore-content h3 { font-family: var(--display); font-weight: 400; color: var(--gold); }
.lore-content blockquote { border-left: 0; border: 2px dashed var(--line); border-radius: var(--hand-b); }
.lore-banner { border-radius: var(--hand-b) !important; }
.wiki-link { text-decoration: underline wavy rgba(240, 185, 58, .6); }
.rich-toolbar { border-radius: var(--hand-c) !important; }
.tb { border-radius: var(--hand-c) !important; }
.rich-editor { font-family: var(--serif); border-radius: var(--hand-c) !important; }
.sb-sec h4 { font-family: var(--display); font-weight: 400; font-size: 19px; }
.sb-stats b { font-family: var(--display); font-weight: 400; }
.flavor { font-family: var(--serif); }

/* ── Écrans & mises en scène ── */
#loading { background: var(--ink) var(--grain) !important; }
#loading h1, .curtain-text, #pause-screen h2, .kicked h1, .narr-text { font-family: var(--display) !important; font-weight: 400 !important; letter-spacing: .03em; }
.loader-d20 polygon { fill: #b9a5f0 !important; stroke: var(--pen) !important; stroke-width: 3 !important; }
.loader-d20 polygon.inner { fill: #d9ccff !important; }
.loader-d20 line { stroke: var(--pen) !important; stroke-width: 2.5 !important; }
.loader-d20 span { font-family: var(--display) !important; font-weight: 400 !important; color: var(--pen) !important; }
.handout { border-radius: var(--hand-b) !important; }

/* ── Comptes ── */
.auth-box { font-family: var(--font); }
.account-card { border-radius: var(--hand-b) !important; }

/* ───────── Page d'accueil ───────── */
body.landing { background: radial-gradient(ellipse at 70% -10%, #1d5249 0%, transparent 55%), radial-gradient(ellipse at 0% 100%, #2b3a1a 0%, transparent 50%), var(--grain), var(--ink); }
.l-nav { background: linear-gradient(180deg, rgba(11, 36, 32, .95), rgba(11, 36, 32, 0)); }
.l-nav .brand { font-size: 32px; }
.l-nav nav a:not(.btn) { font-family: var(--font); font-weight: 400; font-size: 17px; }
.btn-lg { font-size: 21px; padding: 11px 24px; border-radius: var(--hand-a); }
.eyebrow { font: 400 16px var(--serif); letter-spacing: .06em; text-transform: none; border: 2px dashed var(--line); border-radius: var(--hand-a); background: rgba(240, 185, 58, .07); }
.hero h1 { font: 400 clamp(46px, 6.2vw, 84px)/1 var(--display); letter-spacing: .01em; }
.hero h1 em { background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--gold); position: relative; }
.hero h1 em::after { content: ''; position: absolute; left: -2%; right: -2%; bottom: .02em; height: .26em; z-index: -1; background: var(--blood); opacity: .75; border-radius: var(--hand-a); transform: rotate(-1.2deg); }
.lead { font-family: var(--serif); font-size: 19px; }
.proof { font-family: var(--serif); font-weight: 400; font-size: 15px; }
#hero-map { border-radius: var(--hand-b); border: 3px solid var(--text); box-shadow: 10px 16px 0 rgba(0, 0, 0, .4); background: #0c2622; }
.mock-card { background: var(--panel-solid); border: 2px solid var(--line); border-radius: var(--hand-b); box-shadow: 5px 8px 0 rgba(0, 0, 0, .35); backdrop-filter: none; font-family: var(--font); font-size: 15px; }
.mock-card.roll { border-color: var(--gold); }
.mc-label { font: 400 16px var(--display); letter-spacing: .02em; }
.mc-row b { font: 400 40px var(--display); color: #ffe39a; text-shadow: 2px 3px 0 rgba(0, 0, 0, .35); }
.mc-crit { font: 400 15px var(--display); letter-spacing: .14em; color: #ffe39a; }
.chip-i { font-family: var(--font); font-size: 14px; border: 1.5px solid var(--line-2); border-radius: var(--hand-a); }
.chip-i.cur { border-color: var(--pen); background: var(--gold); color: var(--pen); box-shadow: 2px 2px 0 rgba(0, 0, 0, .35); }
.vdot { border-radius: var(--hand-o) !important; }
.play-card { background: var(--panel-solid) var(--grain); border: 2.5px solid var(--line); border-radius: var(--hand-b); box-shadow: 8px 12px 0 rgba(0, 0, 0, .32); }
.play-card.create { border-color: var(--gold); box-shadow: 8px 12px 0 rgba(0, 0, 0, .32); transform: rotate(-.4deg); }
.play-card.join { transform: rotate(.4deg); }
.play-card h2 { font: 400 34px var(--display); color: var(--gold); }
.sys-btn { border: 2px solid var(--line-2); border-radius: var(--hand-c); background: rgba(243, 231, 204, .03); }
.sys-btn.active { border-color: var(--gold); background: rgba(240, 185, 58, .12); box-shadow: 2px 3px 0 rgba(0, 0, 0, .3); }
.sys-btn .si .ai { width: 32px; height: 32px; }
.sys-btn b { font: 400 18px var(--display); }
.sys-btn small { font-family: var(--serif); font-size: 13px; }
.code-input { font: 400 32px var(--display) !important; letter-spacing: .3em; }
.camp-item { border: 2px solid var(--line-2); border-radius: var(--hand-c); }
.camp-item:hover { border-color: var(--gold); background: rgba(240, 185, 58, .07); transform: rotate(-.5deg) translateX(3px); }
.camp-item .ci-role { font-family: var(--serif); border-radius: var(--hand-a); background: rgba(180, 160, 245, .22); }
.camp-item .ci-role.gm { background: rgba(240, 185, 58, .25); }
.sec-title { font: 400 clamp(34px, 4.4vw, 56px)/1.1 var(--display); }
.sec-title span { font: 400 21px var(--serif); }
.feat-grid article { border: 2px solid var(--line-2); border-radius: var(--hand-b); background: rgba(243, 231, 204, .035); }
.feat-grid article:nth-child(odd) { transform: rotate(-.4deg); }
.feat-grid article:nth-child(even) { transform: rotate(.4deg); }
.feat-grid article:hover { transform: rotate(0) translateY(-4px); border-color: var(--line); box-shadow: 6px 10px 0 rgba(0, 0, 0, .3); }
.fi { width: 96px; height: 96px; font-size: 77px; border: 0; background: none; margin: -6px 0 6px -6px; filter: drop-shadow(4px 6px 0 rgba(0, 0, 0, .3)); }
.fi .ai { width: 96px; height: 96px; }
.feat-grid h3 { font: 400 25px var(--display); color: var(--gold); }
.feat-grid p { font-size: 16px; }
.cmp-table { border: 2.5px solid var(--line); border-radius: var(--hand-b); background: var(--panel-solid); }
.cmp-row { border-bottom: 1.5px dashed var(--line-2); font-size: 16px; }
.cmp-row.head { font: 400 18px var(--display); letter-spacing: .04em; text-transform: none; background: rgba(0, 0, 0, .18); }
.cmp-row .us { font-family: var(--display); font-weight: 400; font-size: 18px; }
.faq details { border: 2px solid var(--line-2); border-radius: var(--hand-c); background: rgba(243, 231, 204, .03); }
.faq summary { font: 400 20px var(--display); }
.faq p { font-family: var(--serif); }
.l-foot { border-top: 2px dashed var(--line-2); font-family: var(--serif); }
.acc-name { font-family: var(--display); font-weight: 400; font-size: 18px; }
.mine-empty { border: 2px dashed var(--line); border-radius: var(--hand-b); font-family: var(--serif); }

/* ── Accueil : nature morte dessinée (remplace la fausse interface) ── */
body.landing { background-attachment: fixed; }
.hero-visual { perspective: none; }
.hero-ill { position: relative; width: 100%; max-width: 640px; aspect-ratio: 1; margin: 0 auto; }
.hero-ill::before { content: ''; position: absolute; inset: 8% 4% 4% 6%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 190, 90, .22), rgba(255, 170, 70, .06) 55%, transparent 70%); filter: blur(10px); }
.hero-ill .it { position: absolute; display: block; filter: drop-shadow(6px 10px 0 rgba(0, 0, 0, .28)); transition: transform .35s cubic-bezier(.2, .9, .3, 1.3); animation: bob 7s ease-in-out infinite; }
.hero-ill .it svg { width: 100%; height: 100%; display: block; }
.hero-ill .it:hover { transform: translateY(-8px) rotate(var(--r2, 0deg)) scale(1.05); }
@keyframes bob { 50% { translate: 0 -6px; } }
.it-map { width: 78%; left: 11%; top: 12%; transform: rotate(-7deg); animation: none !important; filter: drop-shadow(10px 16px 0 rgba(0, 0, 0, .3)); }
.it-key { width: 26%; left: 2%; top: 2%; transform: rotate(-14deg); animation-delay: -1s !important; }
.it-candle { width: 25%; right: 2%; top: 0; animation-delay: -3s !important; }
.it-book { width: 34%; left: 0; bottom: 4%; transform: rotate(-10deg); animation-delay: -2s !important; }
.it-sword { width: 46%; left: 28%; bottom: 0; transform: rotate(18deg); animation-delay: -4s !important; }
.it-potion { width: 23%; right: 4%; top: 34%; transform: rotate(8deg); animation-delay: -5s !important; }
.it-coin { width: 22%; right: 0; bottom: 6%; animation-delay: -2.5s !important; }
.it-dice { width: 27%; left: 38%; top: 36%; transform: rotate(10deg); animation-delay: -1.5s !important; filter: drop-shadow(8px 12px 0 rgba(0, 0, 0, .35)); }
.note-roll { position: absolute; left: 4%; top: 36%; width: 34%; padding: 10px 14px 12px; background: #f3e7cc; color: var(--pen); border: 2px solid var(--pen); border-radius: var(--hand-b); transform: rotate(-5deg); box-shadow: 5px 8px 0 rgba(0, 0, 0, .3); display: flex; flex-direction: column; font-family: var(--serif); line-height: 1.15; }
.note-roll::before { content: ''; position: absolute; top: -9px; left: 50%; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff8a80, #c8413b 60%, #7a1d24); border: 2px solid var(--pen); }
.note-roll b { font: 400 18px var(--display); color: #7a1d24; }
.note-roll span { font: 400 20px var(--serif); }
.note-roll em { font: 400 34px var(--display); font-style: normal; color: #b23a33; }
.note-roll small { font: 400 17px var(--display); letter-spacing: .1em; color: #8a5a10; }
@media (max-width: 960px) { .hero-ill { max-width: 420px; } .note-roll { width: 44%; } }

/* Mon stockage */
.stor-box { border: 2px dashed var(--line-2); border-radius: var(--hand-b); padding: 10px 12px; margin: 4px 0 10px; display: grid; gap: 8px; }
.stor-title { font-family: var(--serif); }
.stor-bar { height: 10px; border-radius: 999px; background: rgba(0, 0, 0, .3); border: 1.5px solid var(--line-2); overflow: hidden; }
.stor-fill { height: 100%; width: 0; background: linear-gradient(90deg, #6fbf73, #f0b93a); transition: width .4s; }
.stor-fill.warn { background: linear-gradient(90deg, #f0b93a, #e07a3a); }
.stor-fill.full { background: #c8413b; }
.stor-list { display: grid; gap: 6px; max-height: 60vh; overflow: auto; }
.stor-item { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1.5px solid var(--line-2); border-radius: var(--hand-c); }
.stor-item img, .stor-ico { width: 54px; height: 40px; object-fit: cover; border-radius: 6px; display: grid; place-items: center; background: rgba(0, 0, 0, .25); flex: none; }
.stor-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* l'accueil remet ses enfants en position relative : la modale doit rester par-dessus tout */
body > .modal-back { position: fixed !important; inset: 0; z-index: 9000 !important; }

/* Générateur : la grille des lieux défile, ne déborde plus sur l'aperçu */
.generator { grid-template-columns: minmax(330px, 400px) minmax(0, 1fr); align-items: start; }
.gen-left { min-width: 0; }
.gen-left .kind-grid { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); max-height: 46vh; overflow-y: auto; padding: 2px 6px 2px 2px; }
.kind-card { min-width: 0; padding: 6px 4px; }
.kind-card .kc-icon .ai { width: 40px; height: 40px; }
.kind-card .kc-name { font-size: 14px; line-height: 1.05; text-align: center; overflow-wrap: anywhere; hyphens: auto; }
.gen-right .preview-wrap { min-height: 380px; max-height: 64vh; }
.gen-preview { max-width: 100%; height: auto; }
/* Pause / fondu : astuce pour sortir */
.overlay-hint { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; font-size: 14px; opacity: .7; }
.overlay-close { position: absolute; top: 18px; right: 22px; }
#curtain .overlay-hint { color: #cfc4a8; }

/* Table de bruitages par catégories */
.sfx-cat { margin: 4px 0 10px; }
.sfx-cat-title { font-family: var(--serif); font-size: 15px; color: var(--gold-2, #f0c75e); margin: 2px 2px 4px; opacity: .9; }

/* Aide-mémoire des règles sur les fiches des systèmes clé en main */
.rules-tip { margin: 6px 14px 4px; padding: 8px 12px; border: 1.5px dashed var(--line-2); border-radius: var(--hand-c); font-size: 13px; line-height: 1.4; background: rgba(240, 185, 58, .06); }
.le-row .w140 { width: 140px; flex: none; }

/* Aptitudes actives */
.feat-list { display: grid; gap: 8px; }
.feat-card { border: 1.5px solid var(--line-2); border-radius: var(--hand-c); padding: 8px; display: grid; gap: 6px; }
.feat-card.active-feat { border-color: rgba(240, 185, 58, .5); background: rgba(240, 185, 58, .04); }
.feat-head, .feat-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.feat-foot label { display: flex; gap: 4px; align-items: center; }
.feat-foot .w60 { width: 60px; } .feat-foot .w110 { width: 110px; }
.feat-name input, input.feat-name { font-family: var(--display); font-size: 17px; }
.feat-pips { display: inline-flex; gap: 3px; } .feat-pool b { font-size: 16px; color: var(--gold-2, #f0c75e); }
.feat-note { flex-basis: 100%; }
.feat-quick { margin-bottom: 10px; } .feat-quick-row { display: flex; gap: 6px; flex-wrap: wrap; }
.feat-btn .feat-left { opacity: .75; font-size: 12px; }
.feat-foot .w160 { width: 160px; }
/* Fiches des systèmes clé en main */
.abilities.auto { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.ability .ab-full { text-align: center; line-height: 1.1; max-width: 110px; }
.res-box .res-pips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-width: 150px; margin-top: 6px; }
details.rules-tip summary { cursor: pointer; list-style: none; } details.rules-tip summary::-webkit-details-marker { display: none; }
details.rules-tip p { margin: 6px 0 0; }

/* ── Objets interactifs, butin, potions glissées ── */
.le-row.inv-drag { cursor: grab; }
.le-row.inv-drag:active { cursor: grabbing; }
.drag-handle { color: var(--muted); font-size: 16px; line-height: 1; padding: 0 2px; cursor: grab; user-select: none; }
.le-row.inv-drag:hover .drag-handle { color: var(--gold-2); }
.item-use.heal { border-color: rgba(139, 189, 86, .6); }
.item-use.damage { border-color: rgba(226, 86, 79, .6); }
.item-use small { font-size: 11px; opacity: .8; }
body.dragging-item .char-row, body.dragging-item .sheet .portrait { outline: 2px dashed rgba(139, 189, 86, .45); outline-offset: 2px; }
.item-drop { outline: 3px solid var(--ok) !important; outline-offset: 2px; background: rgba(139, 189, 86, .12) !important; }
.le-row .w90 { width: 90px; flex: none; }
.le-row .w110 { width: 110px; flex: none; }
.effect-badge { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 8px; border-radius: var(--hand-c); font-size: 14px; border: 2px solid var(--line-2); }
.effect-badge.heal { background: rgba(139, 189, 86, .14); border-color: rgba(139, 189, 86, .5); }
.effect-badge.dmg { background: rgba(226, 86, 79, .14); border-color: rgba(226, 86, 79, .5); }
.effect-badge.undone { opacity: .45; text-decoration: line-through; }
.effect-badge b { font-family: var(--display); font-size: 18px; font-weight: 400; }
.effect-badge .fx-undo { margin-left: auto; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; cursor: pointer; padding: 0 6px; }
.effect-badge .fx-undo:disabled { opacity: .3; cursor: default; }
.loot-modal .loot-text { padding: 10px 12px; border-radius: var(--hand-b); background: rgba(243, 231, 204, .07); border: 2px dashed var(--line-2); font-family: var(--serif); line-height: 1.45; }
.loot-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow: auto; }
.loot-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--hand-c); background: rgba(255, 255, 255, .03); border: 2px solid var(--line-2); animation: lootIn .35s ease both; }
.loot-row:nth-child(2) { animation-delay: .06s; } .loot-row:nth-child(3) { animation-delay: .12s; } .loot-row:nth-child(4) { animation-delay: .18s; } .loot-row:nth-child(n+5) { animation-delay: .24s; }
.loot-ico { font-size: 24px; width: 30px; text-align: center; }
.loot-qty { color: var(--gold-2); font-family: var(--display); font-size: 17px; }
@keyframes lootIn { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
.interact-ed .loot-edit { display: flex; flex-direction: column; gap: 5px; }
.interact-ed .row.wrap { flex-wrap: wrap; }
.outcome-badge { margin-top: 6px; padding: 3px 10px; border-radius: var(--hand-c); font-family: var(--display); font-size: 18px; border: 2px solid var(--line-2); }
.outcome-badge.ok { background: rgba(139, 189, 86, .16); border-color: rgba(139, 189, 86, .55); color: #cfeeb0; }
.outcome-badge.ko { background: rgba(226, 86, 79, .14); border-color: rgba(226, 86, 79, .5); color: #ffc2bd; }
.outcome-badge.neutral { background: rgba(243, 231, 204, .06); color: var(--muted); }
.trap-desc { margin-top: 5px; font-style: italic; font-size: 14px; color: var(--text-2); }
.effects-list { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.effects-list .effect-badge { margin-top: 0; }
.effects-list .effect-badge.none { background: rgba(243, 231, 204, .05); border-color: var(--line-2); }
.effects-list.undone { opacity: .45; text-decoration: line-through; }
.effects-list > .fx-undo { align-self: flex-end; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; cursor: pointer; padding: 1px 8px; font-size: 13px; }
.chest-approach .chest-notes { display: flex; flex-direction: column; gap: 4px; }
.chest-approach .chest-note { padding: 6px 10px; border-radius: var(--hand-c); background: rgba(243, 231, 204, .06); border: 1px dashed var(--line-2); font-size: 14px; }
.chest-approach .chest-puzzle { padding: 10px 12px; border-radius: var(--hand-b); background: rgba(124, 92, 214, .14); border: 2px dashed rgba(196, 178, 255, .4); font-family: var(--serif); font-style: italic; }
.chest-acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.chest-act { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; padding: 8px 12px; min-height: 54px; }
.chest-act b { font-family: var(--display); font-size: 18px; font-weight: 400; }
.chest-act small { font-size: 12px; opacity: .75; line-height: 1.2; }
.chest-act.primary { border-color: var(--gold) !important; }
.chest-act.danger { border-color: rgba(226, 86, 79, .6) !important; }
.chest-msg { font-family: var(--display); font-size: 19px; color: var(--gold-2); min-height: 22px; }
.chest-state { display: flex; flex-wrap: wrap; gap: 5px; }
.chest-state span { font-size: 12px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); }
.chest-state span.on { border-color: var(--gold); color: var(--gold-2); }
.trap-ed .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.trap-ed .grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 640px) { .trap-ed .grid3, .trap-ed .grid4 { grid-template-columns: 1fr 1fr; } }
.img-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-height: 56vh; overflow: auto; padding: 2px; }
.img-pick-item { position: relative; aspect-ratio: 1; padding: 0; border: 2px solid var(--line-2); border-radius: var(--hand-c); overflow: hidden; background: rgba(0,0,0,.25); cursor: pointer; }
.img-pick-item:hover { border-color: var(--gold); transform: translateY(-1px); }
.img-pick-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-pick-tag { position: absolute; left: 4px; bottom: 4px; right: 4px; font-size: 11px; background: rgba(0,0,0,.6); color: var(--text); border-radius: 6px; padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lore-linked { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; margin: 8px 0; border-radius: var(--hand-b); border: 2px dashed var(--line-2); background: rgba(243,231,204,.05); }
.lore-linked .ll-name { font-family: var(--display); font-size: 20px; color: var(--gold-2); }
.lore-linked .ll-bio { white-space: pre-wrap; font-family: var(--serif); }
/* ── Appliquer un jet sur des cibles ── */
.apply-btn { margin-left: 8px; padding: 2px 10px; border-radius: var(--hand-c); border: 2px solid var(--line); background: rgba(255,255,255,.05); color: var(--text); font-family: var(--display); font-size: 15px; cursor: pointer; white-space: nowrap; }
.apply-btn.damage { border-color: rgba(226, 86, 79, .6); }
.apply-btn.heal { border-color: rgba(139, 189, 86, .6); }
.apply-btn:hover { background: rgba(255,255,255,.12); transform: translateY(-1px); }
.apply-row { display: flex; justify-content: flex-end; margin-top: 4px; }
.roll-extra { display: flex; align-items: center; flex-wrap: wrap; }
.apply-head { display: flex; align-items: baseline; gap: 12px; }
.apply-amount { font-family: var(--display); font-size: 30px; }
.apply-amount.damage { color: #ffb0a8; } .apply-amount.heal { color: #cfeeb0; }
.apply-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.apply-tok { display: flex; align-items: center; gap: 8px; text-align: left; padding: 6px 8px; border-radius: var(--hand-c); border: 2px solid var(--line-2); background: rgba(255,255,255,.03); color: var(--text); cursor: pointer; }
.apply-tok.on { border-color: var(--gold); background: rgba(240, 185, 58, .14); box-shadow: 0 0 0 1px var(--gold) inset; }
.apply-tok.foe.on { border-color: #e2564f; background: rgba(226, 86, 79, .14); box-shadow: 0 0 0 1px #e2564f inset; }
.apply-tok b { display: block; font-size: 15px; }
.apply-card .effects-list { margin-top: 2px; }
.apply-modal .list-group-title { display: flex; align-items: center; }
.plan-seg { flex-wrap: wrap; }
.plan-seg button { white-space: nowrap; }
.dj-badge { margin: 6px 0 4px; padding: 8px 10px; border: 2px dashed var(--gold); border-radius: var(--hand-a); background: rgba(216, 178, 106, .1); font-size: 13.5px; line-height: 1.35; }
.dj-settings .check { display: flex; align-items: center; gap: 6px; }
.dj-settings .pdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid rgba(0, 0, 0, .4); }
.name-row { display: flex; align-items: center; gap: 8px; }
.name-row .sheet-name { flex: 1; min-width: 0; }
.codex-chip { flex: none; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font); font-size: 13px; padding: 4px 10px; border-radius: var(--hand-c); border: 2px dashed var(--line-2); background: rgba(5, 22, 19, .35); color: inherit; cursor: pointer; }
.codex-chip.linked { border-style: solid; border-color: var(--gold); background: rgba(216, 178, 106, .15); }
.codex-chip:hover { border-color: var(--gold); }
/* Horloge de jeu */
.clock-chip { margin-left: 8px; font-family: var(--font); font-size: 13.5px; padding: 2px 10px; border-radius: var(--hand-c); border: 2px solid var(--line-2); background: rgba(5, 22, 19, .4); color: inherit; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.clock-chip:hover { border-color: var(--gold); }
.clock-now { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.clock-ico svg, .clock-ico img { width: 20px; height: 20px; }
/* Zones déclencheuses */
.zone-action { border: 2px dashed var(--line-2); border-radius: var(--hand-a); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; background: rgba(5, 22, 19, .25); }
.zone-ed .chip { display: inline-flex; align-items: center; gap: 4px; }
.zone-actions { max-height: 46vh; overflow: auto; }
/* Recherche d'objets */
.prop-searchbar { display: flex; gap: 6px; align-items: center; position: sticky; top: 0; z-index: 2; padding: 4px 0 6px; background: var(--panel-solid, #11332e); }
.prop-searchbar .prop-search { flex: 1; min-width: 0; }
.prop-cats { margin-bottom: 4px; flex-wrap: wrap; overflow: visible; }

/* ── Montée de niveau guidée & choix de sorts ── */
.lvlup { gap: 10px; }
.lvlup .lu-sec { padding: 10px 12px; border: 1.5px solid var(--line-2); border-radius: var(--hand-c); background: rgba(243, 231, 204, .03); display: flex; flex-direction: column; gap: 6px; }
.lvlup .lu-sec h4 { margin: 0 0 2px; font-family: var(--font); font-size: 17px; color: var(--gold-2); letter-spacing: .2px; }
.lvlup .lu-sec p { margin: 2px 0; line-height: 1.4; font-size: 13.5px; }
.lvlup .lu-subfeat { border-left: 3px solid var(--gold); padding-left: 8px; }
.lvlup .seg { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 4px; }
.lvlup .lu-pick { padding: 7px 9px; border: 1.5px dashed var(--line-2); border-radius: var(--hand-a); display: flex; flex-direction: column; gap: 4px; }
.lvlup .lu-feat { align-items: flex-start; gap: 8px; padding: 3px 0; }
.lvlup .ok, .sp-pick-count .ok { color: var(--ok); } .lvlup .bad, .sp-pick-count .bad { color: var(--blood); }
.asi-box { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.sp-pick-modal .modal-body { max-height: 72vh; display: flex; flex-direction: column; }
.sp-pick { min-height: 0; flex: 1; }
.sp-pick-lvls { display: flex; flex-wrap: wrap; gap: 5px; }
.sp-pick-list { overflow: auto; max-height: 52vh; border: 1.5px solid var(--line-2); border-radius: var(--hand-c); }
.sp-pick-row { display: flex; gap: 9px; align-items: flex-start; padding: 7px 10px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .12s; }
.sp-pick-row:hover { background: rgba(240, 185, 58, .06); }
.sp-pick-row.on { background: rgba(240, 185, 58, .14); }
.sp-pick-row.known { opacity: .55; cursor: default; }
.sp-pick-row .spell-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-pick-row:hover .spell-desc { -webkit-line-clamp: unset; }
.sp-lvl { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line-2); font-size: 12px; font-weight: 700; color: var(--gold-2); }
.sp-pick-count { font-size: 15px; white-space: nowrap; }
.sp-tag { display: inline-block; margin-left: 5px; padding: 0 5px; border: 1px solid var(--line-2); border-radius: 6px; font-size: 10.5px; line-height: 16px; color: var(--text-2); vertical-align: middle; }
.sp-tag.gold { border-color: var(--gold); color: var(--gold-2); } .sp-tag.ok { border-color: var(--ok); color: var(--ok); } .sp-tag.bad { border-color: var(--blood); color: var(--blood); }
.sp-budget { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sp-budget-item { display: flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1.5px solid var(--line-2); border-radius: var(--hand-a); font-size: 13px; }
.sp-budget-item b { font-size: 15px; }
.sp-budget-item.under { border-color: var(--warn); background: rgba(240, 185, 58, .08); } .sp-budget-item.under b { color: var(--warn); }
.sp-budget-item.over { border-color: var(--blood); } .sp-budget-item.over b { color: var(--blood); }
.sp-budget-item.ok b { color: var(--ok); }
.sp-lock { width: 16px; text-align: center; font-size: 12px; color: var(--gold-2); }
.sp-unprep { opacity: .55; }

/* ── Dés : réglages et aperçu ── */
.dice-dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; transform: rotate(45deg); margin-right: 6px; border: 1.5px solid rgba(0, 0, 0, .5); vertical-align: -1px; }
.dice-dlg .dice-prev { display: flex; align-items: flex-end; justify-content: center; gap: 4px; padding: 10px 0 4px; border-radius: var(--hand-c); background: radial-gradient(ellipse at 50% 70%, rgba(243, 231, 204, .07), transparent 70%); }
.dice-dlg .field > span { display: block; margin-bottom: 4px; }
.dice-styles { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px; }
.dice-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.dice-preset { width: 30px; height: 30px; border-radius: 7px; transform: rotate(45deg); border: 2px solid rgba(0, 0, 0, .45); background: var(--c); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--i) 35%, transparent); cursor: pointer; transition: transform .15s; }
.dice-preset:hover { transform: rotate(45deg) scale(1.15); }
.dice-preset.gem { background: linear-gradient(135deg, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 60%, #000)); }
.dice-preset.metal { background: linear-gradient(135deg, #f4f4f5, var(--c) 45%, #3f3f46); }
.dice-preset.glow { background: #0b0b10; border-color: var(--c); box-shadow: 0 0 10px var(--c); }
.dice-preset.marble { background: repeating-linear-gradient(60deg, var(--c) 0 6px, color-mix(in srgb, var(--c) 50%, #fff) 6px 8px); }
.dice-preset.bone { background: #e8dcc0; box-shadow: inset 0 0 0 4px var(--c); }
.dice-swatch { display: block; }

/* Expertise (maîtrise ×2) : pastille blanc lumineux, bien distincte de la simple maîtrise dorée */
.prof-pip.r2 { background: #fffaf0 !important; border-color: #fff !important; box-shadow: 0 0 6px 2px rgba(255, 255, 255, .85), 0 0 14px 4px rgba(255, 244, 214, .45) !important; }
.prof-pip.r2:hover { box-shadow: 0 0 8px 3px rgba(255, 255, 255, .95), 0 0 18px 6px rgba(255, 244, 214, .55) !important; }

/* ── Codex : secret du MJ, relations, liens ── */
.lore-entry > .lore-secret { margin: 6px 22px 10px; }
.lore-secret { margin: 14px 0 6px; padding: 10px 14px; border: 1.5px dashed rgba(240, 120, 120, .55); border-radius: var(--hand-c); background: rgba(160, 30, 30, .1); }
.lore-secret-head { font-family: var(--font); font-size: 16px; color: #f2a7a7; margin-bottom: 4px; }
.lore-secret-body { font-size: 14px; line-height: 1.5; }
label.lore-secret.edit > span { color: #f2a7a7; }
.lore-rels { padding: 0 22px 14px; }
.lore-rels .list-group-title { width: 100%; }
.lore-rel-list { display: flex; flex-wrap: wrap; gap: 6px; }
.rel-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1.5px solid color-mix(in srgb, var(--rc) 60%, transparent); border-radius: var(--hand-a); background: color-mix(in srgb, var(--rc) 10%, transparent); color: var(--text); font-size: 13px; cursor: pointer; }
.rel-chip:hover { background: color-mix(in srgb, var(--rc) 22%, transparent); }
.rel-chip.secret { border-style: dashed; }
.rel-chip .rel-lbl { color: var(--text-2); }
.rel-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rc); flex: none; box-shadow: 0 0 6px var(--rc); }
.rel-editor { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.rel-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wiki-link.auto { border-bottom-style: dotted; }
.ext-link { color: #8ec5ff; text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.ext-link::after { content: ' ↗'; font-size: .8em; }
/* Texte à liens (fiche de personnage) */
.linked-text .lt-head > span:first-child { font-family: var(--serif); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.linked-text .lt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.linked-text .lt-view { padding: 8px 12px; min-height: 42px; border: 1.5px solid var(--line-2); border-radius: var(--hand-c); background: rgba(243, 231, 204, .03); line-height: 1.55; font-size: 14px; white-space: normal; }
.linked-text .lt-view .wiki-link { color: var(--gold-2); cursor: pointer; border-bottom: 1px solid currentColor; }
/* Toile des relations */
.graph-wrap { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 420px; }
.graph-wrap .graph-canvas { flex: 1; width: 100%; min-height: 360px; cursor: grab; display: block; background: radial-gradient(ellipse at center, rgba(243, 231, 204, .04), transparent 70%); }
.graph-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1.5px dashed var(--line-2); }
.graph-search { width: 180px; }
.graph-cats { display: flex; flex-wrap: wrap; gap: 4px; }
.graph-cats .chip { opacity: .45; font-size: 12.5px; padding: 2px 8px; }
.graph-cats .chip.active { opacity: 1; background: color-mix(in srgb, var(--cc) 18%, transparent); color: var(--text); border-color: color-mix(in srgb, var(--cc) 60%, transparent); }
.graph-cats .cat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--cc); }
.graph-legend { position: absolute; left: 10px; bottom: 34px; display: flex; flex-wrap: wrap; gap: 10px; max-width: 70%; padding: 6px 10px; border-radius: var(--hand-c); background: rgba(14, 24, 21, .8); font-size: 12px; pointer-events: none; }
.graph-legend .lg-item { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); }
.graph-legend .lg-line { width: 18px; height: 3px; border-radius: 2px; background: var(--rc); }
.graph-legend .lg-line.dash { background: repeating-linear-gradient(90deg, rgba(214, 199, 161, .7) 0 4px, transparent 4px 8px); }
.graph-tip { position: absolute; display: none; max-width: 250px; padding: 8px 10px; border: 1.5px solid var(--line-2); border-radius: var(--hand-c); background: rgba(14, 24, 21, .95); pointer-events: none; z-index: 2; box-shadow: 0 8px 22px rgba(0, 0, 0, .4); }
.graph-tip > * + * { margin-top: 3px; }
.graph-wrap .graph-hint { padding: 4px 10px; font-size: 12px; color: var(--muted); }
.graph-empty { position: absolute; inset: 40% 0 auto; text-align: center; }
