:root {
  --gold: #e8c46a; --gold2: #b8913a; --gold3: #6a5020;
  --panel: rgba(14, 11, 9, .92); --panel2: rgba(30, 24, 18, .95);
  --text: #f0e6d0; --muted: #b0a48a;
  --hp: #2fae3a; --border: #7a6030;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0a0e; color: var(--text); font-family: 'Crimson Text', Georgia, serif; user-select: none; }
canvas#game { position: fixed; inset: 0; display: block; cursor: default; }
canvas#game.c-attack { cursor: crosshair; }
canvas#game.c-talk { cursor: help; }
.hidden { display: none !important; }
button { font-family: inherit; }

/* ============ Titre ============ */
#title { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; overflow: auto;
  background: radial-gradient(ellipse at 50% 120%, #5a2410 0%, #2a120a 30%, #0e0a0c 70%), #0b0a0e; }
.embers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.embers i { position: absolute; bottom: -10px; width: 4px; height: 4px; border-radius: 50%; background: #ffa040; box-shadow: 0 0 8px #ff7020; animation: rise linear infinite; }
@keyframes rise { 0% { transform: translateY(0) translateX(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(-110vh) translateX(40px); opacity: 0; } }
.title-inner { position: relative; text-align: center; padding: 24px 16px; max-width: 1000px; width: 100%; }
.logo h1 { font-family: Cinzel, serif; font-weight: 900; font-size: clamp(54px, 11vw, 120px); margin: 0; letter-spacing: .08em; line-height: 1;
  background: linear-gradient(180deg, #fff2c0 0%, #e8c46a 40%, #a86a20 75%, #5a3010 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #2a1406) drop-shadow(0 0 30px rgba(255, 120, 30, .35)); }
.logo-small { font-family: Cinzel, serif; color: var(--gold2); letter-spacing: .4em; text-transform: uppercase; font-size: 14px; }
.logo-sub { font-family: Cinzel, serif; color: #ff9a50; font-size: clamp(16px, 2.6vw, 24px); letter-spacing: .15em; margin-top: 6px; text-shadow: 0 0 12px rgba(255, 100, 30, .6); }
.intro { max-width: 640px; margin: 28px auto; font-size: 19px; line-height: 1.5; color: #e0d4bc; font-style: italic; }
.btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.gbtn { font-family: Cinzel, serif; font-weight: 700; font-size: 16px; color: #ffe8a8; padding: 12px 28px; cursor: pointer; letter-spacing: .05em;
  background: linear-gradient(180deg, #8a2a14 0%, #5a160a 100%); border: 2px solid var(--gold2); border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 200, 120, .4), 0 3px 10px rgba(0, 0, 0, .6); text-shadow: 0 1px 2px #000; transition: .15s; }
.gbtn:hover { background: linear-gradient(180deg, #b03a1a 0%, #7a1e0c 100%); border-color: var(--gold); transform: translateY(-1px); }
.gbtn:disabled { filter: grayscale(1); opacity: .5; cursor: default; transform: none; }
.gbtn.small { font-size: 13px; padding: 7px 14px; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; margin-top: 14px; }
.linkbtn:hover { color: var(--gold); }
.classes { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 26px 0 18px; }
.ccard { width: 260px; padding: 16px; cursor: pointer; text-align: center; transition: .2s;
  background: linear-gradient(180deg, rgba(40, 30, 22, .95), rgba(16, 12, 10, .95)); border: 2px solid #4a3a20; border-radius: 6px; }
.ccard:hover { border-color: var(--gold2); transform: translateY(-3px); }
.ccard.sel { border-color: var(--gold); box-shadow: 0 0 24px rgba(232, 196, 106, .35); }
.ccard canvas { display: block; margin: 0 auto; }
.ccard h3 { font-family: Cinzel, serif; margin: 6px 0 2px; font-size: 22px; }
.ccard .res { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.ccard p { font-size: 15px; line-height: 1.35; color: #d8ccb4; margin: 8px 0 0; }
.namerow { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
#heroName { font-family: Cinzel, serif; font-size: 18px; padding: 10px 14px; width: 240px; background: #120e0a; color: var(--gold); border: 2px solid var(--gold3); border-radius: 4px; outline: none; text-align: center; }
#heroName:focus { border-color: var(--gold); }
.controls-hint { margin-top: 30px; color: #8a7e68; font-size: 14px; }

/* ============ Cadres d'unité ============ */
.uframe { position: fixed; top: 14px; display: flex; align-items: center; gap: 0; z-index: 5; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .7)); }
#playerFrame { left: 14px; }
.tframe { left: 330px; }
.portrait { position: relative; width: 70px; height: 70px; border-radius: 50%; border: 3px solid var(--gold2); background: radial-gradient(circle at 40% 35%, #3a2e22, #0e0a08); overflow: hidden; flex: none; z-index: 2; box-shadow: inset 0 0 12px #000; }
.portrait canvas { width: 64px; height: 64px; }
.tglyph { font-size: 34px; text-align: center; line-height: 64px; color: #c84030; }
.lvl { position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); background: #1a1208; border: 2px solid var(--gold2); border-radius: 10px; font-family: Cinzel, serif; font-weight: 700; font-size: 12px; padding: 0 6px; color: var(--gold); }
.ubody { width: 210px; background: var(--panel); border: 2px solid var(--border); border-left: 0; border-radius: 0 6px 6px 0; padding: 5px 8px 5px 12px; margin-left: -10px; }
.tframe .ubody { border-left: 2px solid var(--border); border-right: 0; border-radius: 6px 0 0 6px; margin-left: 0; margin-right: -10px; padding: 5px 12px 5px 8px; }
.uname { font-family: Cinzel, serif; font-weight: 700; font-size: 13px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { position: relative; height: 15px; background: #0a0806; border: 1px solid #000; margin-bottom: 2px; border-radius: 2px; overflow: hidden; }
.bar .fill { height: 100%; transition: width .15s; }
.bar.hp .fill { background: linear-gradient(180deg, #4ad85a, #1f8a2a); }
.bar.res .fill { background: linear-gradient(180deg, #4a8af0, #1f4ab0); }
.bar span { position: absolute; inset: 0; font-size: 11px; line-height: 14px; text-align: center; font-weight: 700; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.combo { display: flex; gap: 3px; height: 8px; margin-top: 2px; }
.combo i { width: 10px; height: 8px; border-radius: 50%; background: #2a2010; border: 1px solid #000; }
.combo i.on { background: radial-gradient(#ffe060, #c84010); box-shadow: 0 0 5px #ff8020; }
.buffs { display: flex; gap: 3px; margin-top: 3px; min-height: 0; flex-wrap: wrap; }
.buff { position: relative; width: 22px; height: 22px; border-radius: 3px; border: 1px solid #3a8a3a; background: #1a2a1a; font-size: 13px; text-align: center; line-height: 20px; }
.buff.bad { border-color: #a03030; background: #2a1414; }
.buff small { position: absolute; bottom: -12px; left: 0; right: 0; font-size: 9px; color: #ddd; text-shadow: 0 0 2px #000; }

/* ============ Minicarte ============ */
#minimapWrap { position: fixed; top: 10px; right: 12px; z-index: 5; width: 182px; text-align: center; }
#mmZone { font-family: Cinzel, serif; font-weight: 700; font-size: 13px; color: var(--gold); text-shadow: 0 1px 3px #000; margin-bottom: 4px; white-space: nowrap; }
#minimap { width: 170px; height: 170px; border-radius: 50%; border: 4px solid var(--gold2); box-shadow: 0 0 0 2px #1a1208, 0 4px 12px rgba(0, 0, 0, .7); background: #000; cursor: pointer; }
#mmCoords { font-size: 11px; color: var(--muted); text-shadow: 0 1px 2px #000; }
#tracker { position: fixed; top: 230px; right: 14px; width: 250px; z-index: 4; text-align: right; pointer-events: none; }
#tracker .tq { margin-bottom: 10px; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
#tracker .tq b { font-family: Cinzel, serif; font-size: 13px; color: #ffd24a; display: block; }
#tracker .tq div { font-size: 14px; color: #e8e0d0; }
#tracker .tq div.done { color: #8aff8a; }
#tracker .tq .ready { color: #8aff8a; font-style: italic; }
#tracker h4 { font-family: Cinzel, serif; color: var(--gold2); font-size: 12px; margin: 0 0 6px; letter-spacing: .15em; }

/* ============ Messages ============ */
#zoneBanner { position: fixed; top: 18%; left: 0; right: 0; text-align: center; z-index: 6; pointer-events: none; opacity: 0; transition: opacity .8s; }
#zoneBanner.show { opacity: 1; }
.zb-name { font-family: Cinzel, serif; font-weight: 900; font-size: clamp(28px, 5vw, 48px); color: #ffd870; text-shadow: 0 3px 0 #2a1406, 0 0 20px rgba(0, 0, 0, .9); }
.zb-sub { font-family: Cinzel, serif; font-size: 17px; color: #f0e0c0; text-shadow: 0 2px 4px #000; }
#yell { position: fixed; top: 32%; left: 50%; transform: translateX(-50%); max-width: 700px; width: 90%; text-align: center; z-index: 6; pointer-events: none; font-size: 22px; font-weight: 700; color: #ff7a40; text-shadow: 0 2px 4px #000, 0 0 8px #000; opacity: 0; transition: opacity .4s; }
#yell.show { opacity: 1; }
#errMsg { position: fixed; top: 24%; left: 0; right: 0; text-align: center; z-index: 7; color: #ff3a2a; font-size: 18px; font-weight: 700; text-shadow: 0 1px 3px #000; pointer-events: none; opacity: 0; transition: opacity .3s; }
#errMsg.show { opacity: 1; }
#questToast { position: fixed; top: 28%; left: 0; right: 0; text-align: center; z-index: 7; color: #ffe060; font-size: 20px; font-weight: 700; text-shadow: 0 1px 3px #000, 0 0 6px #000; pointer-events: none; opacity: 0; transition: opacity .3s; }
#questToast.show { opacity: 1; }
#toast { position: fixed; top: 38%; left: 0; right: 0; text-align: center; z-index: 7; pointer-events: none; opacity: 0; transition: opacity .6s, transform .6s; transform: scale(.8); }
#toast.show { opacity: 1; transform: scale(1); }
#toast .t1 { font-family: Cinzel, serif; font-weight: 900; font-size: 46px; color: #ffe080; text-shadow: 0 0 20px #ff9020, 0 3px 0 #3a2008; }
#toast .t2 { font-size: 20px; color: #fff0d0; text-shadow: 0 1px 3px #000; }
#dmgFlash { position: fixed; inset: 0; pointer-events: none; z-index: 3; box-shadow: inset 0 0 120px rgba(200, 0, 0, .6); opacity: 0; transition: opacity .4s; }
#interactHint { position: fixed; bottom: 150px; left: 50%; transform: translateX(-50%); z-index: 5; background: var(--panel); border: 1px solid var(--border); padding: 5px 14px; border-radius: 4px; font-size: 15px; display: none; }
#interactHint kbd { font-family: Cinzel, serif; color: var(--gold); border: 1px solid var(--gold3); padding: 0 5px; border-radius: 3px; background: #1a1208; }

/* ============ Barre d'action ============ */
#bottom { position: fixed; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 5px; }
#actionbar { display: flex; gap: 6px; padding: 7px 10px; background: linear-gradient(180deg, rgba(40, 30, 20, .95), rgba(14, 10, 8, .95)); border: 2px solid var(--border); border-radius: 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, .7); }
.aslot { position: relative; width: 54px; height: 54px; border: 2px solid #5a4a2a; border-radius: 5px; cursor: pointer; overflow: hidden; box-shadow: inset 0 0 8px rgba(0, 0, 0, .8); }
.aslot:hover { border-color: var(--gold); }
.aslot .ic { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 28px; color: #fff; text-shadow: 0 0 6px rgba(255, 255, 255, .5), 0 2px 2px #000; }
.aslot .cd { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, .7); }
.aslot .cdt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: Cinzel, serif; font-weight: 900; font-size: 18px; color: #ffe060; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.aslot .key { position: absolute; top: 1px; left: 3px; font-size: 11px; font-weight: 700; color: #eee; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.aslot .cnt { position: absolute; bottom: 1px; right: 3px; font-size: 13px; font-weight: 700; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.aslot.nores .ic { filter: saturate(.3) brightness(.6); }
.aslot.nores { border-color: #2a3a8a; }
.aslot.oor .ic { color: #ff5050; }
.aslot.flash { animation: aflash .25s; }
@keyframes aflash { 0% { box-shadow: inset 0 0 0 30px rgba(255, 230, 150, .7); } 100% { box-shadow: inset 0 0 8px rgba(0, 0, 0, .8); } }
#xpbar { position: relative; width: 520px; max-width: 92vw; height: 12px; background: #0a0612; border: 1px solid #3a2a5a; border-radius: 3px; overflow: hidden; }
#xpbar .fill { height: 100%; background: linear-gradient(180deg, #b070ff, #6a2ac0); transition: width .3s; }
#xpbar span { position: absolute; inset: 0; font-size: 10px; line-height: 11px; text-align: center; font-weight: 700; text-shadow: 0 0 2px #000; }
#castbar { position: fixed; bottom: 140px; left: 50%; transform: translateX(-50%); width: 260px; height: 20px; z-index: 5; background: #0a0806; border: 2px solid var(--gold2); border-radius: 3px; overflow: hidden; }
#castbar .fill { height: 100%; background: linear-gradient(180deg, #ffd060, #c08010); }
#castbar span { position: absolute; inset: 0; text-align: center; font-size: 13px; font-weight: 700; line-height: 17px; text-shadow: 0 0 3px #000; }
#menubar { position: fixed; bottom: 10px; right: 12px; z-index: 5; display: flex; gap: 4px; }
#menubar button { width: 36px; height: 36px; font-size: 18px; color: var(--gold); background: var(--panel2); border: 2px solid var(--border); border-radius: 5px; cursor: pointer; }
#menubar button:hover { border-color: var(--gold); color: #fff; }
#gold { position: fixed; bottom: 52px; right: 14px; z-index: 5; font-family: Cinzel, serif; font-weight: 700; color: #ffd24a; text-shadow: 0 1px 3px #000; font-size: 15px; }
#log { position: fixed; bottom: 12px; left: 12px; width: 380px; max-width: 34vw; max-height: 170px; overflow: hidden; z-index: 4; font-size: 14px; line-height: 1.3; display: flex; flex-direction: column; justify-content: flex-end; pointer-events: none;
  mask-image: linear-gradient(transparent, #000 30%); -webkit-mask-image: linear-gradient(transparent, #000 30%); }
#log div { text-shadow: 0 1px 2px #000, 0 0 3px #000; color: #e8e0d0; }
#log .loot { color: #c8e8ff; } #log .quest { color: #ffe060; } #log .err { color: #ff6050; } #log .lvl { color: #ffd870; font-weight: 700; } #log .sys { color: #b0a8ff; } #log .yell { color: #ffb090; }

/* ============ Fenêtres ============ */
.win { position: fixed; z-index: 20; display: none; min-width: 300px; max-width: 94vw; max-height: 82vh; background: linear-gradient(180deg, rgba(32, 25, 18, .97), rgba(14, 11, 9, .97)); border: 2px solid var(--gold2); border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .8), inset 0 0 0 1px #000; flex-direction: column; }
.win.open { display: flex; }
.win.wide { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
.wtitle { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px 7px 14px; background: linear-gradient(180deg, #5a1a0c, #3a0e06); border-bottom: 2px solid var(--gold3); font-family: Cinzel, serif; font-weight: 700; color: var(--gold); cursor: move; border-radius: 4px 4px 0 0; }
.wtitle .x { background: #2a0a04; border: 1px solid var(--gold3); color: var(--gold); width: 24px; height: 24px; border-radius: 3px; cursor: pointer; }
.wtitle .x:hover { color: #fff; border-color: var(--gold); }
.wbody { padding: 12px 14px; overflow: auto; }
.win.parch { width: 440px; }
.win.parch .wbody { background: linear-gradient(180deg, #e8d8b0, #d4c090); color: #2a1a08; font-size: 17px; line-height: 1.45; border-radius: 0 0 4px 4px; box-shadow: inset 0 0 40px rgba(120, 80, 20, .4); }
.parch h3 { font-family: Cinzel, serif; margin: 0 0 8px; color: #4a1a04; font-size: 19px; }
.parch .qtext { white-space: pre-line; }
.parch .objs { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(80, 50, 10, .35); }
.parch .objs b { font-family: Cinzel, serif; color: #4a1a04; }
.parch .rew { margin-top: 10px; padding: 8px; background: rgba(80, 50, 10, .12); border-radius: 4px; font-size: 15px; }
.parch .opt { display: block; width: 100%; text-align: left; padding: 6px 4px; margin: 2px 0; background: none; border: 0; color: #2a1a08; cursor: pointer; font-size: 17px; border-radius: 3px; }
.parch .opt:hover { background: rgba(120, 70, 10, .18); }
.parch .opt i { font-style: normal; color: #c08a00; font-weight: 900; font-family: Cinzel, serif; margin-right: 6px; }
.parch .acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

.bagGrid { display: grid; grid-template-columns: repeat(6, 46px); gap: 5px; }
.islot { position: relative; width: 46px; height: 46px; border: 2px solid #3a3020; border-radius: 4px; background: radial-gradient(circle at 40% 35%, #2a2218, #0e0a08); display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer; }
.islot:hover { filter: brightness(1.4); }
.islot.empty { cursor: default; opacity: .55; }
.islot small { position: absolute; bottom: 0; right: 3px; font-size: 11px; color: #fff; text-shadow: 0 0 2px #000; }
.bagfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 14px; color: var(--muted); gap: 8px; }
.charWrap { display: flex; gap: 14px; }
.doll { display: grid; grid-template-columns: 46px 110px 46px; grid-template-rows: repeat(4, 46px); gap: 6px; }
.doll canvas { grid-column: 2; grid-row: 1 / span 4; width: 110px; height: 220px; background: radial-gradient(ellipse at 50% 70%, #3a2a1a, #0e0a08); border: 1px solid #3a3020; border-radius: 6px; }
.stats { min-width: 170px; font-size: 15px; }
.stats div { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(255, 255, 255, .06); padding: 3px 0; }
.stats div span:last-child { color: #fff; font-weight: 700; }
.stats h4 { font-family: Cinzel, serif; color: var(--gold); margin: 0 0 6px; }

.qlist .q { padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.qlist .q b { font-family: Cinzel, serif; color: #ffd24a; }
.qlist .q .o { color: #e0d8c8; font-size: 15px; margin-left: 10px; }
.qlist .q .o.done { color: #8aff8a; }
.qlist .q p { font-size: 14px; color: var(--muted); margin: 4px 0; white-space: pre-line; max-height: 0; overflow: hidden; transition: max-height .3s; }
.qlist .q.open p { max-height: 400px; }
.qlist .q .hd { cursor: pointer; }

.tier { display: flex; gap: 10px; align-items: stretch; margin-bottom: 12px; }
.tier .tl { width: 52px; font-family: Cinzel, serif; color: var(--gold2); font-size: 13px; display: flex; align-items: center; }
.tal { flex: 1; padding: 8px 10px; border: 2px solid #3a3020; border-radius: 5px; background: #120e0a; cursor: pointer; font-size: 14px; max-width: 220px; }
.tal b { font-family: Cinzel, serif; display: block; color: #fff; font-size: 14px; }
.tal.locked { opacity: .4; cursor: default; }
.tal.chosen { border-color: var(--gold); background: #2a1e0a; box-shadow: 0 0 12px rgba(232, 196, 106, .3); }
.tal.other { opacity: .35; cursor: default; }
.tal.can:hover { border-color: var(--gold2); }

.vlist .vi { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 4px; cursor: pointer; }
.vlist .vi:hover { background: rgba(255, 255, 255, .06); }
.vlist .vi .pr { margin-left: auto; color: #ffd24a; font-weight: 700; white-space: nowrap; }
.menuList { display: flex; flex-direction: column; gap: 8px; min-width: 260px; }
.keys { font-size: 14px; color: var(--muted); line-height: 1.6; }
.keys kbd { color: var(--gold); font-family: Cinzel, serif; }

#tooltip { position: fixed; z-index: 40; pointer-events: none; display: none; max-width: 300px; padding: 9px 12px; background: rgba(8, 10, 22, .96); border: 1px solid #8a8aa0; border-radius: 4px; font-size: 14px; line-height: 1.35; box-shadow: 0 4px 14px rgba(0, 0, 0, .8); }
#tooltip .tn { font-size: 16px; font-weight: 700; }
#tooltip .ts { color: #fff; }
#tooltip .tg { color: #3ddc4a; }
#tooltip .tm { color: #b8b0a0; }
#tooltip .ty { color: #ffd24a; }
#tooltip .tr { color: #ff4a3a; }
#tooltip .tl { color: #ffd24a; font-style: italic; }
#tooltip hr { border: 0; border-top: 1px solid #3a3a4a; margin: 6px 0; }

.overlay { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse, rgba(20, 20, 30, .6), rgba(0, 0, 0, .9)); }
#death { background: radial-gradient(ellipse, rgba(40, 40, 60, .5), rgba(0, 0, 0, .9)); backdrop-filter: grayscale(1); }
.ov-inner { text-align: center; max-width: 620px; padding: 20px; }
.ov-inner h2 { font-family: Cinzel, serif; font-size: 44px; margin: 0 0 10px; color: #ffd870; text-shadow: 0 0 20px rgba(255, 140, 30, .5); }
#death h2 { color: #c8c8d8; text-shadow: 0 0 20px rgba(150, 150, 255, .4); }
.ov-inner p { font-size: 19px; font-style: italic; color: #e0d8c8; line-height: 1.5; }

/* ============ Icônes (game-icons.net, masques) ============ */
.gi { display: inline-block; width: 72%; height: 72%; background: currentColor; vertical-align: middle;
  -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }
.aslot .ic .gi { width: 78%; height: 78%; background: #fff8e8; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .8)); }
.islot .gi { width: 76%; height: 76%; }
#menubar button .gi { width: 80%; height: 80%; background: var(--gold); }
#menubar button:hover .gi { background: #fff; }
.loadmsg { margin-top: 14px; color: var(--muted); font-style: italic; min-height: 1.4em; }
.credits { max-width: 720px; font-size: 15px; line-height: 1.45; }
.credits h4 { font-family: Cinzel, serif; color: var(--gold); margin: 14px 0 4px; }
.credits .lic { color: var(--muted); margin: 0 0 6px; font-size: 14px; }
.credits ul.cols { columns: 2; margin: 0; padding-left: 18px; }
.credits ul.src { font-size: 12px; color: #9a8e78; word-break: break-all; padding-left: 18px; }
#win-credits .wbody { max-height: 70vh; }
.portrait canvas, .ccard canvas, .doll canvas { image-rendering: pixelated; }
canvas#game { image-rendering: auto; }

/* ============ Monture ============ */
.aslot.active { border-color: #ffd040; box-shadow: 0 0 12px #ffd040, inset 0 0 8px rgba(0, 0, 0, .8); }

/* ============ Manette ============ */
.gpfocus { outline: 3px solid #ffd040 !important; outline-offset: 2px; box-shadow: 0 0 18px rgba(255, 208, 64, .7) !important; }
.ccard.gpfocus { transform: translateY(-3px); }
.pad-hint { margin-top: 12px; color: #ffd870; font-size: 16px; }
body.gamepad .aslot .key { font-family: Cinzel, serif; color: #ffd870; }

/* ============ Tactile ============ */
.touchonly { display: none; }
body.touch .touchonly { display: block; }
#joy { position: fixed; left: 40px; bottom: 60px; width: 150px; height: 150px; border-radius: 50%; z-index: 6; touch-action: none;
  background: radial-gradient(circle, rgba(255, 220, 150, .08), rgba(0, 0, 0, .35)); border: 3px solid rgba(232, 196, 106, .5); }
#joyKnob { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none;
  background: radial-gradient(circle at 40% 35%, #f0d080, #8a6020); border: 2px solid #ffe8a8; box-shadow: 0 3px 10px rgba(0, 0, 0, .6); }
#touchBtns { position: fixed; right: 24px; bottom: 120px; z-index: 6; }
#touchBtns button { display: block; width: 70px; height: 70px; margin-top: 12px; border-radius: 50%; font-size: 30px; color: #ffe8a8; touch-action: none;
  background: radial-gradient(circle at 40% 35%, #8a2a14, #3a0e06); border: 3px solid var(--gold2); box-shadow: 0 3px 10px rgba(0, 0, 0, .6); }
#touchBtns button:active { filter: brightness(1.5); }
body.touch canvas#game, body.touch .aslot { touch-action: none; }
body.touch .aslot { width: 66px; height: 66px; }
body.touch .aslot .ic { font-size: 32px; }
body.touch #log { display: none; }
body.touch #menubar button { width: 48px; height: 48px; font-size: 22px; }
body.touch #gold { bottom: 66px; }
body.touch #interactHint { bottom: 170px; font-size: 18px; }

@media (max-width: 900px) {
  .tframe { left: 14px; top: 100px; }
  #tracker { display: none; }
  #log { display: none; }
  .aslot { width: 44px; height: 44px; }
  .aslot .ic { font-size: 22px; }
  #minimapWrap { transform: scale(.75); transform-origin: top right; }
}

/* ---- Métiers ---- */
.prof h4 { margin: 14px 0 6px; color: var(--gold); font-family: Cinzel, Georgia, serif; font-size: 14px; letter-spacing: 1px; }
.prof .profs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prof .pf { display: flex; gap: 8px; align-items: center; background: rgba(0,0,0,.25); padding: 6px 8px; border-radius: 6px; }
.prof .pf small { color: var(--muted); }
.prof .pi .gi { width: 26px; height: 26px; }
.prof .pb { height: 6px; background: rgba(255,255,255,.08); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.prof .pb > div { height: 100%; }
.prof .mats { display: flex; flex-wrap: wrap; gap: 6px; }
.prof .mt { border: 1px solid; border-radius: 5px; padding: 3px 8px; background: rgba(0,0,0,.25); font-size: 14px; display: flex; gap: 6px; align-items: center; }
.prof .recs { display: flex; flex-direction: column; gap: 6px; max-height: 42vh; overflow-y: auto; padding-right: 4px; }
.prof .rc { background: rgba(0,0,0,.22); border: 1px solid rgba(200,160,90,.18); border-radius: 6px; padding: 6px 8px; }
.prof .rc.locked { opacity: .5; }
.prof .rh { display: flex; align-items: center; gap: 8px; }
.prof .rh b { flex: 1; }
.prof .rh small { color: var(--muted); }
.prof .rh .gi { width: 20px; height: 20px; }
.prof .rd { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.prof button[disabled] { opacity: .4; cursor: default; }

#talentsBody { max-height: 72vh; overflow-y: auto; }


/* ---- Techniques avancées ---- */
#actionbar { flex-wrap: wrap; justify-content: center; max-width: 96vw; }
.asep { width: 2px; align-self: stretch; margin: 4px 3px; background: linear-gradient(180deg, transparent, #7a6440, transparent); }
.aslot .lk { position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; font-size: 10px; font-weight: 700; color: #ffd870; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.aslot.locked .ic { filter: grayscale(1) brightness(.35); }
.aslot.locked { border-color: #3a3020; cursor: default; }
#bottom { width: max-content; max-width: 96vw; }
@media (max-width: 1500px) { body:not(.touch) .aslot { width: 46px; height: 46px; } body:not(.touch) .aslot .ic { font-size: 24px; } #actionbar { gap: 5px; } }
