:root {
  --bg: #0d1117;
  --panel: rgba(17, 21, 29, 0.9);
  --panel-2: #1a202b;
  --line: rgba(255, 255, 255, 0.09);
  --text: #ebe6da;
  --muted: #9b968b;
  --gold: #e3b55b;
  --gold-2: #f4d58d;
  --blue: #59b0ff;
  --red: #ff6250;
  --green: #6fd47a;
  --radius: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
input, select, textarea { -webkit-user-select: text; user-select: text; }
#scene { position: fixed; inset: 0; display: block; touch-action: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.warn { color: #ffb36b; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.grow { flex: 1; }

button {
  font: inherit; color: inherit; background: #242b38; border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 12px; cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
}
button:hover:not(:disabled) { background: #2d3546; border-color: rgba(255, 255, 255, .16); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: linear-gradient(#ebc672, #c99540); color: #241a08; border-color: #f4d58d; font-weight: 700; }
button.primary:hover:not(:disabled) { background: linear-gradient(#f3d17f, #d6a24a); }
button.big { width: 100%; padding: 12px; font-size: 16px; margin-top: 14px; }
button.icon { padding: 3px 8px; min-width: 28px; }
input:not([type]), input[type=text], input[type=password], input[type=number], select {
  font: inherit; color: var(--text); background: #0f131a; border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px;
}
input:focus, select:focus { outline: 2px solid rgba(227, 181, 91, .5); outline-offset: 0; }
.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* ───────── HUD de combat */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; display: flex; gap: 10px; align-items: center;
  padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); pointer-events: none;
}
#topbar > * { pointer-events: auto; }
.pill { font-family: Cinzel, Georgia, serif; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-weight: 700; color: var(--gold-2); white-space: nowrap; }
#timeline { display: flex; gap: 6px; overflow-x: auto; flex: 1; scrollbar-width: none; padding: 2px; }
#timeline::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; min-width: 86px; max-width: 120px; background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--team); border-radius: 8px; padding: 4px 8px; display: grid; grid-template-columns: 1fr auto; gap: 2px 6px;
}
.chip.current { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 14px rgba(227, 181, 91, .35); border-left: 3px solid var(--team); }
.chip.dead { opacity: .3; }
.chip-name { grid-column: 1 / -1; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-hp { height: 4px; background: rgba(0, 0, 0, .6); border-radius: 2px; align-self: center; overflow: hidden; }
.chip-hp i { display: block; height: 100%; background: var(--team); }
.chip-num { font-size: 11px; color: var(--muted); }
.chip { position: relative; }
.chip-ctl { position: absolute; top: 2px; right: 2px; width: 21px; height: 21px; padding: 0; border-radius: 50%; font-size: 12px; line-height: 19px;
  background: var(--panel); border: 1px solid var(--line); cursor: pointer; opacity: .75; }
.chip:has(.chip-ctl) .chip-name { padding-right: 16px; }
.chip-ctl:hover { opacity: 1; border-color: var(--gold); }
.chip-ctl.me { opacity: 1; border-color: var(--gold); box-shadow: 0 0 6px rgba(227, 181, 91, .5); }
.top-actions { display: flex; gap: 6px; }

#log {
  position: fixed; right: 12px; top: 64px; width: 300px; max-height: calc(100% - 220px); overflow-y: auto;
  padding: 8px 10px; font-size: 12px; line-height: 1.5;
}
#log .sep { margin-top: 6px; color: var(--gold-2); border-top: 1px solid var(--line); padding-top: 4px; }
#log .death { color: #ff8a7a; }
#log .dmg { color: #ff7a6a; } #log .heal { color: var(--green); } #log .crit { color: var(--gold-2); }

#bottombar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: max(12px, env(safe-area-inset-bottom));
  display: flex; gap: 14px; align-items: center; padding: 10px 12px; width: min(860px, calc(100% - 24px));
}
#hero-info { width: 190px; flex: 0 0 auto; }
.hero-top { display: flex; justify-content: space-between; gap: 6px; font-weight: 700; }
.hero-top .muted { font-weight: 400; font-size: 12px; white-space: nowrap; }
.hpbar { position: relative; height: 16px; background: rgba(0, 0, 0, .55); border-radius: 5px; overflow: hidden; margin: 5px 0; }
.hpbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#6fe07a, #3fa64e); transition: width .25s; }
.hpbar span { position: relative; display: block; text-align: center; font-size: 11px; font-weight: 700; line-height: 16px; text-shadow: 0 1px 2px #000; }
.res { display: flex; gap: 12px; font-size: 13px; }
.res .ap b { color: #6fb6ff; } .res .mp b { color: #8be08f; }
#hero-buffs { min-height: 14px; margin-top: 2px; }
#spellbar { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; justify-content: center; }
.spell {
  position: relative; width: 54px; height: 54px; padding: 0; border-radius: 10px;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--el) 45%, #1d2330), #161b24);
  border: 1px solid color-mix(in srgb, var(--el) 50%, transparent);
}
.spell .glyph { font-size: 24px; line-height: 54px; color: #fff; text-shadow: 0 0 8px var(--el); }
.spell .key { position: absolute; top: 2px; left: 5px; font-size: 10px; color: var(--muted); }
.spell .cost { position: absolute; bottom: 2px; right: 3px; font-size: 11px; font-weight: 800; background: #2e5ea8; border-radius: 6px; padding: 0 4px; line-height: 15px; }
.spell .cd { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .6); border-radius: 10px; font-weight: 800; font-size: 18px; color: var(--gold-2); }
.spell.selected { outline: 2px solid var(--gold); outline-offset: 2px; box-shadow: 0 0 16px rgba(227, 181, 91, .5); }
.turn-actions { display: flex; flex-direction: column; gap: 6px; align-items: center; }
#btn-end { padding: 10px 16px; white-space: nowrap; }

#banner {
  position: fixed; left: 50%; top: 32%; transform: translate(-50%, -50%); pointer-events: none;
  font-family: Cinzel, Georgia, serif; font-size: 30px; font-weight: 700; color: var(--gold-2); text-shadow: 0 2px 12px rgba(0, 0, 0, .9); opacity: 0; white-space: nowrap;
}
#banner.show { animation: banner 1.3s ease-out; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -40%); } 20% { opacity: 1; transform: translate(-50%, -50%); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -58%); } }

#tooltip {
  position: fixed; z-index: 30; max-width: 280px; pointer-events: none; padding: 8px 10px; font-size: 12px; line-height: 1.45;
  background: rgba(10, 13, 19, .96); border: 1px solid rgba(255, 255, 255, .14); border-radius: 9px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
#tooltip .preview { margin-top: 2px; font-weight: 700; }
#toast {
  position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 40; background: rgba(60, 20, 18, .95);
  border: 1px solid rgba(255, 98, 80, .5); padding: 8px 14px; border-radius: 9px; font-weight: 600;
}

/* ───────── écrans */
.screen { position: fixed; inset: 0; z-index: 10; overflow-y: auto; }
#prep { background: linear-gradient(180deg, rgba(10, 13, 19, .78), rgba(10, 13, 19, .93)); }
.prep-inner { max-width: 1160px; margin: 0 auto; padding: 28px 16px 40px; }
.prep-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.prep-head h1 { margin: 0; font-family: Cinzel, Georgia, "Times New Roman", serif; font-size: 34px; color: var(--gold-2); letter-spacing: .5px; }
.prep-head p { margin: 4px 0 0; }
.prep-head a { color: var(--muted); }
.prep-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card.off > *:not(header) { opacity: .4; pointer-events: none; }
.card header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card h3 { margin: 0; font-size: 17px; font-family: Cinzel, Georgia, serif; letter-spacing: .4px; color: var(--gold-2); }
.tag { font-size: 11px; color: var(--gold-2); border: 1px solid rgba(227, 181, 91, .4); border-radius: 999px; padding: 2px 8px; }
.field { display: grid; gap: 4px; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.field input, .field select { font-size: 14px; }
.classes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.class-tile { display: grid; gap: 2px; text-align: left; padding: 8px; border-left: 3px solid var(--c); }
.class-tile span { font-size: 11px; color: var(--muted); }
.class-tile.selected { background: color-mix(in srgb, var(--c) 22%, #1d2330); border-color: var(--c); }
.statline { display: flex; gap: 12px; margin: 12px 0 6px; font-size: 13px; color: var(--muted); }
.statline b { color: var(--text); }
.spell-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 3px; font-size: 13px; }
.spell-list .g { display: inline-block; width: 20px; text-align: center; }
.foes { list-style: none; padding: 0; margin: 0 0 4px; display: grid; gap: 4px; font-size: 13px; }
.foes li { display: flex; justify-content: space-between; gap: 8px; border-left: 3px solid var(--red); padding-left: 8px; }
.foes .muted { font-size: 12px; text-align: right; }
.sim-box { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.sim-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sim-result { margin-top: 8px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.kpis div { background: var(--panel-2); border-radius: 8px; padding: 6px; text-align: center; display: grid; }
.kpis b { font-size: 18px; } .kpis span { font-size: 11px; color: var(--muted); }
.kpis .win { color: var(--green); } .kpis .loss { color: var(--red); }
.sim-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sim-table th { color: var(--muted); font-weight: 500; text-align: right; padding: 3px 4px; }
.sim-table th:first-child { text-align: left; }
.sim-table td { text-align: right; padding: 3px 4px; border-top: 1px solid var(--line); }
.sim-table td:first-child { text-align: left; }
.sim-table tr.ta td:first-child { color: #9ccfff; } .sim-table tr.tb td:first-child { color: #ffaba0; }

#endscreen { display: grid; place-items: center; background: rgba(8, 10, 14, .55); }
.end-box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: min(460px, calc(100% - 32px)); text-align: center; }
.end-box h2 { margin: 0; font-size: 32px; font-family: Cinzel, Georgia, serif; }
.end-box.win h2 { color: var(--gold-2); } .end-box.loss h2 { color: #ff8a7a; }
.end-box .sim-table { margin-top: 12px; }

/* ───────── modale */
#modal { position: fixed; inset: 0; z-index: 50; background: rgba(5, 7, 10, .7); display: grid; place-items: center; padding: 16px; }
.modal-box { background: #141922; border: 1px solid var(--line); border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.modal-box.wide { width: min(1020px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 14px 16px; overflow-y: auto; }
.modal-body p { margin-top: 0; }
.stats-table { width: 100%; border-collapse: collapse; }
.stats-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 4px; }
.stats-table td { padding: 3px 4px; border-top: 1px solid var(--line); }
.stats-table input { width: 80px; }
.g-list { display: grid; gap: 6px; }
.g-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; }
.g-row.off { opacity: .45; }
.g-num { width: 20px; text-align: center; font-weight: 800; color: var(--gold-2); }
.g-word { color: var(--muted); font-size: 12px; }
.g-unit { color: var(--muted); font-size: 12px; margin-left: -2px; }
.g-row .num { width: 58px; }
.g-tools { margin-left: auto; display: flex; gap: 4px; }

@media (max-width: 900px) {
  .prep-grid { grid-template-columns: 1fr; }
  #log { width: 240px; }
}
@media (max-width: 700px) {
  #topbar { flex-wrap: wrap; }
  #timeline { order: 3; flex-basis: 100%; }
  .top-actions button { padding: 6px 8px; font-size: 12px; }
  #bottombar { flex-wrap: wrap; gap: 8px; }
  #hero-info { width: auto; flex: 1 1 100%; }
  .spell { width: 46px; height: 46px; } .spell .glyph { line-height: 46px; font-size: 20px; }
  #log { left: 12px; right: 12px; width: auto; top: 110px; max-height: 40%; }
  .prep-head h1 { font-size: 26px; }
}

/* ───────── progression & fiche personnage */
.head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.gold { color: var(--gold-2); font-weight: 700; }
.gold-txt { color: var(--gold-2); font-weight: 700; }
.ok-txt { color: var(--green); } .ko-txt { color: #ff8a7a; }
button.primary-soft { border-color: rgba(227, 181, 91, .55); color: var(--gold-2); }
.lvl-line { display: flex; gap: 10px; align-items: baseline; margin-top: 12px; }
.lvl-row { display: flex; gap: 6px; } .lvl-row input { width: 70px; }
.xpbar { position: relative; height: 14px; background: rgba(0, 0, 0, .5); border-radius: 5px; overflow: hidden; margin: 6px 0; }
.xpbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #8c6a2c, #e3b55b); }
.xpbar span { position: relative; display: block; text-align: center; font-size: 11px; line-height: 14px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.xpbar.thin { height: 4px; margin: 4px 0 0; }

.charsheet { display: grid; gap: 10px; }
.cs-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.segs { display: flex; gap: 6px; flex-wrap: wrap; }
.seg.on { border-color: var(--gold); background: rgba(227, 181, 91, .12); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 10px; color: var(--muted); }
.tab.on { color: var(--gold-2); border-bottom-color: var(--gold); }
.tab .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); vertical-align: middle; }
.cs-body h4 { margin: 4px 0 8px; font-family: Cinzel, Georgia, serif; color: var(--gold-2); font-size: 14px; }
.eq-grid { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 14px; }
.forge-grid, .shop-grid, .stats-grid, .test-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; }
.slots { display: grid; gap: 5px; }
.slot, .irow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 8px; text-align: left; padding: 6px 9px; width: 100%; }
.slot-label { width: 100%; font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.slot.sel, .irow.sel { border-color: var(--gold); background: rgba(227, 181, 91, .1); }
.irow.toohigh .iname, .shoprow.toohigh .iname { color: #ff9a8a; }
.iname { font-weight: 600; } .iname.set { color: #b9e08f; }
.worn { color: var(--blue); font-weight: 600; }
.inv { display: grid; gap: 4px; max-height: 52vh; overflow-y: auto; padding-right: 4px; margin-top: 6px; align-content: start; }
.sets { margin-top: 10px; display: grid; gap: 4px; font-size: 12px; }
.setline b { color: #b9e08f; }
.icard { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.icard-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.set-name { color: #b9e08f; font-size: 12px; margin-top: 2px; }
.weapon { font-size: 12px; margin-top: 6px; color: #f1c27d; }
.istats { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 2px; font-size: 13px; }
.istats li.neg b { color: #ff8a7a; } .istats li.exo b { color: #c6a4ff; }
.exo-tag { color: #c6a4ff; font-size: 11px; }
.charge { display: flex; gap: 8px; align-items: center; margin: 10px 0 2px; font-size: 12px; }
.gauge { flex: 1; height: 8px; background: rgba(0, 0, 0, .5); border-radius: 4px; overflow: hidden; }
.gauge i { display: block; height: 100%; background: linear-gradient(90deg, #4a8fd8, #8fd0ff); }
.gauge i.over { background: linear-gradient(90deg, #d8a04a, #ff7a5a); }
.runes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 5px; margin-top: 8px; }
.rune { display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; text-align: left; padding: 6px 8px; font-size: 12px; }
.rune .cnt { font-weight: 700; color: var(--gold-2); }
.rune > span:last-child { grid-column: 1 / -1; }
.rune.rare { border-color: rgba(198, 164, 255, .45); }
.flog { margin-top: 10px; font-size: 12px; display: grid; gap: 2px; max-height: 140px; overflow-y: auto; }
.shoprow { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 6px 8px; background: var(--panel-2); border-radius: 8px; }
.shoprow .btns, td.btns { display: flex; gap: 4px; white-space: nowrap; }
.pts { width: 100%; border-collapse: collapse; } .pts td { padding: 4px; border-top: 1px solid var(--line); }
.tot { width: 100%; border-collapse: collapse; font-size: 13px; } .tot td { padding: 3px 4px; border-top: 1px solid var(--line); }
.scrollbox { max-height: 55vh; overflow-y: auto; }
.field.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.field.inline input { width: 70px; }
.loot { margin: 12px 0 4px; display: grid; gap: 6px; }
.loot-kpis { display: flex; justify-content: center; gap: 18px; font-size: 16px; }
.loot-kpis b { color: var(--gold-2); }
.lvlup { color: var(--gold-2); font-weight: 700; }
.drops { font-size: 13px; }
@media (max-width: 900px) {
  .eq-grid, .forge-grid, .shop-grid, .stats-grid, .test-grid { grid-template-columns: 1fr; }
  .inv { max-height: 34vh; }
}

/* ───────── accueil & sauvegarde */
#login { display: grid; place-items: center; background: linear-gradient(180deg, rgba(10, 13, 19, .75), rgba(10, 13, 19, .95)); padding: 16px; }
.login-box { width: min(460px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.login-box h1 { margin: 0; font-family: Cinzel, Georgia, serif; color: var(--gold-2); font-size: 30px; }
.login-box h3 { font-family: Cinzel, Georgia, serif; color: var(--gold-2); font-size: 15px; margin: 16px 0 8px; }
.profiles { display: grid; gap: 6px; max-height: 40vh; overflow-y: auto; }
.profile { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; text-align: left; }
.profile b { grid-column: 1; } .profile span:nth-of-type(1) { grid-column: 1; } .profile span:nth-of-type(2) { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.profile.sel { border-color: var(--gold); background: rgba(227, 181, 91, .1); }
.lform { display: grid; gap: 4px; margin-top: 12px; }
.lform .check { margin: 4px 0; font-size: 13px; }
.lform button { margin-top: 6px; }
.newp { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.newp summary { cursor: pointer; color: var(--gold-2); font-weight: 600; }
.err { color: #ff8a7a; min-height: 1em; margin: 4px 0 0; font-size: 13px; }
.player { font-size: 13px; }
button.link { background: none; border: none; padding: 0 0 0 6px; color: var(--muted); text-decoration: underline; font-size: 12px; }
#save-status { position: fixed; left: 12px; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 60; font-size: 11px; padding: 3px 8px; border-radius: 999px; background: rgba(10, 13, 19, .85); border: 1px solid var(--line); pointer-events: none; }
#save-status.save-saved, #save-status.save-local { color: var(--green); }
#save-status.save-pending { color: var(--gold-2); }
#save-status.save-offline, #save-status.save-error { color: #ff8a7a; }
#hud:not(.hidden) ~ #save-status { bottom: auto; top: 58px; }
@media (max-width: 700px) { #hud:not(.hidden) ~ #save-status { top: 104px; } }

/* ───────── portraits */
.class-tile { grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; }
.class-tile .tile-sprite { grid-row: 1 / 3; width: 44px; height: 52px; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.class-tile b, .class-tile span { grid-column: 2; }
.foe-name { display: inline-flex; align-items: center; gap: 6px; }
.foe-sprite { width: 28px; height: 30px; object-fit: contain; object-position: center bottom; }
.chip { grid-template-columns: 30px 1fr auto; }
.chip-face { grid-row: 1 / 3; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.12), rgba(0,0,0,.3)); border: 1px solid var(--line); }
.chip-face img { width: 100%; height: 100%; object-fit: cover; }
.chip .chip-name { grid-column: 2 / -1; }
.chip .chip-hp { grid-column: 2; }
.chip .chip-num { grid-column: 3; }

/* ───────── territoires, voies, équipement visible */
.who-row { display: flex; gap: 10px; align-items: flex-end; }
.who-row .field { flex: 1; }
.who-portrait { width: 64px; height: 76px; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 3px 3px rgba(0,0,0,.5)); margin-bottom: 10px; }
.voies { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.voie { display: grid; text-align: left; padding: 6px 8px; font-size: 12px; }
.voie span { color: var(--muted); font-size: 11px; }
.voie.on { border-color: #c6a4ff; background: rgba(198,164,255,.14); }
.region-box { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--line); border-left: 4px solid var(--rc); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; background: color-mix(in srgb, var(--rc) 10%, transparent); }
.region-box > div { display: grid; }
.region-box b { font-family: Cinzel, Georgia, serif; color: var(--gold-2); }
.loot-hint { margin: 6px 0 2px; }
.loot-list { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; margin-top: 3px; }
.loot-item { font-weight: 600; }
.rarity { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; margin-top: 2px; }
.paperdoll { display: grid; place-items: center; background: radial-gradient(ellipse at 50% 80%, rgba(110,150,80,.35), transparent 70%); border-radius: 10px; margin-bottom: 6px; }
.paperdoll img { height: 150px; filter: drop-shadow(0 4px 4px rgba(0,0,0,.5)); }
.world { display: grid; grid-template-columns: 1fr 300px; gap: 14px; }
.world-map { align-self: start; border-radius: 12px; overflow: hidden; border: 1px solid #5a4a32; }
.worldmap { display: block; width: 100%; height: auto; }
.worldmap .region { cursor: pointer; }
.worldmap .zone { stroke: #5a4a32; stroke-width: 2; opacity: .9; transition: opacity .15s, filter .15s; }
.worldmap .region:hover .zone { opacity: 1; filter: brightness(1.08); }
.worldmap .region.sel .zone { stroke: #ffd25a; stroke-width: 4; filter: url(#selGlow); opacity: 1; }
.worldmap .rname { font-family: Cinzel, Georgia, serif; font-size: 15px; font-weight: 700; fill: #3a2a18; }
.worldmap .rlvl { font-size: 12px; fill: #5a4a32; font-weight: 600; }
.worldmap .rlvl.hard { fill: #a8321e; }
.worldmap .title { font-family: Cinzel, Georgia, serif; font-size: 26px; fill: #3a2a18; font-weight: 700; }
.worldmap .compass { font-family: Cinzel, Georgia, serif; font-size: 14px; fill: #3a2a18; font-weight: 700; }
.world-info h3 { margin: 0; font-family: Cinzel, Georgia, serif; color: var(--gold-2); }
.world-info h4 { margin: 12px 0 4px; font-family: Cinzel, Georgia, serif; color: var(--gold-2); font-size: 13px; }
.world-groups { margin: 0; padding-left: 18px; font-size: 13px; }
.world-mons { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.world-mons img { width: 40px; height: 44px; object-fit: contain; background: rgba(255,255,255,.05); border-radius: 8px; }
.classes { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .world { grid-template-columns: 1fr; } }
.gift { margin-top: 8px; font-size: 12px; color: var(--muted); }
.gift b { color: var(--gold-2); }

/* ───────── exploration */
#explore { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#explore > * { pointer-events: auto; }
#ex-loc { position: absolute; top: 10px; left: 12px; padding: 7px 14px; display: flex; gap: 10px; align-items: baseline; border-radius: 999px; }
#ex-name { font-family: Cinzel, Georgia, serif; color: var(--gold-2); font-size: 15px; }
#ex-coords { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
#ex-bar { position: absolute; left: 10px; right: 10px; bottom: 10px; display: grid; grid-template-columns: 300px 1fr auto; gap: 12px; padding: 10px; align-items: stretch; }
#ex-hero { display: flex; gap: 10px; align-items: center; min-width: 0; }
.ex-portrait { width: 62px; height: 62px; border-radius: 12px; background: radial-gradient(circle at 50% 70%, #3a4658, #151a22); border: 1px solid var(--line); object-fit: contain; flex: none; }
.ex-id { display: grid; gap: 5px; min-width: 0; flex: 1; }
#ex-chat { background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; height: 86px; overflow-y: auto; font-size: 12.5px; line-height: 1.45; }
#ex-chat .win { color: #9fe39a; } #ex-chat .loss { color: #ff9a8a; } #ex-chat .gold { color: var(--gold-2); }
#ex-menu { display: grid; grid-template-columns: repeat(4, 88px); gap: 6px; align-content: center; }
#ex-menu button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; font-size: 12px; position: relative; }
#ex-menu .ic { font-size: 17px; color: var(--gold-2); line-height: 1; }
#ex-menu .dot { position: absolute; top: 5px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.tip-mobs { display: grid; gap: 2px; margin: 6px 0 4px; }
.tip-mob { display: flex; gap: 6px; align-items: center; }
.tip-mob img { width: 26px; height: 26px; object-fit: contain; }
#tooltip .win { color: #9fe39a; } #tooltip .warn { color: #f2c94c; } #tooltip .loss { color: #ff8a7a; }
.ex-menu-list { display: grid; gap: 8px; }
.ex-menu-list > * { display: grid; gap: 2px; text-align: left; padding: 10px 12px; text-decoration: none; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font: inherit; }
.ex-menu-list > *:hover { border-color: var(--gold); }
.wm-grid { display: grid; gap: 3px; max-width: 640px; margin: 10px auto; }
.wm-cell { aspect-ratio: 1; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .35); background: var(--rc); padding: 0; position: relative; display: grid; place-items: center; cursor: default; filter: saturate(.9); }
.wm-cell.void { background: transparent; border-color: transparent; }
.wm-cell.fog { background: color-mix(in srgb, var(--rc) 25%, #151a22); filter: none; }
.wm-cell.here { outline: 2px solid var(--gold-2); outline-offset: 1px; }
.wm-cell.go { cursor: pointer; box-shadow: 0 0 0 2px rgba(120, 200, 255, .8); }
.wm-cell.go:hover { filter: brightness(1.15); }
.wm-vil { font-size: 18px; color: #2a1d10; text-shadow: 0 1px 0 rgba(255, 255, 255, .4); }
.wm-me { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 0 3px rgba(0, 0, 0, .4), 0 0 12px var(--gold); animation: wmpulse 1.2s ease-in-out infinite; }
@keyframes wmpulse { 50% { transform: scale(1.35); } }
.wm-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 12px; }
.wm-leg { display: inline-flex; gap: 6px; align-items: center; }
.wm-leg i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
@media (max-width: 900px) {
  #ex-bar { grid-template-columns: 1fr auto; }
  #ex-chat { grid-column: 1 / -1; grid-row: 2; height: 54px; }
  #ex-menu { grid-template-columns: repeat(4, 66px); }
}
.ex-hp { display: grid; gap: 3px; }
.ex-hp .hpbar { margin: 0; height: 14px; }
.ex-hp .hpbar span { line-height: 14px; }
.ex-hp .hpbar.thin { height: 11px; }
.ex-hp .hpbar.thin span { line-height: 11px; font-size: 9.5px; }
/* spécialisations */
.specs { margin-top: 12px; display: grid; gap: 6px; }
.spec-title { font-family: Cinzel, Georgia, serif; color: var(--gold-2); font-size: 13px; }
.spec-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.spec { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 5px; align-content: start; }
.spec.on { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(227, 181, 91, .35); }
.spec-head { display: grid; gap: 1px; }
.spec p { margin: 0; }
.spec .spell-list { margin: 0; }
.spec .spell-list li.locked { opacity: .45; }
.spec button { justify-self: start; font-size: 12px; padding: 4px 10px; }

/* ───────── miniatures d'objets et de ressources */
.icon { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 8px;
  background: radial-gradient(circle at 50% 40%, #3a3428, #1c1a16); border: 2px solid var(--rc, #6a6050); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5); }
.icon img { position: absolute; inset: 0; margin: auto; width: 88%; height: 88%; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); } /* hors flux : une image haute (cape, bottes) ne déforme plus la case */
.icon .ig { font-size: 21px; line-height: 1; color: color-mix(in srgb, var(--ic, #c8b890) 70%, #fff); text-shadow: 0 1px 2px #000; }
.icon.res { border-radius: 50%; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--ic) 45%, #2a2620), #16140f); }
.icon .qty { position: absolute; right: -4px; bottom: -4px; min-width: 18px; padding: 0 4px; border-radius: 9px; background: #1a1712; border: 1px solid #8a7a50;
  font: 700 10.5px/16px system-ui, sans-serif; color: #f4e6c0; font-style: normal; text-align: center; }

/* ───────── inventaire façon MMO : emplacements autour du personnage */
.dinv { display: grid; grid-template-columns: minmax(330px, 1.05fr) minmax(300px, 1fr) minmax(260px, .9fr); gap: 12px; }
.dinv > section { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-width: 0; }
.doll { display: grid; grid-template-columns: 70px 1fr 70px; gap: 8px; align-items: start; background: linear-gradient(180deg, #2a261f, #1a1814) !important; }
.doll-col { display: grid; gap: 8px; }
.dslot { position: relative; width: 66px; height: 66px; padding: 0; display: grid; place-items: center; border-radius: 10px;
  background: radial-gradient(circle at 50% 45%, #3a342a, #15130f); border: 1px solid #5a503c; }
.dslot .icon { width: 54px; height: 54px; border-width: 2px; }
.dslot.sel { outline: 2px solid var(--gold); outline-offset: 1px; }
.dslot-empty { font-size: 24px; color: rgba(230, 210, 160, .18); }
.dslot-label { position: absolute; bottom: -1px; left: 0; right: 0; font-size: 9px; color: rgba(230, 220, 190, .55); text-align: center; pointer-events: none; }
.dslot.full .dslot-label { display: none; }
.doll-mid { display: grid; gap: 6px; justify-items: center; }
.doll-pic { width: 100%; height: 290px; border-radius: 12px; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 80%, #4a5a3a, #1a1e16 75%); border: 1px solid #4a4436; }
.doll-pic img { height: 94%; width: auto; max-width: 96%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .6)); }
.doll-name { display: flex; gap: 6px; align-items: baseline; }
.doll-stats { display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: center; font-size: 12px; color: var(--muted); }
.doll-stats b { color: var(--text); }
.bag { display: grid; grid-template-rows: auto auto 1fr; gap: 8px; }
.bag-tabs { display: flex; gap: 6px; align-items: center; }
.bag-tabs button.on { border-color: var(--gold); color: var(--gold-2); }
.chips-f { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-f { padding: 2px 8px; font-size: 11px; border-radius: 999px; }
.chip-f.on { border-color: var(--gold); color: var(--gold-2); }
.bag-grid { display: grid; grid-template-columns: repeat(auto-fill, 52px); gap: 6px; align-content: start; max-height: 420px; overflow-y: auto; padding: 4px; }
.bagcell { position: relative; width: 52px; height: 52px; padding: 0; display: grid; place-items: center; border-radius: 9px; background: rgba(0, 0, 0, .25); border: 1px solid transparent; }
.bagcell.sel { border-color: var(--gold); background: rgba(227, 181, 91, .12); }
.bagcell.toohigh .icon { filter: grayscale(.7) brightness(.7); }
.bagcell .worn-dot { position: absolute; top: 3px; left: 3px; width: 8px; height: 8px; border-radius: 50%; background: #5ed46a; box-shadow: 0 0 0 2px #1a1712; }
.icard-head .icon { margin-right: 6px; vertical-align: middle; }
@media (max-width: 1100px) { .dinv { grid-template-columns: 1fr 1fr; } .dinv .doll { grid-column: 1 / -1; max-width: 520px; width: 100%; justify-self: center; } }
@media (max-width: 700px) { .dinv { grid-template-columns: 1fr; } }

/* ───────── artisanat */
.craft-list { display: grid; grid-auto-rows: max-content; gap: 6px; max-height: 60vh; overflow-y: auto; }
.craftrow { display: grid; grid-template-columns: 48px 1fr auto auto; gap: 10px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }
.craftrow.ready { border-color: rgba(94, 212, 106, .5); }
.craftrow.toohigh { opacity: .6; }
.craft-need { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.need { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: #ff8a7a; }
.need.ok { color: #9fe39a; }
.need .icon { width: 30px; height: 30px; }
.need .icon .ig { font-size: 15px; }
.res-line { display: flex; gap: 8px; align-items: center; }
.res-line .icon { width: 34px; height: 34px; }

/* ───────── fin de combat (parchemin) */
.end-box.retro { width: min(760px, calc(100% - 24px)); padding: 0; overflow: hidden; text-align: left; background: #e8dfc2; color: #3a2e1c; border: 2px solid #5a4a30; border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .6); }
.retro-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; background: linear-gradient(#5a4a32, #3e3222); color: #f4e6c0; font-family: Cinzel, Georgia, serif; }
.retro-head b { font-size: 16px; }
.end-box.retro.loss .retro-head { background: linear-gradient(#5a3228, #3e221c); }
.retro-body { padding: 10px 14px 4px; max-height: 70vh; overflow-y: auto; }
.retro-sec { margin: 8px 0 4px; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: #6a5230; border-bottom: 1px solid #b8a878; }
.retro-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.retro-table th { text-align: left; font-size: 11px; color: #7a6a48; font-weight: 700; padding: 3px 6px; }
.retro-table td { padding: 4px 6px; border-top: 1px solid #d4c8a4; vertical-align: middle; }
.retro-table tr.dead td { color: #8a7a5a; }
.retro-table .ncell { font-weight: 700; white-space: nowrap; }
.retro-table .xpcell { min-width: 140px; }
.retro-table .xpcell .xpbar { margin: 0 0 2px; background: #b8ac88; height: 8px; }
.retro-table .xpcell span { font-size: 11px; font-weight: 700; color: #4a6a2a; }
.retro-table .gold-txt { color: #8a5a10; font-weight: 800; }
.lootcell { display: flex; flex-wrap: wrap; gap: 4px; }
.icon.sm { width: 32px; height: 32px; border-width: 2px; }
.icon.sm .ig { font-size: 15px; }
.icon.sm .qty { font-size: 9.5px; line-height: 14px; min-width: 15px; right: -3px; bottom: -3px; }
.rune-chip { position: relative; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; background: #3a3428; color: #c8e0ff; border: 2px solid #7a8aa8; font-weight: 800; }
.rune-chip i { position: absolute; right: -3px; bottom: -3px; font: 700 9.5px/14px system-ui; min-width: 15px; padding: 0 3px; border-radius: 8px; background: #1a1712; color: #f4e6c0; font-style: normal; text-align: center; }
.end-box.retro .lvlup { color: #6a4a10; background: rgba(255, 210, 90, .3); border-radius: 6px; padding: 4px 8px; margin-top: 6px; }
.end-box.retro .muted { color: #8a7a5a; }
.retro-stats { margin: 8px 0; font-size: 12px; }
.retro-stats summary { cursor: pointer; color: #6a5230; font-weight: 700; }
.retro-stats .sim-table { color: #3a2e1c; }
.end-box.retro .row.center { padding: 8px 14px 12px; background: #ddd2b0; border-top: 1px solid #b8a878; margin: 0; }

/* ───────── inventaire : fenêtre unique (personnage + fiche à gauche, sac à droite) */
.inv2 { --ip: #2b2f27; --ip2: #1f221c; --il: #454c3a; --lime: #8fcf3c; --lime2: #6fae22;
  display: grid; grid-template-columns: minmax(360px, 1fr) minmax(330px, 1fr); gap: 12px; background: #23261f; border: 1px solid #3a4032; border-radius: 14px; padding: 12px; }
.inv2-left { display: grid; gap: 10px; align-content: start; }
.inv2-doll { display: grid; grid-template-columns: 64px 1fr 64px; gap: 10px; }
.ecol { display: grid; gap: 8px; align-content: start; }
.eslot { width: 64px; height: 64px; padding: 0; display: grid; place-items: center; border-radius: 10px; background: var(--ip2); border: 2px dashed #3e4535; }
.eslot.full { border: 2px solid #4a5240; background: radial-gradient(circle at 50% 45%, #343a2c, #1a1d17); }
.eslot.sel { border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime), 0 0 10px rgba(143, 207, 60, .35); }
.eslot .icon { width: 52px; height: 52px; }
.eslot-empty { font-size: 24px; color: rgba(200, 215, 170, .16); }
.epic { position: relative; border-radius: 12px; background: radial-gradient(ellipse at 50% 70%, #3c4a2c, #1b1f17 80%); border: 1px solid #3a4032; display: grid; place-items: center; min-height: 286px; }
.epic img { height: 250px; max-width: 95%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .55)); }
.epic-stats { position: absolute; left: 8px; right: 8px; bottom: 6px; display: flex; justify-content: center; gap: 12px; font-size: 12px; color: #b8c2a4; }
.epic-stats b { color: #eef4e0; }
.idet { background: var(--ip); border: 1px solid #3a4032; border-radius: 12px; overflow: hidden; }
.idet-head { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 12px; background: #353a2f; font-size: 16px; }
.idet-head span { color: #d8e0c8; font-size: 14px; }
.idet-body { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 10px; }
.idet-pic { display: grid; gap: 4px; justify-items: center; align-content: start; }
.icon.xl { width: 110px; height: 110px; border-width: 3px; border-radius: 14px; }
.icon.xl .ig { font-size: 52px; }
.idet-right { display: grid; grid-template-rows: auto 1fr; gap: 6px; min-width: 0; }
.idet-tabs { display: flex; gap: 4px; }
.idet-tabs button { padding: 4px 10px; font-size: 12.5px; border-radius: 8px 8px 0 0; background: var(--ip2); }
.idet-tabs button.on { background: var(--lime); color: #1a2410; border-color: var(--lime); font-weight: 700; }
.idet-tabs-body { background: var(--ip2); border-radius: 0 8px 8px 8px; padding: 6px 8px; max-height: 150px; overflow-y: auto; }
.idet-tabs-body .eff { padding: 4px 2px; border-bottom: 1px solid rgba(255, 255, 255, .05); color: #d6f0a8; font-weight: 600; font-size: 13px; }
.idet-tabs-body .eff.neg { color: #ff8a7a; }
.idet-tabs-body .eff.weapon { color: #e8dcb0; font-weight: 500; font-size: 12px; }
.idet-tabs-body .eff.muted { color: var(--muted); font-weight: 400; }
.idet-actions { display: flex; gap: 6px; padding: 0 10px 10px; }
.idet-actions button { min-width: 44px; }
button.lime { background: linear-gradient(#9edb4a, var(--lime2)); color: #16200c; border-color: #5a8a20; font-weight: 800; padding: 6px 22px; }
button.lime:disabled { filter: grayscale(.8); opacity: .6; }
.idet-empty { padding: 26px 14px; text-align: center; }
.inv2-right { display: grid; grid-template-rows: auto auto auto 1fr auto; gap: 8px; min-width: 0; }
.inv2-title { text-align: center; font: 700 19px Cinzel, Georgia, serif; color: #eef4e0; background: #353a2f; border-radius: 10px; padding: 8px; }
.inv2-cats { display: flex; gap: 6px; }
.inv2-cats .cat { flex: 1; height: 48px; font-size: 22px; border-radius: 10px; background: var(--ip); }
.inv2-cats .cat.on { background: linear-gradient(#9edb4a, var(--lime2)); color: #16200c; border-color: #5a8a20; }
.inv2-tools { display: flex; gap: 6px; }
.inv2-tools select, .inv2-tools input { flex: 1; min-width: 0; background: var(--ip2); color: var(--text); border: 1px solid #3a4032; border-radius: 8px; padding: 6px 8px; font: inherit; }
.inv2-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; align-content: start; max-height: 420px; overflow-y: auto; padding: 2px; }
.gcell { position: relative; aspect-ratio: 1; padding: 0; display: grid; place-items: center; border-radius: 9px; background: var(--ip); border: 1px solid #383e30; min-width: 0; }
.gcell.empty { display: block; background: rgba(43, 47, 39, .55); }
.gcell.sel { border-color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime); }
.gcell .icon { width: 84%; height: auto; aspect-ratio: 1; }
.gcell.toohigh .icon { filter: grayscale(.7) brightness(.7); }
.gcell .gqty { position: absolute; top: 2px; left: 5px; z-index: 1; font-size: 12.5px; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.gcell .worn-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 2px #1a1d17; }
.inv2-foot { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 0; }
@media (max-width: 860px) { .inv2 { grid-template-columns: 1fr; } }

/* ───────── carte du monde illustrée */
.wmap-wrap { border-radius: 12px; overflow: hidden; border: 2px solid #3a3226; }
.wmap-svg { display: block; width: 100%; height: auto; max-height: 72vh; }
.wm-rlabel { font: 700 15px Cinzel, Georgia, serif; fill: #3a2a14; text-anchor: middle; paint-order: stroke; stroke: rgba(244, 230, 192, .85); stroke-width: 3px; pointer-events: none; }
.wm-rlv { font: 600 10px system-ui, sans-serif; fill: #5a4428; text-anchor: middle; paint-order: stroke; stroke: rgba(244, 230, 192, .8); stroke-width: 2.5px; pointer-events: none; }
.wm-vlabel { font: 700 11px system-ui, sans-serif; fill: #fff; text-anchor: middle; paint-order: stroke; stroke: #2a1a0a; stroke-width: 3px; pointer-events: none; }
.wm-vil.go { cursor: pointer; }
.wm-vil.go:hover path { fill: #fff; }
.wm-pin { animation: wmpin 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; pointer-events: none; }
@keyframes wmpin { 50% { transform: translateY(-4px); } }
.wmap-info { margin-top: 8px; min-height: 40px; font-size: 13px; }

/* ───────── fenêtres façon MMO : Caractéristiques, Sorts, Métiers */
.cwin, .swin, .jwin { --ip: #2b2f27; --ip2: #1f221c; --lime: #8fcf3c; --lime2: #6fae22; background: #23261f; border: 1px solid #3a4032; border-radius: 14px; padding: 12px; }
.cwin { max-width: 560px; margin: 0 auto; display: grid; gap: 10px; }
.ch-head { display: flex; gap: 14px; align-items: center; }
.ch-portrait { width: 84px; height: 84px; object-fit: contain; border-radius: 12px; background: radial-gradient(circle at 50% 70%, #3c4a2c, #1b1f17); border: 2px solid #4a5240; }
.ch-name { font: 700 22px Cinzel, Georgia, serif; color: #f0b840; }
.csub, .slevels { display: flex; gap: 6px; }
.csub button { flex: 1; padding: 8px; font-size: 15px; border-radius: 8px 8px 0 0; background: var(--ip); }
.csub button.on, .slevels button.on, .ingn.on, .jtile.on { background: linear-gradient(#9edb4a, var(--lime2)); color: #16200c; border-color: #5a8a20; font-weight: 700; }
.cbody { background: var(--ip2); border-radius: 0 0 10px 10px; padding: 4px 0; }
.crow { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 10px; align-items: center; padding: 6px 12px; font-size: 15px; }
.crow:nth-child(even) { background: rgba(255, 255, 255, .025); }
.crow b { font-size: 16px; text-align: right; min-width: 56px; }
.crow.xp { grid-template-columns: 1fr 1.4fr; }
.crow.xp .xpbar { margin: 0; height: 20px; }
.crow.xp .xpbar span { position: relative; display: block; text-align: center; font: 700 11px/20px system-ui; }
.sic { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--c) 70%, #fff), var(--c)); color: #fff; font-size: 13px; text-shadow: 0 1px 1px rgba(0, 0, 0, .5); box-shadow: 0 0 0 2px rgba(0, 0, 0, .35); }
.csec, .sdsec { background: #353a2f; text-align: center; padding: 6px; font-size: 15px; margin: 4px 0; }
.sdsec { text-align: left; background: none; padding: 6px 0 2px; color: var(--muted); }
button.plus, button.minus { width: 30px; height: 30px; padding: 0; font-size: 20px; font-weight: 800; border-radius: 8px; background: none; border: none; color: #6ae04a; }
button.minus { color: #ff6a5a; }
button.plus:disabled, button.minus:disabled { color: #4a5040; }
.cfoot { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.cfoot span { margin-left: auto; font-size: 15px; }
.pill-n { min-width: 70px; text-align: center; background: #111; border-radius: 999px; padding: 6px 12px; font-size: 18px; }
.swin { display: grid; grid-template-columns: minmax(330px, 1.1fr) minmax(300px, 1fr); gap: 14px; }
.sleft { display: grid; grid-template-rows: auto 1fr auto; background: var(--ip2); border-radius: 12px; overflow: hidden; }
.shead, .srow { display: grid; grid-template-columns: 1fr 150px 52px; align-items: center; }
.shead { background: #353a2f; padding: 8px 12px; font-size: 14px; }
.shead span:not(:first-child) { text-align: center; }
.slist { max-height: 440px; overflow-y: auto; }
.srow { grid-template-columns: 54px 1fr 150px 52px; gap: 8px; padding: 6px 10px; cursor: pointer; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.srow.sel { background: linear-gradient(#a8e050, #7cbc2c); color: #16200c; }
.srow.sel .muted { color: #2a3a14; }
.srow.locked { opacity: .55; }
.sicon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 10px; font-size: 22px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--c) 55%, #fff), color-mix(in srgb, var(--c) 80%, #000)); border: 3px solid color-mix(in srgb, var(--c) 60%, #fff); }
.sicon.big { width: 72px; height: 72px; font-size: 34px; }
.sname { font-size: 15px; }
.slv { display: flex; align-items: center; justify-content: center; gap: 4px; }
.slv b { width: 22px; text-align: center; font-size: 16px; }
.srow.sel button.plus { color: #1a3a0a; }
.spts { justify-self: center; min-width: 34px; text-align: center; background: #111; color: #fff; border-radius: 999px; padding: 3px 8px; }
.sright { display: grid; gap: 10px; align-content: start; }
.slevels button { width: 46px; padding: 8px 0; background: var(--ip); }
.slevels button.got:not(.on) { color: var(--lime); }
.sdhead { display: flex; gap: 14px; align-items: center; background: var(--ip); border-radius: 12px; padding: 10px; }
.sdhead b { font: 700 20px Cinzel, Georgia, serif; }
.sdbody { display: grid; gap: 4px; font-size: 14px; }
.sdline { display: flex; gap: 22px; }
.sdeff { color: #e8f0d8; }
.jwin { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(330px, 1.4fr); gap: 14px; }
.jleft, .jright { display: grid; gap: 10px; align-content: start; }
.jtiles { display: flex; gap: 8px; }
.jtile { display: grid; gap: 2px; justify-items: center; padding: 6px; border-radius: 12px; background: var(--ip); }
.jic { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; font-size: 24px; color: #fff; background: radial-gradient(circle at 45% 40%, color-mix(in srgb, var(--c) 60%, #fff), var(--c)); border: 3px solid #e8e0f0; }
.jtile.on .jic { border-color: #ffb040; }
.jcard { background: var(--ip); border-radius: 12px; padding: 10px; display: grid; gap: 6px; }
.jname { display: flex; justify-content: space-between; font-size: 16px; }
.jbar { height: 16px; background: #111; border-radius: 999px; overflow: hidden; }
.jbar i { display: block; height: 100%; background: linear-gradient(90deg, #6fae22, #9edb4a); }
.jsub { font-size: 15px; }
.jskill { display: flex; justify-content: space-between; align-items: center; background: var(--ip2); border-radius: 8px; padding: 8px; }
.jtools { display: flex; gap: 8px; align-items: center; }
.jtools > span { min-width: 92px; }
.jtools input { flex: 1; background: var(--ip2); border: 1px solid #3a4032; color: var(--text); border-radius: 8px; padding: 6px 8px; font: inherit; }
.ingn { width: 34px; padding: 4px 0; }
.rlist { display: grid; grid-auto-rows: max-content; gap: 8px; max-height: 470px; overflow-y: auto; }
.rcard { background: var(--ip); border-radius: 12px; overflow: hidden; border: 1px solid transparent; }
.rcard.ready { border-color: rgba(143, 207, 60, .55); }
.rcard.toohigh { opacity: .6; }
.rtop { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 8px; background: #353a2f; }
.rtxt { display: grid; gap: 2px; }
.rside { display: grid; text-align: right; gap: 2px; }
.rbot { display: flex; gap: 8px; align-items: center; padding: 8px; flex-wrap: wrap; }
.ing { position: relative; display: inline-grid; place-items: center; }
.ing b { position: absolute; top: -4px; left: -2px; z-index: 1; font-size: 11px; color: #ff7a6a; text-shadow: 0 1px 2px #000; }
.ing.ok b { color: #9fe39a; }
.ing .icon { width: 42px; height: 42px; }
@media (max-width: 900px) { .swin, .jwin { grid-template-columns: 1fr; } }

.rgold { font-size: 13px; font-weight: 700; color: #ff8a7a; white-space: nowrap; } .rgold.ok { color: #f0c860; }

.artrow { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 8px; background: rgba(0, 0, 0, .25); border-radius: 12px; border: 1px solid #3a4032; }
.artrow .eslot { width: 100%; aspect-ratio: 1; height: auto; border-color: #6a4a3a; }
.artrow .eslot-empty { color: rgba(255, 140, 110, .22); }
.epic { min-height: 360px; }
.epic img { height: 310px; }

/* ───── Équipe (jusqu'à 4 compagnons) et consommables */
.team-win { min-width: min(620px, 92vw); }
.team-list { display: grid; gap: 6px; margin: 8px 0 12px; }
.team-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; background: #1b2130; border: 1px solid #2c3446; }
.team-row.off { opacity: .6; }
.team-row img { width: 48px; height: 52px; object-fit: contain; object-position: center bottom; }
.team-id { display: grid; gap: 2px; }
.team-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.icon .ig.cons { font-size: 24px; line-height: 1; }
.icon.sm .ig.cons { font-size: 16px; }
.icon.xl .ig.cons { font-size: 44px; }
@media (max-width: 560px) { .team-row { grid-template-columns: 40px 1fr; } .team-btns { grid-column: 1 / -1; justify-content: flex-start; } }
.cons-shop { max-height: 260px; overflow: auto; margin-top: 6px; }
.cons-shop .res-line { display: flex; align-items: center; gap: 8px; }
/* barre d'équipe : le héros en entier, les compagnons sur deux colonnes */
.ex-hp { grid-template-columns: 1fr 1fr; column-gap: 4px; }
.ex-hp .hpbar:first-child { grid-column: 1 / -1; }
.ex-hp .hpbar.thin { height: 13px; }
.ex-hp .hpbar.thin span { line-height: 13px; font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 3px; }
/* objet réservé à une autre race : grisé dans le sac */
.gcell.noclass .icon { filter: grayscale(1) brightness(.55); opacity: .55; }
.gcell.noclass:hover .icon { opacity: .8; }
.gcell.noclass { position: relative; }
.gcell.noclass::after { content: '⊘'; position: absolute; left: 3px; top: 1px; font-size: 13px; color: #ff7a6a; text-shadow: 0 1px 2px #000; pointer-events: none; }

/* ───── infobulle d'objet au survol */
#itip { position: fixed; z-index: 10000; display: none; pointer-events: none; width: max-content; max-width: 300px; padding: 9px 11px;
  background: linear-gradient(#262418, #18160f); border: 1px solid #8a7a50; border-radius: 8px; box-shadow: 0 6px 22px rgba(0,0,0,.6);
  font-size: 12.5px; line-height: 1.45; color: #ece3c8; }
#itip.on { display: block; }
#itip .itip-head { display: flex; justify-content: space-between; gap: 14px; font-size: 14px; }
#itip .itip-head span { color: #b8ac88; font-size: 12px; }
#itip .itip-sub { color: #b8ac88; font-size: 11.5px; margin-bottom: 5px; }
#itip .itip-weapon { margin: 4px 0; padding: 4px 6px; background: rgba(0,0,0,.3); border-radius: 5px; color: #f2d58a; font-size: 11.5px; }
#itip .itip-stats > div { padding: 1px 0; }
#itip .itip-stats b { color: #9fe07a; }
#itip .itip-stats .neg b { color: #ff8a7a; }
#itip .itip-set { margin-top: 5px; color: #7fd0a0; font-size: 11.5px; }
#itip .itip-note { margin-top: 5px; color: #b8ac88; font-size: 11px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 4px; }
.shoprow .shop-txt { flex: 1; min-width: 0; }

/* ───── familier (début de la ligne des artefacts) et objet meilleur que l'équipé */
.artrow { grid-template-columns: 1fr 4px repeat(6, 1fr); }
.artrow .petslot { display: contents; }
.artrow .petslot .eslot { border-color: #4a7a5a; }
.artrow .petslot .eslot-empty { color: rgba(140, 220, 160, .3); }
.artrow .artsep { width: 2px; background: rgba(255, 255, 255, .08); border-radius: 2px; }
.gcell { position: relative; }
.gcell.better::before { content: '▲'; position: absolute; right: 3px; top: 1px; z-index: 2; font-size: 11px; line-height: 1; color: #6fe07a;
  text-shadow: 0 0 3px #000, 0 1px 2px #000; pointer-events: none; }

/* ───── voyage automatique */
.wmap rect.wm-pick { fill: rgba(255, 224, 138, .28) !important; stroke: #ffe08a; stroke-width: 4; }
.ex-auto { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); padding: 7px 14px; border-radius: 20px; cursor: pointer;
  background: rgba(20, 22, 18, .88); border: 1px solid #c9a25a; color: #f2e6c4; font-size: 13px; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
@media (max-width: 560px) { .ex-auto { white-space: normal; width: calc(100% - 32px); text-align: center; } }

/* ───── panneau latéral d'exploration (sac rapide, consommables) */
#ex-side { display: none; position: absolute; top: 10px; right: 10px; bottom: 10px; width: 244px; padding: 10px; flex-direction: column; gap: 8px; }
#explore.has-side #ex-side { display: flex; }
#explore.has-side #ex-bar { right: 266px; }
#explore.has-side #ex-side-open { display: none; }
#ex-side-open { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; padding: 0; font-size: 18px; border-radius: 10px; }
.sd-top { display: flex; align-items: center; gap: 6px; }
.sd-heart { position: relative; width: 60px; height: 54px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 6px; }
.sd-heart span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 58px; line-height: 1; color: #d23a3a; text-shadow: 0 2px 4px rgba(0,0,0,.5); pointer-events: none; }
.sd-heart b, .sd-heart i { position: relative; font-style: normal; font-weight: 800; font-size: 12px; line-height: 13px; color: #fff; text-shadow: 0 1px 2px #000; }
.sd-heart i { border-top: 1px solid rgba(255,255,255,.75); }
.sd-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; flex: 1; }
.sd-quick button { padding: 6px 0; font-size: 16px; }
.sd-hide { padding: 4px 6px; font-size: 13px; align-self: flex-start; }
.sd-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.sd-tab { padding: 6px 0; font-size: 15px; }
.sd-tab.on { background: linear-gradient(#9edb4a, var(--lime2)); color: #16200c; border-color: #5a8a20; }
.sd-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; align-content: start; padding-right: 2px; }
.sd-cell { position: relative; aspect-ratio: 1; padding: 2px; display: grid; place-items: center; background: rgba(0,0,0,.35); border: 1px solid #2c3446; border-radius: 9px; }
.sd-cell.empty { pointer-events: none; }
.sd-cell .icon { width: 100%; height: 100%; }
.sd-cell.better::before { content: '▲'; position: absolute; right: 3px; top: 1px; z-index: 2; font-size: 10px; color: #6fe07a; text-shadow: 0 0 3px #000; pointer-events: none; }
.sd-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; }
#ex-menu { grid-template-columns: repeat(5, 80px); }
@media (max-width: 900px) {
  #ex-side { top: 56px; bottom: 150px; z-index: 6; }
  #explore.has-side #ex-bar { right: 10px; }
  #ex-menu { grid-template-columns: repeat(5, 60px); }
}

/* ───── Bestiaire et objets */
.bst { width: min(1000px, 94vw); display: grid; gap: 10px; }
.bst-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bst-tabs button { padding: 10px; font-size: 16px; }
.bst-tabs button.on { background: linear-gradient(#9edb4a, var(--lime2)); color: #16200c; border-color: #5a8a20; font-weight: 700; }
.bst-main { display: grid; grid-template-columns: 250px 1fr; gap: 10px; height: min(62vh, 620px); }
.bst-left { overflow-y: auto; display: grid; gap: 4px; align-content: start; padding-right: 4px; }
.bst-reg { display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px; text-align: left; }
.bst-reg.sub { padding: 6px 12px 6px 24px; font-size: 13px; }
.bst-reg.on { background: linear-gradient(#9edb4a, var(--lime2)); color: #16200c; border-color: #5a8a20; font-weight: 700; }
.bst-right { display: grid; grid-template-rows: auto 1fr auto; gap: 8px; min-height: 0; }
.bst-list { overflow-y: auto; display: grid; gap: 4px; align-content: start; padding-right: 4px; }
.bst-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 6px 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.bst-row img { width: 52px; height: 52px; object-fit: contain; background: rgba(0,0,0,.3); border-radius: 8px; }
.bst-row .icon { width: 44px; height: 44px; }
.bst-row.open { border-color: var(--gold); }
.bst-name { display: grid; gap: 2px; } .bst-name span { color: var(--muted); font-size: 12.5px; }
.bst-chev { color: var(--muted); }
.bst-detail { margin: -2px 0 6px; padding: 10px 12px; background: rgba(0,0,0,.25); border: 1px solid var(--line); border-top: none; border-radius: 0 0 10px 10px; display: grid; gap: 6px; }
.bst-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; }
.bst-stats > div { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; background: rgba(255,255,255,.04); border-radius: 6px; font-size: 13px; }
.bst-sub { font-weight: 700; color: var(--gold-2); margin-top: 4px; }
.bst-loots { display: flex; flex-wrap: wrap; gap: 8px; }
.bst-loot { display: grid; justify-items: center; gap: 2px; } .bst-loot i { font-style: normal; font-size: 11px; color: var(--muted); }
.bst-where { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 8px; background: rgba(255,255,255,.04); border-radius: 6px; font-size: 13px; }
.bst-go, .bst-link { padding: 4px 10px; font-size: 12px; white-space: nowrap; }
.bst-go { background: linear-gradient(#9edb4a, var(--lime2)); color: #16200c; border-color: #5a8a20; font-weight: 700; }
@media (max-width: 700px) { .bst-main { grid-template-columns: 1fr; height: auto; } .bst-left { grid-auto-flow: column; overflow-x: auto; max-height: none; } .bst-list { max-height: 55vh; } }

/* panneau ouvert : boutons du bas en icônes seules (le titre au survol donne le nom) */
#explore.has-side #ex-bar { grid-template-columns: 250px 1fr auto; }
#explore.has-side #ex-menu { grid-template-columns: repeat(6, 46px); gap: 5px; }
#explore.has-side #ex-menu button { font-size: 0; padding: 8px 0; gap: 0; }
#explore.has-side #ex-menu .ic { font-size: 18px; }
#explore.has-side #ex-menu .dot { right: 5px; top: 4px; }

/* couleurs vertes des boutons actifs, disponibles partout (pas seulement dans l’inventaire) */
:root { --lime: #8fcf3c; --lime2: #6fae22; }
.bst input[type=search] { width: 100%; padding: 9px 12px; font-size: 14px; border-radius: 9px; }

/* ───── panneau latéral v2 : mini-carte + raccourcis du menu en bas à droite */
.sd-gold { flex: 1; display: grid; gap: 2px; justify-items: start; font-size: 14px; }
.sd-grid { min-height: 120px; }
.sd-map { flex: none; display: grid; gap: 4px; padding: 6px; background: rgba(0,0,0,.3); border: 1px solid #2c3446; border-radius: 10px; }
.mm-head { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-head b { color: var(--gold-2); font-family: Cinzel, Georgia, serif; }
.mm-svg { width: 100%; height: auto; display: block; border-radius: 6px; }
.mm-cell { cursor: pointer; }
.mm-cell:hover rect { stroke: #fff; stroke-width: 1.5; }
.mm-me { animation: mmPulse 1.6s ease-in-out infinite; }
@keyframes mmPulse { 50% { r: 6; } }
.sd-menu { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.sd-menu button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; font-size: 11px; position: relative; }
.sd-menu .ic { font-size: 17px; color: var(--gold-2); line-height: 1.1; }
.sd-menu .dot { position: absolute; top: 4px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
@media (min-width: 901px) {
  #explore.has-side #ex-menu { display: none; }
  #explore.has-side #ex-bar { grid-template-columns: 300px 1fr; }
}
@media (max-width: 900px) { .sd-menu { display: none; } }

/* ───── donjons */
.dj { width: min(860px, 94vw); display: grid; gap: 12px; }
.dj-head { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; }
.dj-head img { width: 110px; height: 110px; object-fit: contain; background: radial-gradient(circle at 50% 70%, #4a2a22, #15100e); border-radius: 12px; border: 1px solid #6a3a2a; }
.dj-head h3 { margin: 2px 0 6px; font-family: Cinzel, Georgia, serif; color: var(--gold-2); font-size: 22px; }
.dj-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dj-rooms { margin: 6px 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.dj-rooms li { display: flex; justify-content: space-between; padding: 6px 10px; background: rgba(255,255,255,.04); border-radius: 6px; font-size: 13px; }
.dj-rooms li.boss { background: rgba(200, 60, 40, .18); border: 1px solid rgba(255, 98, 80, .4); font-weight: 700; }
.dj-team { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px; background: rgba(0,0,0,.25); border-radius: 8px; font-size: 13px; }
.dj-team .warn { color: #f2c94c; }
#endscreen .dj-next { margin: auto; padding: 22px 34px; text-align: center; display: grid; gap: 6px; background: rgba(20, 16, 12, .92); border: 1px solid #c9a25a; border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.6); animation: djIn .35s ease-out; }
#endscreen .dj-next b { font-family: Cinzel, Georgia, serif; font-size: 24px; color: var(--gold-2); }
@keyframes djIn { from { transform: scale(.9); opacity: 0; } }
.dj-done { display: grid; gap: 6px; justify-items: center; padding: 10px; margin: 8px 0; background: rgba(201, 162, 90, .12); border: 1px solid rgba(201, 162, 90, .5); border-radius: 10px; }
.dj-done b { font-family: Cinzel, Georgia, serif; color: var(--gold-2); font-size: 18px; }
@media (max-width: 700px) { .dj-cols { grid-template-columns: 1fr; } }
/* 11 métiers : les tuiles passent à la ligne dans leur colonne */
.jtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; min-width: 0; }
.jtile { min-width: 0; padding: 5px 2px; }
.jtile .jic { width: 38px; height: 38px; font-size: 18px; }
.jleft { min-width: 0; }
.retro .dj-done b, .end-box .dj-done b { color: #7a4a10; }
.retro .dj-done { background: rgba(160, 110, 40, .14); border-color: rgba(140, 90, 30, .45); }
/* icônes de la carte du monde : donjons et ateliers */
.wm-ic { font-size: 13px; text-anchor: middle; dominant-baseline: middle; fill: #ffe9b8; pointer-events: none; }
.wm-ic.sm { font-size: 11px; }
.wm-dj, .wm-ws { cursor: help; }
.wmap-legend { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin: 4px 0; }
.wmap-legend b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; margin-right: 4px; font-size: 12px; }
.lg-dj { background: #8a1e18; color: #ffe9b8; border: 1px solid #ffd27a; }
.lg-ws { background: #2a2216; color: #ffe9b8; border: 1px solid #e8c870; border-radius: 50% !important; }
.lg-vil { background: #f4e6c0; color: #3a2a14; }
.mm-ic { font-size: 8px; text-anchor: middle; dominant-baseline: middle; fill: #ffe9b8; pointer-events: none; }
.mm-ic.sm { font-size: 6.5px; }
#btn-tactic.on { background: linear-gradient(#9edb4a, var(--lime2)); color: #16200c; border-color: #5a8a20; font-weight: 700; }
.newspell { font-size: 11.5px; color: #c6a4ff; font-weight: 700; }
/* infobulle d'un groupe de monstres (exploration) */
.gtip { min-width: 230px; }
.gt-head { font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.gt-row { display: flex; justify-content: space-between; gap: 18px; font-size: 14.5px; line-height: 1.55; }
.gt-row b { color: #e8d040; font-weight: 600; }
.gt-boss { font-style: normal; font-size: 10px; text-transform: uppercase; color: #ff8a6a; border: 1px solid #ff8a6a80; border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.gt-foot { margin-top: 6px; padding-top: 5px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 12px; line-height: 1.45; }
/* fenêtre Caractéristiques : deux colonnes, tout visible sans défiler */
.cwin.wide { max-width: 940px; }
.cres { display: grid; grid-template-columns: 1fr 1.25fr; gap: 0 14px; }
.cres-col { min-width: 0; }
.cres .crow { padding: 4px 10px; font-size: 14px; gap: 8px; }
.cres .crow b { font-size: 15px; min-width: 44px; }
.cres .csec { margin: 2px 0 4px; padding: 4px; font-size: 14px; }
.cres .sic { width: 23px; height: 23px; font-size: 12px; }
.cres button.plus { width: 26px; height: 26px; }
.cres .crow.xp { grid-template-columns: 1fr; gap: 4px; padding-bottom: 8px; }
.cwin.wide .ch-portrait { width: 64px; height: 64px; }
@media (max-width: 760px) { .cres { grid-template-columns: 1fr; } }
/* cadre du groupe (exploration) : en haut à droite, collé au panneau latéral */
#ex-party { pointer-events: auto; position: absolute; top: 10px; right: 60px; display: flex; flex-direction: column; gap: 6px; z-index: 4; }
#explore.has-side #ex-party { right: 266px; }
.pt-card { position: relative; width: 58px; height: 58px; padding: 0; border-radius: 10px; overflow: visible; background: radial-gradient(circle at 50% 40%, #3c4a2c, #161a13); border: 2px solid #4a5240; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.pt-card:hover { border-color: #8fcf3c; }
.pt-card img { position: absolute; inset: 2px 12px 2px 2px; width: calc(100% - 14px); height: calc(100% - 4px); object-fit: cover; object-position: 50% 20%; border-radius: 7px; }
.pt-lv { position: absolute; left: -6px; bottom: -6px; min-width: 20px; padding: 0 4px; border-radius: 9px; background: #1a1d17; border: 1px solid #8a7a50; font: 700 10.5px/16px system-ui, sans-serif; color: #f4e6c0; }
.pt-hp { position: absolute; right: 3px; top: 4px; bottom: 4px; width: 7px; border-radius: 4px; background: #2a0f0f; overflow: hidden; display: flex; align-items: flex-end; }
.pt-hp i { display: block; width: 100%; border-radius: 4px; }
@media (max-width: 900px) { #ex-party { top: 56px; right: 10px; } .pt-card { width: 46px; height: 46px; } }
/* journal de quêtes */
.qj { display: grid; grid-template-columns: 300px 1fr; gap: 14px; min-height: 460px; }
.qj-left { display: flex; flex-direction: column; gap: 6px; background: #1f221c; border: 1px solid #3a4032; border-radius: 12px; padding: 10px; }
.qj-tab { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-size: 16px; border-radius: 8px; background: #2b2f27; }
.qj-tab.on { background: linear-gradient(#9edb4a, #6fae22); color: #16200c; border-color: #5a8a20; font-weight: 700; }
.qj-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; overflow-y: auto; }
.qj-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px 10px; background: rgba(255, 255, 255, .03); border-radius: 8px; }
.qj-item.on { border-color: #8fcf3c; background: rgba(143, 207, 60, .1); }
.qj-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.qj-search { display: flex; gap: 8px; align-items: center; }
.qj-search input { flex: 1; background: #2b2f27; color: var(--text); border: 1px solid #3a4032; border-radius: 8px; padding: 9px 12px; font: inherit; }
.qj-search span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; background: linear-gradient(#9edb4a, #6fae22); color: #16200c; font-size: 20px; font-weight: 800; }
.qj-detail { flex: 1; background: #1f221c; border: 1px solid #3a4032; border-radius: 12px; padding: 14px 16px; overflow-y: auto; }
.qj-empty { font-style: italic; color: #cfd8c0; }
.qj-bang { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #f0c040; color: #2a1a00; font-style: normal; font-weight: 900; font-size: 12px; }
.qj-head h3 { margin: 0 0 2px; font-family: Cinzel, Georgia, serif; color: #f0c040; }
.qj-desc { margin: 8px 0; }
.qj-steps { list-style: none; padding: 0; margin: 4px 0 10px; display: grid; gap: 6px; }
.qj-step { display: grid; grid-template-columns: 20px 1fr; gap: 6px; }
.qj-step.done { color: var(--muted); }
.qj-step .qj-mark { color: #8fcf3c; }
.qj-goals { list-style: none; padding: 0; margin: 4px 0 0; }
.qj-goals li { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 2px 0; }
.qj-goals li.ok { color: #8fcf3c; }
.qj-rws { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.qj-items { display: flex; gap: 4px; }
@media (max-width: 760px) { .qj { grid-template-columns: 1fr; } }

/* ── étoiles des groupes de monstres ── */
.gt-stars { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 2px 0 4px; font-size: 12px; }
.gt-stars > span:first-child { color: #ffd34a; letter-spacing: 1px; text-shadow: 0 0 4px rgba(255, 200, 60, 0.5); }
.gt-stars i { font-style: normal; color: rgba(255, 255, 255, 0.18); text-shadow: none; }
.gt-stars b { color: #ffd34a; }
.end-stars { margin: 4px 0 8px; padding: 5px 10px; border-radius: 6px; background: rgba(255, 200, 60, 0.12); color: #ffe7a0; font-size: 13px; }

/* ── carte du monde agrandie : zoom, sous-zones, pierres ── */
.wmap-wrap { position: relative; }
.wmap-svg { aspect-ratio: 40 / 28; max-height: 70vh; cursor: grab; touch-action: none; user-select: none; }
.wmap-svg.dragging { cursor: grabbing; }
.wmap-zoom { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px; }
.wmap-zoom button { width: 30px; height: 30px; padding: 0; border-radius: 7px; background: rgba(20, 16, 10, .78); color: #f4e6c0; border: 1px solid rgba(232, 200, 112, .5); font-size: 16px; cursor: pointer; }
.wmap-zoom button:hover { background: rgba(60, 46, 24, .9); }
.wm-zlabel { font: 600 10px system-ui, sans-serif; fill: #2a1d10; text-anchor: middle; paint-order: stroke; stroke: rgba(244, 230, 192, .8); stroke-width: 2.5px; pointer-events: none; }
.wm-zlv { font: 500 8px system-ui, sans-serif; fill: #4a3820; text-anchor: middle; paint-order: stroke; stroke: rgba(244, 230, 192, .7); stroke-width: 2px; pointer-events: none; }
.wmap-svg .wm-zl, .wmap-svg .wm-zb { opacity: 0; transition: opacity .2s; }
.wmap-svg.zoomed .wm-zl, .wmap-svg.zoomed .wm-zb { opacity: 1; }
.wmap-svg.zoomed .wm-rl { opacity: .35; }
.wm-st.go { cursor: pointer; }
.lg-st { background: #bfe8ff; color: #1a5a8a; }
.st-txt { color: #9fd8ff; }

/* ── dialogue avec un personnage de quête ── */
.dlg { display: grid; grid-template-columns: 210px 1fr; gap: 18px; min-height: 280px; }
.dlg-face { border-radius: 12px; background: radial-gradient(circle at 50% 35%, rgba(255, 230, 160, .18), rgba(0, 0, 0, .25)); border: 1px solid rgba(232, 200, 112, .35); display: grid; place-items: end center; overflow: hidden; }
.dlg-face img { width: 100%; max-height: 300px; object-fit: contain; object-position: bottom; }
.dlg-main { display: flex; flex-direction: column; gap: 10px; }
.dlg-name { font: 700 20px Cinzel, Georgia, serif; color: #f4d58d; }
.dlg-name span { display: block; font: 500 12px system-ui, sans-serif; color: var(--muted, #aaa); letter-spacing: .02em; }
.dlg-text { flex: 1; font-size: 14px; line-height: 1.5; }
.dlg-text p { margin: 0 0 8px; font-style: italic; }
.dlg-q { font-size: 15px; color: #f4d58d; }
.dlg-cur { margin: 6px 0; padding: 7px 10px; border-radius: 8px; background: rgba(255, 220, 120, .08); border-left: 3px solid #f6c838; }
.dlg-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dlg-offer { border-color: rgba(246, 200, 56, .6) !important; }
@media (max-width: 640px) { .dlg { grid-template-columns: 1fr; } .dlg-face { max-height: 180px; } }
.wmap-wrap { background: #2c4250; }
.wmap-svg { margin: 0 auto; }
.ssub { margin: 8px 6px 4px; font: 600 11px system-ui, sans-serif; color: #e8c870; letter-spacing: .04em; text-transform: uppercase; }
.srow.gift .sname { color: #ffd38a; }

/* ── mini-carte = miniature de la carte du monde ── */
.mm-wrap { position: relative; border-radius: 7px; overflow: hidden; background: #2c4250; border: 1px solid rgba(232, 200, 112, .25); }
.mm-world { display: block; width: 100%; height: 150px; aspect-ratio: auto; max-height: none; cursor: pointer; }
.mm-world .wm-pin { animation: none; }
.mm-world .wm-rlabel { font-size: 13px; }
.mm-zoom { position: absolute; right: 4px; top: 4px; display: flex; flex-direction: column; gap: 3px; }
.mm-zoom button { width: 20px; height: 20px; padding: 0; border-radius: 5px; background: rgba(20, 16, 10, .78); color: #f4e6c0; border: 1px solid rgba(232, 200, 112, .45); font-size: 13px; line-height: 1; cursor: pointer; }

/* ───── hôtel des ventes et banque */
.hv, .bk { display: grid; gap: 10px; }
.hv.busy, .bk.busy { opacity: .6; pointer-events: none; }
.hv-tabs, .hv-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.hv-tabs button.on, .hv-cats button.on { border-color: var(--gold); color: var(--gold-2); box-shadow: 0 0 0 1px var(--gold) inset; }
.hv-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hv-search { flex: 1; min-width: 180px; padding: 8px 12px; border-radius: 9px; }
.hv-purse { margin-left: auto; white-space: nowrap; }
.hv-h { margin: 6px 0 0; font-size: 14px; color: var(--gold-2); font-family: Cinzel, Georgia, serif; }
.hv-list { display: grid; gap: 5px; max-height: 52vh; overflow-y: auto; padding-right: 4px; }
.hv-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; background: rgba(255,255,255,.04); border-radius: 8px; }
.hv-row .icon { width: 40px; height: 40px; }
.hv-name { flex: 1; display: grid; min-width: 0; }
.hv-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-lots { display: grid; grid-template-columns: repeat(3, 92px); gap: 5px; }
.hv-buy, .hv-none { display: grid; justify-items: center; padding: 4px 6px; font-size: 11px; border-radius: 7px; }
.hv-buy b, .hv-none b { font-size: 13px; color: var(--gold-2); }
.hv-none { color: var(--muted); border: 1px dashed #2c3446; }
.hv-buy.single { min-width: 92px; }
.hv-sell { display: flex; gap: 5px; align-items: center; }
.hv-sell input { width: 96px; padding: 5px 7px; }
.hv-sell select { padding: 5px; }
.hv-price { white-space: nowrap; }
.bk-gold { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: rgba(0,0,0,.25); border: 1px solid #2c3446; border-radius: 10px; }
.bk-gold > div:not(.bk-move) { display: grid; } .bk-gold b { font-size: 20px; }
.bk-move { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; } .bk-move input { width: 110px; padding: 6px 8px; }
.bk-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 5px; max-height: 34vh; overflow-y: auto; align-content: start; }
.bk-grid .sd-cell { aspect-ratio: 1; padding: 2px; }
.bk-log { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 4px 8px; font-size: 13px; background: rgba(255,255,255,.03); border-radius: 6px; }
.bk-log span:nth-child(2) { flex: 1; }
@media (max-width: 700px) { .bk-cols { grid-template-columns: 1fr; } .hv-lots { grid-template-columns: repeat(3, 70px); } .hv-row { flex-wrap: wrap; } }

/* ───────── défi de combat (carte en haut à gauche) */
#challenge { position: fixed; left: 12px; top: 84px; z-index: 5; display: flex; gap: 9px; align-items: flex-start; width: 250px; padding: 8px 30px 8px 9px; font-size: 12px; line-height: 1.35; }
#challenge .ch-ico { position: relative; flex: 0 0 34px; height: 34px; display: grid; place-items: center; font-size: 19px; border-radius: 8px; background: radial-gradient(circle at 50% 35%, rgba(227,181,91,.35), rgba(0,0,0,.35)); border: 1px solid rgba(227,181,91,.5); }
#challenge .ch-body { display: flex; flex-direction: column; min-width: 0; }
#challenge .ch-body b { color: var(--gold-2); font-size: 13px; }
#challenge .ch-txt { color: var(--text); }
#challenge .ch-bonus { color: var(--muted); font-size: 11px; margin-top: 2px; }
#challenge .ch-min { position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; padding: 0; line-height: 16px; border-radius: 5px; font-weight: 800; }
#challenge .ch-mark { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 900; border-radius: 8px; }
#challenge .ch-mark.ok { color: #8bf08f; background: rgba(20, 70, 30, .75); }
#challenge .ch-mark.fail { color: #ff6a5a; background: rgba(80, 20, 18, .75); }
#challenge.ch-ok { border-color: rgba(111, 224, 122, .7); }
#challenge.ch-ok .ch-bonus { color: var(--green); }
#challenge.ch-fail { border-color: rgba(255, 98, 80, .6); }
#challenge.ch-fail .ch-txt { text-decoration: line-through; opacity: .7; }
#challenge.mini { width: auto; padding-right: 30px; }
#challenge.mini .ch-txt, #challenge.mini .ch-bonus { display: none; }
#challenge.pulse { animation: ch-pulse .9s ease-out; }
@keyframes ch-pulse { 0% { transform: scale(1); } 25% { transform: scale(1.08); box-shadow: 0 0 22px rgba(227,181,91,.6); } 100% { transform: scale(1); } }
@media (max-width: 700px) { #challenge { top: 130px; width: 210px; } }
.end-chal { margin: 0 0 8px; padding: 6px 10px; border-radius: 8px; background: rgba(0,0,0,.25); border: 1px solid var(--line); font-size: 13px; }
.end-chal.ok { border-color: rgba(111, 224, 122, .6); }
.end-chal .ec-ico { font-weight: 900; margin-right: 4px; }
.end-chal.ok .ec-ico { color: var(--green); } .end-chal.fail .ec-ico { color: #ff6a5a; }

/* ───────── chrono de tour : jauge au-dessus de « Fin du tour » */
#turn-gauge { width: 100%; height: 6px; border-radius: 3px; background: rgba(0,0,0,.55); overflow: hidden; border: 1px solid var(--line); }
#turn-gauge i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #6fe07a, #b8ec6a); transition: width .1s linear; }
#turn-gauge.low i { background: linear-gradient(90deg, #ff6250, #ffa050); }
#turn-gauge.hidden { visibility: hidden; display: block !important; }

/* frise : le combattant dont c'est le tour ressort ; sorts en recharge grisés */
.chip { transition: transform .2s; }
.chip.current { transform: translateY(2px) scale(1.06); z-index: 1; }
.spell:has(.cd) .glyph { filter: grayscale(1); opacity: .45; }

/* ───────── confirmation de déplacement */
#move-confirm { position: fixed; z-index: 25; width: 190px; padding: 8px 10px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
#move-confirm .mc-head { display: flex; gap: 8px; align-items: center; position: relative; padding-right: 18px; }
#move-confirm .mc-ico { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 7px; background: rgba(111,224,122,.18); border: 1px solid rgba(111,224,122,.5); color: var(--green); font-size: 14px; }
#move-confirm .mc-x { position: absolute; top: -2px; right: -4px; width: 20px; height: 20px; padding: 0; line-height: 16px; border-radius: 5px; }
#move-confirm .mc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
#move-confirm .mc-pm { color: #8be08f; }
#move-confirm .mc-go { padding: 5px 14px; }

/* ═════════ TÉLÉPHONE ═════════
   Portrait (≤ 700 px de large) et paysage (≤ 500 px de haut). Le plateau se cale ensuite sur la place libre
   mesurée (fitInsets dans main.js / applyInsets dans explore.js) : --exbar = hauteur de la barre d'exploration. */
@media (max-width: 700px) {
  /* exploration */
  #ex-loc { left: 8px; top: 8px; right: 56px; padding: 5px 10px; gap: 6px; overflow: hidden; }
  #ex-name { font-size: 13px; white-space: nowrap; }
  #ex-coords { font-size: 12px; white-space: nowrap; }
  #ex-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  #ex-side-open { top: 8px; right: 8px; width: 38px; height: 38px; }
  #ex-party, #explore.has-side #ex-party { top: 54px; right: 8px; gap: 5px; }
  .pt-card { width: 42px; height: 42px; }
  #ex-bar, #explore.has-side #ex-bar { left: 6px; right: 6px; bottom: 6px; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 8px; }
  #ex-hero { gap: 8px; }
  .ex-portrait { width: 46px; height: 46px; }
  #ex-menu, #explore.has-side #ex-menu { display: flex !important; grid-row: 2; overflow-x: auto; gap: 5px; scrollbar-width: none; padding-bottom: 2px; }
  #ex-menu::-webkit-scrollbar { display: none; }
  #ex-menu button, #explore.has-side #ex-menu button { flex: 0 0 60px; font-size: 10.5px; padding: 6px 2px; gap: 1px; }
  #ex-menu .ic, #explore.has-side #ex-menu .ic { font-size: 17px; }
  #ex-menu .dot, #explore.has-side #ex-menu .dot { top: 3px; right: 5px; }
  #ex-chat { grid-column: 1; grid-row: 3; height: 46px; font-size: 12px; }
  #ex-side { top: 54px; right: 56px; left: auto; bottom: calc(var(--exbar, 200px) + 12px); width: min(250px, calc(100% - 70px)); z-index: 6; }

  /* combat */
  #hud:not(.hidden) ~ #save-status { display: none; }
  #topbar { padding: 6px 8px; gap: 6px; }
  .pill { padding: 4px 10px; font-size: 13px; }
  .top-actions { flex: 1; justify-content: flex-end; }
  .top-actions button { padding: 5px 7px; font-size: 11.5px; }
  .chip { min-width: 74px; padding: 3px 6px; }
  .chip-face { width: 26px; height: 26px; }
  #challenge { top: auto; bottom: calc(var(--bb, 170px) + 8px); left: 8px; width: auto; max-width: calc(100% - 16px); }
  #bottombar { left: 6px; right: 6px; width: auto; transform: none; bottom: 6px; padding: 8px; gap: 6px 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  #hero-info { grid-column: 1 / -1; width: auto; }
  #hero-info .hpbar { margin: 3px 0; }
  #hero-buffs { display: none; }
  #spellbar { justify-content: flex-start; gap: 5px; }
  .spell { width: 44px; height: 44px; } .spell .glyph { line-height: 44px; font-size: 19px; }
  .turn-actions { gap: 4px; }
  #btn-end { padding: 9px 12px; }
  #banner { font-size: 22px; }
  #move-confirm { width: 180px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  /* exploration : barre basse d'une ligne, groupe en ligne en haut à droite */
  #ex-loc { top: 6px; left: 6px; padding: 4px 10px; gap: 6px; max-width: 46vw; overflow: hidden; }
  #ex-name { font-size: 13px; white-space: nowrap; }
  #ex-coords { font-size: 12px; white-space: nowrap; }
  #ex-sub { display: none; }
  #ex-side-open { top: 6px; right: 6px; width: 34px; height: 34px; font-size: 16px; }
  #ex-party, #explore.has-side #ex-party { top: 6px; right: 46px; flex-direction: row; gap: 5px; }
  .pt-card { width: 38px; height: 38px; }
  .pt-lv { font-size: 9.5px; line-height: 14px; }
  #ex-bar, #explore.has-side #ex-bar { left: 6px; right: 6px; bottom: 6px; padding: 6px; gap: 8px; grid-template-columns: 200px minmax(0, 1fr) auto; align-items: center; }
  .ex-portrait { width: 40px; height: 40px; border-radius: 9px; }
  #ex-hero { gap: 7px; font-size: 12px; }
  #ex-hero .ex-id { gap: 3px; }
  #ex-chat { grid-row: auto; grid-column: auto; height: 48px; font-size: 11.5px; padding: 4px 8px; }
  #ex-menu, #explore.has-side #ex-menu { display: flex !important; overflow-x: auto; gap: 4px; max-width: 44vw; scrollbar-width: none; }
  #ex-menu::-webkit-scrollbar { display: none; }
  #ex-menu button, #explore.has-side #ex-menu button { flex: 0 0 42px; height: 42px; font-size: 0; padding: 0; gap: 0; justify-content: center; }
  #ex-menu .ic, #explore.has-side #ex-menu .ic { font-size: 18px; }
  #ex-menu .dot, #explore.has-side #ex-menu .dot { top: 3px; right: 4px; }
  #ex-side { top: 50px; right: 6px; bottom: calc(var(--exbar, 70px) + 12px); width: 230px; padding: 8px; gap: 6px; z-index: 6; }
  #ex-side .sd-map { display: none; }
  #explore.has-side #ex-party { right: 242px; }

  /* combat : frise compacte en haut, panneau d'action en colonne à droite */
  #hud:not(.hidden) ~ #save-status { display: none; }
  #topbar { padding: 4px 6px; gap: 6px; flex-wrap: nowrap; }
  #topbar .pill { padding: 3px 9px; font-size: 12px; }
  #timeline { order: 0; flex-basis: auto; gap: 4px; }
  .chip { min-width: 62px; max-width: 96px; padding: 2px 6px; gap: 1px 4px; }
  .chip-face { width: 22px; height: 22px; }
  .chip-name { font-size: 10.5px; } .chip-num { font-size: 10px; }
  .chip-ctl { width: 17px; height: 17px; font-size: 10px; line-height: 15px; }
  .top-actions { gap: 4px; }
  .top-actions button { padding: 4px 7px; font-size: 11px; }
  #btn-tactic { display: none; }
  #bottombar { left: auto; right: 6px; top: 46px; bottom: 6px; transform: none; width: 196px; padding: 8px; gap: 8px;
    display: flex; flex-direction: column; align-items: stretch; overflow-y: auto; }
  #hero-info { width: auto; font-size: 12px; }
  #hero-info .hpbar { height: 13px; margin: 3px 0; } #hero-info .hpbar span { line-height: 13px; font-size: 10px; }
  #hero-buffs { display: none; }
  #spellbar { flex: none; justify-content: flex-start; gap: 5px; }
  .spell { width: 40px; height: 40px; border-radius: 8px; } .spell .glyph { line-height: 40px; font-size: 17px; }
  .spell .cd { border-radius: 8px; font-size: 15px; }
  .turn-actions { margin-top: auto; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px 10px; }
  #turn-gauge { flex-basis: 100%; }
  #btn-end { flex-basis: 100%; padding: 8px; }
  #log { top: 46px; right: 210px; width: 230px; max-height: calc(100% - 56px); font-size: 11px; }
  #challenge { top: 46px; left: 6px; width: 210px; padding: 6px 28px 6px 7px; }
  #challenge .ch-ico { flex-basis: 28px; height: 28px; font-size: 15px; }
  #banner { font-size: 20px; }
  #toast { bottom: 12px; }
}
@media (max-width: 700px), (max-height: 500px) and (orientation: landscape) {
  #explore:not(.hidden) ~ #save-status { bottom: calc(var(--exbar, 200px) + 4px); left: 10px; }
  #ex-hero .ex-id > div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* menu d'exploration sur téléphone : les 12 boutons visibles d'un coup (2 rangées de 6) */
@media (max-width: 700px) {
  #ex-menu, #explore.has-side #ex-menu { display: grid !important; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; }
  #ex-menu button, #explore.has-side #ex-menu button { flex: none; min-width: 0; font-size: 9.5px; padding: 5px 0; white-space: nowrap; overflow: hidden; }
}
@media (max-height: 500px) and (orientation: landscape) {
  #ex-menu, #explore.has-side #ex-menu { display: grid !important; grid-template-columns: repeat(6, 38px); grid-auto-rows: 34px; gap: 4px; max-width: none; overflow: visible; }
  #ex-menu button, #explore.has-side #ex-menu button { flex: none; width: 38px; height: 34px; }
  #ex-menu .ic, #explore.has-side #ex-menu .ic { font-size: 16px; }
  #ex-chat { height: 72px; }
}
/* fenêtres sur téléphone : marges réduites, badge de sauvegarde masqué derrière */
body:has(#modal:not(.hidden)) #save-status { display: none; }
@media (max-width: 700px) {
  #modal { padding: 6px; }
  .modal-box { max-height: calc(100dvh - 12px); }
  .modal-head { padding: 8px 12px; }
  .modal-body { padding: 10px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  #modal { padding: 4px; }
  .modal-box { max-height: calc(100dvh - 8px); }
  .modal-head { padding: 5px 10px; }
  .modal-head h2 { font-size: 15px; }
  .modal-body { padding: 8px 10px; }
  .doll-pic { height: 200px; }
  .bag-grid { max-height: 220px; }
}
/* téléphone tenu en portrait : invite à tourner l'écran (le jeu se joue en paysage) */
#rotate { display: none; }
@media (orientation: portrait) and (pointer: coarse) {
  #rotate { display: flex; position: fixed; inset: 0; z-index: 100000; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    padding: 24px; text-align: center; background: radial-gradient(circle at 50% 40%, #1d2430, #0b0e13 70%); color: var(--text); }
  #rotate b { font-family: Cinzel, Georgia, serif; font-size: 22px; color: var(--gold-2); }
  #rotate span { color: var(--muted); font-size: 14px; }
  #rotate button { margin-top: 10px; padding: 12px 18px; font-size: 15px; }
  .rot-phone { font-size: 64px; animation: rotPhone 2.4s ease-in-out infinite; }
}
@keyframes rotPhone { 0%, 25% { transform: rotate(0); } 50%, 75% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
/* ═════ téléphone en paysage, exploration : carte en plein écran + colonne à droite (vie, sac, mini-carte, menu) ═════ */
@media (max-height: 500px) and (orientation: landscape) {
  #ex-side, #explore.has-side #ex-side { display: flex; top: 0; right: 0; bottom: 0; width: 236px; border-radius: 0; border-width: 0 0 0 1px;
    padding: 6px; gap: 5px; overflow: hidden; z-index: 6; }
  #ex-side-open, #ex-side [data-sd="hide"] { display: none !important; }
  #ex-side .sd-top { gap: 4px; }
  #ex-side .sd-heart { width: 46px; height: 42px; padding-bottom: 4px; }
  #ex-side .sd-heart span { font-size: 46px; }
  #ex-side .sd-heart b, #ex-side .sd-heart i { font-size: 10.5px; line-height: 11px; }
  #ex-side .sd-gold { font-size: 12.5px; } #ex-side .sd-gold .small { font-size: 10px; }
  #ex-side .sd-hide { padding: 3px 7px; }
  #ex-side .sd-tabs { gap: 3px; } #ex-side .sd-tab { padding: 3px 0; font-size: 13px; }
  #ex-side .sd-grid { min-height: 0; grid-template-columns: repeat(5, 1fr); gap: 4px; }
  #ex-side .sd-map { display: grid; padding: 4px; gap: 2px; }
  #ex-side .mm-head { font-size: 10.5px; }
  #ex-side .mm-world { height: 74px; }
  #ex-side .sd-menu { display: grid !important; grid-template-columns: repeat(6, 1fr); gap: 3px; }
  #ex-side .sd-menu button { font-size: 0; padding: 5px 0; gap: 0; }
  #ex-side .sd-menu .ic { font-size: 15px; }
  #ex-side .sd-menu .dot { top: 2px; right: 3px; width: 6px; height: 6px; }
  /* barre du bas : seul le journal reste, posé sur la carte */
  #ex-bar, #explore.has-side #ex-bar { left: 6px; right: 248px; bottom: 6px; display: block; padding: 0; background: none; border: none;
    backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none; }
  #ex-hero, #ex-menu, #explore.has-side #ex-menu { display: none !important; }
  #ex-chat { pointer-events: auto; width: min(400px, 100%); height: 50px; background: rgba(8, 10, 14, .55); font-size: 11.5px; }
  #ex-party, #explore.has-side #ex-party { top: 6px; right: 244px; flex-direction: column; }
  #ex-loc { max-width: calc(100% - 300px); }
  #explore:not(.hidden) ~ #save-status { bottom: auto; top: 40px; left: 8px; }
}
.tap-hint { margin-top: 5px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,.12); color: var(--gold-2); font-size: 11.5px; font-weight: 700; }
/* ═════ colonne de droite plus étroite (−30 %) en paysage sur téléphone ═════ */
@media (max-height: 500px) and (orientation: landscape) {
  #ex-side, #explore.has-side #ex-side { width: 165px; padding: 5px; gap: 4px; }
  #ex-side .sd-top { flex-wrap: wrap; gap: 3px; }
  #ex-side .sd-heart { width: 40px; height: 36px; }
  #ex-side .sd-heart span { font-size: 40px; }
  #ex-side .sd-heart b, #ex-side .sd-heart i { font-size: 9.5px; line-height: 10px; }
  #ex-side .sd-gold { font-size: 11.5px; min-width: 0; }
  #ex-side .sd-gold .small { display: none; }
  #ex-side .sd-hide { padding: 2px 6px; font-size: 12px; }
  #ex-side .sd-tab { font-size: 12px; padding: 2px 0; }
  #ex-side .sd-grid { grid-template-columns: repeat(4, 1fr); gap: 3px; }
  #ex-side .mm-head { display: none; }
  #ex-side .mm-world { height: 64px; }
  #ex-side .mm-zoom button { width: 17px; height: 17px; font-size: 11px; }
  #ex-side .sd-menu { grid-template-columns: repeat(4, 1fr); }
  #ex-side .sd-menu button { padding: 4px 0; }
  #ex-side .sd-menu .ic { font-size: 14px; }
  #ex-bar, #explore.has-side #ex-bar { right: 176px; }
  #ex-party, #explore.has-side #ex-party { right: 172px; }
  #ex-loc { max-width: calc(100% - 230px); }
  /* combat */
  #bottombar { width: 140px; padding: 6px; gap: 6px; }
  #hero-info .hero-top { font-size: 11.5px; } #turn-hint { display: none; }
  .res { gap: 8px; font-size: 11.5px; }
  #spellbar { gap: 4px; }
  .spell { width: 40px; height: 40px; }
  .turn-actions .check { font-size: 10.5px; }
  #log { right: 152px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  #bottombar .spell { width: 38px; height: 38px; } #bottombar .spell .glyph { line-height: 38px; font-size: 16px; }
}
/* ═════ combat en paysage sur téléphone, façon MMO mobile : frise en bas à droite de la carte, boutons en icônes en haut,
   fin de combat large ═════ */
@media (max-height: 500px) and (orientation: landscape) {
  #topbar { display: contents; }
  #topbar #round { position: fixed; z-index: 4; left: 6px; bottom: 6px; padding: 3px 9px; font-size: 11.5px; }
  #timeline { position: fixed; z-index: 4; right: 152px; bottom: 6px; max-width: calc(100% - 300px); flex: none; gap: 3px; padding: 4px;
    background: rgba(14, 17, 23, .82); border: 1px solid var(--line); border-radius: 10px; }
  #timeline .chip { min-width: 0; max-width: none; width: 38px; padding: 2px; display: grid; grid-template-columns: 1fr; gap: 2px; border-left-width: 1px; border-bottom: 3px solid var(--team); }
  #timeline .chip-face { grid-row: auto; width: 32px; height: 32px; border-radius: 7px; }
  #timeline .chip-name, #timeline .chip-num { display: none; }
  #timeline .chip-hp { grid-column: 1; height: 3px; }
  #timeline .chip .chip-ctl { top: -5px; right: -5px; }
  #timeline .chip.current { transform: translateY(-3px); }
  .top-actions { position: fixed; z-index: 4; top: 6px; right: 152px; gap: 4px; }
  .top-actions button { padding: 4px 7px; font-size: 11px; }
  #bottombar { top: 6px; }
  #challenge { top: 6px; }
  #log { top: 40px; }
  /* fin de combat : presque toute la carte */
  .end-box.retro { width: calc(100% - 164px); max-width: none; margin-right: 152px; }
  .retro-head { padding: 5px 12px; } .retro-head b { font-size: 14px; }
  .retro-body { padding: 6px 12px 2px; max-height: calc(100dvh - 90px); }
  .retro-table { font-size: 12px; } .retro-table td { padding: 2px 6px; }
  .end-box .row.center { padding: 6px; }
}
/* ───── frise du groupe façon MMO : en-tête (réduire, nombre), raccourci monture, chef en grand avec couronne */
#ex-party { align-items: flex-end; }
.pt-head { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 8px; background: rgba(14, 17, 23, .82); border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.pt-head button { width: 20px; height: 20px; padding: 0; line-height: 16px; border-radius: 5px; font-weight: 800; }
.pt-mount { width: 44px; height: 30px; padding: 0; border-radius: 8px; font-size: 17px; background: linear-gradient(#3a4a2a, #232c19); border: 1px solid #5a6a40; opacity: .75; }
.pt-mount.on { background: linear-gradient(#9edb4a, var(--lime2)); border-color: #5a8a20; opacity: 1; }
.pt-card.lead { width: 66px; height: 66px; border-color: #d8b860; box-shadow: 0 0 0 1px #8a6a20, 0 0 12px rgba(227, 181, 91, .45); }
.pt-crown { position: absolute; right: 13px; bottom: -3px; font-size: 13px; color: #f4d58d; text-shadow: 0 1px 2px #000; }
#mount-pop { position: fixed; z-index: 30; width: 230px; padding: 8px 10px; display: grid; gap: 6px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.55); }
#mount-pop.hidden { display: none; }
.mp-head { display: flex; justify-content: space-between; align-items: center; } .mp-head b { color: var(--gold-2); font-family: Cinzel, Georgia, serif; }
.mp-head button { width: 22px; height: 22px; padding: 0; }
.mp-cur { display: flex; gap: 8px; align-items: center; }
.mp-sub { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.mp-other { display: flex; gap: 8px; align-items: center; text-align: left; padding: 4px 6px; }
.mp-note { font-size: 10.5px; }
@media (max-height: 500px) and (orientation: landscape) {
  .pt-card.lead { width: 46px; height: 46px; }
  .pt-mount { width: 38px; height: 26px; font-size: 15px; }
  .pt-head { padding: 2px 4px; font-size: 10.5px; }
}
/* ═════ fenêtres sur téléphone en paysage : réduites (zoom ≈ 0,62) avec leur disposition d'ordinateur, tenant à l'écran ═════ */
@media (max-height: 500px) and (orientation: landscape) {
  #modal .modal-box { zoom: .62; width: min(560px, calc((100vw - 16px) / .62)); max-height: calc((100dvh - 8px) / .62); }
  #modal .modal-box.wide { width: min(1080px, calc((100vw - 16px) / .62)); }
  #modal .modal-head { padding: 10px 16px; } #modal .modal-head h2 { font-size: 18px; }
  #modal .modal-body { padding: 12px 16px; }
  .inv2 { grid-template-columns: minmax(360px, 1fr) minmax(330px, 1fr); }
  .dinv { grid-template-columns: minmax(330px, 1.05fr) minmax(300px, 1fr) minmax(260px, .9fr); }
  .dinv .doll { grid-column: auto; max-width: none; }
  .swin, .jwin { grid-template-columns: 1fr 1fr; }
  #endscreen .end-box.retro { zoom: .8; width: calc((100% - 164px) / .8); margin-right: calc(152px / .8); }
}
@media (max-height: 500px) and (orientation: landscape) {
  #modal .modal-box { zoom: .58; width: min(560px, calc((100vw - 16px) / .58)); max-height: calc((100dvh - 8px) / .58); }
  #modal .modal-box.wide { width: min(1080px, calc((100vw - 16px) / .58)); }
  .epic { min-height: 220px; } .epic img { height: 190px; }
  .inv2-grid { max-height: 300px; }
}
/* fenêtre de la monture : fiche, barres, part d'XP, écurie */
#mount-pop { width: 270px; max-height: calc(100dvh - 16px); overflow-y: auto; }
.mp-id { min-width: 0; } .mp-ren { padding: 0 5px; font-size: 11px; line-height: 16px; }
.mp-name { width: 140px; padding: 3px 6px; }
.mp-line { display: grid; grid-template-columns: 52px 1fr auto; gap: 6px; align-items: center; font-size: 12px; }
.mp-bar { height: 8px; border-radius: 4px; background: rgba(0,0,0,.5); overflow: hidden; }
.mp-bar i { display: block; height: 100%; }
.mp-bar.xp i { background: linear-gradient(90deg, #d8b860, #f4d58d); }
.mp-bar.en i { background: linear-gradient(90deg, #5ec8ff, #9fe0ff); }
.mp-bar.low i { background: linear-gradient(90deg, #ff6250, #ffa050); }
.mp-feed { display: flex; gap: 4px; flex-wrap: wrap; } .mp-feed button { font-size: 11.5px; padding: 3px 7px; }
.mp-share { display: grid; gap: 3px; font-size: 12px; } .mp-share input { width: 100%; }
.mp-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12.5px; }
.mp-row > span:first-child { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mp-row button { padding: 3px 8px; font-size: 11.5px; }
.mp-store-cur { font-size: 12px; }
@media (max-height: 500px) and (orientation: landscape) { #mount-pop { zoom: .8; max-height: calc((100dvh - 16px) / .8); } }
.mp-ic { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 8px; font-size: 18px; background: radial-gradient(circle at 50% 40%, #3c4a2c, #161a13); border: 1px solid #5a6a40; }
/* inventaire sur téléphone en paysage : la fiche de l'objet prend sa propre colonne, entre le personnage et le sac
   (tout tient sur l'écran, sans défiler, comme dans les MMO mobiles) */
@media (max-height: 500px) and (orientation: landscape) {
  #modal .modal-box.wide:has(.inv2) { width: calc((100vw - 16px) / .58); }
  .inv2 { grid-template-columns: auto minmax(280px, 1fr) minmax(330px, 1.1fr); grid-template-rows: auto 1fr; align-items: start; }
  .inv2-left { display: contents; }
  .inv2-doll { grid-column: 1; grid-row: 1; grid-template-columns: 50px 190px 50px; gap: 8px; }
  .inv2 .ecol { gap: 6px; }
  .inv2 .ecol .eslot { width: 50px; height: 50px; } .inv2 .ecol .eslot .icon { width: 42px; height: 42px; }
  .inv2 .epic { min-height: 0; height: 100%; } .inv2 .epic img { height: 250px; }
  .inv2 .artrow { grid-column: 1; grid-row: 2; padding: 5px; gap: 5px; }
  .inv2 { gap: 8px; padding: 8px; }
  .inv2 .idet { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; display: grid; grid-template-rows: auto 1fr auto; }
  .inv2 .idet-body { grid-template-columns: 1fr; align-content: start; }
  .inv2 .idet-pic { grid-auto-flow: column; justify-content: center; align-items: center; gap: 10px; }
  .inv2 .idet-tabs-body { max-height: max(110px, calc(100dvh / .58 - 470px)); }
  .inv2 .idet-actions { padding-top: 6px; }
  .inv2-right { grid-column: 3; grid-row: 1 / span 2; gap: 6px; }
  .inv2-title { padding: 5px; font-size: 17px; } .inv2-cats .cat { height: 40px; }
  .inv2-grid { max-height: max(160px, calc(100dvh / .58 - 400px)); } /* le sac défile en lui-même, la fenêtre jamais */
}
/* ═════ création de personnage (façon MMO mobile) : grande illustration à gauche, races et formulaire à droite ═════ */
.newp-btn { width: 100%; margin-top: 14px; padding: 11px; font-weight: 700; color: var(--gold-2); border: 1px dashed var(--gold); background: rgba(244, 213, 141, .06); }
#login.creating { padding: 8px; }
.cr-box { --cr-bg: #e9dcc0; --cr-ink: #3a2a18; --cr-wood: #5a3d22; --cr-wood2: #3f2914;
  width: min(1180px, 100%); height: min(720px, calc(100dvh - 16px)); display: grid; grid-template-columns: 1fr 1.08fr; grid-template-rows: auto 1fr;
  background: repeating-linear-gradient(90deg, rgba(0,0,0,.025) 0 2px, transparent 2px 90px), var(--cr-bg); color: var(--cr-ink);
  border: 4px solid var(--cr-wood); border-radius: 18px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.cr-bar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; background: linear-gradient(var(--cr-wood), var(--cr-wood2)); }
.cr-bar h2 { margin: 0; font: 700 22px Cinzel, Georgia, serif; color: #f4d58d; text-shadow: 0 2px 0 #2a1a0a; }
.cr-back { background: #f3e6c8; color: var(--cr-ink); border: 2px solid #c9a86a; border-radius: 999px; padding: 5px 18px; font-weight: 700; }
.cr-stage { container-type: size; position: relative; display: grid; place-items: center; overflow: hidden; touch-action: pan-y; user-select: none; }
.cr-halo { position: absolute; height: min(78%, 92cqw); aspect-ratio: 1; border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -54%);
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 35%, #fff8e6) 0 52%, transparent 53%), repeating-conic-gradient(from 0deg, rgba(90,61,34,.22) 0 6deg, transparent 6deg 12deg);
  border: 10px solid rgba(90, 61, 34, .18); box-shadow: inset 0 0 0 6px rgba(255,255,255,.35); }
.cr-hero { position: relative; height: 76%; max-width: 70%; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(40, 25, 10, .45)); animation: cr-in .35s ease-out; margin-bottom: 9%; }
@keyframes cr-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.cr-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 54px; height: 86px; font-size: 44px; line-height: 1; padding: 0 0 6px;
  color: #f3e6c8; background: linear-gradient(#7a5530, var(--cr-wood2)); border: 2px solid #2a1a0a; border-radius: 12px; box-shadow: 0 3px 0 #2a1a0a; }
.cr-arrow.l { left: 12px; } .cr-arrow.r { right: 12px; }
.cr-turn { position: absolute; right: 16px; bottom: 14px; width: 44px; height: 44px; border-radius: 12px; font-size: 22px; color: var(--cr-ink); background: #f3e6c8; border: 2px solid #c9a86a; }
.cr-title { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font: 700 26px Cinzel, Georgia, serif; color: var(--cr-ink); pointer-events: none; }
.cr-side { display: grid; grid-template-rows: auto auto 1fr; min-height: 0; overflow-y: auto; border-left: 3px solid rgba(90, 61, 34, .35); }
.cr-medals { display: flex; justify-content: center; gap: 12px; padding: 10px; background: var(--cr-wood2); }
.cr-medal { width: 56px; height: 56px; padding: 0; border-radius: 50%; border: 3px solid #9c7a48; background: radial-gradient(#f3e6c8, #c9b48a); overflow: hidden; box-shadow: 0 0 0 2px #2a1a0a; }
.cr-medal i { display: block; width: 100%; height: 100%; background-repeat: no-repeat; }
.cr-medal.on { border-color: var(--c); box-shadow: 0 0 0 2px #2a1a0a, 0 0 14px 3px color-mix(in srgb, var(--c) 70%, transparent); transform: scale(1.08); }
.cr-info { padding: 12px 18px 4px; display: grid; gap: 8px; }
.cr-info h3 { margin: 0; font: 700 24px Cinzel, Georgia, serif; color: var(--cr-ink); }
.cr-info h3 span { font: 600 13px system-ui, sans-serif; color: #7a5a34; margin-left: 8px; }
.cr-desc { margin: 0; font-size: 15px; line-height: 1.4; }
.cr-chips, .cr-spells { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-chip { padding: 3px 9px; border-radius: 999px; background: rgba(90, 61, 34, .12); border: 1px solid rgba(90, 61, 34, .25); font-size: 12.5px; }
.cr-chip.gift { background: #5a3d22; color: #f4d58d; border-color: #3f2914; font-weight: 700; }
.cr-spell { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 3px; border-radius: 999px; background: #f6ecd6; border: 1px solid #c9a86a; font-size: 12px; }
.cr-spell i { width: 20px; height: 20px; display: grid; place-items: center; font-style: normal; border-radius: 50%; background: var(--cr-wood); color: #f4d58d; font-size: 11px; }
.cr-start { font-size: 13px; color: #6a4a28; }
.cr-form { padding: 6px 18px 14px; display: grid; gap: 8px; align-content: end; }
.cr-comp { display: flex; align-items: center; gap: 10px; }
.cr-lab { font-weight: 700; font-size: 14px; color: #6a4a28; }
.cr-comps { display: flex; gap: 6px; flex-wrap: wrap; }
.cr-cbtn { display: grid; justify-items: center; gap: 1px; padding: 3px 4px; min-width: 50px; border-radius: 10px; background: #f6ecd6; border: 2px solid #d8c398; color: var(--cr-ink); font-size: 10.5px; }
.cr-cbtn i { width: 30px; height: 30px; border-radius: 50%; background-color: #e2d2ad; background-repeat: no-repeat; display: grid; place-items: center; font-style: normal; font-size: 16px; }
.cr-cbtn.on { border-color: #b8862e; background: #fbe9b8; box-shadow: 0 0 0 1px #b8862e; }
.cr-row { display: flex; gap: 8px; }
.cr-row input { flex: 1; min-width: 0; background: #fffaf0; color: var(--cr-ink); border: 3px solid #5a3d22; border-radius: 12px; padding: 9px 14px; font-size: 17px; }
.cr-row input::placeholder { color: #9a8a70; }
.cr-dice { width: 48px; border-radius: 12px; background: #f3e6c8; border: 2px solid #c9a86a; font-size: 20px; }
.cr-opts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.cr-opts .muted { color: #8a7454; }
.cr-go { padding: 12px; font-size: 20px; font-family: Cinzel, Georgia, serif; border-radius: 14px; }
.cr-box .err { color: #b3261e; margin: 0; min-height: 0; font-weight: 600; }
/* téléphone en paysage : tout tient sur l'écran */
@media (max-height: 500px) and (orientation: landscape) {
  #login.creating { padding: 4px; }
  .cr-box { height: calc(100dvh - 8px); border-width: 3px; border-radius: 12px; grid-template-columns: 1fr 1.25fr; }
  .cr-bar { padding: 3px 10px; } .cr-bar h2 { font-size: 15px; } .cr-back { padding: 2px 12px; font-size: 12px; }
  .cr-arrow { width: 36px; height: 58px; font-size: 30px; } .cr-arrow.l { left: 6px; } .cr-arrow.r { right: 6px; }
  .cr-turn { width: 32px; height: 32px; font-size: 16px; right: 8px; bottom: 8px; }
  .cr-title { font-size: 17px; bottom: 6px; }
  .cr-hero { height: 80%; }
  .cr-medals { padding: 5px; gap: 8px; } .cr-medal { width: 38px; height: 38px; border-width: 2px; }
  .cr-info { padding: 5px 12px 0; gap: 4px; } .cr-info h3 { font-size: 16px; } .cr-info h3 span { font-size: 11px; }
  .cr-desc { font-size: 11.5px; line-height: 1.3; }
  .cr-chip { font-size: 10.5px; padding: 1px 6px; } .cr-spells { display: none; } .cr-start { font-size: 10.5px; }
  .cr-form { padding: 3px 12px 5px; gap: 4px; }
  .cr-info { gap: 3px; }
  .cr-lab { font-size: 11px; } .cr-cbtn { min-width: 38px; padding: 1px 3px; font-size: 9px; border-width: 1px; } .cr-cbtn i { width: 22px; height: 22px; font-size: 12px; }
  .cr-row input { padding: 4px 10px; font-size: 13px; border-width: 2px; border-radius: 9px; } .cr-dice { width: 36px; font-size: 15px; }
  .cr-opts { font-size: 10.5px; } .cr-opts .check { margin: 0; }
  .cr-go { padding: 5px; font-size: 15px; border-radius: 10px; }
}
/* écran tactile : fiche épinglée d'un groupe / d'une ressource / d'un atelier, avec son bouton d'action */
#tap-card { position: fixed; z-index: 26; width: max-content; max-width: min(300px, 60vw); padding: 8px 10px 10px; box-shadow: 0 8px 24px rgba(0,0,0,.55); display: grid; gap: 8px; }
#tap-card .tc-body { padding-right: 18px; font-size: 13px; }
#tap-card .tc-body:empty { display: none; }
#tap-card .tc-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 0; line-height: 18px; border-radius: 6px; }
#tap-card .tc-go { padding: 8px 14px; font-size: 15px; display: flex; gap: 8px; justify-content: center; align-items: center; }
@media (max-height: 500px) and (orientation: landscape) { #tap-card { max-width: min(260px, 55vw); padding: 6px 8px 8px; gap: 6px; } #tap-card .tc-body { font-size: 11.5px; } #tap-card .tc-go { padding: 6px 12px; font-size: 14px; } }

/* ───── accueil : compte (se connecter / créer un compte) */
.acc-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 16px 0 4px; padding: 4px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 10px; }
.acc-tabs button { background: transparent; border: 0; padding: 8px; font-family: Cinzel, Georgia, serif; color: var(--muted); }
.acc-tabs button.on { background: rgba(227, 181, 91, .16); color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(227, 181, 91, .45); }
.acc-attach { margin-top: 12px; font-size: 13px; }
.acc-attach summary { cursor: pointer; color: var(--muted); }
.acc-attach[open] summary { color: var(--gold-2); }
@media (max-height: 500px) and (orientation: landscape) {
  .login-box { padding: 12px 16px; max-height: calc(100dvh - 16px); overflow-y: auto; }
  .login-box h1 { font-size: 22px; }
  .acc-tabs { margin-top: 8px; }
  .lform .field { margin-bottom: 4px; }
  .login-box { width: min(620px, 100%); }
  .login-box > p.muted:first-of-type:not(:has(button)) { display: none; }
  #f-acc { grid-template-columns: 1fr 1fr; column-gap: 10px; }
  #f-acc > p, #f-acc > button, #f-acc > .err { grid-column: 1 / -1; }
  #f-acc > p.muted { margin: 2px 0 6px; }
  .profiles { max-height: 34vh; }
}
