/* Eloymes — interface sombre et épique : obsidienne, cuivre, braise. */
:root { --ink: #efe4d2; --dim: #a99a8a; --panel: rgba(14, 9, 14, 0.82); --edge: #6b4a2e; --copper: #c07a45; --gold: #e8b64c; --ember: #ff7a2a; --hp: #c8352d; --mp: #e07a1a; color-scheme: dark; }
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; height: 100%; background: #07040a; color: var(--ink); font: 16px/1.45 'Alegreya Sans', system-ui, sans-serif; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

#stage { position: fixed; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; }
#stage > canvas { display: block; width: 100%; height: 100%; }
.labels { position: absolute; inset: 0; pointer-events: none; }
#stage.hurt::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 120px rgba(200, 20, 10, 0.55); animation: hurt 0.5s ease-out forwards; }
@keyframes hurt { to { opacity: 0; } }

/* Chargement et création */
#loading { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; background: radial-gradient(ellipse at 50% 70%, #2a0f12, #07040a 70%); z-index: 20; }
#loading h1, #login h1 { font: 800 clamp(40px, 6vw, 64px)/1 Cinzel, serif; color: var(--gold); margin: 0; letter-spacing: 0.02em; text-shadow: 0 0 30px rgba(255, 120, 30, 0.45); }
#loading p { color: var(--dim); }
#login { position: absolute; inset: 0; z-index: 15; display: flex; align-items: center; padding: clamp(16px, 5vw, 72px); background: linear-gradient(90deg, rgba(7, 4, 10, 0.92) 0%, rgba(7, 4, 10, 0.6) 34%, transparent 58%); }
#login[hidden], [hidden] { display: none !important; }
#loginform { width: min(400px, 100%); display: flex; flex-direction: column; gap: 10px; }
.lore { color: #cdbfae; margin: 4px 0 8px; font-size: 17px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend, label { font: 600 14px Cinzel, serif; color: var(--copper); margin-bottom: 6px; }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; min-height: 46px; border-radius: 6px; border: 1px solid var(--edge); background: rgba(30, 18, 22, 0.8); font-weight: 700; }
.seg button[aria-pressed='true'] { background: linear-gradient(#5a2a18, #2e140e); border-color: var(--ember); color: #ffd9b0; box-shadow: 0 0 18px rgba(255, 110, 30, 0.3); }
#loginform input:not([type=checkbox]) { min-height: 46px; font: 600 18px 'Alegreya Sans', sans-serif; color: var(--ink); background: rgba(20, 12, 16, 0.9); border: 1px solid var(--edge); border-radius: 6px; padding: 0 12px; }
.err { min-height: 1.2em; margin: 0; color: #ff8a7a; font-size: 14px; }
.go { min-height: 52px; border-radius: 6px; border: 1px solid #ffb070; background: linear-gradient(#c4561e, #7a2a10); font: 800 17px Cinzel, serif; color: #fff2de; text-shadow: 0 1px 2px #000; box-shadow: 0 0 26px rgba(255, 100, 20, 0.35); }
.go:hover { filter: brightness(1.12); }
.small { color: var(--dim); font-size: 13px; margin: 2px 0 0; }

/* HUD */
#hud { display: none; }
body.playing #hud { display: block; }
.frame { position: absolute; display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--edge); border-radius: 40px 8px 8px 40px; padding: 6px 12px 6px 6px; width: 290px; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5); }
#pframe { left: 14px; top: 14px; }
#pframe.combat { border-color: #c8352d; box-shadow: 0 0 16px rgba(200, 40, 30, 0.35); }
#tframe { left: 318px; top: 14px; }
.lvl { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font: 800 18px Cinzel, serif; color: #2a1608; background: radial-gradient(#f6d27a, #a8702a); border: 2px solid #3a2414; }
.bars { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.bars b { font: 700 14px Cinzel, serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.target.hostile b { color: #ff7a6a; } .target.neutral b, .target.critter b { color: #f2d06a; } .target.friendly b { color: #8ee89a; }
.bar { position: relative; height: 15px; background: rgba(0, 0, 0, 0.6); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; transition: width 0.15s; }
.bar.hp i { background: linear-gradient(#e2584a, var(--hp)); } .bar.mp i { background: linear-gradient(#ffad4a, var(--mp)); }
.bar span { position: absolute; inset: 0; text-align: center; font: 700 11px/15px 'Alegreya Sans', sans-serif; text-shadow: 0 1px 2px #000; white-space: nowrap; }
#minimap { position: absolute; right: 14px; top: 14px; width: 180px; height: 180px; border-radius: 50%; border: 3px solid var(--edge); box-shadow: 0 0 0 2px #1a0e0a, 0 6px 20px rgba(0, 0, 0, 0.6); background: #000; }
#quests { position: absolute; right: 14px; top: 212px; width: 260px; background: var(--panel); border: 1px solid var(--edge); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
#quests h3 { margin: 0 0 6px; font: 800 13px Cinzel, serif; color: var(--gold); }
#quests .q { margin-bottom: 8px; } #quests .q b { color: #f2d06a; font-size: 15px; }
#quests ul { margin: 2px 0 0; padding-left: 16px; color: #d8cbbb; } #quests li.ok { color: #8a8077; text-decoration: line-through; } #quests li.turn { color: #8ee89a; list-style: '➤ '; }
#quests .none { margin: 0; color: var(--dim); }
#log-old { position: absolute; left: 14px; bottom: 54px; width: min(380px, 36vw); max-height: 170px; overflow-y: auto; background: linear-gradient(transparent, rgba(10, 6, 10, 0.7) 20%); border-radius: 8px; padding: 8px 10px; font-size: 14px; scrollbar-width: thin; }
#log div { margin-bottom: 2px; text-shadow: 0 1px 2px #000; } #log .gold { color: #f2c35a; } #log .kill { color: #d8cbbb; } #log .bad { color: #ff8a7a; } #log .sys { color: #b9a8ff; }
#actionbar { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); display: flex; gap: 8px; padding: 8px; background: var(--panel); border: 1px solid var(--edge); border-radius: 10px; }
.slot { position: relative; width: 56px; height: 56px; padding: 0; border-radius: 8px; border: 2px solid var(--voie); background: radial-gradient(circle at 50% 35%, #3a2626, #140b0e); overflow: hidden; }
.slot svg { width: 100%; height: 100%; display: block; }
.slot .key { position: absolute; left: 4px; top: 2px; font: 800 12px 'Alegreya Sans', sans-serif; text-shadow: 0 1px 2px #000; }
.slot .cd { position: absolute; inset: 0; }
.slot .lock { display: none; }
.slot.locked { filter: grayscale(1) brightness(0.45); } .slot.locked .lock { display: grid; place-items: center; position: absolute; inset: 0; font: 800 20px Cinzel, serif; color: #fff; }
.slot.nomana svg { filter: saturate(0.3) brightness(0.6) hue-rotate(200deg); }
.slot.oor { box-shadow: inset 0 0 0 40px rgba(200, 30, 20, 0.35); }
.slot:hover { filter: brightness(1.25); }
#castbar { position: absolute; left: 50%; bottom: 112px; transform: translateX(-50%); width: 300px; height: 22px; background: rgba(0, 0, 0, 0.75); border: 1px solid var(--edge); border-radius: 4px; overflow: hidden; }
#cb-fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#ffcf6a, #d07a1a); }
#cb-name, #cb-time { position: absolute; top: 0; line-height: 22px; font: 700 13px 'Alegreya Sans', sans-serif; text-shadow: 0 1px 2px #000; }
#cb-name { left: 8px; } #cb-time { right: 8px; }
#xpbar { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; background: rgba(8, 4, 10, 0.9); border-top: 1px solid var(--edge); }
#xpfill { display: block; height: 100%; background: linear-gradient(#a86ae0, #6a2aa8); transition: width 0.4s; }
#xptext { position: absolute; inset: 0; text-align: center; font: 700 12px/18px 'Alegreya Sans', sans-serif; text-shadow: 0 1px 2px #000; }
#help { position: absolute; left: 50%; top: 14px; transform: translate(-50%, -12px); display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--edge); border-radius: 8px; padding: 10px 14px; font-size: 14px; opacity: 0; pointer-events: none; transition: 0.4s; }
#help.show { opacity: 1; transform: translate(-50%, 0); }
#help b { font: 800 13px Cinzel, serif; color: var(--gold); }
kbd { font: 700 12px 'Alegreya Sans', sans-serif; padding: 0 5px; border: 1px solid #6b5a4a; border-radius: 3px; background: #241a1c; white-space: nowrap; }

/* Plaques de nom au-dessus des entités */
.plate { display: flex; flex-direction: column; align-items: center; transform: translateY(-50%); font: 700 13px 'Alegreya Sans', sans-serif; text-shadow: 0 1px 2px #000, 0 0 6px #000; white-space: nowrap; }
.plate .nm { color: #ff7a6a; } .plate.friendly .nm { color: #8ee89a; } .plate.neutral .nm, .plate.critter .nm { color: #f2d06a; }
.plate .tt { font-size: 11px; color: #cfc2b2; font-weight: 500; }
.plate .tt:empty { display: none; }
.plate .hb { width: 64px; height: 5px; background: rgba(0, 0, 0, 0.7); margin-top: 2px; border-radius: 2px; overflow: hidden; }
.plate .hb i { display: block; height: 100%; background: #d8342a; }
.plate .mark { font: 800 30px/1 Cinzel, serif; color: #ffd23a; text-shadow: 0 0 10px rgba(255, 180, 40, 0.8), 0 2px 2px #000; }
.plate .mark.wait { color: #9a9088; text-shadow: 0 2px 2px #000; font-size: 22px; }
.plate.targeted .nm { text-decoration: underline; text-underline-offset: 3px; }
.plate.dead { opacity: 0.45; }
.plate .lv { display: none; }
.plate.compact .nm, .plate.compact .tt { display: none; }
.plate.compact .lv { display: block; font: 700 10px/1 'Alegreya Sans', sans-serif; color: #ffb0a0; background: rgba(20, 10, 12, 0.6); border: 1px solid rgba(255, 120, 100, 0.45); border-radius: 8px; padding: 1px 5px; }
.plate.compact.neutral .lv, .plate.compact.critter .lv { color: #f2d06a; border-color: rgba(242, 208, 106, 0.45); }

/* Textes et annonces */
.fct { position: absolute; left: 0; top: 0; pointer-events: none; font: 800 20px 'Alegreya Sans', sans-serif; text-shadow: 0 2px 3px #000, 0 0 8px #000; white-space: nowrap; will-change: transform; }
.fct.hit { color: #ffe08a; } .fct.crit { color: #ffb030; font-size: 28px; } .fct.hurt { color: #ff5a4a; } .fct.heal { color: #7aff8a; } .fct.xp { color: #c89aff; font-size: 17px; }
#banner { position: absolute; left: 0; right: 0; top: 24%; text-align: center; pointer-events: none; opacity: 0; font: 800 clamp(38px, 6vw, 66px)/1.05 Cinzel, serif; color: var(--gold); text-shadow: 0 0 30px rgba(255, 120, 30, 0.5), 0 3px 4px #000; }
#banner small { display: block; font: 600 clamp(16px, 2vw, 22px) 'Alegreya Sans', sans-serif; color: #e8d8c4; margin-top: 8px; }
#banner.show { animation: banner 3.6s ease forwards; }
@keyframes banner { 0% { opacity: 0; transform: scale(0.94); } 12% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }
#toast { position: absolute; left: 50%; top: 92px; transform: translateX(-50%); pointer-events: none; opacity: 0; font: 700 18px 'Alegreya Sans', sans-serif; color: #f2d06a; text-shadow: 0 2px 3px #000; white-space: nowrap; }
#toast.show { animation: toast 2.8s ease forwards; }
@keyframes toast { 0% { opacity: 0; } 10%, 75% { opacity: 1; } 100% { opacity: 0; } }
#errmsg { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); pointer-events: none; opacity: 0; font: 700 18px 'Alegreya Sans', sans-serif; color: #ff6a5a; text-shadow: 0 2px 3px #000; }
#errmsg.show { animation: toast 1.6s ease forwards; }
#tooltip { position: absolute; width: 250px; background: rgba(12, 8, 12, 0.95); border: 1px solid var(--edge); border-radius: 6px; padding: 10px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 2px; pointer-events: none; z-index: 5; }
#tooltip b { font: 800 15px Cinzel, serif; color: #ffd9b0; } #tooltip .voie { font-size: 13px; } #tooltip p { margin: 4px 0 0; color: #cdbfae; } #tooltip em { color: #ff7a6a; font-style: normal; }
#dialog { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, 92vw); max-height: 70vh; overflow-y: auto; background: linear-gradient(rgba(22, 14, 16, 0.96), rgba(12, 8, 12, 0.96)); border: 1px solid var(--copper); border-radius: 10px; padding: 18px 22px; box-shadow: 0 0 0 1px #000, 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 40px rgba(255, 110, 30, 0.12); z-index: 6; }
#dialog h3 { margin: 0; font: 800 22px Cinzel, serif; color: var(--gold); }
#dialog .tt { margin: 0 0 10px; color: var(--dim); font-size: 14px; }
#dialog p { margin: 0 0 10px; font-size: 16.5px; color: #e8dccb; }
#dialog .obj { border-top: 1px solid #3a2a22; padding-top: 8px; margin-bottom: 8px; font-size: 15px; } #dialog .obj b { color: var(--copper); font-family: Cinzel, serif; } #dialog .obj ul { margin: 4px 0 0; padding-left: 18px; }
#dialog .opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
#dialog .opts button { min-height: 44px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--edge); background: #241619; font-weight: 700; }
#dialog .opts button.main { border-color: #ffb070; background: linear-gradient(#a84a1a, #5e220e); color: #fff2de; }
#dialog .opts button:hover { filter: brightness(1.2); }
#deathveil { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px; background: radial-gradient(transparent, rgba(40, 0, 0, 0.65)); pointer-events: none; }
#deathveil b { font: 800 40px Cinzel, serif; color: #ff6a4a; text-shadow: 0 3px 4px #000; } #deathveil span { color: #e8d8c4; }

@media (max-width: 900px) {
  .frame { width: 230px; } #tframe { left: 14px; top: 84px; }
  #quests { width: 210px; top: 168px; } #minimap { width: 140px; height: 140px; }
  #log { display: none; }
  .slot { width: 46px; height: 46px; }
}

/* ---------- Bêta multijoueur v0.5 ---------- */
.gi { width: 100%; height: 100%; display: block; }
.ltabs { display: flex; gap: 6px; }
.ltabs button { flex: 1; min-height: 38px; border-radius: 6px; border: 1px solid var(--edge); background: rgba(20, 12, 14, 0.8); color: var(--dim); font: 700 15px 'Alegreya Sans', sans-serif; }
.ltabs button[aria-pressed="true"] { color: #fff2de; border-color: var(--copper); background: linear-gradient(#4a2416, #24120c); }
#loginform label small { color: var(--dim); font-weight: 400; }
#loginform .remember { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #cdbfae; }
#loginform .remember input { width: 18px; height: 18px; min-height: 0; }
#loginform:not(.register) .reg-only, #loginform.solo .online-only, #loginform.solo .reg-only { display: none; }
#loginform.register .login-only, #loginform.solo .login-only, #loginform:not(.register):not(.solo) .name-only { display: none; }

#chat { position: absolute; left: 14px; bottom: 54px; width: min(420px, 38vw); display: flex; flex-direction: column; background: rgba(10, 6, 10, 0.62); border: 1px solid rgba(107, 74, 46, 0.6); border-radius: 8px; font-size: 14px; }
.ctabs { display: flex; gap: 2px; padding: 4px 4px 0; }
.ctabs button { padding: 3px 10px; border: 0; border-radius: 5px 5px 0 0; background: transparent; color: var(--dim); font: 700 12.5px 'Alegreya Sans', sans-serif; }
.ctabs button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.08); color: var(--ink); }
.ctabs button.ping { color: #7ab8ff; }
#chatlog { height: 160px; overflow-y: auto; padding: 4px 8px; scrollbar-width: thin; }
#chatlog .cl { margin-bottom: 2px; text-shadow: 0 1px 2px #000; line-height: 1.3; overflow-wrap: anywhere; }
#chatlog .tm { color: #6a5e56; font-size: 11px; margin-right: 5px; }
#chatlog .g { color: #f4efe8; }
#chatlog .w { color: #7ab8ff; }
#chatlog .info { color: #7fe08a; }
#chatlog .info.k-bad { color: #ff9a8a; }
#chatlog .sys { color: #a99a8a; font-style: italic; }
#chatlog .who { all: unset; cursor: pointer; font-weight: 800; }
#chatlog .who:hover { text-decoration: underline; }
#chat[data-tab="g"] .cl:not(.g):not(.sys), #chat[data-tab="w"] .cl:not(.w), #chat[data-tab="info"] .cl:not(.info) { display: none; }
#chatin { margin: 4px; min-height: 30px; padding: 4px 8px; border-radius: 5px; border: 1px solid rgba(107, 74, 46, 0.5); background: rgba(0, 0, 0, 0.45); color: var(--ink); font: 500 14px 'Alegreya Sans', sans-serif; }
#chatin:focus { border-color: var(--copper); outline: none; background: rgba(0, 0, 0, 0.7); }

#menu { position: absolute; right: 14px; bottom: 30px; display: flex; gap: 6px; }
#menu button { position: relative; width: 50px; height: 50px; padding: 8px; border-radius: 8px; border: 1px solid var(--edge); background: var(--panel); color: #d9b48a; }
#menu button:hover, #menu button[aria-pressed="true"] { color: #ffe0b0; border-color: var(--copper); background: rgba(60, 30, 16, 0.9); }
#menu button span { position: absolute; left: 4px; top: 1px; font: 800 11px 'Alegreya Sans', sans-serif; color: var(--ink); text-shadow: 0 1px 2px #000; }
#menu .badge { position: absolute; right: -6px; top: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #ff7a2a; color: #1a0a04; font: 800 12px/20px 'Alegreya Sans', sans-serif; box-shadow: 0 0 10px rgba(255, 120, 40, 0.7); }
#menu .badge:empty { display: none; }
#online { position: absolute; right: 14px; top: 198px; width: 180px; text-align: center; font-size: 12.5px; color: var(--dim); text-shadow: 0 1px 2px #000; }
#quests { top: 222px; }
#harvesttip { position: absolute; pointer-events: none; transform: translate(-50%, -140%); padding: 3px 8px; border-radius: 5px; background: rgba(12, 8, 12, 0.88); border: 1px solid #8a6a3a; color: #ffe6b0; font: 700 13px 'Alegreya Sans', sans-serif; white-space: nowrap; z-index: 4; }
#netstatus { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); padding: 18px 24px; border-radius: 10px; background: rgba(12, 8, 12, 0.95); border: 1px solid var(--copper); text-align: center; z-index: 30; font-size: 16px; }
#netstatus button { margin-top: 10px; min-height: 40px; padding: 0 18px; }
.mountslot.active { box-shadow: 0 0 0 2px #a8c8ff, 0 0 16px rgba(150, 190, 255, 0.7); }
.mountslot .gi { padding: 8px; }
.frame.target.ally b { color: #7ab8ff; }
.plate.ally .nm { color: #7ab8ff; }

#tooltip { z-index: 9; width: 270px; }
#tooltip .num { color: #ffe6b0; } #tooltip .num b { color: #fff; }
#tooltip .slv, #tooltip .req { color: var(--dim); font-size: 13px; }
#tooltip .bad { color: #ff7a6a; }
#tooltip .st { color: #8ee89a; }
#tooltip .syn { font-size: 13px; }
#tooltip .hint { color: #8a7a6a; font-size: 12px; margin-top: 4px; }

.win { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); width: min(560px, 94vw); max-height: calc(100% - 150px); display: flex; flex-direction: column; background: linear-gradient(rgba(24, 15, 17, 0.97), rgba(12, 8, 12, 0.97)); border: 1px solid var(--copper); border-radius: 10px; box-shadow: 0 0 0 1px #000, 0 18px 40px rgba(0, 0, 0, 0.7); z-index: 7; }
#w-stats { left: 24px; transform: none; width: min(420px, 94vw); top: 90px; }
#w-spells { left: auto; right: 24px; transform: none; width: min(420px, 94vw); top: 90px; }
.win header { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 16px; border-bottom: 1px solid #3a2a22; cursor: move; user-select: none; }
.win h2 { margin: 0; font: 800 17px Cinzel, serif; color: var(--gold); }
.win .x { width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--edge); background: transparent; color: var(--ink); font-size: 20px; line-height: 1; }
.win .body { padding: 12px 14px; overflow-y: auto; }
.win .pts { margin: 0 0 10px; color: #e8dccb; } .win .pts b { color: var(--ember); font-size: 18px; } .win .pts small { color: var(--dim); }
.win .hint { color: #8a7a6a; font-size: 13px; margin: 8px 0 0; }
.equip { display: grid; grid-template-columns: 56px 1fr 56px; gap: 10px; align-items: start; }
.ecol { display: flex; flex-direction: column; gap: 8px; }
.eslot, .cell { position: relative; width: 52px; height: 52px; padding: 6px; border-radius: 7px; border: 1px solid #4a3428; background: radial-gradient(circle at 50% 35%, #2a1c1c, #120a0c); }
.eslot.full { border-color: #a07040; } .eslot:hover, .cell[data-uid]:hover { border-color: var(--gold); filter: brightness(1.2); }
.eslot .ghost { opacity: 0.55; }
.figure { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.figure .sil { width: 96px; height: 96px; opacity: 0.6; }
.figure .sum { display: flex; flex-direction: column; align-items: center; font-size: 13.5px; color: #cdbfae; line-height: 1.35; } .figure .sum b { font: 800 15px Cinzel, serif; color: var(--gold); }
.bag { margin-top: 12px; }
.bag .tabs { display: flex; gap: 4px; margin-bottom: 6px; }
.bag .tabs button { padding: 4px 12px; border-radius: 6px; border: 1px solid var(--edge); background: transparent; color: var(--dim); font: 700 13.5px 'Alegreya Sans', sans-serif; }
.bag .tabs button[aria-pressed="true"] { color: #fff2de; border-color: var(--copper); background: rgba(80, 40, 20, 0.5); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, 52px); gap: 6px; max-height: 240px; overflow-y: auto; }
.cell.empty { opacity: 0.4; }
.cell.low { filter: grayscale(0.7); }
.cell .n { position: absolute; right: 3px; bottom: 1px; font: 800 12px 'Alegreya Sans', sans-serif; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.orbs { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; padding-top: 8px; border-top: 1px solid #3a2a22; font: 700 14px 'Alegreya Sans', sans-serif; }
.orb { display: inline-flex; align-items: center; gap: 5px; } .orb i { width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 0 6px rgba(255, 255, 255, 0.25); }
.srow, .sprow { display: grid; grid-template-columns: 40px 1fr auto 36px; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid #2a1e1a; }
.sprow { grid-template-columns: 44px 1fr 36px; }
.si { width: 34px; height: 34px; padding: 3px; border-radius: 6px; background: rgba(255, 255, 255, 0.04); }
.sic { width: 44px; height: 44px; border-radius: 7px; border: 2px solid var(--voie); background: radial-gradient(circle at 50% 35%, #3a2626, #140b0e); overflow: hidden; }
.sic svg { width: 100%; height: 100%; display: block; }
.sn { display: flex; flex-direction: column; } .sn b { font-size: 15.5px; } .sn small { color: #cdbfae; font-size: 13px; }
.sv { font: 800 18px 'Alegreya Sans', sans-serif; color: var(--ink); } .sv small { font-size: 12px; color: #8ee89a; font-weight: 600; }
.plus { width: 34px; height: 34px; border-radius: 7px; border: 1px solid #a07040; background: linear-gradient(#5a2c16, #2c140a); color: #ffe0b0; font: 800 20px/1 'Alegreya Sans', sans-serif; }
.plus:disabled { opacity: 0.3; }
.plus:not(:disabled):hover { filter: brightness(1.3); }
.derived { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; padding: 8px 10px; border-radius: 7px; background: rgba(255, 255, 255, 0.04); font-size: 14px; color: #cdbfae; } .derived b { color: #fff; }
.sprow.locked { opacity: 0.5; }
.pips { display: flex; gap: 4px; margin-top: 3px; } .pips i { width: 14px; height: 6px; border-radius: 3px; background: #3a2a22; } .pips i.on { background: var(--ember); box-shadow: 0 0 6px rgba(255, 120, 40, 0.7); }
@media (max-width: 900px) { #chat { width: 46vw; } #chatlog { height: 110px; } #online { display: none; } }
#w-inv { width: min(820px, 96vw); }
#w-inv .body { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
#w-inv .bag { margin-top: 0; }
#w-inv .figure .sil { width: 70px; height: 70px; }
#w-inv .grid { max-height: 300px; }
@media (max-width: 760px) { #w-inv .body { grid-template-columns: 1fr; } }
#loginform .small a { color: var(--copper); }
#login { overflow-y: auto; align-items: safe center; }
#loginform { gap: 8px; padding: 12px 0; }
#loginform .remember { font-family: 'Alegreya Sans', sans-serif; font-weight: 500; }
@media (max-height: 760px) { #login h1 { font-size: 40px; } #login .lore { font-size: 15px; margin: 0 0 4px; } #loginform input:not([type=checkbox]) { min-height: 40px; } }
#worldmap { position: absolute; inset: 0; z-index: 12; display: flex; align-items: center; justify-content: center; background: rgba(6, 4, 8, 0.72); }
#worldmap[hidden] { display: none; }
.wm-frame { display: flex; flex-direction: column; height: min(94%, 980px); aspect-ratio: 1 / 1.06; max-width: 96%; border: 2px solid var(--copper); border-radius: 12px; background: #120c10; box-shadow: 0 0 0 1px #000, 0 24px 60px rgba(0, 0, 0, 0.8); overflow: hidden; }
.wm-frame header { display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 16px; border-bottom: 1px solid #3a2a22; }
.wm-frame h2 { margin: 0; font: 800 19px Cinzel, serif; color: var(--gold); }
.wm-hint { flex: 1; color: var(--dim); font-size: 13px; }
.wm-frame .x { width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--edge); background: transparent; color: var(--ink); font-size: 22px; line-height: 1; }
#wm-canvas { flex: 1; min-height: 0; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
#minimap { cursor: zoom-in; }

/* Fondu au noir lors du passage d'une porte */
#fade { position: absolute; inset: 0; background: #050304; opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 40; }
#fade.on { opacity: 1; }

/* Emplacement de la fiole */
.slot.fioleslot .gi { padding: 8px; }
.slot.fioleslot .cnt { position: absolute; right: 4px; bottom: 2px; font: 800 13px 'Alegreya Sans', sans-serif; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; z-index: 2; }
.slot.fioleslot.empty .gi { opacity: 0.35; filter: grayscale(0.8); }
