/* =========================================================================
   ÉVEIL — interface style Warcraft
   ========================================================================= */
:root {
  --gold: #f8d878; --gold2: #c8a050; --gold3: #8b6a2b; --bronze: #6b5023;
  --ink: #0d0907; --panel: #17110c; --panel2: #221a12; --text: #f0e6d0; --text2: #b8a888; --text3: #7a6a50;
  --parch: #ead8ae; --parch-ink: #3a2410;
  --hp: #2fbf3f; --mana: #2f7fe0; --mitote: #8a4ad8; --xp: #9a5ad8;
  --red: #c8241c; --title: 'Cinzel', 'Trajan Pro', Georgia, serif; --body: 'EB Garamond', 'Palatino Linotype', Georgia, serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0812; color: var(--text); font-family: var(--body); font-size: 15px; user-select: none; }
canvas#world { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
canvas#bgfx { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 1; pointer-events: none; }
.hidden { display: none !important; }
button { font-family: var(--title); cursor: pointer; }
input, textarea, select { font-family: var(--body); user-select: text; }
b.q { color: var(--gold); } b.boss { color: #ff6a5a; } b.npc { color: #7dff6a; }

/* ---------- Boutons ---------- */
.wbtn {
  position: relative; padding: 9px 22px; min-width: 150px; font-size: 14px; font-weight: 700; letter-spacing: .06em;
  color: var(--gold); text-shadow: 0 1px 2px #000;
  background: linear-gradient(180deg, #9a2418 0%, #6a1008 48%, #4a0804 52%, #6a1408 100%);
  border: 2px solid var(--gold2); border-radius: 4px;
  box-shadow: 0 0 0 1px #000, inset 0 1px 0 rgba(255,220,150,.35), 0 3px 8px rgba(0,0,0,.6);
  transition: filter .12s, transform .08s;
}
.wbtn:hover { filter: brightness(1.25); }
.wbtn:active { transform: translateY(1px); }
.wbtn.big { min-width: 260px; font-size: 18px; padding: 12px 26px; }
.wbtn.gold { background: linear-gradient(180deg, #c89a30 0%, #8a6418 50%, #6a4a10 52%, #8a6418 100%); color: #fff6d0; }
.wbtn.blue { background: linear-gradient(180deg, #2a5a9a 0%, #163a6a 50%, #0e2a52 52%, #163a6a 100%); }
.wbtn.ghost { background: rgba(0,0,0,.4); border-color: rgba(200,160,80,.5); min-width: 0; }
.wbtn.small { min-width: 0; padding: 5px 12px; font-size: 12px; }
.wbtn:disabled { filter: grayscale(1) brightness(.6); cursor: default; }

/* ---------- Écrans ---------- */
.screen { position: fixed; inset: 0; z-index: 5; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.screen.active { display: flex; }
.screen-title { font-family: var(--title); font-size: 34px; color: var(--gold); text-shadow: 0 0 20px rgba(255,200,100,.4), 0 2px 4px #000; letter-spacing: .08em; }
.logo-wrap { text-align: center; margin-top: -40px; }
.logo {
  font-family: 'Cinzel Decorative', var(--title); font-weight: 900; font-size: clamp(80px, 14vw, 170px); letter-spacing: .12em; line-height: 1;
  background: linear-gradient(180deg, #fff6d0 0%, #ffd870 35%, #c8902a 60%, #8a5a10 75%, #ffe9a0 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(255,190,80,.45)) drop-shadow(0 4px 0 #2a1600) drop-shadow(0 6px 10px #000);
  animation: logoGlow 5s ease-in-out infinite;
}
@keyframes logoGlow { 50% { filter: drop-shadow(0 0 50px rgba(255,210,120,.7)) drop-shadow(0 4px 0 #2a1600) drop-shadow(0 6px 10px #000); } }
.logo-sub { font-family: var(--title); font-size: clamp(16px, 2.2vw, 26px); color: #e8d8b0; letter-spacing: .35em; text-transform: uppercase; text-shadow: 0 2px 6px #000; margin-top: 6px; }
.title-menu { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.quote { font-style: italic; font-size: 20px; color: #e8dcc0; text-shadow: 0 2px 6px #000; max-width: 700px; text-align: center; min-height: 28px; transition: opacity 1s; }
.ver { position: absolute; bottom: 12px; right: 16px; font-size: 12px; color: var(--text3); font-family: var(--title); }

#slots { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.slot { width: 250px; padding: 18px; text-align: center; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.slot:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px #000, 0 0 24px rgba(255,200,100,.35); }
.slot canvas { display: block; margin: 0 auto 8px; border-radius: 50%; border: 2px solid var(--gold2); }
.slot .sname { font-family: var(--title); font-size: 18px; color: var(--gold); }
.slot .sinfo { color: var(--text2); font-size: 14px; margin: 4px 0 10px; }
.slot .empty { font-family: var(--title); color: var(--text3); font-size: 18px; padding: 60px 0; }
.slot .del { font-size: 11px; color: #c86a5a; background: none; border: none; margin-top: 8px; font-family: var(--body); text-decoration: underline; }

/* ---------- Création ---------- */
.create-wrap { display: grid; grid-template-columns: 300px 340px 380px; gap: 20px; align-items: stretch; }
.class-list { display: flex; flex-direction: column; gap: 8px; }
.ccard { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; background: linear-gradient(180deg, #221a12, #120d09); border: 2px solid var(--bronze); border-radius: 6px; transition: all .15s; }
.ccard:hover { border-color: var(--gold2); }
.ccard.on { border-color: var(--gold); box-shadow: 0 0 16px rgba(255,210,120,.35), inset 0 0 20px rgba(255,200,100,.12); }
.ccard .ci { font-size: 28px; width: 40px; text-align: center; filter: drop-shadow(0 2px 3px #000); }
.ccard .cn { font-family: var(--title); font-weight: 700; color: var(--gold); font-size: 15px; }
.ccard .cr { font-size: 13px; color: var(--text2); }
.create-preview { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px; }
#create-canvas { border-radius: 8px; border: 2px solid var(--gold3); box-shadow: inset 0 0 40px #000, 0 0 30px rgba(0,0,0,.6); background: radial-gradient(circle at 50% 60%, #3a2a50, #0c0810 70%); }
.pickers { display: flex; gap: 20px; }
.pickers label { font-family: var(--title); font-size: 12px; color: var(--text2); display: block; margin-bottom: 4px; text-align: center; }
.swatches { display: flex; gap: 6px; }
.sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #000; cursor: pointer; box-shadow: 0 0 0 1px var(--gold3); }
.sw.on { box-shadow: 0 0 0 2px var(--gold); transform: scale(1.15); }
#create-name { width: 260px; padding: 10px 14px; font-size: 20px; text-align: center; font-family: var(--title); color: var(--gold); background: #0c0806; border: 2px solid var(--gold3); border-radius: 4px; outline: none; }
#create-name:focus { border-color: var(--gold); box-shadow: 0 0 12px rgba(255,210,120,.3); }
.class-info { padding: 18px 20px; overflow-y: auto; max-height: 560px; }
.class-info h2 { font-family: var(--title); color: var(--gold); font-size: 22px; }
.class-info .role { color: var(--text2); font-family: var(--title); font-size: 12px; letter-spacing: .1em; margin-bottom: 8px; }
.class-info p { line-height: 1.45; margin-bottom: 12px; }
.class-info .apt { background: rgba(255,210,120,.08); border-left: 3px solid var(--gold); padding: 8px 12px; margin-bottom: 12px; }
.class-info .apt b { color: var(--gold); font-family: var(--title); font-size: 13px; }
.spell-mini { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 13px; }
.spell-mini .si { width: 30px; height: 30px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 17px; border: 1px solid var(--gold3); border-radius: 4px; background: #0c0806; }
.spell-mini b { color: var(--gold); font-family: var(--title); font-size: 12px; }
.spell-mini span { color: var(--text2); }
.create-actions { display: flex; gap: 20px; }

/* ---------- Intro ---------- */
#screen-intro { background: #000; }
#intro-lines { max-width: 760px; text-align: center; }
#intro-lines p { font-size: 26px; font-style: italic; color: #e8dcc0; opacity: 0; margin: 16px 0; transition: opacity 1.6s; text-shadow: 0 0 20px rgba(255,200,120,.2); }
#intro-lines p.on { opacity: 1; }
#btn-skip-intro { position: absolute; bottom: 30px; right: 30px; }

/* ---------- Panneaux ---------- */
.wpanel {
  position: absolute; z-index: 20;
  background: linear-gradient(180deg, rgba(34,26,18,.97), rgba(14,10,7,.98));
  border: 2px solid var(--gold3); border-radius: 6px;
  box-shadow: 0 0 0 1px #000, 0 0 0 4px rgba(40,28,14,.95), 0 0 0 5px var(--bronze), 0 12px 40px rgba(0,0,0,.8), inset 0 0 40px rgba(0,0,0,.5);
}
.wpanel > .ph { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 8px 16px; background: linear-gradient(180deg, #3a2a16, #1e150c); border-bottom: 2px solid var(--gold3); border-radius: 4px 4px 0 0; }
.wpanel > .ph h3 { font-family: var(--title); color: var(--gold); font-size: 17px; letter-spacing: .06em; text-shadow: 0 2px 3px #000; }
.xbtn { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--gold2); background: radial-gradient(#a8241c, #4a0804); color: var(--gold); font-size: 14px; line-height: 1; }
.xbtn:hover { filter: brightness(1.3); }
.wpanel > .pb { padding: 14px 16px; overflow-y: auto; }
.parch { background: radial-gradient(ellipse at 50% 30%, #f3e4bf, #dcc490 80%, #c8ac78); color: var(--parch-ink); border-radius: 4px; box-shadow: inset 0 0 30px rgba(120,80,30,.4); }
.parch h4 { font-family: var(--title); color: #5a2a08; font-size: 18px; margin-bottom: 8px; }
.parch .sec { font-family: var(--title); color: #6a3a10; font-size: 13px; letter-spacing: .08em; margin: 14px 0 6px; border-bottom: 1px solid rgba(90,50,10,.3); padding-bottom: 3px; }
.parch p { line-height: 1.5; white-space: pre-line; }
.sect-title { font-family: var(--title); color: var(--gold); font-size: 13px; letter-spacing: .1em; margin: 12px 0 8px; padding-bottom: 4px; border-bottom: 1px solid rgba(200,160,80,.25); }
.muted { color: var(--text2); }
.tiny { font-size: 12px; }

/* ---------- Cadres d'unité ---------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud > * { pointer-events: auto; }
.uframe { position: absolute; top: 14px; display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 6px; background: linear-gradient(180deg, rgba(30,22,14,.92), rgba(12,9,6,.92)); border: 2px solid var(--gold3); border-radius: 40px 8px 8px 40px; box-shadow: 0 0 0 1px #000, 0 4px 14px rgba(0,0,0,.6); }
#pframe { left: 14px; width: 330px; }
#tframe { left: 360px; width: 300px; border-radius: 8px 40px 40px 8px; padding: 6px 6px 6px 10px; }
.portrait { position: relative; width: 72px; height: 72px; flex-shrink: 0; border-radius: 50%; border: 3px solid var(--gold2); box-shadow: 0 0 0 1px #000, inset 0 0 10px #000; overflow: visible; background: #0c0810; }
.portrait canvas { border-radius: 50%; display: block; }
.portrait.small { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }
.portrait .lvl { position: absolute; bottom: -6px; left: -6px; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(#3a2a10, #120a04); border: 2px solid var(--gold2); color: var(--gold); font-family: var(--title); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.portrait.small .lvl { left: auto; right: -6px; }
.ticon { font-size: 26px; }
.ubody { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.uname { font-family: var(--title); font-weight: 700; font-size: 14px; color: #fff; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { position: relative; height: 15px; background: #0a0705; border: 1px solid #000; box-shadow: 0 0 0 1px rgba(200,160,80,.35); border-radius: 2px; overflow: hidden; }
.bar .fill { position: absolute; inset: 0; width: 100%; transition: width .15s; }
.bar span { position: relative; z-index: 1; display: block; text-align: center; font-size: 11px; line-height: 15px; font-weight: 600; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; font-family: var(--title); }
.bar.hp .fill { background: linear-gradient(180deg, #5af06a, #1f9a2a 55%, #157a1e); }
.bar.hp.enemy .fill { background: linear-gradient(180deg, #ff6a5a, #c02020 55%, #8a1010); }
.bar.mana .fill { background: linear-gradient(180deg, #6ab0ff, #2a6ad8 55%, #1a4aa8); }
.bar.mitote { height: 11px; }
.bar.mitote span { font-size: 9px; line-height: 11px; }
.bar.mitote .fill { background: linear-gradient(90deg, #4a2a7a, #8a4ad8, #d06aff); }
.bar.mitote.high .fill { animation: mpulse .6s infinite alternate; }
@keyframes mpulse { to { filter: brightness(1.6); } }
.bar.accept .fill { background: linear-gradient(90deg, #e8f0ff, #fff6c0); }
.bar.accept span { color: #2a2a40; text-shadow: none; }
.tinfo { font-size: 12px; color: var(--text2); display: flex; gap: 8px; flex-wrap: wrap; }
.tinfo .weak { color: #9aff8a; } .tinfo .res { color: #ff9a8a; }
#tframe.boss { border-color: #c82a2a; box-shadow: 0 0 0 1px #000, 0 0 20px rgba(200,40,40,.4); }
#tframe.final { border-color: #e8f0ff; box-shadow: 0 0 0 1px #000, 0 0 24px rgba(220,230,255,.4); }

#buffs { position: absolute; top: 100px; left: 18px; display: flex; gap: 5px; flex-wrap: wrap; max-width: 420px; }
.buff { position: relative; width: 34px; height: 34px; border: 1px solid var(--gold2); border-radius: 4px; background: #0c0806; display: flex; align-items: center; justify-content: center; font-size: 19px; box-shadow: 0 0 0 1px #000; }
.buff.debuff { border-color: #c8241c; }
.buff .bt { position: absolute; bottom: -14px; left: 0; right: 0; text-align: center; font-size: 10px; color: #fff; text-shadow: 0 1px 2px #000; font-family: var(--title); }

/* ---------- Minicarte ---------- */
#minimap { position: absolute; top: 10px; right: 14px; width: 196px; display: flex; flex-direction: column; align-items: center; }
#mm-zone { font-family: var(--title); font-weight: 700; font-size: 13px; color: var(--gold); text-shadow: 0 1px 3px #000, 0 0 8px #000; margin-bottom: 4px; text-align: center; }
.mm-ring { width: 192px; height: 192px; border-radius: 50%; padding: 6px; background: radial-gradient(circle, transparent 60%, #2a1e10 61%); border: 3px solid var(--gold2); box-shadow: 0 0 0 2px #000, 0 0 0 5px var(--bronze), 0 6px 20px rgba(0,0,0,.7); cursor: pointer; }
#mm { width: 180px; height: 180px; border-radius: 50%; display: block; }
#mm-clock { margin-top: 6px; padding: 2px 12px; font-family: var(--title); font-size: 12px; color: var(--text); background: rgba(10,7,4,.85); border: 1px solid var(--gold3); border-radius: 10px; }

/* ---------- Suivi des quêtes ---------- */
#tracker { position: absolute; top: 260px; right: 18px; width: 270px; max-height: 42vh; overflow: hidden; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
#tracker .th { font-family: var(--title); font-size: 13px; color: var(--gold); margin-bottom: 6px; cursor: pointer; }
.tq { margin-bottom: 9px; cursor: pointer; }
.tq .tt { font-family: var(--title); font-weight: 700; font-size: 13px; color: #ffd200; }
.tq.ready .tt { color: #7dff6a; }
.tq .to { font-size: 14px; color: #e8e0d0; padding-left: 10px; }
.tq .to.ok { color: #9a9a9a; text-decoration: line-through; }
.tdaily { font-size: 13px; color: #9ad0ff; margin-top: 4px; cursor: pointer; }

/* ---------- Chat ---------- */
#chat { position: absolute; left: 14px; bottom: 116px; width: 430px; height: 170px; padding: 6px 8px; background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.45)); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
#chat:hover { background: rgba(0,0,0,.55); overflow-y: auto; }
#chat-log div { font-size: 14px; line-height: 1.3; text-shadow: 0 1px 2px #000, 0 0 3px #000; margin-top: 2px; }
#chat-log .sys { color: #ffe9a0; } #chat-log .quest { color: #ffd200; } #chat-log .xp { color: #c8a0ff; }
#chat-log .npc { color: #f0e8c8; } #chat-log .boss { color: #ff8a7a; } #chat-log .warn { color: #ff9a8a; }
#chat-log .truth { color: #fff4c8; } #chat-log .prog { color: #ffd200; font-size: 13px; } #chat-log .event { color: #ffb0e0; }

/* ---------- Barre d'action ---------- */
#bottom { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
#xpbar { position: relative; width: 760px; height: 14px; background: #0a0705; border: 1px solid #000; box-shadow: 0 0 0 2px var(--gold3), 0 0 0 3px #000; border-radius: 2px; overflow: hidden; }
#xpbar .fill { position: absolute; inset: 0; width: 0; background: linear-gradient(180deg, #c88aff, #7a3ad8 55%, #5a2aa8); transition: width .4s; }
#xpbar.max .fill { background: linear-gradient(180deg, #fff6c0, #ffd870 55%, #c8902a); width: 100% !important; }
#xpbar span { position: relative; z-index: 1; display: block; text-align: center; font-size: 11px; line-height: 14px; font-family: var(--title); color: #fff; text-shadow: 0 1px 2px #000; }
#xpbar::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 75px, rgba(0,0,0,.6) 75px 76px); pointer-events: none; }
.bar-row { display: flex; gap: 14px; align-items: flex-end; padding: 8px 12px; background: linear-gradient(180deg, rgba(40,30,18,.95), rgba(14,10,6,.97)); border: 2px solid var(--gold3); border-radius: 8px; box-shadow: 0 0 0 1px #000, 0 0 0 4px rgba(30,20,10,.9), 0 0 0 5px var(--bronze), 0 6px 20px rgba(0,0,0,.7); }
#actionbar { display: flex; gap: 6px; }
.slotbtn { position: relative; width: 54px; height: 54px; border: 2px solid var(--gold2); border-radius: 5px; background: radial-gradient(circle at 40% 35%, #3a2c1c, #0c0806 75%); display: flex; align-items: center; justify-content: center; font-size: 28px; cursor: pointer; box-shadow: 0 0 0 1px #000, inset 0 0 10px rgba(0,0,0,.8); overflow: hidden; }
.slotbtn:hover { border-color: var(--gold); filter: brightness(1.2); }
.slotbtn .key { position: absolute; top: 1px; left: 4px; font-size: 11px; font-family: var(--title); color: #fff; text-shadow: 0 1px 2px #000, 0 0 2px #000; z-index: 3; }
.slotbtn .cd { position: absolute; inset: 0; background: conic-gradient(rgba(0,0,0,.72) calc(var(--p) * 1turn), transparent 0); z-index: 2; }
.slotbtn .cdt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 17px; font-family: var(--title); font-weight: 700; color: #ffe; text-shadow: 0 0 4px #000, 0 1px 2px #000; z-index: 3; }
.slotbtn.nomana { filter: saturate(.3) brightness(.7); box-shadow: 0 0 0 1px #000, inset 0 0 20px rgba(40,60,200,.8); }
.slotbtn.locked { filter: grayscale(1) brightness(.45); }
.slotbtn.locked .lk { position: absolute; bottom: 2px; right: 4px; font-size: 10px; color: #ddd; font-family: var(--title); z-index: 3; }
.slotbtn.breath { border-color: #7fd8ff; }
.slotbtn.ult { border-color: #ff9a4a; }
.slotbtn.flash { animation: sflash .25s; }
@keyframes sflash { from { box-shadow: 0 0 0 1px #000, 0 0 18px #fff, inset 0 0 20px #fff; } }
#micro { display: flex; gap: 4px; }
.mbtn { width: 34px; height: 44px; border: 1px solid var(--gold3); border-radius: 4px; background: linear-gradient(180deg, #3a2a18, #120c06); font-size: 17px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--gold); position: relative; }
.mbtn small { font-size: 9px; font-family: var(--title); color: var(--text2); }
.mbtn:hover { border-color: var(--gold); filter: brightness(1.3); }
.mbtn .dot { position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; background: #ffd200; box-shadow: 0 0 6px #ffd200; border: 1px solid #000; }

/* ---------- Barre d'incantation ---------- */
#castbar { position: absolute; bottom: 150px; left: 50%; transform: translateX(-50%); width: 300px; height: 20px; background: #0a0705; border: 2px solid var(--gold2); box-shadow: 0 0 0 1px #000; border-radius: 3px; overflow: hidden; }
#castbar .fill { position: absolute; inset: 0; width: 0; background: linear-gradient(180deg, #ffe08a, #d8a020 55%, #a87810); }
#castbar span { position: relative; z-index: 1; display: block; text-align: center; font-family: var(--title); font-size: 12px; line-height: 16px; color: #fff; text-shadow: 0 1px 2px #000; }

/* ---------- Bannières ---------- */
#zonebanner { position: absolute; top: 15%; left: 0; right: 0; text-align: center; pointer-events: none !important; opacity: 0; transition: opacity 1.2s; }
#zonebanner.on { opacity: 1; }
.zb-name { font-family: var(--title); font-weight: 900; font-size: 46px; color: var(--gold); letter-spacing: .06em; text-shadow: 0 0 20px rgba(0,0,0,.9), 0 3px 4px #000; }
.zb-sub { font-style: italic; font-size: 20px; color: #e8dcc0; text-shadow: 0 2px 4px #000; }
.zb-lv { font-family: var(--title); font-size: 13px; color: var(--text2); margin-top: 4px; text-shadow: 0 1px 3px #000; }
#errmsg { position: absolute; top: 24%; left: 0; right: 0; text-align: center; font-family: var(--title); font-weight: 700; font-size: 18px; color: #ff3a2a; text-shadow: 0 2px 3px #000, 0 0 6px #000; pointer-events: none !important; opacity: 0; transition: opacity .3s; }
#errmsg.on { opacity: 1; transition: none; }
#eventbanner { position: absolute; top: 32%; left: 0; right: 0; text-align: center; pointer-events: none !important; opacity: 0; transition: opacity 1s, transform 1s; transform: scale(.95); }
#eventbanner.on { opacity: 1; transform: scale(1); }
.eb-title { font-family: var(--title); font-weight: 900; font-size: 34px; color: #fff3c0; text-shadow: 0 0 24px rgba(255,200,80,.8), 0 2px 4px #000; }
.eb-sub { font-style: italic; font-size: 19px; color: #f0e6d0; text-shadow: 0 2px 4px #000; max-width: 800px; margin: 6px auto 0; }
#toasts { position: absolute; top: 40%; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none !important; }
.toast { text-align: center; animation: toastIn 4.5s forwards; }
.toast .tt1 { font-family: var(--title); font-weight: 900; font-size: 38px; color: #ffe9a0; text-shadow: 0 0 22px rgba(255,200,80,.85), 0 3px 4px #000; }
.toast .tt2 { font-size: 18px; color: #fff; text-shadow: 0 2px 4px #000; }
.toast.relic .tt1 { font-size: 26px; color: #ffb0e0; }
@keyframes toastIn { 0% { opacity: 0; transform: translateY(20px) scale(.9); } 10% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }

/* ---------- Tooltip ---------- */
#tooltip { position: fixed; z-index: 100; max-width: 320px; padding: 10px 12px; pointer-events: none; background: rgba(8,6,16,.96); border: 1px solid #8a8aa8; border-radius: 5px; box-shadow: 0 0 0 1px #000, 0 6px 20px rgba(0,0,0,.8); font-size: 14px; line-height: 1.35; }
#tooltip .tn { font-family: var(--title); font-weight: 700; color: #fff; font-size: 15px; }
#tooltip .tr { display: flex; justify-content: space-between; color: #ddd; font-size: 13px; }
#tooltip .td { color: var(--gold); margin-top: 4px; }
#tooltip .tg { color: #9aff8a; } #tooltip .tl { color: #ff6a5a; }

/* ---------- Dialogue PNJ ---------- */
#p-dialog { left: 40px; top: 120px; width: 440px; max-height: calc(100vh - 260px); display: flex; flex-direction: column; }
#p-dialog .pb { padding: 10px; }
.dlg-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.dlg-head canvas { border-radius: 50%; border: 3px solid #8a5a20; flex-shrink: 0; }
.dlg-greet { font-size: 16px; line-height: 1.5; padding: 14px 16px; }
.qopt { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin: 2px 0; cursor: pointer; border-radius: 3px; font-size: 16px; color: #2a1806; }
.qopt:hover { background: rgba(120,70,10,.15); }
.qopt .mk { font-family: var(--title); font-weight: 900; font-size: 20px; width: 18px; text-align: center; -webkit-text-stroke: .5px #3a2000; }
.qopt.grey { color: #7a6a5a; }
.qdetail { padding: 16px 18px; font-size: 16px; }
.qdetail .obj { margin: 3px 0 3px 8px; }
.qrew { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.qrew .rw { display: flex; align-items: center; gap: 6px; padding: 4px 10px; background: rgba(90,50,10,.12); border: 1px solid rgba(90,50,10,.3); border-radius: 4px; font-size: 14px; }
.dlg-actions { display: flex; justify-content: space-between; gap: 10px; padding: 10px 4px 2px; }

/* ---------- Journal de quêtes ---------- */
#p-quests { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 860px; height: 600px; display: flex; flex-direction: column; }
.ql-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 12px; height: 100%; min-height: 0; }
.ql-list { overflow-y: auto; padding-right: 4px; }
.ql-item { padding: 6px 10px; cursor: pointer; border-radius: 3px; font-family: var(--title); font-size: 14px; color: #ffd200; display: flex; justify-content: space-between; }
.ql-item:hover, .ql-item.on { background: rgba(255,210,120,.12); }
.ql-item.ready { color: #7dff6a; }
.ql-item small { color: var(--text2); font-family: var(--body); }
.ql-zone { font-family: var(--title); font-size: 11px; color: var(--text3); letter-spacing: .1em; margin: 10px 0 4px 4px; text-transform: uppercase; }
.ql-detail { overflow-y: auto; padding: 18px 20px; }

/* ---------- Personnage ---------- */
#p-char { left: 30px; top: 110px; width: 520px; max-height: calc(100vh - 240px); display: flex; flex-direction: column; }
.char-top { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.char-top canvas { border-radius: 8px; border: 2px solid var(--gold3); }
.char-top h2 { font-family: var(--title); color: var(--gold); font-size: 22px; }
.char-top .rk { color: #ffd870; font-style: italic; font-size: 16px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.stat { display: flex; justify-content: space-between; font-size: 14px; border-bottom: 1px dotted rgba(200,160,80,.2); padding: 2px 0; }
.stat b { color: #fff; font-family: var(--title); font-size: 13px; }
.virtue { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dotted rgba(200,160,80,.2); }
.virtue .vi { font-size: 22px; width: 30px; text-align: center; }
.virtue .vn { flex: 1; }
.virtue .vn b { font-family: var(--title); color: var(--gold); font-size: 14px; }
.virtue .vn span { display: block; font-size: 12px; color: var(--text2); }
.virtue .vv { font-family: var(--title); font-size: 18px; color: #fff; width: 30px; text-align: center; }
.plus { width: 26px; height: 26px; border-radius: 4px; border: 1px solid var(--gold2); background: linear-gradient(#3a7a2a, #1a4a10); color: #fff; font-size: 16px; font-weight: 700; }
.plus:disabled { filter: grayscale(1) brightness(.5); }
.relics { display: flex; gap: 8px; flex-wrap: wrap; }
.relic { width: 46px; height: 46px; border: 2px solid #a050c0; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 24px; background: radial-gradient(#3a1a4a, #0c0610); box-shadow: 0 0 10px rgba(160,80,200,.4); }
.relic.none { border-color: #333; box-shadow: none; filter: grayscale(1) opacity(.3); }
.mds-box { padding: 10px 12px; background: linear-gradient(90deg, rgba(255,200,100,.1), rgba(255,140,180,.08)); border: 1px solid rgba(255,210,120,.3); border-radius: 6px; margin-top: 6px; }
.mds-box b { color: #ffd870; font-family: var(--title); }

/* ---------- Grimoire ---------- */
#p-grimoire { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 900px; max-height: 88vh; display: flex; flex-direction: column; }
.grim-head { display: flex; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.gh-box { flex: 1; min-width: 180px; padding: 10px 12px; border: 1px solid rgba(200,160,80,.35); border-radius: 6px; background: rgba(255,200,100,.05); }
.gh-box .big { font-family: var(--title); font-size: 22px; color: var(--gold); }
.gh-box .lbl { font-size: 12px; color: var(--text2); font-family: var(--title); letter-spacing: .08em; }
.prac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.pcard { position: relative; padding: 12px 14px; border: 2px solid var(--bronze); border-radius: 6px; background: linear-gradient(180deg, #241a10, #120c07); cursor: pointer; transition: all .15s; }
.pcard:hover { border-color: var(--gold); box-shadow: 0 0 14px rgba(255,210,120,.25); transform: translateY(-2px); }
.pcard.done { border-color: #3a7a3a; }
.pcard .pt { display: flex; align-items: center; gap: 10px; padding-right: 58px; }
.pcard .pi { font-size: 30px; }
.pcard .pn { font-family: var(--title); font-weight: 700; color: var(--gold); font-size: 15px; }
.pcard .ps { font-size: 12px; color: #9aff8a; font-family: var(--title); }
.pcard .ps.todo { color: #ffd870; }
.pcard .pe { font-size: 13px; color: var(--text2); margin-top: 6px; line-height: 1.35; }
.pcard .pe b { color: #ffb0e0; }
.pcard .px { position: absolute; top: 10px; right: 12px; font-family: var(--title); font-size: 12px; color: #c8a0ff; }
.pcard.quest::after { content: '!'; position: absolute; top: -10px; left: -6px; font-family: var(--title); font-weight: 900; font-size: 24px; color: #ffd200; text-shadow: 0 0 6px #000, 0 0 10px #ffd200; }

/* ---------- Livre de l'Âme / Codex ---------- */
#p-livre, #p-codex { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 820px; height: 82vh; display: flex; flex-direction: column; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.tab { padding: 5px 12px; border: 1px solid var(--gold3); border-radius: 4px 4px 0 0; background: #1a120a; color: var(--text2); font-family: var(--title); font-size: 12px; cursor: pointer; }
.tab.on { background: #3a2a16; color: var(--gold); border-color: var(--gold2); }
.entry { padding: 12px 16px; margin-bottom: 10px; }
.entry .ed { font-family: var(--title); font-size: 12px; color: #7a4a10; margin-bottom: 4px; }
.entry .ek { font-weight: 600; color: #5a2a08; }
.entry p { margin: 3px 0; line-height: 1.45; }
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 10px; }
.cx { padding: 10px 12px; border: 1px solid var(--bronze); border-radius: 6px; background: linear-gradient(180deg, #1e1610, #0e0a07); display: flex; gap: 10px; }
.cx canvas { flex-shrink: 0; border-radius: 6px; background: radial-gradient(#2a1a3a, #08050c); border: 1px solid #3a2a4a; }
.cx .cn { font-family: var(--title); color: #e8c8ff; font-size: 14px; }
.cx .ck { font-size: 12px; color: var(--text2); }
.cx .ct { font-style: italic; color: #fff4c8; font-size: 14px; margin-top: 4px; line-height: 1.35; }
.cx .cw { font-size: 12px; margin-top: 4px; }
.cx.unknown { filter: grayscale(1) brightness(.5); }
.cx.boss { border-color: #8a2a2a; }

/* ---------- Carte ---------- */
#p-map { left: 50%; top: 50%; transform: translate(-50%, -50%); }
#p-map .pb { padding: 10px; }
#worldmap { display: block; border: 2px solid var(--gold3); border-radius: 4px; background: #0c0810; }

/* ---------- Menu ---------- */
#p-menu { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 380px; }
#p-menu .pb { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 15px; }
.opt-row input[type=range] { width: 160px; accent-color: #c8a050; }
.opt-row input[type=checkbox] { width: 18px; height: 18px; accent-color: #c8a050; }

/* ---------- Modal (pratiques, mort, fin) ---------- */
#modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(10,6,20,.75), rgba(0,0,0,.92)); animation: fadeIn .4s; }
@keyframes fadeIn { from { opacity: 0; } }
.mbox { width: 640px; max-width: 94vw; max-height: 92vh; overflow-y: auto; }
.mbox .pb { padding: 22px 26px; }
.mbox .mh { text-align: center; margin-bottom: 12px; }
.mbox .mh .mi { font-size: 50px; filter: drop-shadow(0 0 14px rgba(255,210,120,.5)); }
.mbox .mh h2 { font-family: var(--title); color: var(--gold); font-size: 26px; text-shadow: 0 2px 4px #000; }
.mbox .intro { padding: 14px 18px; font-size: 16px; line-height: 1.5; margin-bottom: 14px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-family: var(--title); font-size: 13px; color: var(--gold); margin-bottom: 4px; letter-spacing: .03em; }
.field input, .field textarea { width: 100%; padding: 10px 12px; font-size: 17px; color: var(--parch-ink); background: #f3e6c4; border: 2px solid #8a6a3a; border-radius: 4px; outline: none; box-shadow: inset 0 2px 6px rgba(90,50,10,.25); }
.field textarea { min-height: 80px; resize: vertical; line-height: 1.4; }
.field input:focus, .field textarea:focus { border-color: var(--gold); box-shadow: inset 0 2px 6px rgba(90,50,10,.25), 0 0 12px rgba(255,210,120,.4); }
.mactions { display: flex; justify-content: center; gap: 14px; margin-top: 16px; }
.mmsg { text-align: center; color: #ffb0a0; font-style: italic; min-height: 20px; margin-top: 6px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.choice { padding: 12px; text-align: center; border: 2px solid var(--bronze); border-radius: 6px; cursor: pointer; font-family: var(--title); font-size: 14px; color: var(--gold); background: #1a120a; }
.choice:hover { border-color: var(--gold2); }
.choice.on { border-color: var(--gold); background: #3a2a14; box-shadow: 0 0 14px rgba(255,210,120,.3); }
.slider-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.slider-row input { flex: 1; accent-color: #ffb050; }
.slider-row .sv { font-family: var(--title); font-size: 24px; color: var(--gold); width: 50px; text-align: center; }
.dur-pick { display: flex; justify-content: center; gap: 10px; margin: 10px 0; }

.breath-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 10px 0; }
.breath-orb { width: 260px; height: 260px; display: flex; align-items: center; justify-content: center; position: relative; }
.breath-orb .orb { width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffffff, #bfe8ff 30%, #5aa8e0 70%, rgba(40,90,160,.2)); box-shadow: 0 0 60px rgba(150,210,255,.8), 0 0 120px rgba(120,180,255,.4); transition: transform 5s ease-in-out; }
.breath-orb .ringg { position: absolute; width: 250px; height: 250px; border-radius: 50%; border: 2px dashed rgba(190,230,255,.35); }
.breath-txt { font-family: var(--title); font-size: 30px; color: #dff2ff; text-shadow: 0 0 20px rgba(150,210,255,.8); }
.breath-sub { color: var(--text2); font-size: 15px; }
.timer-ring { width: 240px; height: 240px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-direction: column; background: conic-gradient(#ffd870 calc(var(--p) * 1turn), rgba(255,255,255,.06) 0); position: relative; }
.timer-ring::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: radial-gradient(#1a1430, #0a0812); }
.timer-ring > * { position: relative; }
.timer-ring .tt { font-family: var(--title); font-size: 44px; color: #fff3c0; }
.timer-ring .ts { font-style: italic; color: var(--text2); }

.done-box { text-align: center; }
.done-box .rays { font-size: 64px; animation: spinGlow 6s linear infinite; display: inline-block; filter: drop-shadow(0 0 20px #ffd870); }
@keyframes spinGlow { to { transform: rotate(360deg); } }
.done-box h2 { font-family: var(--title); color: var(--gold); font-size: 28px; margin: 6px 0 12px; }
.rewards { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.rw-big { padding: 10px 16px; border: 1px solid rgba(255,210,120,.4); border-radius: 6px; background: rgba(255,210,120,.08); min-width: 130px; }
.rw-big .v { font-family: var(--title); font-size: 22px; color: #fff3c0; }
.rw-big .l { font-size: 12px; color: var(--text2); font-family: var(--title); }
.ev-box { margin: 12px auto; padding: 12px 16px; max-width: 480px; border: 1px solid rgba(255,150,210,.4); border-radius: 6px; background: rgba(255,150,210,.07); }
.ev-box b { font-family: var(--title); color: #ffb0e0; font-size: 17px; }

.death { text-align: center; }
.death h2 { font-family: var(--title); font-size: 34px; color: #d8c0ff; text-shadow: 0 0 20px rgba(150,100,255,.6); margin-bottom: 14px; }
.death p { font-style: italic; font-size: 19px; color: #e8dcc0; margin-bottom: 20px; }

#ending { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle, #fffaf0 0%, #ffe8b0 40%, #c89040 100%); animation: endIn 3s; color: #3a2008; text-align: center; padding: 30px; }
@keyframes endIn { from { opacity: 0; } }
#ending p.l { font-size: 28px; font-style: italic; opacity: 0; transition: opacity 2s; margin: 10px 0; }
#ending p.l.on { opacity: 1; }
#ending .eh { font-family: 'Cinzel Decorative', var(--title); font-weight: 900; font-size: 80px; color: #8a5a10; text-shadow: 0 0 40px #fff, 0 3px 0 #fff6d0; opacity: 0; transition: opacity 3s; }
#ending .eh.on { opacity: 1; }
#ending .estats { display: flex; gap: 16px; margin: 20px 0; flex-wrap: wrap; justify-content: center; opacity: 0; transition: opacity 2s; }
#ending .estats.on { opacity: 1; }
#ending .es { padding: 10px 16px; background: rgba(255,255,255,.5); border: 1px solid #c89040; border-radius: 6px; }
#ending .es b { display: block; font-family: var(--title); font-size: 26px; color: #6a3a08; }

/* ---------- Défilement ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,.3); }
::-webkit-scrollbar-thumb { background: linear-gradient(#8b6a2b, #5a4018); border-radius: 5px; border: 1px solid #000; }
.howto { max-width: 760px; max-height: 70vh; overflow-y: auto; }
.howto h4 { font-family: var(--title); color: #5a2a08; margin: 14px 0 6px; }
.howto li { margin-left: 22px; line-height: 1.5; }
kbd { font-family: var(--title); font-size: 12px; padding: 1px 6px; border: 1px solid #8a6a3a; border-bottom-width: 2px; border-radius: 3px; background: #fff6dc; color: #3a2410; }
