/* ===================== LÉGENDA CRAFT — style "dessiné à la main" ===================== */
:root {
  --ink: #3a2a1c;
  --ink-soft: #6b5640;
  --paper: #f6edd8;
  --paper-dark: #e8d9b5;
  --accent: #b5482e;
  --gold: #d4a017;
  --hand: "Segoe Print", "Bradley Hand", "Comic Sans MS", "Chalkboard SE", cursive;
  --body: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2b2218; color: var(--ink); font-family: var(--body); }
.hidden { display: none !important; }
.muted { color: var(--ink-soft); opacity: .85; }
.small { font-size: 12px; }
code { background: rgba(0,0,0,.08); padding: 0 4px; border-radius: 3px; }

/* papier quadrillé comme les dessins */
.paper {
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(110,150,200,.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110,150,200,.13) 1px, transparent 1px);
  background-size: 18px 18px;
  border: 2px solid var(--ink);
  border-radius: 10px 14px 9px 13px / 13px 9px 14px 10px;
  box-shadow: 3px 4px 0 rgba(0,0,0,.35);
}

.btn {
  font-family: var(--hand); font-size: 16px; color: var(--ink); cursor: pointer;
  background: #f3d98b; border: 2px solid var(--ink); padding: 6px 14px;
  border-radius: 12px 8px 14px 9px / 9px 14px 8px 12px; box-shadow: 2px 3px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: 3px 4px 0 var(--ink); background: #f7e3a2; }
.btn:active { transform: translate(2px,2px); box-shadow: 0 0 0 var(--ink); }
.btn.big { font-size: 20px; padding: 10px 22px; width: 100%; margin-top: 10px; }
.btn.small { font-size: 13px; padding: 3px 9px; box-shadow: 1px 2px 0 var(--ink); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 2px 3px 0 var(--ink), 0 0 18px #f3c84b; } }

input, select {
  font-family: var(--body); font-size: 16px; padding: 7px 9px; width: 100%; margin-top: 3px;
  border: 2px solid var(--ink); border-radius: 8px 6px 9px 5px; background: #fffaf0; color: var(--ink);
}
label { display: block; margin: 9px 0; font-family: var(--hand); font-size: 15px; }

/* ===================== LAUNCHER ===================== */
#launcher {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #5a4630 0%, #2b2218 75%);
}
#launcher::before {
  content: ""; position: absolute; inset: 0; opacity: .25; pointer-events: none;
  background-image: url("../assets/sprites/maarxus.png"); background-repeat: no-repeat; background-position: 6% 90%; background-size: 220px;
}
.launcher-box { display: flex; gap: 24px; width: min(1000px, 96vw); max-height: 94vh; padding: 22px; position: relative; }
.launcher-left { flex: 1.15; display: flex; flex-direction: column; min-width: 0; }
.launcher-right { flex: 1; display: flex; flex-direction: column; min-width: 300px; border-left: 2px dashed var(--ink-soft); padding-left: 22px; overflow-y: auto; }
.logo { width: 100%; max-width: 460px; align-self: center; filter: drop-shadow(0 3px 6px rgba(0,0,0,.35)); }
/* le logo, mis en valeur : respiration douce et halo chaleureux (v0.12) */
.logo { animation: logo-flotte 6s ease-in-out infinite; filter: drop-shadow(0 6px 14px rgba(120, 80, 20, .25)); }
@keyframes logo-flotte {
  0%, 100% { transform: translateY(0); filter: drop-shadow(0 6px 14px rgba(120, 80, 20, .25)); }
  50% { transform: translateY(-5px); filter: drop-shadow(0 10px 22px rgba(190, 140, 40, .35)); }
}
h2, h3 { font-family: var(--hand); margin: 6px 0; }
.news { overflow-y: auto; flex: 1; padding-right: 6px; }
.news article { border-bottom: 1px dashed var(--ink-soft); padding: 6px 0; }
.news h4 { margin: 0; font-family: var(--hand); color: var(--accent); }
.news time { font-size: 12px; color: var(--ink-soft); }
.news p { margin: 4px 0; font-size: 14px; line-height: 1.35; }
.server-status { display: flex; align-items: center; gap: 8px; font-family: var(--hand); margin-bottom: 8px; }
.server-status .dot { width: 12px; height: 12px; border-radius: 50%; background: #aaa; border: 2px solid var(--ink); }
.server-status.on .dot { background: #6c3; }
.server-status.off .dot { background: #d33; }
.tabs { display: flex; gap: 6px; margin-bottom: 4px; }
.tab { flex: 1; font-family: var(--hand); font-size: 16px; background: transparent; border: 2px solid var(--ink); border-bottom: none; padding: 6px; border-radius: 10px 10px 0 0; cursor: pointer; color: var(--ink); opacity: .6; }
.tab.active { background: #fbe6a6; opacity: 1; }
.msg { min-height: 20px; color: var(--accent); font-weight: bold; margin: 8px 0; }
.msg.ok { color: #2f7a2f; }
.launcher-foot { margin-top: auto; padding-top: 10px; display: flex; gap: 8px; align-items: center; }
#char-existing { text-align: center; }
#char-preview { background: rgba(255,255,255,.4); border: 2px dashed var(--ink-soft); border-radius: 12px; }
.races { display: flex; gap: 8px; }
.race-card { flex: 1; cursor: pointer; text-align: center; padding: 6px 4px; border: 2px solid var(--ink-soft); border-radius: 12px 9px 13px 8px; background: rgba(255,255,255,.35); font-family: var(--hand); font-size: 14px; transition: transform .1s; }
.race-card:hover { transform: translateY(-2px); }
.race-card.sel { border-color: var(--accent); background: #fbe6a6; box-shadow: 2px 3px 0 var(--ink); }
.race-card canvas { display: block; margin: 0 auto; }
.race-detail { font-size: 13.5px; line-height: 1.35; margin: 8px 0; min-height: 90px; }
.race-detail ul { margin: 4px 0; padding-left: 18px; color: #2f6a2f; }
.row { display: flex; align-items: center; gap: 10px; font-family: var(--hand); margin: 8px 0; }
.colors { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 21px; height: 21px; border-radius: 50%; border: 2px solid var(--ink); cursor: pointer; }
.swatch.sel { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ===================== JEU ===================== */
#game { position: fixed; inset: 0; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24'><path d='M2 2 L20 9 L12 12 L9 20 Z' fill='%23f6edd8' stroke='%233a2a1c' stroke-width='2'/></svg>") 2 2, auto; }
.hud { position: absolute; z-index: 5; }
#hud-stats { top: 10px; left: 10px; width: 260px; padding: 8px 10px; }
.hud-name { font-family: var(--hand); font-size: 18px; margin-bottom: 4px; }
.hud-name .lvl { font-size: 14px; color: var(--ink-soft); }
.bar { position: relative; height: 16px; border: 2px solid var(--ink); border-radius: 8px 5px 9px 6px; margin: 4px 0; background: rgba(0,0,0,.12); overflow: hidden; }
.bar > div { height: 100%; width: 0; transition: width .25s; }
.bar span { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 13px; font-weight: bold; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.bar.hp > div { background: linear-gradient(#e86a5a, #b8321f); }
.bar.xp > div { background: linear-gradient(#b48ae8, #7444b8); }
.bar.aggro > div { background: repeating-linear-gradient(-45deg, #e8462a 0 8px, #c23518 8px 16px); }
.bar.aggro.high { animation: shake .3s infinite; }
@keyframes shake { 25% { transform: translateX(-1px); } 75% { transform: translateX(1px); } }
.group-box { margin-top: 8px; border-top: 1px dashed var(--ink-soft); padding-top: 4px; }
.group-box .gm { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.group-box .gm .bar { flex: 1; height: 10px; margin: 2px 0; }
#minimap-box { top: 10px; right: 10px; padding: 6px; text-align: center; }
#minimap { display: block; border: 1px solid var(--ink-soft); border-radius: 6px; image-rendering: pixelated; }
.hud-region { font-family: var(--hand); font-size: 13px; margin-top: 4px; max-width: 180px; }
.region-banner { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); font-family: var(--hand); font-size: 32px; color: var(--paper); text-shadow: 2px 2px 0 var(--ink), -1px -1px 0 var(--ink); pointer-events: none; opacity: 0; transition: opacity 1s; z-index: 4; text-align: center; white-space: nowrap; }
.region-banner.show { opacity: 1; }

#chat { left: 10px; bottom: 10px; width: 420px; padding: 6px; }
#chat-log { height: 170px; overflow-y: auto; font-size: 13.5px; line-height: 1.3; padding: 2px 4px; }
#chat-log .l { margin: 1px 0; word-wrap: break-word; }
#chat-log .who { font-weight: bold; cursor: pointer; }
#chat-log .tag { font-size: 11px; padding: 0 3px; border-radius: 3px; color: #fff; margin-right: 2px; }
#chat-form { display: flex; gap: 4px; margin-top: 4px; }
#chat-form select { width: 95px; font-size: 13px; padding: 4px; }
#chat-form input { font-size: 14px; padding: 4px 7px; }
.ch-g { color: var(--ink); } .ch-z { color: #2d5f8a; } .ch-gr { color: #2e7d32; } .ch-mp { color: #a0307f; } .ch-s { color: #b5482e; } .ch-sys { color: #6b5640; font-style: italic; }

#skillbar { bottom: 10px; left: 50%; transform: translateX(-50%); padding: 6px; display: flex; gap: 6px; align-items: center; }
.slot { position: relative; width: 52px; height: 52px; border: 2px solid var(--ink); border-radius: 10px 7px 11px 8px; background: rgba(255,255,255,.5); cursor: pointer; padding: 3px; }
.slot:hover { background: #fbe6a6; }
.slot img { max-width: 100%; max-height: 100%; pointer-events: none; }
.slot .key { position: absolute; left: 2px; top: 0; font-size: 11px; font-weight: bold; }
.slot .count { position: absolute; right: 3px; bottom: 1px; font-size: 12px; font-weight: bold; text-shadow: 0 0 2px #fff; }
.slot .cd { position: absolute; inset: 0; background: rgba(40,30,20,.6); border-radius: 8px; display: none; color: #fff; font-weight: bold; align-items: center; justify-content: center; font-size: 16px; }
.slot .big-q { font-family: var(--hand); font-size: 26px; }
.sep { width: 2px; height: 40px; background: var(--ink-soft); margin: 0 4px; }

.panel { position: absolute; z-index: 8; right: 10px; top: 230px; width: 340px; max-height: calc(100vh - 320px); display: flex; flex-direction: column; }
.panel-head, .dialog-head { display: flex; align-items: center; padding: 6px 10px; border-bottom: 2px dashed var(--ink-soft); gap: 8px; }
.panel-head h3, .dialog-head h3 { flex: 1; }
.x { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--ink); }
.panel-body { padding: 8px 10px; overflow-y: auto; font-size: 14px; }
.panel-body.help p { margin: 6px 0 10px; line-height: 1.4; }
.quest { border-bottom: 1px dashed var(--ink-soft); padding: 6px 0; }
.quest h4 { margin: 0; font-family: var(--hand); }
.quest.main h4 { color: var(--accent); }
.quest.done h4::after { content: " ✔"; color: #2e7d32; }
.quest .obj { font-size: 13px; margin-left: 8px; }
.quest .obj.ok { color: #2e7d32; text-decoration: line-through; }
.quest details { font-size: 13px; color: var(--ink-soft); }
.quest .ab { font-size: 11px; float: right; }
.inv-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.inv-item { position: relative; aspect-ratio: 1; border: 2px solid var(--ink-soft); border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; background: rgba(255,255,255,.45); padding: 3px; }
.inv-item:hover { border-color: var(--ink); background: #fbe6a6; }
.inv-item img { max-width: 100%; max-height: 100%; }
.inv-item .n { position: absolute; right: 2px; bottom: 0; font-size: 12px; font-weight: bold; }
.inv-item.eq { border-color: var(--gold); box-shadow: 0 0 6px var(--gold); }
.inv-item.locked { opacity: .5; }
.inv-weapon { font-family: var(--hand); margin-bottom: 8px; }

.dialog { position: absolute; z-index: 9; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, 94vw); max-height: 80vh; display: flex; flex-direction: column; }
#dialog-portrait { border: 2px solid var(--ink-soft); border-radius: 10px; background: rgba(255,255,255,.4); }
.dialog-body { padding: 10px 14px; overflow-y: auto; font-size: 15px; line-height: 1.45; }
.dialog-body .greet { font-style: italic; }
.dialog-body .talk { background: rgba(255,240,190,.6); border-left: 3px solid var(--gold); padding: 6px 10px; margin: 8px 0; }
.dq { border: 2px solid var(--ink-soft); border-radius: 10px 7px 11px 8px; padding: 8px 10px; margin: 10px 0; background: rgba(255,255,255,.4); }
.dq.main { border-color: var(--accent); }
.dq h4 { margin: 0 0 4px; font-family: var(--hand); }
.dq .rw { font-size: 13px; color: #2e7d32; margin: 4px 0; }
.dq .lv { font-size: 12px; color: var(--accent); }

.popup { position: absolute; z-index: 9; top: 120px; left: 50%; transform: translateX(-50%); padding: 12px 16px; text-align: center; }
.overlay { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(30,10,5,.55); color: var(--paper); text-align: center; font-family: var(--hand); }
.overlay .paper { color: var(--ink); padding: 20px 30px; }
.announce { position: absolute; z-index: 15; top: 120px; left: 50%; transform: translateX(-50%); font-family: var(--hand); font-size: 24px; background: rgba(60,20,10,.85); color: #ffe7a0; border: 2px solid #ffe7a0; padding: 10px 24px; border-radius: 12px; text-align: center; max-width: 80vw; }

@media (max-width: 800px) {
  .launcher-box { flex-direction: column; overflow-y: auto; }
  .launcher-right { border-left: none; padding-left: 0; }
  #chat { width: 300px; } #chat-log { height: 110px; }
}

/* ===================== Phase 1 : mana, or, boss, raretés, shop, perso, carte ===================== */
.bar.mp > div { background: linear-gradient(#6ab0ff, #2a5fc8); }
.gold-line { font-size: 13px; margin-top: 4px; font-family: var(--hand); }
.gold-line .coin { height: 15px; vertical-align: -3px; filter: hue-rotate(-170deg) saturate(2); }
.bossbar { position: absolute; z-index: 6; top: 12px; left: 50%; transform: translateX(-50%); width: min(520px, 60vw); text-align: center; }
.bossbar .bb-name { font-family: var(--hand); font-size: 20px; color: #ffe7a0; text-shadow: 2px 2px 0 #2a1a10, -1px -1px 0 #2a1a10; }
.bar.boss { height: 18px; background: rgba(30,15,10,.7); border-color: #2a1a10; }
.bar.boss > div { background: linear-gradient(#9be05a, #3f8a24); }
.inv-grid { grid-template-columns: repeat(6, 1fr); }
.inv-item { border-width: 3px; }
.inv-item.dragging { opacity: .35; }
.inv-item.over { outline: 3px dashed var(--accent); }
.inv-item.r-epique, .inv-item.r-legendaire, .inv-item.r-mythique, .inv-item.r-ancestral, .inv-item.r-divin, .inv-item.r-transcendant { animation: rglow 2s infinite; }
@keyframes rglow { 50% { box-shadow: 0 0 10px var(--rc); } }
.inv-slot-empty { aspect-ratio: 1; border: 2px dashed rgba(107,86,64,.3); border-radius: 8px; }
.tooltip { position: fixed; z-index: 50; pointer-events: none; max-width: 260px; background: #2b2218; color: #f6edd8; border: 2px solid #c9a227; border-radius: 8px; padding: 8px 10px; font-size: 13px; line-height: 1.35; }
.tooltip b { font-family: var(--hand); font-size: 15px; }
.tooltip .rr { font-size: 11px; font-weight: bold; text-transform: uppercase; letter-spacing: .5px; }
.shop { border-top: 2px dashed var(--ink-soft); margin-top: 10px; padding-top: 8px; }
.shop-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; padding: 4px 6px; border-radius: 8px; background: rgba(255,255,255,.45); border-left: 4px solid var(--rc, #999); }
.shop-row img { height: 34px; }
.shop-row .nm { flex: 1; }
.shop-row .pr { font-weight: bold; color: #8a6a10; }
.say { margin: 6px 0; padding: 6px 10px; background: rgba(255,240,190,.55); border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; }
.say b { font-family: var(--hand); color: var(--accent); }
.say.narr { background: rgba(200,220,255,.35); border-left-color: #6a8ac8; font-style: italic; }
.dq.star { border-color: #4fa83a; box-shadow: 0 0 0 2px rgba(79,168,58,.25); }
.char-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 14px; margin-bottom: 8px; }
.title-row { display: flex; align-items: center; gap: 8px; padding: 6px; margin: 4px 0; border: 2px solid var(--ink-soft); border-radius: 8px; cursor: pointer; background: rgba(255,255,255,.4); }
.title-row.on { border-color: var(--gold); background: #fbe6a6; }
.title-row .tn { font-family: var(--hand); font-weight: bold; }
.t-brocoli { color: #3f8a24; } .t-eau { color: #2f80ed; } .t-feu { color: #e8361b; } .t-terre { color: #8a5a2a; } .t-foudre { color: #b89a00; }
.codex { border-left: 3px solid #9b51e0; padding: 6px 10px; margin: 6px 0; background: rgba(230,215,255,.35); font-size: 13.5px; line-height: 1.4; }
.panel-map { width: min(800px, 94vw); left: 50%; right: auto; transform: translateX(-50%); top: 70px; max-height: calc(100vh - 160px); }
#worldmap { width: 100%; height: auto; border: 2px solid var(--ink-soft); border-radius: 10px; background: #4d8fca; cursor: crosshair; }

/* ===================== Phase 2 : sorts, classes, défis ===================== */
.spellbar { display: flex; gap: 6px; }
.spellbar:not(:empty) { margin-left: 4px; padding-left: 10px; border-left: 2px solid var(--ink-soft); }
.slot.spell { background: rgba(190,200,255,.4); }
.slot .mana { position: absolute; right: 2px; top: 0; font-size: 10px; font-weight: bold; color: #2a5fc8; }
.class-card { border: 2px solid var(--ink-soft); border-radius: 12px 9px 13px 8px; padding: 8px 10px; margin: 6px 0; background: rgba(255,255,255,.4); cursor: pointer; }
.class-card:hover { background: #fbe6a6; }
.class-card.sel { border-color: var(--accent); box-shadow: 2px 3px 0 var(--ink); background: #fbe6a6; }
.class-card h5 { margin: 0; font-family: var(--hand); font-size: 15px; }
.class-card .small { line-height: 1.3; }
.class-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.class-banner { border: 2px solid var(--gold); background: rgba(255,240,190,.5); border-radius: 10px; padding: 8px 10px; font-size: 14px; margin-bottom: 8px; }
.defi-box { border: 3px solid #b5482e; border-radius: 12px; padding: 10px 12px; margin: 10px 0; background: rgba(255,220,200,.35); text-align: center; }
.defi-box h4 { margin: 0 0 4px; font-family: var(--hand); color: #b5482e; }

/* médaillons et livres : brillance dans le sac */
.inv-item[data-it^="medaillon_"] img { animation: medspin 2.8s ease-in-out infinite; }
@keyframes medspin { 0%, 100% { transform: rotateY(0deg); filter: brightness(1); } 50% { transform: rotateY(180deg); filter: brightness(1.35) drop-shadow(0 0 6px rgba(255,220,120,.8)); } }
.inv-item[data-it^="livre_"] img { animation: bookglow 2.2s ease-in-out infinite; }
@keyframes bookglow { 50% { filter: brightness(1.25) drop-shadow(0 0 5px rgba(160,140,255,.7)); } }

/* ---------------------------------------------------------------- CONCEPT ARTS */
#launcher { background-size: cover; background-position: center; }
#launcher::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(43,34,24,.25) 0%, rgba(26,20,13,.78) 100%);
}
#launcher .launcher-box { z-index: 1; background: rgba(247,240,225,.96); }
#loadscreen {
  position: fixed; inset: 0; z-index: 300; background: #14100b;
  opacity: 1; transition: opacity .6s ease;
}
#loadscreen.fondu { opacity: 0; pointer-events: none; }
#loadscreen .ls-art { position: absolute; inset: 0; background-size: cover; background-position: center; }
#loadscreen .ls-bas {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 34px 22px;
  background: linear-gradient(transparent, rgba(16,12,8,.85));
  color: #f3e8d2; text-align: center;
}
#loadscreen .ls-title { font-family: 'IM Fell English SC', serif; font-size: 34px; text-shadow: 0 2px 8px #000; }
#loadscreen .ls-tip { font-style: italic; opacity: .85; margin-top: 4px; font-size: 15px; text-shadow: 0 1px 4px #000; }

/* ---------------------------------------------------------------- DISCUSSIONS AVEC LES PNJ */
.dlg-questions { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.dlg-questions .dlg-q { text-align: left; font-style: italic; }
.dlg-r { background: rgba(120, 95, 60, .08); border-left: 3px solid #b8935f; padding: 6px 10px; border-radius: 0 8px 8px 0; margin: 2px 0 6px; }

/* ---------------------------------------------------------------- MENU ROND DES POSES */
#posemenu { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 60; }
#posemenu .pm-centre {
  position: absolute; left: -24px; top: -24px; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(43,34,24,.92); color: #f3e8d2; display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 2px solid #b8935f; font-size: 18px;
}
#posemenu .pm-slot {
  position: absolute; left: -34px; top: -34px; width: 68px; height: 68px; border-radius: 50%;
  background: rgba(247,240,225,.95); border: 2px solid #8a6a42; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  font-family: var(--hand); box-shadow: 0 3px 10px rgba(0,0,0,.35);
}
#posemenu .pm-slot span { font-size: 20px; }
#posemenu .pm-slot small { font-size: 10px; }
#posemenu .pm-slot:hover { background: #ffe9c8; transform-origin: center; }
#posemenu .pm-note {
  position: absolute; left: -120px; top: 110px; width: 240px; text-align: center;
  background: rgba(43,34,24,.9); color: #f3e8d2; padding: 6px 8px; border-radius: 8px; font-size: 12px;
}

/* ---------------------------------------------------------------- MODE EXPLORATION */
#explore-banner {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 55;
  background: rgba(43,34,24,.92); color: #f3e8d2; border: 2px solid #b8935f;
  padding: 7px 16px; border-radius: 20px; font-family: var(--hand); font-size: 15px;
  box-shadow: 0 4px 14px rgba(0,0,0,.4); pointer-events: none;
}

#loadscreen .ls-logo {
  position: absolute; top: 26px; left: 50%; transform: translateX(-50%);
  width: 300px; max-width: 45vw; filter: drop-shadow(0 3px 10px rgba(0,0,0,.6));
  pointer-events: none;
}

/* v0.12 : les altérations d'état et bénédictions du joueur */
#etats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; min-height: 0; }
.etat { font-size: 11px; padding: 1px 7px; border-radius: 10px; border: 1.5px solid rgba(120,40,40,.55); background: rgba(255,235,235,.85); color: #7a2020; font-weight: bold; }
.etat.bon { border-color: rgba(60,120,50,.55); background: rgba(235,250,230,.9); color: #2e6b28; }

/* v0.13 : le grimoire */
#panel-grimoire { width: 480px; max-height: 76vh; }
.grim-rang { font-family: var(--hand); margin: 10px 0 4px; font-size: 17px; border-bottom: 1px dashed rgba(60,40,20,.35); }
.grim-sort { display: flex; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 8px; margin: 2px 0; border: 1.5px solid transparent; }
.grim-sort img { width: 34px; height: 34px; image-rendering: auto; }
.grim-sort .gs-nom { font-weight: bold; }
.grim-sort .gs-infos { font-size: 11px; opacity: .85; }
.grim-sort.connu { background: rgba(255,250,235,.8); border-color: rgba(120,90,40,.3); }
.grim-sort.verrouille { opacity: .55; filter: grayscale(.6); }
.grim-sort .btn { margin-left: auto; }
.grim-sort.en-barre { outline: 2px solid var(--accent); }

/* v0.14 : la Grande Arène */
.arene-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 7px 8px; margin: 4px 0; border: 1.5px solid rgba(120,90,40,.35); border-radius: 10px; background: rgba(255,250,235,.7); }
.arene-row.verrou { opacity: .55; }
#triomphe { position: fixed; top: 18%; left: 50%; transform: translate(-50%, -30px); text-align: center; z-index: 60; opacity: 0; pointer-events: none; transition: opacity .6s, transform .6s; text-shadow: 0 2px 8px rgba(40,20,0,.6); }
#triomphe.show { opacity: 1; transform: translate(-50%, 0); }
#triomphe .tr-coupe { font-size: 64px; animation: tr-pop .8s ease; }
#triomphe .tr-titre { font-family: var(--hand, Georgia); font-size: 38px; color: #ffd34d; }
#triomphe .tr-joueur { font-size: 20px; color: #fff3d0; }
#triomphe .tr-sous { font-size: 13px; color: #e8d8b0; font-style: italic; }
@keyframes tr-pop { 0% { transform: scale(.2) rotate(-20deg); } 60% { transform: scale(1.25) rotate(6deg); } 100% { transform: scale(1); } }

/* v0.15 : forge, sacre, maître d'armes */
.forge-ligne { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.forge-ligne select { max-width: 220px; }
.maitre-cond { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 4px 6px; margin: 3px 0; border-radius: 8px; background: rgba(255,245,230,.6); border: 1px solid rgba(150,110,60,.3); }
.maitre-cond.ok { background: rgba(230,250,230,.75); border-color: rgba(60,130,50,.4); }
.maitre-cond .mc-val { margin-left: auto; font-weight: bold; font-size: 12px; }
.maitre-cond .mc-barre { flex-basis: 100%; height: 5px; border-radius: 3px; background: rgba(60,40,20,.15); overflow: hidden; }
.maitre-cond .mc-barre div { height: 100%; background: linear-gradient(90deg, #c9884a, #ffd34d); }

/* v0.16 : groupes, amis, toasts */
#toasts { position: fixed; top: 70px; right: 14px; z-index: 70; display: flex; flex-direction: column; gap: 8px; max-width: 300px; }
.toast { background: var(--paper, #f6edda); border: 2px solid rgba(120,90,40,.5); border-radius: 12px; padding: 9px 11px; box-shadow: 0 4px 14px rgba(40,20,0,.25); animation: toast-in .25s ease; font-size: 13px; }
@keyframes toast-in { from { transform: translateX(40px); opacity: 0; } }
.toast .tb { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
#groupe-panel { position: fixed; right: 14px; top: 248px; z-index: 18; width: 192px; background: rgba(246,237,218,.92); border: 2px solid rgba(120,90,40,.45); border-radius: 12px; padding: 7px 8px; font-size: 12px; box-shadow: 0 3px 10px rgba(40,20,0,.2); }
#groupe-panel h5 { margin: 0 0 4px; font-family: var(--hand, Georgia); font-size: 14px; }
.gp-membre { margin: 4px 0; position: relative; }
.gp-nom { display: flex; align-items: center; gap: 4px; }
.gp-nom .gp-x, .gp-nom .gp-chef { cursor: pointer; opacity: .5; font-size: 11px; border: none; background: none; padding: 0 2px; }
.gp-nom .gp-x:hover, .gp-nom .gp-chef:hover { opacity: 1; }
.gp-barre { height: 5px; border-radius: 3px; background: rgba(60,40,20,.18); overflow: hidden; margin-top: 2px; }
.gp-barre div { height: 100%; background: #5bd15b; }
.gp-barre.mana div { background: #4f8fd9; }
.gp-zone { opacity: .65; font-size: 10.5px; }
.gp-off { opacity: .5; font-style: italic; }
.gp-boutons { display: flex; gap: 4px; margin-top: 6px; }
.gp-boutons .btn { padding: 2px 7px; font-size: 12px; }
.ami-ligne { display: flex; align-items: center; gap: 7px; padding: 5px 4px; border-bottom: 1px dashed rgba(100,80,50,.25); }
.ami-point { width: 9px; height: 9px; border-radius: 50%; background: #9a9a9a; flex-shrink: 0; }
.ami-point.on { background: #4caf50; }
.ami-ligne .btn { margin-left: auto; }
.l.ch-gr { color: #2e7d4f; }

/* ============ l'Ardeur du combat (v0.17.1) ============ */
#ardeur { display: none; align-items: center; gap: 2px; margin: 4px 0 2px; }
#ardeur .ardeur-mot { font-size: 11px; color: #c96; font-style: italic; margin-right: 4px; }
#ardeur .flamme { font-size: 12px; filter: grayscale(1) opacity(.25); transition: filter .15s, transform .15s; }
#ardeur .flamme.on { filter: none; transform: scale(1.15); text-shadow: 0 0 6px rgba(255,140,40,.8); }

/* ============ les guildes (v0.18) ============ */
#panel-guilde { display: none; position: absolute; right: 10px; top: 240px; width: 340px; max-height: calc(100vh - 330px); overflow: auto; z-index: 40;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 10px; box-shadow: 4px 5px 0 rgba(43,31,20,.25); color: var(--ink); }
#panel-guilde .panel-titre { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 2px dashed var(--ink-soft); font-family: var(--hand); font-size: 19px; }
#panel-guilde .panel-titre .fermer { margin-left: auto; cursor: pointer; padding: 0 6px; }
#panel-guilde.open { display: block; }
#panel-guilde .gd-tag { color: #c9a227; font-size: 13px; }
.gd-vide { padding: 12px; color: #cbd; line-height: 1.5; }
.gd-niveau { padding: 6px 10px; }
.gd-xpbar { height: 8px; background: var(--paper-dark); border-radius: 4px; overflow: hidden; margin: 4px 0 2px; }
.gd-xpbar div { height: 100%; background: linear-gradient(90deg, #c9a227, #ffd97a); }
.gd-xptxt { font-size: 11px; color: #7a6a52; }
.gd-motd { margin: 4px 10px; padding: 6px 8px; background: rgba(201,162,39,.12); border-left: 3px solid #c9a227; font-style: italic; font-size: 12px; }
.gd-tresor { padding: 6px 10px; font-size: 13px; }
.gd-tresor input { width: 70px; margin-left: 6px; }
.gd-membres { margin: 6px 0; border-top: 1px solid var(--paper-dark); }
.gd-ligne { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-bottom: 1px solid var(--paper-dark); font-size: 13px; }
.gd-ligne.off { opacity: .5; }
.gd-grade { width: 16px; color: #b8860b; }
.gd-nom { flex: 1; }
.gd-zone { font-size: 11px; color: #7a6a52; }
.gd-actions button { padding: 1px 5px; margin-left: 2px; font-size: 11px; }
.gd-pied { display: flex; gap: 6px; padding: 8px 10px; flex-wrap: wrap; }
.l.ch-gd { color: #d9a7ff; }

/* v0.21 — fenêtre d'échange */
#panel-echange { display: none; position: absolute; left: 50%; top: 120px; transform: translateX(-50%); width: 430px; max-height: calc(100vh - 200px); overflow: auto; z-index: 45;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 10px; box-shadow: 4px 5px 0 rgba(43,31,20,.25); color: var(--ink); }
#panel-echange.open { display: block; }
#panel-echange .panel-titre { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 2px dashed var(--ink-soft); font-family: var(--hand); font-size: 19px; }
#panel-echange .panel-titre .fermer { margin-left: auto; cursor: pointer; padding: 0 6px; }
.ech-corps { display: flex; gap: 8px; padding: 8px; }
.ech-col { flex: 1; min-height: 120px; border: 2px dashed var(--ink-soft); border-radius: 8px; padding: 6px; }
.ech-col.ok { border-color: #5a9a4a; background: rgba(120,190,100,.12); }
.ech-obj { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.ech-obj img { width: 24px; height: 24px; }
.ech-or input { width: 70px; }
.ech-aide { padding: 0 10px 6px; }
.gd-journal { margin-top: 6px; max-height: 120px; overflow: auto; }

/* v0.21 — blason de guilde (image : plus de dépendance à la police d'emoji) */
.ico-guilde { width: 24px; height: 24px; vertical-align: middle; }
.ico-guilde-btn { width: 36px; height: 36px; object-fit: contain; image-rendering: auto; }
.gd-ann, .gd-cand, .gd-recrut { margin: 6px 8px; padding: 4px 6px; border: 1px dashed var(--ink-soft); border-radius: 6px; font-size: 13px; }
.gd-cand { border-style: solid; }
#panel-guilde .gd-vide { color: var(--ink); opacity: 1; padding: 10px; }

/* v0.21.1 — grande fenêtre de guilde à onglets */
#panel-guilde { left: 50%; right: auto; top: 50%; transform: translate(-50%, -50%); width: min(820px, 96vw); height: min(640px, 88vh); max-height: none; overflow: hidden; z-index: 46; font-size: 15px; }
#panel-guilde.open { display: flex; flex-direction: column; }
.gd-tete { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 3px solid var(--ink); background: rgba(201,162,39,.14); }
.gd-blason { width: 56px; height: 56px; }
.gd-titre { font-family: var(--hand); font-size: 28px; line-height: 1.05; flex: 1; }
.gd-titre small { display: block; font-family: Georgia, serif; font-size: 13px; color: #6b5a44; }
.gd-tete .fermer { font-size: 26px; cursor: pointer; padding: 2px 10px; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper); }
.gd-tete .fermer:hover { background: #e8c9a0; }
.gd-onglets { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px 0; border-bottom: 2px solid var(--ink); }
.gd-onglets button { font: inherit; font-size: 15px; padding: 9px 12px; border: 2px solid var(--ink); border-bottom: none; border-radius: 9px 9px 0 0; background: var(--paper-dark); color: var(--ink); cursor: pointer; }
.gd-onglets button.actif { background: #ffe9a8; font-weight: bold; }
.gd-pastille { background: #c0392b; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; }
.gd-corps { flex: 1; overflow-y: auto; padding: 10px 12px; }
.gd-carte { border: 2px solid var(--ink-soft); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: rgba(255,255,255,.35); line-height: 1.45; }
.gd-carte h4 { margin: 0 0 6px; font-family: var(--hand); font-size: 21px; }
.gd-carte p { margin: 6px 0; } .gd-carte ul, .gd-carte ol { margin: 4px 0; padding-left: 22px; } .gd-carte li { margin: 3px 0; }
.gd-carte code { background: rgba(43,31,20,.12); padding: 1px 5px; border-radius: 4px; }
.gd-note { font-size: 13px; color: #5d4e3a; } .gd-fort { font-size: 18px; font-weight: bold; color: #7a5a00; }
.gd-rang { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 2px; }
.gd-rang input, .gd-rang select { font: inherit; font-size: 15px; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 8px; background: #fffaf0; color: var(--ink); flex: 1; min-width: 120px; }
.gd-rang input[type=number] { flex: 0 0 130px; }
.gd-btn { font: inherit; font-size: 15px; font-weight: bold; padding: 9px 16px; min-height: 40px; border: 2px solid var(--ink); border-radius: 9px; background: #ffe9a8; color: var(--ink); cursor: pointer; box-shadow: 2px 3px 0 rgba(43,31,20,.25); }
.gd-btn:hover { background: #ffd97a; } .gd-btn:active { transform: translate(1px, 2px); box-shadow: none; }
.gd-btn.gros { font-size: 17px; padding: 12px 22px; } .gd-btn.petit { font-size: 13px; padding: 5px 10px; min-height: 32px; }
.gd-btn.rouge { background: #f3c4b8; } .gd-btn.rouge:hover { background: #eba393; }
.gd-table { width: 100%; border-collapse: collapse; } .gd-table th { text-align: left; font-size: 13px; color: #6b5a44; }
.gd-table td, .gd-table th { padding: 6px 6px; border-bottom: 1px solid var(--paper-dark); vertical-align: middle; }
.gd-table tr.off { opacity: .75; } .gd-table tr.ok td { background: rgba(120,190,100,.14); }
.gd-table .gd-actions { text-align: right; } .gd-table .gd-actions .gd-btn { margin: 2px; }
.gd-grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 14px; }
.gd-objet { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--paper-dark); }
.gd-objet img { width: 30px; height: 30px; } .gd-objet span { flex: 1; }
#panel-guilde .gd-journal { max-height: 170px; overflow: auto; font-size: 13px; margin: 0; }
#panel-guilde .gd-motd { margin: 4px 0; font-size: 15px; }
#panel-guilde .gd-xpbar { height: 14px; border: 1px solid var(--ink-soft); }
#panel-guilde .gd-xptxt { font-size: 13px; }
.gd-danger { text-align: left; }
