/* =====================================================================
   DERNIER REFUGE — interface v2
   Thème : survie réaliste, matériaux sombres (toile, métal usé, grain),
   accent ambre (feu de camp, coucher de soleil). Polices : Rajdhani (titres),
   Inter (texte). Textures --grain / --cloth / --metal générées par ui.js.
   ===================================================================== */
:root {
  --ink: #ece6da; --ink2: #cfc8bb; --dim: #8e897f; --dim2: #67625a;
  --line: rgba(236, 224, 200, 0.08); --line2: rgba(236, 224, 200, 0.15); --line3: rgba(236, 224, 200, 0.28);
  --acc: #e0982f; --acc2: #ffc46a; --accd: #8a5a1c; --acc-a: rgba(224, 152, 47, 0.15);
  --ok: #7ec45e; --bad: #e2533f; --warn: #f2c14e; --blue: #4ea3ff; --gold: #f2c14e;
  --font: 'Inter', system-ui, 'Segoe UI', Roboto, sans-serif; --head: 'Rajdhani', 'Segoe UI', sans-serif;
  --grain: none; --cloth: none; --metal: none;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0c0b0a; color: var(--ink); font-family: var(--font); font-size: 14px; user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
#c { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
.hidden { display: none !important; }
button { font-family: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--acc2); outline-offset: 2px; }
input, select { font-family: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
::-webkit-scrollbar-thumb { background: rgba(236, 224, 200, 0.16); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(224, 152, 47, 0.5); }
small, .small { font-size: 12px; color: var(--dim); }
.dim { color: var(--dim); }
.center { text-align: center; }

/* icônes vectorielles et icônes d'objets */
.si { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; flex-shrink: 0; }
.si .f { fill: currentColor; stroke: none; }
.si.sm { width: 1em; height: 1em; }
.ico { display: inline-block; object-fit: contain; flex-shrink: 0; pointer-events: none; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.55)); }
/* liseré clair : les objets sombres (armes, outils) se détachent des cases sombres */
img.ico { filter: drop-shadow(0 0 1.1px rgba(255, 238, 214, 0.38)) drop-shadow(0 3px 3px rgba(0, 0, 0, 0.6)); }
.ico.emo { display: inline-flex; align-items: center; justify-content: center; line-height: 1; filter: saturate(0.82) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); }
/* silhouettes vectorielles de secours (icons.js) */
.ico.svgi { display: inline-flex; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 1px rgba(255, 255, 255, 0.12)); }
.ico.svgi svg { width: 100%; height: 100%; display: block; overflow: visible; }
.r-commun { --rc: #b8c0c8; } .r-rare { --rc: #3aa0ff; } .r-epique { --rc: #b05ce8; } .r-legendaire { --rc: #f2b630; }
.rt { color: var(--rc, var(--ink)); font-weight: 700; }

/* touches */
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; margin: 0 2px; border-radius: 4px; background: linear-gradient(180deg, #f3eee4, #cfc7b8); color: #17140f; font: 700 12px/1 var(--head); letter-spacing: 0.02em; text-transform: uppercase; box-shadow: 0 2px 0 #776e60, 0 3px 6px rgba(0, 0, 0, 0.45); border: 1px solid #fffaf0; white-space: nowrap; vertical-align: middle; }
kbd.ms { padding: 0 2px; } kbd.ms .si { width: 15px; height: 15px; stroke-width: 1.7; }
kbd.wide { letter-spacing: 0.12em; }
kbd.pad { border-radius: 999px; min-width: 22px; background: linear-gradient(180deg, #4a4640, #26231f); color: #fff; border-color: #6a655c; box-shadow: 0 2px 0 #0d0c0b; }

/* barres */
.bar { position: relative; height: 10px; background: rgba(0, 0, 0, 0.55); border-radius: 2px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05); }
.bar > i, .bar > s { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--acc); transition: width 0.25s ease; text-decoration: none; }
.bar > i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, 0.15)); }

/* boutons */
.big { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 3px; border: 1px solid var(--line3); background: linear-gradient(180deg, #3b3731, #24211d); color: var(--ink); font: 700 15px var(--head); letter-spacing: 0.12em; text-transform: uppercase; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 3px 10px rgba(0, 0, 0, 0.35); transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.08s, color 0.15s; }
.big:hover:not([disabled]) { border-color: var(--acc); color: #fff; background: linear-gradient(180deg, #48423a, #2b2722); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 0 1px rgba(224, 152, 47, 0.25), 0 6px 16px rgba(0, 0, 0, 0.4); }
.big:active:not([disabled]) { transform: translateY(1px); }
.big.primary, .mini.primary, button.primary { background: linear-gradient(180deg, #f4b553, #c77a1c); color: #1a1006; border-color: #ffd28a; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 16px rgba(224, 152, 47, 0.28); }
.big.primary:hover:not([disabled]) { background: linear-gradient(180deg, #ffc56a, #d98a26); color: #140c04; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 22px rgba(255, 180, 80, 0.45); }
.big.danger, .mini.danger { background: linear-gradient(180deg, #5a2a24, #3a1a16); border-color: rgba(226, 83, 63, 0.6); color: #ffd6cf; }
.big.danger:hover:not([disabled]) { border-color: var(--bad); background: linear-gradient(180deg, #6e3029, #461d18); }
.big[disabled], .mini[disabled] { opacity: 0.4; cursor: default; }
.big.xl { padding: 15px 30px; font-size: 18px; }
.big.wide { width: 100%; }
.big .si { width: 18px; height: 18px; }
.mini { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 3px; border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.06); font: 600 12px var(--head); letter-spacing: 0.08em; text-transform: uppercase; }
.mini:hover:not([disabled]) { border-color: var(--acc); }
.mini.ghost { background: none; border-color: transparent; }
.mini.ghost:hover { border-color: var(--line3); color: #fff; }
.link { background: none; border: none; color: var(--acc2); text-decoration: underline; padding: 0 4px; font: inherit; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 3px; border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.04); color: var(--ink2); font: 600 13px var(--head); letter-spacing: 0.06em; text-transform: uppercase; transition: border-color 0.12s, background 0.12s, color 0.12s; }
.chip:hover { border-color: var(--line3); color: #fff; }
.chip.on { background: var(--acc-a); border-color: var(--acc); color: var(--acc2); box-shadow: inset 0 0 14px rgba(224, 152, 47, 0.12); }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.6); box-shadow: 0 0 0 1px var(--line3), inset 0 -4px 8px rgba(0, 0, 0, 0.25), inset 0 3px 6px rgba(255, 255, 255, 0.15); transition: transform 0.12s, box-shadow 0.12s; }
.sw:hover { transform: scale(1.1); }
.sw.on { box-shadow: 0 0 0 2px var(--acc), 0 0 12px rgba(224, 152, 47, 0.55), inset 0 -4px 8px rgba(0, 0, 0, 0.25); }
input[type=range] { accent-color: var(--acc); }
.tag { display: inline-flex; align-items: center; gap: 4px; font: 600 11px var(--head); letter-spacing: 0.08em; text-transform: uppercase; padding: 1px 7px; border-radius: 2px; background: rgba(255, 255, 255, 0.07); color: var(--ink2); border: 1px solid var(--line); }
.tag.ok { background: rgba(126, 196, 94, 0.14); color: #c6efb2; border-color: rgba(126, 196, 94, 0.28); }
.tag.no { background: rgba(226, 83, 63, 0.14); color: #ffb3a6; border-color: rgba(226, 83, 63, 0.3); }
.tag.rt { color: var(--rc); border-color: var(--rc); background: rgba(0, 0, 0, 0.3); }
.cost { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px 1px 2px; border-radius: 3px; background: rgba(0, 0, 0, 0.38); font: 700 12px var(--head); border: 1px solid transparent; }
.cost i { font-style: normal; color: var(--dim); font-weight: 600; }
.cost.ok b { color: #c6efb2; }
.cost.no { background: rgba(226, 83, 63, 0.14); border-color: rgba(226, 83, 63, 0.3); }
.cost.no b { color: #ffab9c; }
.rcost { display: flex; flex-wrap: wrap; gap: 3px; }
.rchip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 4px; border-radius: 2px; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(242, 193, 78, 0.35); font: 600 13px var(--head); }
.rchip.xp { color: var(--gold); padding-left: 8px; }
.empty { padding: 40px 20px; text-align: center; color: var(--dim); }
.acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.acts.left { justify-content: flex-start; }
.sec-h { display: flex; align-items: center; gap: 8px; font: 700 13px var(--head); letter-spacing: 0.16em; text-transform: uppercase; color: var(--acc2); padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--line2); }
.sec-h small { margin-left: auto; letter-spacing: 0; text-transform: none; font: 500 11.5px var(--font); color: var(--dim); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-s { font: 700 12px var(--head); letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); margin: 14px 0 6px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--dim); margin: 0 6px 1px 2px; }
dl.stats { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 6px 0; font-size: 12.5px; }
dl.stats dt { color: var(--dim); }
dl.stats dd { margin: 0; text-align: right; font-weight: 600; color: var(--ink); }
dl.stats dd.ok { color: #a9e08c; } dl.stats dd.no { color: #ff9f8f; } dl.stats dd.blue { color: #8cc4ff; }
.lvlb { width: 40px; height: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); background: linear-gradient(160deg, #ffd790, #e0982f 55%, #8a5a1c); color: #1a1006; font: 700 17px var(--head); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35); }

/* ---------------------------------------------------------------- chargement */
#loading { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: radial-gradient(ellipse at 50% 120%, rgba(224, 120, 40, 0.28), transparent 55%), radial-gradient(ellipse at 50% 40%, #1d1813 0%, #0b0a09 75%); transition: opacity 0.6s; }
#loading::after { content: ''; position: absolute; inset: 0; background-image: var(--grain); opacity: 0.6; pointer-events: none; }
#loading.out { opacity: 0; pointer-events: none; }
.lwrap { display: flex; flex-direction: column; align-items: center; gap: 14px; z-index: 1; }
.logo { text-align: center; line-height: 0.9; }
.logo span { display: block; font: 600 20px var(--head); letter-spacing: 0.7em; text-transform: uppercase; color: var(--ink2); padding-left: 0.7em; }
.logo b { display: block; font: 700 92px/0.9 var(--head); letter-spacing: 0.08em; background: linear-gradient(180deg, #ffe0a0 0%, #f0a038 48%, #9a5516 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 26px rgba(224, 152, 47, 0.4)); }
.lsub { font: 600 12px var(--head); letter-spacing: 0.4em; text-transform: uppercase; color: var(--dim); }
.lbar { width: min(420px, 80vw); height: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-top: 18px; }
.lbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accd), var(--acc), var(--acc2)); box-shadow: 0 0 12px var(--acc); transition: width 0.3s; }
#ltext { color: var(--dim); font: 600 13px var(--head); letter-spacing: 0.18em; text-transform: uppercase; }
.ltip { position: absolute; bottom: calc(34px + var(--sab)); left: 50%; transform: translateX(-50%); z-index: 1; display: flex; gap: 10px; align-items: baseline; max-width: 86vw; color: var(--ink2); font-size: 13px; text-align: center; }
.ltip b { font: 700 12px var(--head); letter-spacing: 0.2em; text-transform: uppercase; color: var(--acc2); }
#errbox { position: fixed; left: 8px; bottom: 8px; z-index: 200; max-width: 70vw; background: rgba(160, 20, 20, 0.92); color: #fff; padding: 8px 12px; border-radius: 4px; font: 12px monospace; white-space: pre-wrap; cursor: pointer; }

/* ---------------------------------------------------------------- menu principal */
#menu { position: fixed; inset: 0; z-index: 40; overflow: hidden; background: linear-gradient(90deg, rgba(7, 6, 5, 0.94) 0%, rgba(7, 6, 5, 0.82) 26%, rgba(7, 6, 5, 0.5) 58%, rgba(7, 6, 5, 0.12) 100%), linear-gradient(0deg, rgba(0, 0, 0, 0.55), transparent 35%); }
#menu::after { content: ''; position: absolute; inset: 0; background-image: var(--grain); opacity: 0.55; pointer-events: none; }
.mshell { position: relative; z-index: 1; display: grid; grid-template-columns: 290px minmax(0, 720px); height: 100%; padding: var(--sat) 0 var(--sab) var(--sal); }
.mnav { display: flex; flex-direction: column; padding: 38px 20px 22px 30px; border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(10, 9, 8, 0.55), rgba(10, 9, 8, 0.2)); min-height: 0; overflow-y: auto; }
.mlogo { margin-bottom: 38px; line-height: 0.9; }
.mlogo span { display: block; font: 600 17px var(--head); letter-spacing: 0.62em; text-transform: uppercase; color: var(--ink2); margin-left: 3px; }
.mlogo b { display: block; font: 700 66px/0.92 var(--head); letter-spacing: 0.05em; background: linear-gradient(180deg, #ffe0a0 0%, #f0a038 46%, #9a5516 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 18px rgba(224, 152, 47, 0.35)); }
.mlogo small { display: block; margin-top: 12px; font: 600 10.5px var(--head); letter-spacing: 0.28em; text-transform: uppercase; color: var(--dim); text-wrap: balance; line-height: 1.5; }
.mlist { display: flex; flex-direction: column; gap: 2px; }
.mni { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: none; border: none; border-left: 2px solid transparent; color: var(--ink2); font: 700 19px var(--head); letter-spacing: 0.16em; text-transform: uppercase; text-align: left; transition: color 0.15s, background 0.15s, padding 0.18s, border-color 0.15s; }
.mni .si { width: 20px; height: 20px; opacity: 0.65; }
.mni:hover, .mni:focus-visible { color: #fff; padding-left: 20px; background: linear-gradient(90deg, rgba(224, 152, 47, 0.12), transparent); border-left-color: rgba(224, 152, 47, 0.5); outline: none; }
.mni.on { color: var(--acc2); border-left-color: var(--acc); background: linear-gradient(90deg, rgba(224, 152, 47, 0.2), transparent 90%); }
.mni.on .si { opacity: 1; }
.mni.quit { margin-top: 10px; color: #d9a39a; }
.mni.quit:hover { color: #ffb3a6; border-left-color: var(--bad); background: linear-gradient(90deg, rgba(226, 83, 63, 0.14), transparent); }
.mfoot { margin-top: auto; padding-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ver { font: 600 11px var(--head); letter-spacing: 0.14em; color: var(--dim2); }
.mpane { overflow-y: auto; padding: 34px 34px 24px; min-height: 0; touch-action: pan-y; }
/* barres de défilement discrètes : visibles au survol seulement */
.mpane::-webkit-scrollbar-thumb, .mnav::-webkit-scrollbar-thumb { background: transparent; }
.mpane:hover::-webkit-scrollbar-thumb, .mnav:hover::-webkit-scrollbar-thumb { background: rgba(236, 224, 200, 0.16); }
.mpane::-webkit-scrollbar-track, .mnav::-webkit-scrollbar-track { background: transparent; }
.mpane.pin { animation: paneIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.mph { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line2); position: relative; }
.mph::after { content: ''; position: absolute; left: 0; bottom: -1px; width: 64px; height: 2px; background: var(--acc); }
.mph h1 { margin: 0; font: 700 42px/1 var(--head); letter-spacing: 0.12em; text-transform: uppercase; color: #fff; }
.mph p { margin: 6px 0 0; color: var(--ink2); }
.mbox { padding: 18px; background: rgba(14, 13, 11, 0.86); background-image: var(--grain); border: 1px solid var(--line2); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.mbox h3 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font: 700 18px var(--head); letter-spacing: 0.12em; text-transform: uppercase; }
.mbox h3 .si { color: var(--acc2); }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mode { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; background: rgba(14, 13, 11, 0.9); border: 1px solid var(--line2); color: var(--ink); transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; position: relative; }
.mode:hover { transform: translateY(-3px); border-color: var(--line3); box-shadow: 0 16px 34px rgba(0, 0, 0, 0.5); }
.mode.on { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc), 0 16px 36px rgba(224, 152, 47, 0.18); }
.mode.on::after { content: ''; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 34px 34px 0; border-color: transparent var(--acc) transparent transparent; }
.mart { position: relative; height: 150px; overflow: hidden; }
.mart > svg { width: 100%; height: 100%; display: block; transition: transform 0.8s ease; }
.mode:hover .mart > svg { transform: scale(1.05); }
.mart::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(14, 13, 11, 0.9), transparent 45%); }
.mbadge { position: absolute; left: 12px; bottom: 10px; z-index: 1; display: flex; align-items: center; gap: 6px; padding: 3px 9px; background: rgba(0, 0, 0, 0.6); border: 1px solid var(--line2); font: 600 11px var(--head); letter-spacing: 0.14em; text-transform: uppercase; color: var(--acc2); }
.mtx { padding: 12px 16px 16px; }
.mtx b { display: block; font: 700 23px var(--head); letter-spacing: 0.08em; text-transform: uppercase; }
.mtx p { margin: 6px 0 10px; color: var(--ink2); font-size: 13px; line-height: 1.5; }
.mfeat { display: flex; gap: 5px; flex-wrap: wrap; }
.mfeat span { padding: 2px 8px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); font: 600 11px var(--head); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink2); }
.mopts { margin-top: 14px; padding: 4px 18px; background: rgba(14, 13, 11, 0.86); border: 1px solid var(--line2); }
/* boutons de lancement : collés en bas du volet, toujours visibles même sur un petit écran */
.macts { position: sticky; bottom: -24px; z-index: 2; display: flex; gap: 10px; flex-wrap: wrap; margin: 16px -34px -24px; padding: 16px 34px 22px; background: linear-gradient(0deg, rgba(8, 7, 6, 0.97) 0%, rgba(8, 7, 6, 0.9) 62%, rgba(8, 7, 6, 0)); }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: none; }
.srow > span { font: 600 14px var(--head); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink2); display: flex; flex-direction: column; }
.srow > span small { font: 500 11.5px var(--font); letter-spacing: 0; text-transform: none; color: var(--dim); margin-top: 2px; }
.sctl { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.sctl input[type=range] { width: 200px; }
.rv { min-width: 58px; text-align: right; font: 700 14px var(--head); color: var(--acc2); }
.snote { padding: 8px 0; font-size: 12px; color: var(--dim); }
.snote.bad { color: #ffab9c; }
/* copies de secours des sauvegardes illisibles (menu Jouer) */
.bsave { padding: 8px 0 10px; border-bottom: 1px solid var(--line); }
.bsave > b { display: flex; align-items: center; gap: 6px; font: 600 13px var(--head); letter-spacing: 0.08em; text-transform: uppercase; color: var(--warn); }
.bsave > small { display: block; margin: 2px 0 6px; font-size: 11.5px; color: var(--dim); }
.bsi { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 12.5px; color: var(--ink2); }
.bsi > span { flex: 1; min-width: 0; }
.bsi small { color: var(--dim); }
.bsi .chip { padding: 4px 9px; font-size: 11.5px; }
.mgrid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.joinrow { display: flex; gap: 8px; margin: 10px 0; align-items: stretch; }
/* code de 4 à 8 lettres ou chiffres (accord avec le serveur dédié) */
.joinrow input { width: 196px !important; min-width: 0; margin: 0 !important; text-align: center; font: 700 22px var(--head) !important; letter-spacing: 0.22em; text-transform: uppercase; }
.mrooms { display: grid; gap: 6px; max-height: 280px; overflow-y: auto; margin-top: 10px; }
.room { display: grid; grid-template-columns: 32px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 12px; text-align: left; background: rgba(78, 163, 255, 0.07); border: 1px solid rgba(78, 163, 255, 0.25); color: var(--ink); }
.room .rmi { grid-row: span 2; color: var(--blue); }
.room .rmi .si { width: 24px; height: 24px; }
.room b { font: 700 15px var(--head); }
.room span { font-size: 12px; color: var(--dim); }
.room code { color: var(--gold); letter-spacing: 0.2em; }
.room:hover { border-color: var(--blue); background: rgba(78, 163, 255, 0.14); }
details { margin-top: 12px; color: var(--dim); font-size: 12px; }
summary { cursor: pointer; }
.mbox input:not([type=range]), .field input, .mwin input:not([type=range]), details input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line2); border-radius: 3px; color: #fff; font: 500 15px var(--font); outline: none; transition: border-color 0.15s; user-select: text; -webkit-user-select: text; }
.mbox input:focus, .field input:focus, .mwin input:focus, details input:focus { border-color: var(--acc); }
.cc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 330px); gap: 16px; align-items: start; }
.cc-form .field { margin-bottom: 12px; }
.field label { font: 600 12px var(--head); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink2); }
.field label small { letter-spacing: 0; text-transform: none; color: var(--dim); font: 500 11px var(--font); margin-left: 6px; }
.fsec { margin: 14px 0 7px; font: 600 12px var(--head); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink2); }
.sws { display: flex; gap: 8px; flex-wrap: wrap; }
.cc .sctl { justify-content: flex-start; }
.cc-view { position: sticky; top: 0; display: flex; flex-direction: column; gap: 8px; }
/* créateur de personnage : le volet s'élargit pour un grand aperçu 3D */
.mshell.wide { grid-template-columns: 290px minmax(0, 1120px); }
.mshell.wide .cc { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); }
.pvbox { position: relative; min-height: 220px; overflow: hidden; background: radial-gradient(ellipse at 50% 88%, rgba(224, 152, 47, 0.16), transparent 55%), radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, 0.05), transparent 70%); }
/* fond de studio photo (opaque) : sol éclairé, mur dégradé, liseré de lumière */
.pvbox.pv-lg { height: min(660px, calc(100vh - 190px)); min-height: 320px; background: radial-gradient(ellipse 60% 22% at 50% 90%, rgba(255, 190, 110, 0.22), transparent 70%), radial-gradient(ellipse 70% 60% at 50% 38%, #34302a, #1a1815 62%, #0e0d0b); border: 1px solid var(--line2); box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6), 0 14px 34px rgba(0, 0, 0, 0.45); }
.pvbox.pv-lg::before { content: ''; position: absolute; left: 0; right: 0; top: 72%; bottom: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.35)); pointer-events: none; }
.pvbox.pv-off::after { content: 'Aperçu 3D indisponible'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 12px; }
.pv-canvas { position: absolute; inset: 0; display: block; cursor: grab; }
.pv-canvas.drag { cursor: grabbing; }
.pvbar { display: flex; gap: 6px; justify-content: center; }
.pvhint { text-align: center; font-size: 11.5px; color: var(--dim); }
.tips { padding-left: 18px; }
.tips li { margin: 8px 0; line-height: 1.5; color: var(--ink2); }

/* ---------------------------------------------------------------- fenêtres modales */
#modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.75)); padding: 16px; }
/* question posée pendant le lancement (sauvegarde illisible) : au-dessus de l'écran de chargement */
#modal.top { z-index: 110; }
.mwin { position: relative; width: min(820px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px 26px; background-color: #15130f; background-image: var(--grain), linear-gradient(180deg, #1e1b17, #121110); border: 1px solid var(--line2); box-shadow: var(--shadow); animation: popIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.15); touch-action: pan-y; }
.mwin::before { content: ''; position: absolute; left: -1px; top: -1px; width: 18px; height: 18px; border-top: 2px solid var(--acc); border-left: 2px solid var(--acc); }
.mwin::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 18px; height: 18px; border-bottom: 2px solid var(--acc); border-right: 2px solid var(--acc); }
.mwin h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font: 700 26px var(--head); letter-spacing: 0.12em; text-transform: uppercase; }
.mwin h2 .si { color: var(--acc2); }
.mwin p { color: var(--ink2); line-height: 1.5; }
.stabs { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.pause .ptitle { text-align: center; font: 700 46px var(--head); letter-spacing: 0.4em; text-transform: uppercase; margin: 4px 0 16px; padding-left: 0.4em; color: #fff; }
.vlist { display: grid; gap: 8px; max-width: 380px; margin: 0 auto; }
.vlist .big { justify-content: flex-start; }
.code { font: 700 22px var(--head); letter-spacing: 0.3em; color: var(--gold); }
.ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.ctl table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ctl td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink2); }
.ctl td:first-child { white-space: nowrap; color: var(--acc2); width: 1%; }
.ctl h4 { margin: 16px 0 6px; display: flex; align-items: center; gap: 6px; font: 700 14px var(--head); letter-spacing: 0.14em; text-transform: uppercase; color: var(--acc2); }
.ctl > div > h4:first-child { margin-top: 0; }

/* ---------------------------------------------------------------- HUD */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud > * { position: absolute; }
#hud button, #hud input, #bpanel, #rtsbar, #dead, #brover, #hotbar, #sleep { pointer-events: auto; }

/* vitalité */
#vitals { left: calc(16px + var(--sal)); top: calc(14px + var(--sat)); width: 268px; display: grid; gap: 6px; padding: 10px 12px 10px 10px; background: linear-gradient(110deg, rgba(12, 11, 10, 0.72), rgba(12, 11, 10, 0.32) 80%, rgba(12, 11, 10, 0)); border-left: 2px solid rgba(224, 152, 47, 0.6); }
.vtop { display: flex; gap: 10px; align-items: center; }
.vmain { flex: 1; display: grid; gap: 5px; }
.vbar { display: grid; grid-template-columns: 17px 1fr 32px; align-items: center; gap: 6px; }
.vbar .vic { display: flex; color: var(--ink2); }
.vbar .vic .si { width: 15px; height: 15px; }
.vbar > b { font: 700 14px var(--head); text-align: right; text-shadow: 0 1px 2px #000; }
.vbar.hp .bar { height: 13px; }
.vbar.hp .bar > i { background: linear-gradient(90deg, #9e251c, #e2533f); }
.vbar.hp .bar > s { background: rgba(255, 228, 190, 0.6); transition: width 0.9s ease 0.35s; }
.vbar.hp .vic { color: #ef6a55; }
.vbar.hp.low .bar { animation: lowpulse 0.9s infinite; }
.vbar.sh .bar { height: 9px; }
.vbar.sh .bar > i { background: linear-gradient(90deg, #2160c8, #5aaaff); }
.vbar.sh .vic { color: #6ab4ff; }
.bar.seg::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / var(--segs, 2) - 2px), rgba(0, 0, 0, 0.75) calc(100% / var(--segs, 2) - 2px), rgba(0, 0, 0, 0.75) calc(100% / var(--segs, 2))); }
.vsub { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vbar.sm { grid-template-columns: 15px 1fr 26px; gap: 5px; }
.vbar.sm .bar { height: 7px; }
.vbar.sm > b { font-size: 12.5px; }
.vbar.sm .vic .si { width: 13px; height: 13px; }
.vbar.food .bar > i { background: linear-gradient(90deg, #9c5f1e, #e09a45); }
.vbar.food .vic { color: #e8a85a; }
.vbar.water .bar > i { background: linear-gradient(90deg, #1d63a8, #4fb0ff); }
.vbar.water .vic { color: #6cbcff; }
.vbar.low .bar { animation: lowpulse 1s infinite; }
.vbar.xs { grid-template-columns: 15px 1fr; }
.vbar.xs .bar { height: 4px; }
.vbar.xs .vic .si { width: 12px; height: 12px; }
.vbar.stam .bar > i { background: linear-gradient(90deg, #8e9a3a, #dbe37e); }
.vbar.stam .vic { color: #d6dc7a; }
#xpbox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#xpbox .bar { flex: 1; height: 3px; }
#xpbox .bar > i { background: linear-gradient(90deg, var(--accd), var(--gold)); }
#pts { width: 100%; color: var(--gold); font: 700 12px var(--head); letter-spacing: 0.08em; text-transform: uppercase; animation: pulse 1.6s infinite; }
.vrow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#stance { display: flex; align-items: center; gap: 4px; height: 24px; padding: 0 6px; background: rgba(0, 0, 0, 0.42); border: 1px solid var(--line); color: var(--ink2); font: 700 11px var(--head); letter-spacing: 0.1em; text-transform: uppercase; }
#stance .si { width: 16px; height: 16px; }
#stance.on { border-color: rgba(224, 152, 47, 0.7); color: var(--acc2); box-shadow: 0 0 10px rgba(224, 152, 47, 0.25); }
#temp { display: flex; align-items: center; gap: 3px; height: 24px; padding: 0 7px; background: rgba(0, 0, 0, 0.42); border: 1px solid var(--line); font: 700 13px var(--head); }
#temp:empty { display: none; }
#temp.cold { color: #8fd3ff; border-color: rgba(143, 211, 255, 0.5); animation: pulse 1.3s infinite; }
#temp.hot { color: #ffb070; }
#effects { display: flex; gap: 3px; flex-wrap: wrap; }
.fx { position: relative; display: flex; align-items: center; gap: 3px; height: 24px; font-size: 15px; padding: 0 6px 0 5px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(126, 196, 94, 0.4); color: #b6e69a; }
.fx .si { width: 15px; height: 15px; }
.fx.bad { border-color: rgba(226, 83, 63, 0.8); background: rgba(80, 10, 6, 0.5); color: #ff8f7d; animation: pulse 1.4s infinite; }
.fx.e-froid, .fxrow.e-froid .fxi { color: #9ad8ff; } .fx.e-froid { border-color: rgba(143, 211, 255, 0.6); background: rgba(10, 40, 70, 0.5); }
.fx.e-mouille, .fxrow.e-mouille .fxi { color: #7cc4ff; } .fx.e-mouille { border-color: rgba(124, 196, 255, 0.5); background: rgba(10, 30, 60, 0.45); }
.fx.e-chaleur, .fx.e-feu, .fxrow.e-chaleur .fxi, .fxrow.e-feu .fxi { color: #ffb070; }
.fx.e-abri, .fx.e-repos { color: #e6d3a8; }
.fx small { font: 700 10px var(--head); color: #fff; }
.fx .emo { font-size: 14px; line-height: 1; }

/* boussole */
#compass { left: 50%; top: calc(8px + var(--sat)); transform: translateX(-50%); width: min(460px, 44vw); height: 60px; }
#compass .cwin { position: absolute; left: 0; right: 0; top: 0; height: 50px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent); mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent); }
#compass .cwin::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 30px; background: linear-gradient(180deg, rgba(10, 9, 8, 0.55), rgba(10, 9, 8, 0.2)); }
.cstrip { position: absolute; left: 0; top: 0; height: 30px; will-change: transform; }
.cstrip .ct { position: absolute; top: 22px; width: 1px; height: 5px; background: rgba(255, 255, 255, 0.38); }
.cstrip .ct.m { top: 19px; height: 8px; background: rgba(255, 255, 255, 0.7); }
.cstrip em { position: absolute; top: 4px; transform: translateX(-50%); font: 600 10px var(--head); color: rgba(255, 255, 255, 0.5); font-style: normal; }
.cstrip .cl { position: absolute; top: 1px; transform: translateX(-50%); font: 700 14px var(--head); color: #fff; text-shadow: 0 1px 3px #000; letter-spacing: 0.04em; }
.cstrip .cl.cd { color: var(--acc2); font-size: 16px; top: 0; }
.cmarks { position: absolute; left: 0; right: 0; top: 30px; height: 20px; }
.cmk { position: absolute; left: 0; top: 0; width: 0; display: flex; flex-direction: column; align-items: center; will-change: transform; }
.cmk .si { width: 14px; height: 14px; color: #fff; filter: drop-shadow(0 1px 2px #000); flex-shrink: 0; }
.cmk small { font: 700 9px var(--head); color: rgba(255, 255, 255, 0.8); white-space: nowrap; text-shadow: 0 1px 2px #000; }
.cmk.goal .si { color: var(--acc2); width: 16px; height: 16px; } .cmk.goal small { color: var(--acc2); }
.cmk.nol small { visibility: hidden; }
.cmk.foe .si { color: #ff7a64; } .cmk.own .si { color: var(--ok); } .cmk.bag .si { color: #ffd400; } .cmk.zone .si { color: #7ec0ff; }
.cneedle { position: absolute; left: 50%; top: 14px; width: 2px; height: 16px; margin-left: -1px; background: var(--acc2); box-shadow: 0 0 6px var(--acc); }
.cdeg { position: absolute; left: 50%; top: 47px; transform: translateX(-50%); font: 700 10.5px var(--head); color: var(--acc2); letter-spacing: 0.08em; text-shadow: 0 1px 2px #000; }

/* horloge, Battle Royale, code de partie */
#clock { left: 50%; top: calc(70px + var(--sat)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 3px 18px; background: linear-gradient(90deg, transparent, rgba(10, 9, 8, 0.62) 18%, rgba(10, 9, 8, 0.62) 82%, transparent); font: 600 13px var(--head); letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; }
#clock:empty { display: none; }
#clock .sep { width: 1px; height: 12px; background: var(--line3); }
#clock .tm { font-size: 16px; color: #fff; letter-spacing: 0.06em; }
#clock .wx { display: flex; color: var(--acc2); }
#brbar { left: 50%; top: calc(70px + var(--sat)); transform: translateX(-50%); display: flex; gap: 6px; }
.brs { display: flex; align-items: center; gap: 6px; padding: 4px 12px; background: rgba(10, 9, 8, 0.72); border: 1px solid var(--line2); font: 600 12px var(--head); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.brs b { font-size: 18px; color: #fff; }
.brs small { color: var(--dim); font: 600 11px var(--head); }
.brs .si { color: var(--acc2); }
.brs.zone { border-color: rgba(78, 163, 255, 0.5); } .brs.zone .si { color: #7ec0ff; }
.brs.zone.warn { border-color: var(--warn); animation: pulse 1s infinite; } .brs.zone.warn .si, .brs.zone.warn small { color: var(--warn); }
#roomcode { left: 50%; top: calc(98px + var(--sat)); transform: translateX(-50%); display: flex; align-items: center; gap: 6px; font: 600 12px var(--head); letter-spacing: 0.1em; padding: 2px 12px; background: rgba(78, 163, 255, 0.18); border: 1px solid rgba(78, 163, 255, 0.35); white-space: nowrap; }
#roomcode b { color: var(--gold); letter-spacing: 0.25em; }

/* minicarte */
#mapbox { right: calc(16px + var(--sar)); top: calc(14px + var(--sat)); display: flex; flex-direction: column; align-items: center; gap: 5px; }
.mmring { position: relative; width: 172px; height: 172px; border-radius: 50%; padding: 5px; background: conic-gradient(from 20deg, #58524a, #1f1d1a, #4d4840, #1c1a17, #58524a, #22201c, #4d4840, #1f1d1a, #58524a); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
.mmring::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.7), inset 0 0 14px rgba(0, 0, 0, 0.55); pointer-events: none; }
#minimap { width: 100%; height: 100%; border-radius: 50%; display: block; background: #1a2a33; }
#coords { font: 600 11px var(--head); color: var(--ink2); letter-spacing: 0.1em; background: rgba(0, 0, 0, 0.5); padding: 1px 9px; }
#killfeed { right: calc(16px + var(--sar)); top: calc(222px + var(--sat)); display: grid; gap: 3px; justify-items: end; }
.kf { display: flex; align-items: center; gap: 8px; padding: 3px 10px; background: linear-gradient(270deg, rgba(10, 9, 8, 0.78), rgba(10, 9, 8, 0.3)); border-right: 2px solid var(--bad); font: 600 13px var(--head); letter-spacing: 0.04em; animation: slideL 0.25s ease; }
.kf b { color: var(--acc2); } .kf .kv { color: #ff9a8a; } .kf .kw { color: var(--dim); font-size: 12px; }
#tracker { right: calc(16px + var(--sar)); top: calc(222px + var(--sat)); width: 270px; display: grid; gap: 6px; }
#killfeed:not(:empty) + #tracker { top: calc(360px + var(--sat)); }
.tq { padding: 8px 12px 9px; background: linear-gradient(270deg, rgba(12, 11, 10, 0.76), rgba(12, 11, 10, 0.45)); border-right: 2px solid var(--acc); }
.tq.ready { border-right-color: var(--ok); box-shadow: 0 0 18px rgba(126, 196, 94, 0.3); }
.tq.ct { border-right-color: var(--blue); }
.tq.ct .tt { font-size: 12.5px; color: #bcd9f5; }
.tq.ct .tt .si { color: var(--blue); }
.tt { display: flex; align-items: center; gap: 6px; font: 700 14px var(--head); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 4px; }
.tt small { margin-left: auto; font-size: 11px; }
.tqi { font-size: 15px; }
.to { font-size: 12px; color: #d6dde3; display: flex; justify-content: space-between; gap: 8px; line-height: 1.5; }
.to span { display: flex; align-items: center; }
.to b { font: 700 12px var(--head); }
.to.done { color: var(--ok); opacity: 0.85; }
.to.done span { text-decoration: line-through; }
.to .si { margin-right: 4px; }
.claim { display: flex; align-items: center; gap: 4px; color: var(--ok); font-size: 12px; font-weight: 600; }

/* viseur */
#crosshair { left: 50%; top: 50%; width: 0; height: 0; }
#crosshair i { position: absolute; left: -2.5px; top: -2.5px; width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.45); }
#hitm { position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; opacity: 0; }
#hitm::before, #hitm::after { content: ''; position: absolute; left: 10px; top: -2px; width: 2px; height: 26px; background: linear-gradient(180deg, #fff 0 34%, transparent 34% 66%, #fff 66%); transform: rotate(45deg); }
#hitm::after { transform: rotate(-45deg); }
#hitm.show { opacity: 1; }
#hitm.head::before, #hitm.head::after { background: linear-gradient(180deg, #ff4a3a 0 34%, transparent 34% 66%, #ff4a3a 66%); }
#hitm.kill { transform: scale(1.35); }
body.rts #crosshair { display: none; }
#reload { left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: conic-gradient(var(--acc2) calc(var(--p, 0) * 360deg), rgba(255, 255, 255, 0.14) 0); -webkit-mask: radial-gradient(circle, transparent 16px, #000 17px); mask: radial-gradient(circle, transparent 16px, #000 17px); }

/* invite d'interaction */
/* largeur du contenu (et non 50 % de l'écran, limite d'un bloc placé à left: 50 %) : centrage exact, lignes non coupées */
#prompt { left: 50%; top: 61%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px); display: flex; flex-direction: column; align-items: center; gap: 5px; }
.pr-main { display: flex; align-items: center; gap: 10px; padding: 7px 18px 7px 8px; background: linear-gradient(90deg, rgba(12, 11, 10, 0.88), rgba(12, 11, 10, 0.62)); border: 1px solid var(--line2); border-left: 3px solid var(--acc); font: 600 16px var(--head); letter-spacing: 0.04em; white-space: nowrap; animation: fadeUp 0.18s ease; }
.pr-main kbd { height: 26px; min-width: 26px; font-size: 14px; }
.pr-main.dim { border-left-color: var(--dim2); color: var(--ink2); padding-left: 14px; }
.pr-main.lock { border-left-color: var(--bad); }
.pr-main.rar { border-left-color: var(--rc); box-shadow: inset 4px 0 14px -6px var(--rc); }
.pr-main.rar.r-commun { border-left-color: var(--acc); box-shadow: none; }
.pr-main.lock > .si { color: var(--bad); width: 20px; height: 20px; }
.pr-alt { display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 6px; background: rgba(12, 11, 10, 0.66); font: 600 13.5px var(--head); color: var(--ink2); white-space: nowrap; }
#prompt .pc { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
/* coûts + action secondaire : lignes séparées d'habitude, regroupées sur une seule ligne sur petit écran */
.pr-sub { display: contents; }

/* pêche */
#fishhud { left: 50%; bottom: calc(126px + var(--sab)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 6px 16px; background: rgba(10, 18, 24, 0.75); border: 1px solid rgba(78, 163, 255, 0.4); font: 600 14px var(--head); letter-spacing: 0.06em; white-space: nowrap; }
#fishhud small { color: var(--dim); font: 500 12px var(--font); }
#fishhud .si { color: #7ec0ff; }
.bob { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #e2533f 60%); box-shadow: 0 0 8px rgba(226, 83, 63, 0.7); animation: bob 1.6s ease-in-out infinite; }

/* barre d'objets */
#hotname { left: 50%; bottom: calc(114px + var(--sab)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; font: 700 15px var(--head); letter-spacing: 0.2em; text-transform: uppercase; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85); opacity: 0; transition: opacity 0.35s; white-space: nowrap; }
#hotname.show { opacity: 1; animation: nameIn 0.25s ease; }
.rdot { width: 8px; height: 8px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 8px var(--rc); }
#hotbar { left: 50%; bottom: calc(40px + var(--sab)); transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; }
.hs { position: relative; width: 62px; height: 62px; display: flex; align-items: center; justify-content: center; border-radius: 4px; background: radial-gradient(circle at 50% 46%, rgba(120, 108, 88, 0.32), transparent 62%), linear-gradient(180deg, rgba(42, 39, 34, 0.86), rgba(14, 13, 11, 0.92)); border: 1px solid var(--line2); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5), inset 0 12px 18px rgba(255, 255, 255, 0.03), 0 4px 12px rgba(0, 0, 0, 0.42); transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s; cursor: pointer; }
.hs .hk { position: absolute; left: 5px; top: 2px; font: 700 12px var(--head); color: var(--dim); }
.hs .hn { position: absolute; right: 5px; bottom: 2px; font: 700 13px var(--head); text-shadow: 0 1px 2px #000; }
.hs.vide { background: linear-gradient(180deg, rgba(30, 28, 25, 0.5), rgba(10, 9, 8, 0.55)); border-style: dashed; border-color: var(--line); box-shadow: none; }
.hs.ghost .ico { opacity: 0.28; filter: grayscale(1); }
.hs.ghost .hn { color: var(--bad); }
.hs[class*="r-"]::after { content: ''; position: absolute; left: 7px; right: 7px; bottom: 0; height: 2px; background: var(--rc); opacity: 0.8; }
.hs.on { border-color: var(--acc); transform: translateY(-5px); background: linear-gradient(180deg, rgba(70, 52, 28, 0.9), rgba(26, 20, 12, 0.92)); box-shadow: 0 0 0 1px rgba(224, 152, 47, 0.55), 0 0 20px rgba(224, 152, 47, 0.35), inset 0 0 22px rgba(224, 152, 47, 0.16); }
.hs.on .hk { color: var(--acc2); }
.hs.sel { border-color: var(--acc2); }
.hs.flash { animation: slotPop 0.25s ease; }
.hs:hover { border-color: var(--line3); }
.hmag { position: absolute; left: 7px; bottom: 4px; height: 2px; background: var(--acc2); box-shadow: 0 0 4px var(--acc); }
body.nohints #hotbar { bottom: calc(14px + var(--sab)); }
body.nohints #hotname { bottom: calc(88px + var(--sab)); }
body.nohints #fishhud { bottom: calc(100px + var(--sab)); }

/* munitions */
#ammo { right: calc(22px + var(--sar)); bottom: calc(44px + var(--sab)); text-align: right; }
.am-w { font: 600 12px var(--head); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink2); text-shadow: 0 1px 2px #000; }
.am-row { display: flex; align-items: baseline; gap: 8px; justify-content: flex-end; }
.am-m { font: 700 46px/1 var(--head); text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75); }
.am-m.low { color: var(--acc2); }
.am-m.zero { color: var(--bad); animation: pulse 0.8s infinite; }
.am-x { font: 600 18px var(--head); color: var(--dim); }
.am-r { display: inline-flex; align-items: center; gap: 4px; align-self: center; font: 700 18px var(--head); padding-left: 10px; border-left: 1px solid var(--line3); text-shadow: 0 1px 3px #000; }
.am-hint { margin-top: 4px; font: 600 12px var(--head); letter-spacing: 0.1em; text-transform: uppercase; color: var(--acc2); animation: pulse 1s infinite; }
body.nohints #ammo, body.nohints #vehhud { bottom: calc(18px + var(--sab)); }

/* véhicule */
#vehhud { right: calc(22px + var(--sar)); bottom: calc(44px + var(--sab)); width: 190px; display: flex; flex-direction: column; align-items: center; }
#vehhud .gauge { width: 170px; height: 170px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6)); }
.g-bg { fill: none; stroke: rgba(10, 9, 8, 0.7); stroke-width: 12; stroke-linecap: round; }
.g-val { fill: none; stroke: var(--acc); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 0.12s linear; filter: drop-shadow(0 0 4px rgba(224, 152, 47, 0.8)); }
.g-tk line { stroke: rgba(255, 255, 255, 0.45); stroke-width: 1; }
.g-tk line.mj { stroke: rgba(255, 255, 255, 0.85); stroke-width: 1.6; }
.g-tk text { fill: rgba(255, 255, 255, 0.7); font: 600 9px var(--head); text-anchor: middle; }
.g-spd { position: absolute; top: 56px; left: 0; right: 0; text-align: center; line-height: 1; }
.g-spd b { display: block; font: 700 42px var(--head); color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8); }
.g-spd small { font: 600 11px var(--head); letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.g-name { margin-top: -18px; display: flex; align-items: center; gap: 6px; font: 700 12px var(--head); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink2); }
.g-row { width: 170px; display: grid; grid-template-columns: 16px 1fr 40px; align-items: center; gap: 6px; margin-top: 5px; font: 700 12px var(--head); }
.g-row .bar { height: 6px; }
.g-fuel .bar > i { background: linear-gradient(90deg, #a87a1c, #f2c14e); }
.g-hp .bar > i { background: linear-gradient(90deg, #4c8a32, #8fd36a); }
.g-row.low .si, .g-row.low b { color: var(--bad); }
.g-row.low .bar > i { background: var(--bad); }
.g-ic { position: absolute; top: 126px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, 0.25); }
body.inveh #hotbar, body.inveh #hotname { display: none; }
body.isdead #hotbar, body.isdead #hotname, body.isdead #ammo, body.isdead #crosshair, body.isdead #prompt, body.isdead #cqhud, body.isdead #fishhud { display: none; }
.g-ic .si { width: 20px; height: 20px; }
.g-ic.on { color: #9fd8ff; filter: drop-shadow(0 0 6px rgba(120, 200, 255, 0.9)); }
.g-alt { margin-top: 5px; padding: 1px 10px; text-align: center; font: 700 12px var(--head); letter-spacing: 0.14em; color: #9fd0ff; background: rgba(10, 30, 50, 0.55); border: 1px solid rgba(126, 192, 255, 0.35); }
#vehhud.nofuel .g-fuel { animation: pulse 0.8s infinite; }

/* file de fabrication */
#cqhud { right: calc(22px + var(--sar)); bottom: calc(150px + var(--sab)); width: 250px; }
.cqh { display: flex; align-items: center; gap: 6px; font: 700 11px var(--head); letter-spacing: 0.18em; text-transform: uppercase; color: var(--acc2); margin-bottom: 4px; text-shadow: 0 1px 2px #000; }
.cqe { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 6px 8px; background: rgba(0, 0, 0, 0.32); border: 1px solid var(--line); margin-bottom: 4px; }
#cqhud .cqe { background: rgba(10, 9, 8, 0.74); }
.cqe.cur { border-left: 3px solid var(--acc); }
.cqt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cqe b { font: 700 13px var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cqe .bar { height: 5px; }
.cqe .bar > i { background: linear-gradient(90deg, var(--acc), var(--acc2)); transition: width 0.4s linear; }
.cqe small { font-size: 10.5px; color: var(--dim); }
.cqe.paused { border-color: rgba(242, 193, 78, 0.45); }
.cqe.paused .bar > i { background: var(--warn); }
.cqe .pz { display: flex; align-items: center; gap: 4px; color: var(--warn); }

/* journal, discussion */
#feed { left: calc(16px + var(--sal)); bottom: calc(86px + var(--sab)); width: min(440px, 44vw); display: grid; gap: 3px; }
.fl { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; padding: 4px 10px; background: linear-gradient(90deg, rgba(10, 9, 8, 0.74), rgba(10, 9, 8, 0.22)); border-left: 2px solid var(--line3); font-size: 13px; transition: opacity 0.6s; animation: slideR 0.25s ease; }
.fl.out { opacity: 0; }
.fl.gain { border-left-color: var(--ok); }
.fl.chat { border-left-color: var(--blue); }
.fl em { font-style: normal; font-weight: 700; color: var(--acc2); }
.fl .gi { display: inline-flex; align-items: center; gap: 4px; color: #c6efb2; font-weight: 600; }
.fl .gi b { color: #fff; }
#chatin { left: calc(16px + var(--sal)); bottom: calc(44px + var(--sab)); width: min(440px, 80vw); padding: 9px 12px; border-radius: 2px; border: 1px solid var(--acc); background: rgba(10, 9, 8, 0.85); color: #fff; font-size: 14px; outline: none; user-select: text; -webkit-user-select: text; }

/* aide de construction */
#buildhint { left: 50%; bottom: calc(118px + var(--sab)); transform: translateX(-50%); display: grid; gap: 6px; padding: 8px 14px 8px 8px; background: linear-gradient(180deg, rgba(14, 13, 11, 0.9), rgba(14, 13, 11, 0.78)); border: 1px solid var(--line2); border-left: 3px solid var(--acc); max-width: 92vw; }
.bh-h { display: flex; align-items: center; gap: 10px; }
.bh-h b { font: 700 15px var(--head); letter-spacing: 0.06em; text-transform: uppercase; }
.bh-c { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 2px; }
.bh-s { margin-left: 8px; display: flex; align-items: center; gap: 4px; font: 700 12px var(--head); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.bh-s.ok { color: var(--ok); } .bh-s.bad { color: #ff8a78; }
.bh-t { min-width: 0; }
.bh-l { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 0 6px; font: 700 11px/18px var(--head); letter-spacing: 0.1em; text-transform: uppercase; color: #bcd9f5; background: rgba(78, 163, 255, 0.14); border: 1px solid rgba(78, 163, 255, 0.35); vertical-align: 2px; }
.bh-tip { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--dim); }
.bh-tip kbd { transform: scale(0.85); }
.bh-pick { display: flex; align-items: center; gap: 8px; padding: 4px 8px; background: rgba(224, 152, 47, 0.12); border: 1px solid rgba(224, 152, 47, 0.4); font: 600 13px var(--head); letter-spacing: 0.04em; }
.bh-pick b { color: var(--acc2); }
.bh-pick small { font: 500 11px var(--font); color: var(--dim); }

/* aide des touches (bas de l'écran) */
#keyhints { left: 0; right: 0; bottom: 0; height: calc(30px + var(--sab)); padding-bottom: var(--sab); display: flex; justify-content: center; align-items: center; background: linear-gradient(0deg, rgba(8, 7, 6, 0.85), rgba(8, 7, 6, 0.5) 65%, rgba(8, 7, 6, 0)); }
.khin { display: flex; gap: 16px; align-items: center; white-space: nowrap; overflow: hidden; max-width: calc(100vw - 24px); }
.kh { display: inline-flex; align-items: center; gap: 5px; font: 600 12.5px var(--head); letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink2); text-shadow: 0 1px 2px #000; }
.kh kbd { height: 20px; min-width: 20px; font-size: 11.5px; margin: 0; }
.kh em { font-style: normal; }
/* mention « maintenir » après un bouton de manette (appui long) */
.khold { font: 600 9.5px var(--head); letter-spacing: 0.06em; text-transform: lowercase; color: var(--dim); margin: 0 1px 0 -1px; }
.pr-alt .khold, .bh-pick .khold { font-size: 10.5px; }
#keyhints.fit3 .kh.p3, #keyhints.fit2 .kh.p2 { display: none; }
@media (max-width: 1100px) { .kh.p3 { display: none; } }
@media (max-width: 820px) { .kh.p2 { display: none; } }

/* sommeil */
#sleep { inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 60%, #0c0f18, #000 70%); opacity: 0; transition: opacity 1.4s ease; z-index: 3; }
#sleep.on { opacity: 0.96; }
#sleep:not(.on) { pointer-events: none; }
.sl-in { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sl-z { height: 50px; }
.sl-z i { display: inline-block; font: 700 34px var(--head); font-style: normal; color: var(--acc2); opacity: 0; animation: zfloat 2.6s infinite; }
.sl-z i:nth-child(2) { animation-delay: 0.5s; font-size: 28px; }
.sl-z i:nth-child(3) { animation-delay: 1s; font-size: 22px; }
.sl-t { font: 700 30px var(--head); letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink2); padding-left: 0.3em; }
.sl-c { font: 600 64px/1 var(--head); letter-spacing: 0.08em; color: #fff; text-shadow: 0 0 30px rgba(255, 197, 106, 0.35); transition: color 1s, text-shadow 1s; }
.sl-c.wake { color: var(--acc2); text-shadow: 0 0 40px rgba(255, 197, 106, 0.8); }
.sl-bar { display: flex; align-items: center; gap: 10px; width: min(360px, 80vw); margin: 6px 0 2px; color: var(--dim); font: 600 12px var(--head); letter-spacing: 0.08em; }
.sl-bar .bar { flex: 1; height: 4px; }
.sl-bar .bar > i { background: linear-gradient(90deg, #3a4a7a, #e8a05a, #ffd890); transition: width 0.6s linear; }
.sl-bar span { display: inline-flex; align-items: center; gap: 4px; }
.sl-in p { max-width: 380px; }

/* mort */
#dead { inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(70, 0, 0, 0.32), rgba(0, 0, 0, 0.84)); }
#dead.br { background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.72)); }
.dwin { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; animation: fadeUp 0.6s ease; padding: 0 16px; }
#dead .dt { font: 700 66px/1 var(--head); letter-spacing: 0.3em; text-transform: uppercase; color: #e2533f; text-shadow: 0 0 40px rgba(226, 40, 20, 0.55); padding-left: 0.3em; }
#dead.br .dt { color: #fff; text-shadow: 0 0 30px rgba(255, 255, 255, 0.25); }
#dead .ds { font: 600 18px var(--head); letter-spacing: 0.06em; }

/* Battle Royale */
#brover { inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.bo { pointer-events: auto; text-align: center; width: min(560px, 92vw); background: rgba(14, 13, 11, 0.95); background-image: var(--grain); border: 1px solid var(--line2); box-shadow: var(--shadow); overflow: hidden; animation: popIn 0.3s ease; }
.bo-art { height: 130px; }
.bo-art > svg { width: 100%; height: 100%; display: block; }
.bo-in { padding: 16px 22px 20px; }
.bo h2 { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 10px; font: 700 30px var(--head); letter-spacing: 0.14em; text-transform: uppercase; }
.bo h2 .si { color: var(--acc2); }
.bo-stats { display: flex; justify-content: center; gap: 34px; margin: 6px 0 12px; }
.bo-stats b { display: block; font: 700 36px/1 var(--head); color: var(--acc2); }
.bo-stats small { font: 600 11px var(--head); letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.bo-tips { text-align: left; margin: 16px 0 0; padding-left: 18px; color: var(--ink2); font-size: 13px; line-height: 1.6; }
.bo .rt { font-weight: 700; }
.bo.drop { width: auto; padding: 16px 20px; }
.bo.drop canvas { width: min(480px, 80vw, 64vh); height: auto; aspect-ratio: 1; cursor: crosshair; border: 1px solid var(--line2); display: block; margin: 0 auto 6px; }
.cdn { color: var(--acc2); margin-left: 6px; }
.bo.end { padding: 26px; }
.bo-trophy .si { width: 64px; height: 64px; color: var(--dim); }
.bo.end.win .bo-trophy .si { color: var(--gold); filter: drop-shadow(0 0 20px rgba(242, 193, 78, 0.6)); }
.bo.end.win h2 { color: var(--gold); text-shadow: 0 0 22px rgba(242, 193, 78, 0.6); }
#score { left: 50%; top: 18%; transform: translateX(-50%); min-width: 330px; padding: 14px 18px; background: rgba(14, 13, 11, 0.95); border: 1px solid var(--line2); box-shadow: var(--shadow); }
#score h3 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font: 700 18px var(--head); letter-spacing: 0.12em; text-transform: uppercase; }
#score h3 small { margin-left: auto; }
#score div { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--line); }
#score div.me b { color: var(--acc2); }
#fps { right: calc(196px + var(--sar)); top: calc(12px + var(--sat)); font: 700 12px var(--head); color: #9f9; text-shadow: 0 1px 2px #000; }

/* notifications, bannières */
#toasts { position: fixed; left: 50%; top: calc(128px + var(--sat)); transform: translateX(-50%); z-index: 70; display: grid; gap: 6px; justify-items: center; pointer-events: none; width: min(580px, 92vw); }
.toast { display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 12px; background: linear-gradient(90deg, rgba(20, 18, 15, 0.95), rgba(20, 18, 15, 0.88)); border: 1px solid var(--line2); border-left: 3px solid var(--blue); font-size: 13.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); animation: tin 0.3s ease; transition: opacity 0.5s, transform 0.5s; }
.toast > .si { color: var(--blue); width: 17px; height: 17px; }
.toast.good { border-left-color: var(--ok); } .toast.good > .si { color: var(--ok); }
.toast.bad { border-left-color: var(--bad); } .toast.bad > .si { color: var(--bad); }
.toast.warn { border-left-color: var(--warn); } .toast.warn > .si { color: var(--warn); }
.toast.out { opacity: 0; transform: translateY(-8px); }
.banner { position: fixed; left: 50%; top: 24%; transform: translateX(-50%); z-index: 75; pointer-events: none; text-align: center; animation: bin 0.6s cubic-bezier(0.2, 1.3, 0.4, 1); transition: opacity 0.7s, transform 0.7s; width: 92vw; }
.banner .bt { display: inline-flex; align-items: center; gap: 14px; font: 700 52px/1.1 var(--head); letter-spacing: 0.22em; text-transform: uppercase; color: #fff; text-shadow: 0 0 30px rgba(224, 152, 47, 0.8), 0 4px 10px #000; padding: 4px 40px; background: linear-gradient(90deg, transparent, rgba(10, 9, 8, 0.55) 20%, rgba(10, 9, 8, 0.55) 80%, transparent); }
.banner .bt .si { width: 0.8em; height: 0.8em; }
.banner .bs { margin-top: 10px; font-size: 16px; color: #f4f4f4; text-shadow: 0 2px 6px #000; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.banner.quest .bt { color: var(--gold); }
.banner.reward .bt { color: #a9e08c; text-shadow: 0 0 30px rgba(126, 196, 94, 0.7), 0 4px 10px #000; }
.banner.raid .bt { color: #ff6b5b; text-shadow: 0 0 30px rgba(255, 60, 40, 0.9), 0 4px 10px #000; }
.banner.lvl .bt { color: var(--gold); }
.banner.out { opacity: 0; transform: translate(-50%, -20px); }

/* étiquettes 3D, chiffres de dégâts */
#labels, #nums { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; text-align: center; font: 600 12px var(--head); letter-spacing: 0.04em; text-shadow: 0 1px 2px #000, 0 0 4px #000; white-space: nowrap; will-change: transform; }
.lbl b { font-weight: 700; } .lbl .own { color: #8dffb0; } .lbl .foe { color: #ff9a8a; }
.lbl .alpha { color: #ff3a2a; font-size: 10px; border: 1px solid #ff3a2a; padding: 0 3px; border-radius: 2px; }
.lbl .tm { font-size: 11px; color: #ffc6e6; }
.hb { width: 56px; height: 4px; margin: 3px auto 0; background: rgba(0, 0, 0, 0.65); overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4); }
.hb i { display: block; height: 100%; background: #e2533f; }
.hb.ally i { background: #7ec45e; } .hb.tor i { background: #9a7aff; } .hb.tame i { background: #ff8ad0; }
.num { position: absolute; left: 0; top: 0; font: 700 18px var(--head); color: #fff; text-shadow: 0 2px 3px #000; will-change: transform; display: none; }
.num.head { color: #ff5a4a; font-size: 24px; } .num.tor { color: #b49aff; }
#vignette { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
#vignette.low { box-shadow: inset 0 0 170px rgba(170, 0, 0, 0.6); animation: pulse 1s infinite; }
#vignette.cold { box-shadow: inset 0 0 190px rgba(120, 200, 255, 0.45); }
#vignette.poison { box-shadow: inset 0 0 190px rgba(90, 200, 60, 0.4); }
#vignette.zone { box-shadow: inset 0 0 230px rgba(40, 120, 255, 0.65); }
#vignette.hit { animation: hitflash 0.35s; }
.dmgdir { position: fixed; left: 50%; top: 50%; width: 220px; height: 220px; pointer-events: none; z-index: 6; animation: fade 0.7s forwards; }
.dmgdir::before { content: ''; position: absolute; left: 50%; top: 0; width: 70px; height: 14px; margin-left: -35px; border-radius: 50%; background: radial-gradient(ellipse, rgba(255, 40, 30, 0.9), transparent 70%); }
#selbox { position: fixed; z-index: 8; border: 1.5px solid #4cff7a; background: rgba(76, 255, 122, 0.12); pointer-events: none; display: none; }

/* panneau bâtiment, vue stratégique */
#bpanel { right: calc(16px + var(--sar)); bottom: calc(96px + var(--sab)); width: 340px; padding: 12px; background: rgba(16, 15, 13, 0.95); background-image: var(--grain); border: 1px solid var(--line2); box-shadow: var(--shadow); }
.bph { display: flex; align-items: center; gap: 8px; font: 700 17px var(--head); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.bph b { flex: 1; }
.hpb { height: 7px; } .hpb > i { background: linear-gradient(90deg, #4c8a32, #8fd36a); }
.tlist { display: grid; gap: 6px; margin: 8px 0; }
.tr { display: grid; grid-template-columns: 34px 1fr; column-gap: 8px; text-align: left; padding: 8px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); color: var(--ink); }
.tr:hover { border-color: var(--acc); }
.tr .iic { grid-row: span 4; font-size: 26px; }
.tr.no { opacity: 0.55; }
.queue { display: flex; gap: 5px; margin: 6px 0; }
.qi { position: relative; width: 34px; height: 34px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 20px; overflow: hidden; }
.qi i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--gold); }
#rtsbar { left: 50%; bottom: calc(10px + var(--sab)); transform: translateX(-50%); width: min(1000px, 96vw); padding: 10px 12px; background: rgba(16, 15, 13, 0.95); background-image: var(--grain); border: 1px solid var(--line2); box-shadow: var(--shadow); display: grid; gap: 8px; }
.rres { display: flex; gap: 12px; flex-wrap: wrap; font: 700 15px var(--head); }
.rres span { display: inline-flex; align-items: center; gap: 4px; }
.rres .pop { margin-left: auto; color: var(--acc2); }
.rsel { display: flex; gap: 6px; flex-wrap: wrap; min-height: 26px; }
.su { padding: 4px 10px; background: rgba(126, 196, 94, 0.14); border: 1px solid rgba(126, 196, 94, 0.4); }
.racts { display: flex; gap: 6px; flex-wrap: wrap; }
.racts button { display: inline-flex; align-items: center; gap: 5px; padding: 8px 12px; border-radius: 3px; border: 1px solid var(--line2); background: linear-gradient(180deg, #34302b, #221f1b); font: 600 13px var(--head); letter-spacing: 0.06em; text-transform: uppercase; }
.racts button:hover { border-color: var(--acc); }
.racts button.primary { margin-left: auto; background: linear-gradient(180deg, #f4b553, #c77a1c); color: #1a1006; border-color: #ffd28a; }
/* la barre d'aide des touches occupe le bas de l'écran : la barre de commandement se place au-dessus */
body.rts:not(.nohints) #rtsbar { bottom: calc(38px + var(--sab)); }
body.rts #hotbar, body.rts #prompt, body.rts #tracker, body.rts #feed, body.rts #hotname, body.rts #ammo { display: none; }

/* ---------------------------------------------------------------- fenêtre à onglets */
#panel { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.74)); padding: calc(12px + var(--sat)) calc(12px + var(--sar)) calc(12px + var(--sab)) calc(12px + var(--sal)); }
.pwin { position: relative; width: min(1260px, 100%); height: min(790px, 100%); display: flex; flex-direction: column; background-color: #15130f; background-image: var(--grain), linear-gradient(180deg, #1d1a16, #121110); border: 1px solid var(--line2); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.pwin::before { content: ''; position: absolute; left: -1px; top: -1px; width: 20px; height: 20px; border-top: 2px solid var(--acc); border-left: 2px solid var(--acc); z-index: 2; pointer-events: none; }
.pwin::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 20px; height: 20px; border-bottom: 2px solid var(--acc); border-right: 2px solid var(--acc); pointer-events: none; }
#panel.pop .pwin { animation: popIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
.ptabs { display: flex; align-items: stretch; height: 54px; padding: 0 8px; background-image: var(--metal), linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.15)); border-bottom: 1px solid var(--line2); overflow-x: auto; flex-shrink: 0; }
.ptabs button { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 15px; border: none; background: none; color: var(--dim); font: 700 15px var(--head); letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; transition: color 0.15s, background 0.15s; }
.ptabs button .si { width: 19px; height: 19px; }
.ptabs button kbd { height: 18px; min-width: 18px; font-size: 10.5px; opacity: 0.75; margin-left: 2px; }
.ptabs button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.03); }
.ptabs button.on { color: #fff; background: linear-gradient(0deg, rgba(224, 152, 47, 0.12), transparent); }
.ptabs button.on .si { color: var(--acc2); }
.ptabs button.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; background: var(--acc); box-shadow: 0 0 12px var(--acc); }
.ptabs .pclose { margin-left: auto; color: var(--ink2); }
.ptabs .pclose .si { width: 20px; height: 20px; }
.pbody { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px; touch-action: pan-y; }
.pbody.t-inv, .pbody.t-craft { overflow: hidden; }
.pbody h4 { margin: 16px 0 8px; font: 700 14px var(--head); color: var(--acc2); letter-spacing: 0.14em; text-transform: uppercase; }

/* inventaire */
.inv2 { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; gap: 16px; height: 100%; }
.inv2 > section { min-height: 0; }
.inv-doll { display: flex; flex-direction: column; padding: 12px; background: rgba(0, 0, 0, 0.22); background-image: var(--cloth); border: 1px solid var(--line); }
.doll { flex: 1; min-height: 0; display: grid; grid-template-columns: 62px minmax(0, 1fr) 62px; gap: 6px; }
.doll-l, .doll-r { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.doll .pvbox { min-height: 240px; }
.dslot { position: relative; width: 62px; height: 62px; display: flex; align-items: center; justify-content: center; padding: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.22)); border: 1px solid var(--line2); border-radius: 3px; color: var(--dim2); transition: border-color 0.12s; }
.dslot > .si { width: 28px; height: 28px; opacity: 0.6; margin-bottom: 8px; }
.dslot small { position: absolute; bottom: 2px; left: 0; right: 0; text-align: center; font: 600 9px var(--head); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.dslot.full { border-color: var(--line3); background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.35)); }
.dslot.full small { display: none; }
.dslot[class*="r-"]::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: 0; height: 2px; background: var(--rc); }
.dslot:hover, .dslot.sel { border-color: var(--acc); }
.dl-pv { width: 62px; height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--dim2); border: 1px dashed var(--line); }
.dl-pv small { font: 600 9px var(--head); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.dl-pv.on { color: #ffe9a8; border-color: rgba(255, 233, 168, 0.4); }
.doll-st { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.dstat { display: grid; grid-template-columns: 18px 1fr; column-gap: 6px; padding: 5px 8px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); }
.dstat .si { grid-row: span 2; align-self: center; color: var(--acc2); }
.dstat span { font: 600 10px var(--head); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.dstat b { font: 700 13.5px var(--head); }
.inv-mid { display: flex; flex-direction: column; }
.inv-top { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px; }
.inv-f { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.fchip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 3px; color: var(--ink2); font: 600 12px var(--head); letter-spacing: 0.06em; text-transform: uppercase; }
.fchip small { color: var(--dim); font: 700 11px var(--head); }
.fchip span { display: none; }
.fchip.on span { display: inline; }
.fchip:hover { border-color: var(--line3); color: #fff; }
.fchip.on { background: var(--acc-a); border-color: var(--acc); color: var(--acc2); }
.isearch { display: flex; align-items: center; gap: 6px; padding: 0 10px; height: 30px; background: rgba(0, 0, 0, 0.38); border: 1px solid var(--line2); border-radius: 3px; color: var(--dim); width: 170px; flex-shrink: 0; }
.isearch:focus-within { border-color: var(--acc); }
.isearch input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--ink); font: 500 13px var(--font); user-select: text; -webkit-user-select: text; }
.igrid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; align-content: start; padding: 2px 4px 2px 2px; }
.igrid .empty, .igrid .ifnote { grid-column: 1 / -1; }
.ifnote { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink2); padding: 2px 0 4px; }
.tile { position: relative; height: 98px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 4px 5px; background: radial-gradient(circle at 50% 40%, rgba(130, 118, 98, 0.2), transparent 62%), linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.26)); border: 1px solid var(--line); border-radius: 3px; color: var(--ink); transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s; }
.tile[class*="r-"] { background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc) 18%, transparent), transparent 70%), linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.26)); }
.tile[class*="r-"]::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: 0; height: 2px; background: var(--rc); opacity: 0.85; }
.tile:hover { border-color: var(--line3); transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35); }
.tile.on { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc), 0 0 18px rgba(224, 152, 47, 0.25); }
.tile .tqty { position: absolute; right: 6px; top: 4px; font: 700 13px var(--head); text-shadow: 0 1px 2px #000; }
.tile .thk { position: absolute; left: 5px; top: 5px; min-width: 16px; height: 16px; font: 700 10px/16px var(--head); text-align: center; color: #1a1006; background: var(--acc2); font-style: normal; }
.tile em { font-style: normal; font-size: 10.5px; line-height: 1.15; color: var(--ink2); text-align: center; max-height: 24px; overflow: hidden; margin-top: 3px; }
.inv-hot { margin-top: 10px; padding-top: 2px; }
.inv-hot .sec-h { margin-bottom: 8px; }
.hbar { display: flex; gap: 6px; flex-wrap: wrap; }
.hbar .hs { width: 58px; height: 58px; }
.inv-det { overflow-y: auto; padding-right: 2px; }
.det { display: flex; flex-direction: column; gap: 8px; }
.det-ic { height: 150px; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--rc, #e0982f) 22%, transparent), transparent 66%), rgba(0, 0, 0, 0.28); border: 1px solid var(--line); }
.det-n { font: 700 24px/1.1 var(--head); letter-spacing: 0.04em; }
.det-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.det-d { margin: 0; color: var(--ink2); font-size: 13px; line-height: 1.5; }
.det-a { display: flex; gap: 6px; flex-wrap: wrap; }
.det-a .big { flex: 1; padding: 10px 14px; }
.det-hot { padding-top: 8px; border-top: 1px solid var(--line); }
.det-hot > div { display: flex; gap: 4px; margin-top: 5px; }
.hset { flex: 1; height: 30px; padding: 0; background: rgba(0, 0, 0, 0.38); border: 1px solid var(--line2); border-radius: 2px; font: 700 13px var(--head); color: var(--ink2); }
.hset:hover { border-color: var(--acc); color: #fff; }
.hset.on { background: var(--acc); color: #1a1006; border-color: var(--acc2); }
.det-empty { text-align: center; color: var(--dim); padding: 30px 10px; }
.det-empty > .si { width: 46px; height: 46px; opacity: 0.35; }
body.dnd [data-hslot] { outline: 1px dashed rgba(224, 152, 47, 0.55); outline-offset: 2px; }
[data-hslot].dover { border-color: var(--acc2) !important; box-shadow: 0 0 0 2px var(--acc), 0 0 18px rgba(224, 152, 47, 0.5) !important; }
body.dnd, body.dnd * { cursor: grabbing !important; }

/* fabrication */
.craft2 { display: grid; grid-template-columns: 210px minmax(0, 1fr) 370px; gap: 16px; height: 100%; }
.craft2 > section, .craft2 > aside { min-height: 0; }
.cr-cats { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.ccat { display: grid; grid-template-columns: 26px 1fr auto auto; align-items: center; gap: 8px; padding: 10px; text-align: left; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-left: 3px solid transparent; color: var(--ink2); transition: background 0.12s, border-color 0.12s, color 0.12s; }
.ccat > .si { width: 22px; height: 22px; }
.ccat span { display: flex; flex-direction: column; font: 700 14px var(--head); letter-spacing: 0.08em; text-transform: uppercase; }
.ccat span small { font: 500 11px var(--font); letter-spacing: 0; text-transform: none; color: var(--dim); }
.ccat .st { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 6px var(--bad); }
.ccat .st.ok { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.ccat .cnt { min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ok); color: #0c1a06; font: 700 11px/18px var(--head); text-align: center; }
.ccat:hover { border-color: var(--line3); color: #fff; }
.ccat.on { border-left-color: var(--acc); background: linear-gradient(90deg, rgba(224, 152, 47, 0.16), rgba(224, 152, 47, 0.02)); color: #fff; }
.ccat.on > .si { color: var(--acc2); }
.cr-list { display: flex; flex-direction: column; }
.rlist { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 4px; }
.rrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 5px 10px 5px 6px; text-align: left; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-left: 3px solid transparent; color: var(--ink); transition: border-color 0.12s, background 0.12s; }
.rrow .rn { display: flex; flex-direction: column; min-width: 0; }
.rrow .rn b { font: 700 14.5px var(--head); letter-spacing: 0.03em; }
.rrow .rn small { font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrow .rn small i { font-style: normal; }
.rrow .rn small i.ok { color: #a9e08c; } .rrow .rn small i.no { color: #ff9f8f; }
.rrow .rt2 { display: flex; align-items: center; gap: 4px; font: 600 12px var(--head); color: var(--dim); }
.rrow.can { border-left-color: var(--ok); }
.rrow.locked { opacity: 0.45; }
.rrow:hover { border-color: var(--line3); }
.rrow.on { border-color: var(--acc); border-left-color: var(--acc); background: linear-gradient(90deg, rgba(224, 152, 47, 0.18), rgba(224, 152, 47, 0.03)); }
.cr-sheet { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; padding-right: 4px; }
.sheet { padding: 14px; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line2); }
.sh-top { display: flex; gap: 12px; align-items: flex-start; }
.sh-ic { width: 116px; height: 116px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--rc, #e0982f) 24%, transparent), transparent 68%), rgba(0, 0, 0, 0.3); border: 1px solid var(--line); }
.sh-tx { min-width: 0; }
.sh-n { font: 700 22px/1.1 var(--head); margin-bottom: 6px; }
.sh-n small { color: var(--acc2); font-size: 16px; }
.sheet .det-d { margin-top: 8px; }
.ings { display: flex; flex-direction: column; gap: 4px; }
.ing { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 8px; padding: 2px 10px 2px 3px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.ing span { font-size: 13px; }
.ing span small { color: var(--dim); }
.ing b { font: 700 15px var(--head); }
.ing b i { font-style: normal; color: var(--dim); font-weight: 600; }
.ing.ok b { color: #a9e08c; }
.ing.no { border-color: rgba(226, 83, 63, 0.35); background: rgba(226, 83, 63, 0.07); }
.ing.no b { color: #ff9f8f; }
.sh-qty { display: flex; align-items: center; gap: 6px; margin: 14px 0 10px; flex-wrap: wrap; }
.sh-qty > span:first-child { font: 600 12px var(--head); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin-right: 4px; }
.sh-qty > b { min-width: 34px; text-align: center; font: 700 20px var(--head); }
.sh-tot { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--dim); }
.qbtn { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(180deg, #3b3731, #26231f); border: 1px solid var(--line3); border-radius: 3px; color: var(--ink); }
.qbtn:hover:not([disabled]) { border-color: var(--acc); color: #fff; }
.qbtn[disabled] { opacity: 0.35; cursor: default; }
.sh-why { display: flex; align-items: center; gap: 6px; padding: 8px 10px; margin-bottom: 10px; background: rgba(226, 83, 63, 0.1); border: 1px solid rgba(226, 83, 63, 0.35); color: #ffb3a6; font-size: 12.5px; }
/* file de fabrication : reste visible en bas de la colonne pendant qu'on fait défiler la fiche */
.cr-queue { position: sticky; bottom: 0; z-index: 1; margin-top: auto; max-height: 48%; overflow-y: auto; padding: 12px; background: #17140f; background-image: var(--grain); border: 1px solid var(--line2); box-shadow: 0 -12px 22px rgba(0, 0, 0, 0.5); }
.cr-queue .cqe .ico { width: 36px; height: 36px; }

/* construction */
.build2 { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.bhelp { margin-top: 12px; padding: 10px 12px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); font-size: 12px; color: var(--ink2); line-height: 1.55; }
.bhelp p { margin: 6px 0; }
.bhelp kbd { height: 18px; min-width: 18px; font-size: 10.5px; }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 10px; align-content: start; }
.bcard { display: flex; flex-direction: column; gap: 6px; padding: 10px; text-align: left; background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(0, 0, 0, 0.24)); border: 1px solid var(--line); border-radius: 3px; color: var(--ink); transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.bcard:hover:not([disabled]) { border-color: var(--acc); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45); }
.bcard.can { border-bottom: 2px solid var(--ok); }
.bcard.locked { opacity: 0.45; cursor: default; }
.bc-ic { position: relative; height: 100px; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 72%, rgba(224, 152, 47, 0.13), transparent 70%), rgba(0, 0, 0, 0.26); }
.newb { position: absolute; top: 6px; left: 6px; padding: 1px 6px; background: var(--acc); color: #1a1006; font: 700 10px var(--head); letter-spacing: 0.12em; text-transform: uppercase; }
.lockb { position: absolute; top: 6px; right: 6px; display: flex; gap: 3px; align-items: center; padding: 1px 6px; background: rgba(0, 0, 0, 0.65); font: 700 11px var(--head); color: #ffb3a6; }
.bc-n { font: 700 15px var(--head); letter-spacing: 0.03em; }
.bc-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.bc-d { font-size: 11.5px; color: var(--dim); line-height: 1.4; min-height: 16px; }

/* personnage */
.char2 { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; }
.ch-id { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.ch-av { width: 92px; height: 92px; min-height: 0; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, #3a352e, #15130f 75%); border: 1px solid var(--line3); box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6); color: var(--acc2); }
.ch-av .pv-canvas { cursor: default; }
.cname { font: 700 28px var(--head); letter-spacing: 0.04em; }
.big-lvl { display: flex; gap: 12px; align-items: center; margin: 6px 0 12px; }
.big-lvl > div { flex: 1; display: grid; gap: 4px; }
.big-lvl b { font: 700 16px var(--head); letter-spacing: 0.06em; text-transform: uppercase; }
.big-lvl .lvlb { width: 48px; height: 48px; font-size: 20px; }
.bar.xp > i { background: linear-gradient(90deg, var(--accd), var(--gold)); }
.cstats { width: 100%; border-collapse: collapse; }
.cstats td { padding: 6px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.cstats td:first-child { color: var(--ink2); }
.cstats td:first-child .si { color: var(--acc2); margin-right: 6px; }
.cstats td:last-child { text-align: right; font: 700 15px var(--head); }
.statrow { display: grid; grid-template-columns: 30px minmax(0, 1fr) 40px 32px; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); margin-bottom: 5px; }
.statrow .sic { font-size: 20px; display: flex; align-items: center; justify-content: center; color: var(--acc2); }
.statrow .sic .si { width: 22px; height: 22px; }
.statrow.s-sante .sic { color: #ef6a55; } .statrow.s-endurance .sic { color: #d6dc7a; } .statrow.s-agilite .sic { color: #7ec0ff; } .statrow.s-metabolisme .sic { color: #e8a85a; }
.statrow span b { font: 700 15px var(--head); }
.statrow span small { display: block; font-size: 11.5px; color: var(--dim); }
.statrow .sv { font: 700 22px var(--head); text-align: center; color: var(--acc2); }
.fxrow { display: grid; grid-template-columns: 28px 1fr; gap: 8px; padding: 6px 10px; background: rgba(126, 196, 94, 0.07); border: 1px solid rgba(126, 196, 94, 0.18); margin-bottom: 4px; font-size: 13px; }
.fxrow.bad { background: rgba(226, 83, 63, 0.08); border-color: rgba(226, 83, 63, 0.25); }
.fxrow .fxi { font-size: 18px; display: flex; align-items: center; justify-content: center; color: #a9e08c; }
.fxrow .fxi .si { width: 20px; height: 20px; }
.fxrow.bad .fxi { color: #ff8f7d; }
.fxrow small { display: block; color: var(--dim); }
.badge { margin-left: 8px; font: 700 11px var(--head); padding: 2px 8px; background: var(--gold); color: #1a1006; letter-spacing: 0.08em; animation: pulse 1.5s infinite; }
.tipline { margin-top: 14px; line-height: 1.55; }

/* quêtes */
.qmain { padding: 18px; margin-bottom: 18px; background: linear-gradient(135deg, rgba(224, 152, 47, 0.14), rgba(0, 0, 0, 0.25)); border: 1px solid rgba(224, 152, 47, 0.42); }
.qmain.ready { border-color: var(--ok); background: linear-gradient(135deg, rgba(126, 196, 94, 0.16), rgba(0, 0, 0, 0.25)); }
.qchain { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px; font: 600 12px var(--head); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-bottom: 12px; }
.qchain .bar { flex-basis: 100%; height: 4px; }
.qhead { display: flex; gap: 16px; align-items: center; }
.qic { font-size: 50px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5)); }
.qt { font: 700 28px var(--head); letter-spacing: 0.06em; text-transform: uppercase; }
.qd { color: #d6dde3; font-size: 13.5px; line-height: 1.5; font-style: italic; }
.qobj { display: grid; gap: 8px; margin: 14px 0; }
.qo { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 12px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); }
.qo span { display: flex; align-items: center; gap: 4px; }
.qo .bar { grid-column: span 2; height: 4px; }
.qo.done { color: var(--ok); }
.qo.done .bar > i { background: var(--ok); }
.qrw { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.glowbtn { animation: glow 1.2s infinite alternate; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.rc { display: flex; flex-direction: column; gap: 6px; padding: 12px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); text-align: left; }
.rc.can { border-color: rgba(126, 196, 94, 0.5); }
.rh { display: flex; gap: 10px; align-items: center; }
.rh .iic { font-size: 30px; }
.rh b { font: 700 15px var(--head); letter-spacing: 0.04em; }
.rs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.rdesc { font-size: 12px; color: var(--dim); line-height: 1.4; }
.rbtn { display: flex; gap: 6px; margin-top: auto; }

/* camp, carte */
.urow { display: grid; grid-template-columns: 1fr 140px 50px; gap: 10px; align-items: center; padding: 6px 10px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); margin-bottom: 4px; }
.clan2 p { line-height: 1.5; }
.mapwrap { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 18px; align-items: start; }
#bigmap { width: min(100%, 68vh); display: block; margin: 0 auto; aspect-ratio: 1; height: auto; border: 1px solid var(--line2); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.maplg { padding: 12px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink2); display: grid; gap: 8px; }
.maplg h4 { margin: 0 0 4px !important; }
.lg { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: middle; }
.lg.own { background: #f08a24; } .lg.foe { background: rgba(255, 90, 70, 0.7); border-radius: 50%; } .lg.zone { border: 2px solid #3aa0ff; border-radius: 50%; }

/* ---------------------------------------------------------------- infobulle, glisser-déposer */
#tip { position: fixed; left: 0; top: 0; z-index: 90; max-width: 300px; padding: 10px 12px; background: rgba(16, 15, 13, 0.97); border: 1px solid var(--line3); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.65); pointer-events: none; opacity: 0; transition: opacity 0.12s; font-size: 12.5px; }
#tip.show { opacity: 1; }
.tip-h { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line2); }
.tip-h[class*="r-"] { border-bottom-color: var(--rc); }
.tip-h b { display: block; font: 700 16px var(--head); letter-spacing: 0.03em; }
.tip-h small { color: var(--dim); }
#tip p { margin: 0 0 6px; color: var(--ink2); line-height: 1.45; }
.tip-t { color: var(--ink); }
.tip-k { margin-top: 6px; font-size: 11px; color: var(--acc2); }
#dragghost { position: fixed; left: 0; top: 0; z-index: 95; width: 64px; height: 64px; display: none; align-items: center; justify-content: center; pointer-events: none; background: rgba(20, 18, 15, 0.86); border: 1px solid var(--acc); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.6), 0 0 18px rgba(224, 152, 47, 0.35); }
#dragghost.show { display: flex; }

/* ---------------------------------------------------------------- commandes tactiles */
#touch { position: fixed; inset: 0; z-index: 9; display: none; pointer-events: none; }
#touch.on { display: block; }
#tarea { position: absolute; inset: 0; pointer-events: auto; }
#tjoy { position: absolute; width: 124px; height: 124px; margin: -62px 0 0 -62px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.3); background: radial-gradient(circle, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.12)); display: none; pointer-events: none; }
#tknob { position: absolute; left: 36px; top: 36px; width: 52px; height: 52px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.35)); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35); }
/* 1re colonne (à droite, sens rtl) à la taille du gros bouton « Frapper / tirer » : il ne chevauche plus « Viser » */
.tcol { position: absolute; right: calc(14px + var(--sar)); bottom: calc(76px + var(--sab)); display: grid; grid-template-columns: 76px repeat(2, 58px); gap: 8px; justify-content: end; justify-items: center; align-items: center; pointer-events: none; direction: rtl; }
.tb { pointer-events: auto; width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.3); background: rgba(12, 11, 10, 0.5); font: 700 22px var(--head); color: #fff; direction: ltr; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); }
.tb .si { width: 26px; height: 26px; }
.tb.big { width: 76px; height: 76px; background: radial-gradient(circle at 40% 35%, rgba(255, 196, 106, 0.55), rgba(224, 152, 47, 0.35)); border-color: var(--acc); }
.tb.big .si { width: 34px; height: 34px; }
.tb.down, .tb.act { background: rgba(224, 152, 47, 0.6); border-color: var(--acc2); }
.tb.glow { box-shadow: 0 0 16px var(--ok); border-color: var(--ok); }
.trow { position: absolute; left: 50%; top: calc(8px + var(--sat)); transform: translateX(-50%); display: flex; gap: 5px; pointer-events: none; }
.trow button { pointer-events: auto; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(12, 11, 10, 0.6); color: var(--ink); }
.trow button .si { width: 20px; height: 20px; }
body:has(#touch.on) #compass { top: calc(54px + var(--sat)); }
body:has(#touch.on) #clock, body:has(#touch.on) #brbar { top: calc(114px + var(--sat)); }
body:has(#touch.on) #roomcode { top: calc(142px + var(--sat)); }
body:has(#touch.on) #toasts { top: calc(160px + var(--sat)); }
body:has(#touch.on) #hotbar { bottom: calc(8px + var(--sab)); }
body:has(#touch.on) .hs { width: 48px; height: 48px; }
body:has(#touch.on) .hs .ico { width: 34px !important; height: 34px !important; }
body:has(#touch.on) #crosshair i { width: 7px; height: 7px; left: -3.5px; top: -3.5px; }
body:has(#touch.on) #ammo, body:has(#touch.on) #vehhud { bottom: auto; top: calc(214px + var(--sat)); right: calc(16px + var(--sar)); }
body:has(#touch.on) #cqhud { display: none; }
/* tactile : le suivi de quêtes ne garde que la quête principale (les boutons d'action occupent la droite) */
body:has(#touch.on) #tracker .tq.ct { display: none; }
body:has(#touch.on) .ptabs kbd, body:has(#touch.on) .tip-k { display: none; }
body:has(#touch.on) .ptabs button { padding: 0 11px; }
body.rts #touch .tcol { display: none; }

/* ---------------------------------------------------------------- écrans moyens */
@media (max-width: 1180px) {
  .inv2 { grid-template-columns: 260px minmax(0, 1fr); grid-template-rows: auto auto; height: auto; }
  .inv-det { grid-column: 1 / -1; }
  .pbody.t-inv, .pbody.t-craft { overflow-y: auto; }
  .igrid { max-height: 46vh; }
  .craft2 { grid-template-columns: 190px minmax(0, 1fr); height: auto; }
  .cr-sheet { grid-column: 1 / -1; overflow: visible; }
  .rlist { max-height: 48vh; }
  .fchip span { display: none; }
}
@media (max-width: 980px) {
  .mshell { grid-template-columns: 230px minmax(0, 1fr); }
  .mlogo b { font-size: 50px; }
  .mni { font-size: 16px; padding: 10px 10px; }
  .modes, .mgrid2 { grid-template-columns: 1fr; }
  .cc, .mshell.wide .cc { grid-template-columns: 1fr; }
  .mshell.wide { grid-template-columns: 230px minmax(0, 1fr); }
  .cc-view { position: static; order: -1; }
  .pvbox.pv-lg { height: 44vh; }
  .build2, .char2, .mapwrap { grid-template-columns: 1fr; }
  #vitals { width: 230px; }
}

/* ---------------------------------------------------------------- écrans peu hauts (portables 720p) */
@media (max-height: 800px) and (min-width: 761px) {
  .mlogo { margin-bottom: 26px; }
  .mpane { padding-top: 26px; }
  .mph { margin-bottom: 12px; padding-bottom: 10px; }
  .mph h1 { font-size: 36px; }
  .mart { height: 116px; }
  .mtx { padding: 10px 14px 12px; }
  .mtx p { margin: 4px 0 8px; }
  .mopts { margin-top: 10px; }
  .mopts .srow { padding: 7px 0; }
  .sh-ic { width: 92px; height: 92px; }
}

/* ---------------------------------------------------------------- téléphones (portrait étroit) */
@media (max-width: 760px) {
  .mshell, .mshell.wide { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .pvbox.pv-lg { height: 46vh; }
  .mnav { padding: 14px 14px 8px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; border-right: none; border-bottom: 1px solid var(--line); }
  .mlogo { margin: 0 12px 0 0; }
  .mlogo b { font-size: 34px; } .mlogo span { font-size: 11px; } .mlogo small { display: none; }
  .mlist { flex-direction: row; flex-wrap: wrap; }
  .mni { font-size: 13px; padding: 8px; letter-spacing: 0.08em; }
  .mni:hover { padding-left: 8px; }
  .mfoot { display: none; }
  .mpane { padding: 16px 14px; }
  .macts { bottom: -16px; margin: 12px -14px -16px; padding: 12px 14px 14px; }
  .mph h1 { font-size: 30px; }
  /* minmax(0, …) : l'aperçu 3D du personnage (largeur en px) n'élargit plus la colonne au-delà de l'écran */
  .inv2, .craft2 { grid-template-columns: minmax(0, 1fr); }
  .doll .pvbox { min-height: 200px; }
  .ptabs button span { display: none; }
  .ptabs button kbd { display: none; }
  .ptabs button { padding: 0 12px; }
  .ptabs button .si { width: 22px; height: 22px; }
  .srow { flex-direction: column; align-items: flex-start; }
  .sctl { justify-content: flex-start; }
  .ctl { grid-template-columns: 1fr; }
  #tracker { width: 200px; }
  #tracker .to { font-size: 11px; }
  #vitals { width: 190px; }
  .mmring { width: 112px; height: 112px; padding: 4px; }
  #killfeed, #tracker { top: calc(150px + var(--sat)); }
  #compass { width: min(300px, 60vw); }
  #feed { bottom: calc(150px + var(--sab)); }
  #fps { right: calc(140px + var(--sar)); }
}

/* ---------------------------------------------------------------- téléphones en paysage (petite hauteur) */
@media (max-height: 520px) {
  #vitals { width: 200px; gap: 4px; padding: 6px 8px; }
  .lvlb { width: 32px; height: 32px; font-size: 14px; }
  .vbar.hp .bar { height: 10px; }
  .vbar > b { font-size: 12px; }
  .vrow { display: none; }
  .mmring { width: 96px; height: 96px; padding: 3px; }
  #coords { display: none; }
  #killfeed, #tracker { top: calc(112px + var(--sat)); }
  #tracker { width: 190px; gap: 4px; }
  .tq { padding: 5px 8px; } .tt { font-size: 12.5px; } .to { font-size: 11px; }
  .tq.ct { display: none; }
  #compass { height: 34px; } #compass .cwin { height: 30px; } .cmarks, .cdeg { display: none; }
  #clock, #brbar { top: calc(36px + var(--sat)); }
  .hs { width: 44px; height: 44px; }
  .hs .ico { width: 30px !important; height: 30px !important; }
  /* nom de l'objet : juste au-dessus de la barre d'objets (40 + 56 px avec l'aide des touches ; 88 px sans, règle body.nohints) */
  #hotname { bottom: calc(100px + var(--sab)); font-size: 12px; }
  #feed { bottom: calc(64px + var(--sab)); width: 300px; } .fl { font-size: 11.5px; padding: 2px 7px; }
  /* consigne d'interaction ancrée par le bas, au-dessus du nom de l'objet : elle ne recouvre plus la barre d'objets
     (coûts et action secondaire regroupés sur une ligne compacte, plus bas) */
  #prompt { top: auto; bottom: calc(122px + var(--sab)); }
  body.nohints #prompt { bottom: calc(110px + var(--sab)); }
  /* tactile : centrée dans l'espace libre à gauche des boutons d'action (286 px à droite), sans les recouvrir */
  body:has(#touch.on) #prompt { left: calc((100vw - 286px - var(--sar)) / 2); max-width: calc(100vw - 302px - var(--sar)); }
  .pr-main { font-size: 13.5px; padding: 5px 12px 5px 6px; }
  /* au-dessus de la barre d'objets (48 px + marges) pour ne jamais chevaucher la case 8 */
  .tcol { grid-template-columns: 60px repeat(4, 48px); gap: 6px; bottom: calc(74px + var(--sab)); right: calc(10px + var(--sar)); }
  .tb { width: 48px; height: 48px; font-size: 17px; } .tb .si { width: 22px; height: 22px; }
  .tb.big { width: 60px; height: 60px; }
  .trow { gap: 3px; } .trow button { width: 34px; height: 34px; } .trow button .si { width: 17px; height: 17px; }
  body:has(#touch.on) #compass { top: calc(44px + var(--sat)); }
  /* vitalité sous la rangée de boutons du haut (les boutons Inventaire et Fabrication cachaient la valeur de santé) */
  body:has(#touch.on) #vitals { top: calc(48px + var(--sat)); }
  body:has(#touch.on) #clock, body:has(#touch.on) #brbar { top: calc(78px + var(--sat)); font-size: 12px; }
  body:has(#touch.on) #tracker { top: calc(112px + var(--sat)); }
  /* place comptée au-dessus des boutons d'action : objectifs terminés masqués, 3 au plus */
  body:has(#touch.on) #tracker .to.done, body:has(#touch.on) #tracker .to:nth-child(n+5) { display: none; }
  body:has(#touch.on) #feed { display: none; }
  body:has(#touch.on) #ammo, body:has(#touch.on) #vehhud { top: calc(124px + var(--sat)); }
  #vehhud { transform: scale(0.75); transform-origin: right bottom; }
  .banner .bt { font-size: 28px; } .banner { top: 18%; }
  .pwin { height: 100%; } .pbody { padding: 10px; }
  .ptabs { height: 44px; }
  #bpanel { width: 290px; bottom: calc(60px + var(--sab)); max-height: 70vh; overflow-y: auto; }
  #rtsbar { padding: 6px 8px; gap: 4px; } .racts button { padding: 5px 8px; font-size: 12px; }
  #dead .dt { font-size: 38px; }
  .mlogo { margin-bottom: 14px; } .mlogo b { font-size: 40px; }
  .mni { padding: 7px 12px; font-size: 15px; }
  .mpane { padding: 18px 20px; }
  .macts { bottom: -18px; margin: 12px -20px -18px; padding: 12px 20px 14px; }
  .mart { height: 96px; }
  .sl-c { font-size: 40px; }
}

/* ---------------------------------------------------------------- consigne d'interaction compacte (petite hauteur, portrait) */
/* puces de coût et ligne « Réservoir… » sur une seule ligne : environ 60 px de haut au lieu de 106 */
@media (max-height: 520px), (max-width: 480px) {
  .pr-main kbd { height: 22px; min-width: 22px; font-size: 12.5px; }
  .pr-sub { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 6px; max-width: calc(100vw - 24px); }
  #prompt .pc { gap: 3px; }
  #prompt .cost { font-size: 11px; padding: 1px 5px 1px 2px; }
  #prompt .cost .ico { width: 16px !important; height: 16px !important; font-size: 10px !important; }
  .pr-alt { padding: 2px 10px 2px 4px; font-size: 12px; }
  .pr-alt kbd { height: 20px; min-width: 20px; font-size: 11.5px; }
}

/* ---------------------------------------------------------------- écrans de 521 à 600 px de haut */
/* à 61 % du haut, une consigne avec coûts et action secondaire descendait encore sur la barre d'objets */
@media (max-height: 600px) and (min-height: 521px) {
  #prompt { top: auto; bottom: calc(136px + var(--sab)); }
  body.nohints #prompt { bottom: calc(110px + var(--sab)); }
}

/* ---------------------------------------------------------------- téléphones en portrait (moins de 480 px de large) */
/* vérifié en 375 × 812, 360 × 740 et 320 × 568 : tous les boutons et les 8 cases dans l'écran, rien sur la mini-carte */
@media (max-width: 480px) {
  /* barre d'objets : cases de 40 px (8 × 40 + 7 × 4 + 8 = 356 px), plus petites si l'écran est encore plus étroit */
  #hotbar { gap: 4px; padding: 4px; }
  #hotbar .hs, body:has(#touch.on) #hotbar .hs { width: min(40px, calc((100vw - 52px) / 8)); height: min(40px, calc((100vw - 52px) / 8)); }
  #hotbar .hs .ico, body:has(#touch.on) #hotbar .hs .ico { width: 28px !important; height: 28px !important; }
  #hotbar .hs .ico.emo { font-size: 18px !important; }
  #hotbar .hs .hk { left: 3px; top: 1px; font-size: 10px; }
  #hotbar .hs .hn { right: 3px; bottom: 1px; font-size: 11px; }
  #hotbar .hs.on { transform: translateY(-3px); }
  /* rangée du haut (tactile) : les 11 boutons sur une seule ligne, dans l'écran ; Pause reste au bout, à droite */
  .trow { left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); transform: none; justify-content: center; gap: 3px; }
  .trow button { flex: 0 1 36px; min-width: 0; width: auto; height: 34px; }
  .trow button .si { width: 18px; height: 18px; }
  /* sous la rangée : boussole, horloge, code de partie, puis vitalité à gauche et mini-carte à droite */
  body:has(#touch.on) #compass { top: calc(46px + var(--sat)); width: calc(100vw - 32px - var(--sal) - var(--sar)); }
  body:has(#touch.on) #clock, body:has(#touch.on) #brbar { top: calc(106px + var(--sat)); }
  body:has(#touch.on) #brbar { max-width: calc(100vw - 16px); flex-wrap: wrap; justify-content: center; }
  body:has(#touch.on) #roomcode { top: calc(136px + var(--sat)); }
  body:has(#touch.on) #vitals, body:has(#touch.on) #mapbox { top: calc(160px + var(--sat)); }
  .mmring { width: 104px; height: 104px; }
  /* suivi des quêtes sous la mini-carte, à droite du viseur ; 3 objectifs au plus, terminés masqués */
  body:has(#touch.on) #killfeed, body:has(#touch.on) #tracker { top: calc(306px + var(--sat)); }
  body:has(#touch.on) #killfeed:not(:empty) + #tracker { top: calc(400px + var(--sat)); }
  body:has(#touch.on) #tracker { width: 160px; gap: 4px; }
  body:has(#touch.on) #tracker .tq { padding: 5px 8px; }
  body:has(#touch.on) #tracker .tt { font-size: 12px; }
  body:has(#touch.on) #tracker .to.done, body:has(#touch.on) #tracker .to:nth-child(n+5) { display: none; }
  /* notifications sur la bande boussole / horloge (passagères), jamais sur la mini-carte */
  body:has(#touch.on) #toasts { top: calc(46px + var(--sat)); }
  body:has(#touch.on) #toasts .toast:nth-last-child(n+3) { display: none; }   /* les 2 plus récentes seulement */
  .toast { font-size: 12.5px; padding: 7px 12px 7px 10px; }
  /* munitions et compteur du véhicule : sous la vitalité, à gauche */
  body:has(#touch.on) #ammo { top: calc(306px + var(--sat)); bottom: auto; left: calc(16px + var(--sal)); right: auto; text-align: left; }
  body:has(#touch.on) #ammo .am-row { justify-content: flex-start; }
  body:has(#touch.on) .am-m { font-size: 34px; }
  body:has(#touch.on) #vehhud { top: calc(306px + var(--sat)); bottom: auto; left: calc(8px + var(--sal)); right: auto; transform: scale(0.7); transform-origin: left top; }
  /* boutons d'action un peu plus petits : la consigne d'interaction tient entre le viseur et les boutons */
  .tcol { grid-template-columns: 62px repeat(2, 50px); gap: 6px; bottom: calc(62px + var(--sab)); right: calc(10px + var(--sar)); }
  .tb { width: 50px; height: 50px; font-size: 19px; } .tb .si { width: 23px; height: 23px; }
  .tb.big { width: 62px; height: 62px; } .tb.big .si { width: 30px; height: 30px; }
  body:has(#touch.on) #prompt { top: calc(50% + 18px); bottom: auto; left: 50%; max-width: calc(100vw - 24px); }
  .pr-main { white-space: normal; max-width: calc(100vw - 24px); font-size: 14px; padding: 5px 12px 5px 6px; }
  /* nom de l'objet : en bas à gauche, au-dessus de la barre (le centre est pris par les boutons d'action) */
  body:has(#touch.on) #hotname { bottom: calc(60px + var(--sab)); left: calc(12px + var(--sal)); transform: none; font-size: 12px; letter-spacing: 0.1em; }
  /* onglets de la fenêtre (7 + Fermer) : tiennent dans la largeur, le bouton Fermer n'est plus coupé */
  .ptabs { padding: 0 4px; }
  .ptabs button, body:has(#touch.on) .ptabs button { padding: 0 clamp(4px, calc((100vw - 230px) / 16), 10px); }
  /* grands titres ramenés à la largeur de l'écran */
  .banner { top: 30%; } .banner .bt { font-size: 24px; letter-spacing: 0.12em; padding: 4px 14px; gap: 8px; } .banner .bs { font-size: 13px; }
  #dead .dt { font-size: 34px; letter-spacing: 0.16em; }
}
/* portrait moins haut (360 × 740…) : boutons d'action encore un peu réduits, pour laisser la consigne sous le viseur */
@media (max-width: 480px) and (max-height: 780px) {
  .tcol { grid-template-columns: 56px repeat(2, 46px); gap: 5px; bottom: calc(58px + var(--sab)); }
  .tb { width: 46px; height: 46px; font-size: 18px; } .tb .si { width: 21px; height: 21px; }
  .tb.big { width: 56px; height: 56px; } .tb.big .si { width: 27px; height: 27px; }
}
/* très petit portrait (360 × 640, 320 × 568) : boussole compacte, tout remonte, suivi des quêtes réduit */
@media (max-width: 480px) and (max-height: 680px) {
  body:has(#touch.on) #compass { height: 34px; } body:has(#touch.on) #compass .cwin { height: 30px; }
  body:has(#touch.on) #compass .cmarks, body:has(#touch.on) #compass .cdeg { display: none; }
  body:has(#touch.on) #clock, body:has(#touch.on) #brbar { top: calc(80px + var(--sat)); font-size: 12px; }
  body:has(#touch.on) #roomcode { top: calc(108px + var(--sat)); }
  body:has(#touch.on) #vitals, body:has(#touch.on) #mapbox { top: calc(128px + var(--sat)); }
  body:has(#touch.on) .vrow { display: none; }
  body:has(#touch.on) #killfeed, body:has(#touch.on) #tracker, body:has(#touch.on) #ammo, body:has(#touch.on) #vehhud { top: calc(244px + var(--sat)); }
  body:has(#touch.on) #tracker { width: 136px; }
  body:has(#touch.on) #tracker .to:nth-child(n+4) { display: none; }
}
@media (max-width: 480px) and (max-height: 600px) {
  body:has(#touch.on) #tracker .to { display: none; }   /* titre de la quête seulement (objectifs : bouton Quêtes) */
}
@media (max-width: 340px) {
  #vitals { width: 172px; }
  .mmring { width: 96px; height: 96px; }
}

/* ---------------------------------------------------------------- animations */
@keyframes pulse { 50% { opacity: 0.55; } }
@keyframes lowpulse { 50% { box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(226, 83, 63, 0.9), 0 0 10px rgba(226, 83, 63, 0.6); } }
@keyframes tin { from { opacity: 0; transform: translateY(-10px); } }
@keyframes bin { from { opacity: 0; transform: translate(-50%, 20px) scale(0.85); } }
@keyframes glow { from { box-shadow: 0 0 6px rgba(126, 196, 94, 0.4); } to { box-shadow: 0 0 22px rgba(126, 196, 94, 0.9); } }
@keyframes hitflash { 0% { box-shadow: inset 0 0 130px rgba(255, 0, 0, 0.7); } 100% { box-shadow: none; } }
@keyframes fade { to { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.965) translateY(8px); } }
@keyframes paneIn { from { opacity: 0; transform: translateX(18px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
@keyframes slideL { from { opacity: 0; transform: translateX(20px); } }
@keyframes slideR { from { opacity: 0; transform: translateX(-16px); } }
@keyframes nameIn { from { opacity: 0; letter-spacing: 0.4em; } }
@keyframes slotPop { 40% { transform: translateY(-5px) scale(1.12); } }
@keyframes bob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
@keyframes zfloat { 0% { opacity: 0; transform: translate(0, 10px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(14px, -24px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* =====================================================================
   Vague 2A (équipe U) : combat, météo, carte interactive, quêtes des habitants, colonie, étiquettes des PNJ
   ===================================================================== */
/* ---- réticule dynamique (G.aim.spread), barré si le tir est bloqué (G.aim.blocked), masqué en visée */
#crosshair .cr { position: absolute; display: none; background: rgba(255, 255, 255, 0.94); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); transition: top 0.06s linear, left 0.06s linear; }
#crosshair.dyn .cr { display: block; }
#crosshair .cr.t, #crosshair .cr.b { left: -1px; width: 2px; height: 9px; }
#crosshair .cr.l, #crosshair .cr.r { top: -1px; width: 9px; height: 2px; }
#crosshair .cr.t { top: calc(-1 * var(--g, 8px) - 9px); }
#crosshair .cr.b { top: var(--g, 8px); }
#crosshair .cr.l { left: calc(-1 * var(--g, 8px) - 9px); }
#crosshair .cr.r { left: var(--g, 8px); }
#crosshair.dyn i { width: 3px; height: 3px; left: -1.5px; top: -1.5px; }
#crosshair.ads i, #crosshair.ads .cr { display: none; }
#crosshair .crx { display: none; position: absolute; left: -10px; top: -10px; width: 20px; height: 20px; }
#crosshair.blk .crx { display: block; }
#crosshair .crx::before, #crosshair .crx::after { content: ''; position: absolute; left: 9px; top: 0; width: 2px; height: 20px; background: #ff5a4a; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); transform: rotate(45deg); }
#crosshair .crx::after { transform: rotate(-45deg); }
#crosshair.blk i, #crosshair.blk .cr { opacity: 0.35; }
body:has(#touch.on) #crosshair .cr.t, body:has(#touch.on) #crosshair .cr.b { width: 3px; left: -1.5px; }
body:has(#touch.on) #crosshair .cr.l, body:has(#touch.on) #crosshair .cr.r { height: 3px; top: -1.5px; }
/* ---- marqueurs de touche : tête, armure qui absorbe, élimination */
#hitm.show { animation: hmPop 0.16s ease-out; }
#hitm.armor::before, #hitm.armor::after { background: linear-gradient(180deg, #8fc4ff 0 34%, transparent 34% 66%, #8fc4ff 66%); }
#hitm.kill { transform: scale(1.55); border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 70, 50, 0.55); }
#hitm.kill::before, #hitm.kill::after { width: 3px; left: 9.5px; background: linear-gradient(180deg, #ff3b2f 0 40%, transparent 40% 60%, #ff3b2f 60%); }
@keyframes hmPop { from { transform: scale(0.6); opacity: 0.4; } }
/* ---- chiffres de dégâts par zone (classes z-<zone> ; texte produit par fx.number) */
.num.z-tete { color: #ff5a4a; font-size: 25px; }
.num.z-torse, .num.z-corps { color: #ffffff; }
.num.z-ventre { color: #ffe3a6; }
.num.z-bras, .num.z-jambes, .num.z-pattes { color: #c9d1da; font-size: 16px; }
.num.z-vital { color: #ff7a5a; font-size: 23px; }
.num.ab { color: #9cc8ff; }
.num.ab::after { content: ' ⛨'; font-size: 0.75em; }
/* ---- vignette de suppression (G.sup) */
#supv { position: fixed; inset: 0; pointer-events: none; z-index: 4; opacity: 0; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 36%, rgba(14, 10, 6, 0.5) 74%, rgba(0, 0, 0, 0.88) 100%); transition: opacity 0.12s; }
body.w2-dialogue-on #supv { opacity: 0 !important; }
/* ---- anneau du soin en cours (me.ch) */
#healring { left: 50%; top: calc(50% + 30px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px; }
#healring svg { width: 54px; height: 54px; transform: rotate(-90deg); }
#healring circle { fill: none; stroke-width: 4.5; }
#healring .bg { stroke: rgba(0, 0, 0, 0.5); }
#healring .fg { stroke: var(--ok); stroke-dasharray: 100; stroke-dashoffset: 100; stroke-linecap: round; transition: stroke-dashoffset 0.1s linear; filter: drop-shadow(0 0 4px rgba(126, 196, 94, 0.6)); }
#healring .hi { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; }
#healring b { font: 600 12px var(--head); letter-spacing: 0.1em; text-transform: uppercase; color: #d9f2c9; text-shadow: 0 1px 3px #000; white-space: nowrap; }
/* ---- silhouette du corps (zone touchée, blessures, protections) */
#bodyhud { left: calc(292px + var(--sal)); top: calc(18px + var(--sat)); width: 30px; height: 60px; opacity: 0; transition: opacity 0.4s; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8)); }
#bodyhud.on { opacity: 1; }
#bodyhud svg { width: 100%; height: 100%; overflow: visible; }
#bodyhud [data-z] { fill: rgba(236, 230, 218, 0.14); stroke: rgba(236, 230, 218, 0.55); stroke-width: 1.2; transition: fill 0.3s, stroke 0.3s; }
#bodyhud .a1 { stroke: rgba(143, 196, 255, 0.75); }
#bodyhud .a2 { stroke: #8fc4ff; fill: rgba(80, 140, 220, 0.22); }
#bodyhud .a3 { stroke: #b9dcff; stroke-width: 1.8; fill: rgba(80, 140, 220, 0.34); }
#bodyhud .inj { fill: rgba(255, 140, 60, 0.55); stroke: #ffb070; animation: bodyInj 1.6s ease-in-out infinite; }
#bodyhud .hit { animation: bodyHit 0.9s ease-out; }
@keyframes bodyHit { 0%, 35% { fill: rgba(255, 50, 30, 0.95); stroke: #ff6b5b; } }
@keyframes bodyInj { 50% { fill: rgba(255, 140, 60, 0.22); } }
/* ---- horloge : saison, météo (7 temps), radio ; thermomètre */
#clock .sea { letter-spacing: 0.12em; }
#clock .sea.s-printemps { color: #b6e69a; } #clock .sea.s-ete { color: #ffd27a; } #clock .sea.s-automne { color: #f0a060; } #clock .sea.s-hiver { color: #bfe3ff; }
#clock .wx.w-pluie, #clock .wx.w-orage { color: #9cc8ff; } #clock .wx.w-neige, #clock .wx.w-blizzard { color: #e6f4ff; }
#clock .wx.w-brouillard, #clock .wx.w-nuageux { color: #d6d6d6; }
#clock .rdo { display: flex; color: var(--acc2); animation: pulse 1s infinite; }
#temp .thermo2 { width: 16px; height: 16px; }
#temp small { font: 600 10px var(--head); opacity: 0.8; margin-left: 1px; }
/* ---- bulletins radio dans le fil des messages */
.fl.radio { border-left-color: var(--acc); background: linear-gradient(90deg, rgba(42, 30, 12, 0.88), rgba(10, 9, 8, 0.3)); flex-wrap: nowrap; align-items: flex-start; }
.fl.radio .rd-ic { display: flex; color: var(--acc2); padding-top: 2px; }
.fl.radio .rd-tx { flex: 1; min-width: 0; line-height: 1.42; }
.fl.radio b { color: #ffd88f; } .fl.radio em { font-style: italic; font-weight: 400; color: #ffc0a8; }
/* ---- carte de titre (découverte d'un lieu, rang de la colonie) */
.w2-titlecard { position: fixed; left: 50%; top: 21%; transform: translateX(-50%); z-index: 74; pointer-events: none; text-align: center; width: 92vw; transition: opacity 0.8s, filter 0.8s; }
.w2-titlecard .tc-ic { font-size: 28px; margin-bottom: 6px; animation: fadeUp 0.8s ease; }
.w2-titlecard .tc-t { font: 700 46px/1.05 var(--head); letter-spacing: 0.42em; padding-left: 0.42em; color: #fff6e6; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85), 0 0 40px rgba(224, 152, 47, 0.35); animation: tcT 1.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.w2-titlecard .tc-l { display: block; height: 2px; width: 0; margin: 12px auto 9px; background: linear-gradient(90deg, transparent, var(--acc2), transparent); animation: tcLine 1.3s 0.25s forwards; }
.w2-titlecard .tc-s { font: 500 15px var(--font); letter-spacing: 0.24em; text-transform: uppercase; color: #e8dcc4; text-shadow: 0 2px 8px #000; animation: fadeUp 1s 0.4s both; }
.w2-titlecard.out { opacity: 0; filter: blur(4px); }
@keyframes tcT { from { opacity: 0; letter-spacing: 0.85em; filter: blur(6px); } }
@keyframes tcLine { to { width: min(520px, 70vw); } }
/* ---- boussole : couleurs des repères */
.cmk.k-ping .si { color: #ff8a3a; } .cmk.k-danger .si { color: #ff4a3a; } .cmk.k-tribu .si { color: #4cc3ff; } .cmk.k-butin .si { color: #7dff8a; }
.cmk.k-ping small { color: #ffb27a; } .cmk.k-danger small { color: #ff8f7d; }
.cmk.unk .si { color: rgba(255, 255, 255, 0.5); }
/* ---- fil des éliminations : tir à la tête, distance */
.kf .kx { display: inline-flex; align-items: center; gap: 4px; }
.kf .kx:empty { display: none; }
.kf .kx .khs { font-style: normal; font-size: 13px; line-height: 1; }
.kf .kx small { font: 600 11px var(--head); color: var(--ink2); }
.kf.head { border-right-color: #ff5a4a; }
.kf.mine { background: linear-gradient(270deg, rgba(64, 42, 10, 0.88), rgba(10, 9, 8, 0.3)); border-right-color: var(--acc2); }
.kf.me { border-right-color: #ffffff; }
/* ---- suivi à l'écran et journal : quêtes des habitants */
.tq.npc { border-right-color: #c9a227; }
.tq.npc .tt small { color: var(--dim); font-weight: 500; }
.tq.npc .to .si { width: 13px; height: 13px; margin-right: 4px; vertical-align: -2px; }
.npcq { display: grid; gap: 10px; margin-bottom: 14px; }
.qnpc { padding: 12px 14px; background: linear-gradient(110deg, rgba(201, 162, 39, 0.08), rgba(255, 255, 255, 0.02)); border: 1px solid rgba(201, 162, 39, 0.28); border-left: 3px solid #c9a227; }
.qnpc.ready { border-color: rgba(126, 196, 94, 0.5); border-left-color: var(--ok); box-shadow: 0 0 18px rgba(126, 196, 94, 0.15); }
.qnpc .qwho { font-size: 12px; color: #e2c98a; margin: 2px 0 4px; display: flex; align-items: center; gap: 5px; }
.qnpc .qwho .si { width: 13px; height: 13px; }
.qnpc .qo.next { opacity: 0.45; }
.qnpc .qo.cur span { color: #fff; font-weight: 600; }
.qnpc .qready { margin-top: 8px; padding: 6px 10px; background: rgba(126, 196, 94, 0.12); border: 1px solid rgba(126, 196, 94, 0.35); color: #c6efb2; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.rchip.rep { color: #ffd88f; border-color: rgba(242, 193, 78, 0.4); }
/* ---- onglet Camp : rang auprès de la Ferme Morel */
.colrep { padding: 10px 12px; margin: 4px 0 12px; background: rgba(242, 193, 78, 0.06); border: 1px solid rgba(242, 193, 78, 0.25); display: grid; gap: 6px; }
.colrep .cr-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.colrep .cr-h b { font: 700 18px var(--head); letter-spacing: 0.06em; color: #ffd88f; text-transform: uppercase; }
.colrep .cr-h span { font-size: 12px; color: var(--dim); }
.colrep .bar { height: 6px; background: rgba(255, 255, 255, 0.08); }
.colrep .bar i { display: block; height: 100%; background: linear-gradient(90deg, #b5702a, #ffc46a); }
.colrep .cr-svc { display: flex; flex-wrap: wrap; gap: 5px; }
.colrep.hostile { background: rgba(226, 83, 63, 0.08); border-color: rgba(226, 83, 63, 0.4); }
.colrep.hostile .cr-h b { color: #ff7a64; }
/* ---- carte interactive (zoom, déplacement, repères) */
.w2map { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 14px; height: min(74vh, 780px); }
.w2map .bmbox { position: relative; min-height: 300px; overflow: hidden; background: #132029; border: 1px solid var(--line2); touch-action: none; }
.w2map canvas { position: absolute; left: 0; top: 0; cursor: grab; }
.w2map canvas:active { cursor: grabbing; }
.w2map .bmctl { position: absolute; right: 10px; top: 10px; display: grid; gap: 4px; }
.w2map .bmctl button { width: 34px; height: 34px; display: grid; place-items: center; background: rgba(12, 11, 10, 0.82); border: 1px solid var(--line3); color: var(--ink); }
.w2map .bmctl button:hover, .w2map .bmctl button:focus-visible { border-color: var(--acc); color: var(--acc2); outline: none; }
.w2map .bmscale { position: absolute; left: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 2px; font: 600 11px var(--head); color: #fff; text-shadow: 0 1px 2px #000; }
.w2map .bmscale i { display: block; height: 5px; border: 2px solid #fff; border-top: 0; min-width: 20px; }
.w2map .bmhint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: 11.5px; color: rgba(236, 230, 218, 0.75); background: rgba(10, 9, 8, 0.6); padding: 3px 10px; pointer-events: none; white-space: nowrap; }
.w2map .bmpop { position: absolute; z-index: 2; width: 236px; transform: translate(-50%, 0); padding: 10px; background: rgba(16, 14, 12, 0.96); border: 1px solid var(--line3); box-shadow: var(--shadow); display: grid; gap: 7px; }
.w2map .bmpop.up { transform: translate(-50%, -100%); }
.w2map .bmpop .ph { display: flex; align-items: center; gap: 6px; } .w2map .bmpop .ph b { flex: 1; font-size: 14px; } .w2map .bmpop .ph small { color: var(--dim); }
.w2map .bmpop .pic { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.w2map .bmpop .pic button { height: 34px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line2); color: var(--ink); }
.w2map .bmpop .pic button.on { border-color: var(--acc); background: var(--acc-a); color: var(--acc2); }
.w2map .bmpop input { width: 100%; box-sizing: border-box; height: 34px; padding: 0 8px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--line3); color: var(--ink); user-select: text; -webkit-user-select: text; }
.w2map .bmpop .pa { display: flex; gap: 6px; justify-content: flex-end; }
.w2map .maplg { overflow: auto; }
.w2map .bmlist { display: grid; gap: 3px; margin-bottom: 8px; }
.w2map .bmi { display: flex; align-items: center; gap: 6px; padding: 4px 6px; background: rgba(255, 255, 255, 0.03); cursor: pointer; font-size: 12.5px; }
.w2map .bmi:hover { background: var(--acc-a); }
.w2map .bmi span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w2map .bmi small { color: var(--dim); }
.w2map .bmi .del { width: 26px; height: 24px; display: grid; place-items: center; background: none; border: 1px solid transparent; color: var(--dim); }
.w2map .bmi .del:hover { color: #ff8f7d; border-color: rgba(226, 83, 63, 0.4); }
.lg.q { background: #ffd25a; } .lg.tribu { background: #4cc3ff; }
#mapbox { pointer-events: auto; cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
/* ---- étiquettes des PNJ (entities.js, équipe E) : nom, rôle, icône de dialogue */
.lbl.npc b, .lab.npc b { color: #ffe1a8; }
.lbl.npc small, .lab.npc small, .lbl.npc .role, .lab.npc .role { display: block; font: 500 10.5px var(--font); letter-spacing: 0.05em; color: #d8cdb8; }
.lbl.talk::after, .lab.talk::after { content: ''; display: block; width: 18px; height: 15px; margin: 3px auto 0; background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M3 2h18a1.5 1.5 0 0 1 1.5 1.5v9A1.5 1.5 0 0 1 21 14H10l-5 4v-4H3a1.5 1.5 0 0 1-1.5-1.5v-9A1.5 1.5 0 0 1 3 2z' fill='%23ffd88f' stroke='%23000' stroke-width='1.2'/%3E%3Ccircle cx='8' cy='8' r='1.3' fill='%23000'/%3E%3Ccircle cx='12' cy='8' r='1.3' fill='%23000'/%3E%3Ccircle cx='16' cy='8' r='1.3' fill='%23000'/%3E%3C/svg%3E"); filter: drop-shadow(0 1px 2px #000); animation: lblTalk 2.4s ease-in-out infinite; }
.lbl.npc.sleep b, .lab.npc.sleep b { color: #bdb6a8; }
@keyframes lblTalk { 50% { transform: translateY(-2px); } }
/* ---- boutons tactiles selon le contexte (mode de tir, souffle, ping) */
#touch .ctx { display: none; }
body.w2-fm #touch .tb.ctx.fm, body.w2-br #touch .tb.ctx.br, body.w2-pg #touch .trow .ctx.pg { display: flex; }
@media (max-width: 760px) {
  .w2map { grid-template-columns: 1fr; height: auto; }
  .w2map .bmbox { height: 60vh; }
  .w2map .bmhint { display: none; }
  .w2-titlecard { top: 30%; }
  .w2-titlecard .tc-t { font-size: 28px; letter-spacing: 0.26em; padding-left: 0.26em; }
  .w2-titlecard .tc-s { font-size: 12px; }
}
@media (max-width: 480px) {
  #bodyhud { left: calc(212px + var(--sal)); top: calc(160px + var(--sat)); width: 24px; height: 48px; }
  .fl.radio { font-size: 12px; }
}

/* =====================================================================
   qa21 (équipe U) : capsule du mode de tir (U-11), dernier message radio (U-5), partage par clan (U-15),
   spectateur du Battle Royale (U-18), fil d'infos (U-14), fil des éliminations (U-16), HUD sans recouvrement
   (U-2), boutons tactiles de hausse et de penché (U-4), cibles tactiles d'au moins 44 px (U-13).
   Les colonnes s'accrochent aux variables posées par ui.js (layoutVars, en px) : --tb bas de la rangée tactile
   du haut, --pb bas de la boussole, --cb bas de la pile centrale (boussole, horloge, code), --vb bas de la
   vitalité, --mb bas de la minicarte, --kb bas du fil des éliminations, --at / --ab haut et bas des munitions,
   --al leur bord gauche, --gt haut des boutons d'action, --hbt haut de la barre d'objets.
   ===================================================================== */
.kplus { margin: 0 1px; font: 700 11px var(--head); color: var(--dim); }
.am-w { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.am-fm { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px 1px 4px; border: 1px solid rgba(224, 152, 47, 0.55); border-radius: 3px; background: rgba(12, 11, 10, 0.55); color: var(--acc2); }
.am-fm .si { width: 13px; height: 13px; }
.am-fm b { font: 700 11px var(--head); letter-spacing: 0.1em; }
.am-fm.m-auto { border-color: rgba(226, 83, 63, 0.7); color: #ff9a8a; }
.qradio { margin-bottom: 14px; padding: 9px 12px; background: linear-gradient(90deg, rgba(42, 30, 12, 0.7), rgba(10, 9, 8, 0.2)); border-left: 2px solid var(--acc); font-size: 13px; line-height: 1.45; }
.qradio b { color: #ffd88f; } .qradio em { font-style: italic; color: #ffc0a8; }
.clanhelp { display: flex; gap: 7px; align-items: flex-start; margin: 10px 0; padding: 7px 10px; background: rgba(78, 163, 255, 0.07); border: 1px solid rgba(78, 163, 255, 0.25); color: var(--ink2); }
.clanhelp .si { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--blue); }
#dead.br .dt.sp { font-size: 46px; letter-spacing: 0.22em; color: #cfe3ff; text-shadow: 0 0 26px rgba(120, 180, 255, 0.3); }
@media (max-width: 760px) { #dead.br .dt.sp { font-size: 30px; letter-spacing: 0.14em; } }

/* ---- fil d'infos (U-14) : jamais sur la barre d'objets (moitié de l'écran moins la demi-barre de 275 px) ;
   entre 761 et 1000 px de large, il passe au-dessus de la barre d'objets et du nom de l'objet */
#feed { max-width: calc(50vw - 300px - var(--sal)); }
@media (max-width: 1000px) and (min-width: 761px) { #feed { max-width: none; bottom: calc(140px + var(--sab)); } }
@media (max-width: 760px) { #feed { max-width: none; } }

/* ---- fil des éliminations (U-16) : une ligne par entrée (noms coupés), 5 entrées au plus ; le suivi des
   quêtes se place toujours sous le fil (--kb), et ne descend jamais sur les munitions ni la barre d'objets */
#killfeed { max-width: min(300px, calc(100vw - 32px)); }
.kf { max-width: 100%; white-space: nowrap; overflow: hidden; }
.kf > b, .kf .kw { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kf > b { max-width: 112px; } .kf .kw { max-width: 84px; flex: 0 1 auto; }
#killfeed:not(:empty) + #tracker { top: calc(var(--kb, 354px) + 6px); }
#tracker { max-height: calc(min(var(--at, 100vh), var(--hbt, 100vh)) - 236px - var(--sat)); overflow: hidden; }
#tracker.cut { -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 26px), transparent); }
#killfeed:not(:empty) + #tracker { max-height: calc(min(var(--at, 100vh), var(--hbt, 100vh)) - var(--kb, 354px) - 14px); }
@media (max-width: 760px) { #tracker { max-height: calc(min(var(--at, 100vh), var(--hbt, 100vh)) - 164px - var(--sat)); } }
@media (max-height: 520px) { #tracker { max-height: calc(min(var(--at, 100vh), var(--hbt, 100vh)) - 126px - var(--sat)); } }
/* écrans de bureau étroits : la silhouette des blessures passe sous la vitalité (elle touchait la boussole) ; la
   boussole laisse la place de la vitalité et de la minicarte */
@media (max-width: 1100px) { #bodyhud { left: calc(16px + var(--sal)); top: calc(var(--vb, 200px) + 6px); } }
/* petite hauteur sans tactile : l'horloge passe sous la boussole (34 px), elle la mordait de 6 px ; la boussole
   laisse la place de la vitalité (200 px) ; 3 éliminations au plus (le fil touchait les munitions) */
@media (max-height: 520px) {
  #clock, #brbar { top: calc(44px + var(--sat)); }
  #compass { width: min(460px, 44vw, calc(100vw - 2 * (16px + 212px + 10px) - var(--sal) - var(--sar))); }
  #killfeed .kf:nth-last-child(n+4) { display: none; }
}
/* moins de 950 px de large : les munitions passent au-dessus de la barre d'objets (elles mordaient sa droite) */
@media (max-width: 950px) { #ammo { bottom: auto; top: calc(var(--hbt, 100vh) - 8px); transform: translateY(-100%); } }
@media (max-width: 760px) and (min-width: 481px) { #compass { width: min(300px, calc(100vw - 2 * (16px + 212px + 10px) - var(--sal) - var(--sar))); } }
@media (max-width: 900px) and (min-width: 761px) { #compass { width: min(460px, 44vw, calc(100vw - 2 * (16px + 230px + 8px) - var(--sal) - var(--sar))); } }

/* ---- écran tactile (pointeur grossier) : cibles d'au moins 44 px (U-13) dans les fenêtres : puces des réglages,
   filtres de l'inventaire, onglets, contrôles et liste de la carte */
@media (pointer: coarse) {
  .chip { min-height: 44px; padding: 6px 14px; }
  .fchip { min-height: 44px; min-width: 44px; justify-content: center; }
  .isearch { height: 44px; }
  .isearch input { align-self: stretch; }
  .ptabs button { min-width: 44px; justify-content: center; }
  .w2map .bmctl { gap: 6px; }
  .w2map .bmctl button { width: 44px; height: 44px; }
  .w2map .bmpop .pic button, .w2map .bmpop input { height: 44px; }
  .w2map .bmi { min-height: 44px; }
  .w2map .bmi .del { width: 44px; height: 44px; }
  /* vérification finale QA 2.1 : menu principal au doigt (onglets de 36 px, lien « Effacer » de 15 px) */
  .mnav .mni { min-height: 44px; }
  .snote .link { min-height: 44px; padding: 0 12px; }
}
/* ---- tactile : rangée du haut (U-13 : cibles de 44 px, sur deux lignes s'il le faut) ; construction et vue
   stratégique seulement en Survie (classe w2-surv, ui.js touchCtx) */
body:has(#touch.on) .trow { left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); transform: none; flex-wrap: wrap; justify-content: center; gap: 4px; }
body:has(#touch.on) .trow button { flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; }
body:has(#touch.on) .trow button .si { width: 22px; height: 22px; }
body:not(.w2-surv) #touch .trow .sv { display: none; }
/* pile centrale et colonnes sous la rangée du haut */
body:has(#touch.on) #compass { top: calc(var(--tb, 52px) + 2px); }
body:has(#touch.on) #clock, body:has(#touch.on) #brbar { top: calc(var(--pb, 112px) + 2px); }
body:has(#touch.on) #roomcode { top: calc(var(--pb, 112px) + 31px); }
body:has(#touch.on) #toasts { top: calc(var(--cb, 140px) + 6px); }
body:has(#touch.on) #vitals, body:has(#touch.on) #mapbox { top: calc(var(--tb, 52px) + 6px); }
body:has(#touch.on) #bodyhud { left: calc(16px + var(--sal)); top: calc(var(--vb, 200px) + 6px); width: 22px; height: 44px; }
/* colonne de droite : fil des éliminations puis suivi sous la minicarte ; munitions juste au-dessus des boutons */
body:has(#touch.on) #killfeed, body:has(#touch.on) #tracker { top: calc(var(--mb, 200px) + 6px); }
body:has(#touch.on) #killfeed:not(:empty) + #tracker { top: calc(var(--kb, 300px) + 6px); }
body:has(#touch.on) #killfeed .kf:nth-last-child(n+4) { display: none; }
body:has(#touch.on) #killfeed { max-height: calc(var(--at, 400px) - var(--mb, 200px) - 14px); overflow: hidden; }
body:has(#touch.on) #tracker { max-height: calc(var(--at, 400px) - var(--mb, 200px) - 14px); }
body:has(#touch.on) #killfeed:not(:empty) + #tracker { max-height: calc(var(--at, 400px) - var(--kb, 300px) - 14px); }
body:has(#touch.on) #ammo { top: calc(var(--gt, 600px) - 8px); bottom: auto; transform: translateY(-100%); right: calc(16px + var(--sar)); }
/* boutons de hausse (en lunette) et de penché (en visée) : 48 px ; le suivi s'efface en visée */
#touch .tzero, #touch .tlean { position: absolute; display: none; align-items: center; gap: 6px; pointer-events: none; }
body.w2-zr #touch .tzero, body.w2-ln #touch .tlean { display: flex; }
#touch .tzero .tb, #touch .tlean .tb { width: 48px; height: 48px; }
#touch .tzero .tb .si, #touch .tlean .tb .si { width: 24px; height: 24px; }
#touch .tzv { min-width: 56px; padding: 3px 6px; text-align: center; font: 700 14px var(--head); letter-spacing: 0.04em; color: #fff; background: rgba(12, 11, 10, 0.62); border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 4px; text-shadow: 0 1px 2px #000; white-space: nowrap; }
#touch .tzero { right: calc(14px + var(--sar)); top: calc(var(--mb, 200px) + 6px); }
#touch .tlean { left: calc(46px + var(--sal)); top: calc(var(--vb, 200px) + 6px); }
body.w2-zr:has(#touch.on) #tracker, body.w2-ln:has(#touch.on) #tracker { display: none; }
body.w2-zr:has(#touch.on) #killfeed { top: calc(var(--mb, 200px) + 60px); }
body.rts #touch .tzero, body.rts #touch .tlean { display: none; }
body:has(#touch.on) #fps { top: auto; bottom: calc(4px + var(--sab)); left: calc(16px + var(--sal)); right: auto; }

/* ---- téléphone en portrait (tactile ou non) : pile centrale en haut (sous la rangée tactile), puis vitalité à
   gauche et minicarte à droite ; fil des éliminations et suivi dans la colonne de droite, sous la plus basse des
   deux ; en tactile, munitions sous la vitalité, penché sous les munitions, hausse en haut de la colonne de droite */
@media (max-width: 480px) {
  #compass { width: calc(100vw - 32px - var(--sal) - var(--sar)); }
  #vitals, #mapbox { top: calc(var(--cb, 100px) + 4px); }
  #killfeed, #tracker { top: calc(max(var(--vb, 300px), var(--mb, 280px)) + 6px); right: calc(16px + var(--sar)); width: calc(100vw - 228px - var(--sal) - var(--sar)); max-width: none; }
  #killfeed:not(:empty) + #tracker { top: calc(var(--kb, 400px) + 6px); }
  #tracker { max-height: calc(min(var(--at, 100vh), var(--hbt, 100vh)) - max(var(--vb, 300px), var(--mb, 280px)) - 14px); }
  #killfeed:not(:empty) + #tracker { max-height: calc(min(var(--at, 100vh), var(--hbt, 100vh)) - var(--kb, 400px) - 14px); }
  body:has(#touch.on) #vitals, body:has(#touch.on) #mapbox { top: calc(var(--cb, 160px) + 4px); }
  body:has(#touch.on) #bodyhud { left: calc(212px + var(--sal)); top: calc(var(--cb, 160px) + 6px); width: 24px; height: 48px; }
  body:has(#touch.on) #killfeed, body:has(#touch.on) #tracker { top: calc(max(var(--vb, 330px), var(--mb, 320px)) + 6px); width: calc(100vw - 228px - var(--sal) - var(--sar)); }
  body:has(#touch.on) #killfeed:not(:empty) + #tracker { top: calc(var(--kb, 380px) + 6px); }
  body:has(#touch.on) #tracker { max-height: calc(var(--gt, 500px) - max(var(--vb, 330px), var(--mb, 320px)) - 14px); }
  body:has(#touch.on) #killfeed:not(:empty) + #tracker { max-height: calc(var(--gt, 500px) - var(--kb, 380px) - 14px); }
  body:has(#touch.on) #ammo { top: calc(var(--vb, 330px) + 6px); transform: none; left: calc(16px + var(--sal)); right: auto; }
  body:has(#touch.on) #ammo .am-w { justify-content: flex-start; }
  body:has(#touch.on) #vehhud { top: calc(var(--vb, 330px) + 6px); }
  body:has(#touch.on) #killfeed { max-height: calc(var(--gt, 500px) - max(var(--vb, 330px), var(--mb, 320px)) - 14px); }
  #touch .tzero { top: calc(max(var(--vb, 330px), var(--mb, 320px)) + 6px); }
  body.w2-zr:has(#touch.on) #killfeed { top: calc(max(var(--vb, 330px), var(--mb, 320px)) + 60px); }
  #touch .tlean { left: calc(16px + var(--sal)); top: calc(var(--ab, 380px) + 8px); }
  /* vérification finale QA 2.1 : l'invite (« Voler : … », « Parler à … ») passait au milieu de l'écran, sur le suivi des
     quêtes de la colonne de droite ; en tactile portrait elle va dans la colonne de gauche, sous les munitions (ou la
     vitalité), et sous les boutons de penché quand ils sont affichés */
  body:has(#touch.on) #prompt { top: calc(var(--ab, 440px) + 8px); bottom: auto; left: calc(12px + var(--sal)); transform: none; align-items: flex-start; max-width: 192px; }
  body.w2-ln:has(#touch.on) #prompt { top: calc(var(--ab, 440px) + 64px); }
}

/* ---- tactile, paysage peu haut (téléphone, petite tablette) : rangée du haut à gauche de la minicarte (qui garde
   son coin) ; à gauche, vitalité puis fil des éliminations et suivi replié (titres seuls, le détail est dans le
   journal) ; à droite, minicarte, munitions, boutons d'action sur 6 colonnes et 2 rangs ; hausse à gauche des
   munitions, penché sous la vitalité */
@media (orientation: landscape) and (max-height: 600px) {
  body:has(#touch.on) .trow { right: calc(120px + var(--sar)); gap: 3px; }
  body:has(#touch.on) .mmring { width: 96px; height: 96px; padding: 3px; }
  body:has(#touch.on) #coords { display: none; }
  body:has(#touch.on) #mapbox { top: calc(14px + var(--sat)); }
  body:has(#touch.on) #compass { width: clamp(150px, min(36vw, calc(100vw - 500px)), 300px); height: 34px; }
  body:has(#touch.on) #compass .cwin { height: 30px; }
  body:has(#touch.on) #compass .cmarks, body:has(#touch.on) #compass .cdeg { display: none; }
  body:has(#touch.on) #clock, body:has(#touch.on) #brbar { font-size: 12px; }
  body:has(#touch.on) #vitals { width: 200px; }
  body:has(#touch.on) .vrow { display: none; }
  body:has(#touch.on) #bodyhud { left: auto; right: calc(100vw - var(--al, 100vw) + 6px); top: calc(var(--mb, 110px) + 4px); width: 20px; height: 40px; }
  body:has(#touch.on) #ammo { top: calc(var(--mb, 110px) + 4px); transform: none; right: calc(16px + var(--sar)); }
  body:has(#touch.on) .am-m { font-size: 30px; }
  body:has(#touch.on) .am-x, body:has(#touch.on) .am-r { font-size: 15px; }
  body:has(#touch.on) .am-w { font-size: 11px; }
  body:has(#touch.on) .tcol { grid-template-columns: 60px repeat(5, 48px); gap: 6px; bottom: calc(74px + var(--sab)); right: calc(10px + var(--sar)); }
  body:has(#touch.on) .tb { width: 48px; height: 48px; font-size: 17px; }
  body:has(#touch.on) .tb .si { width: 22px; height: 22px; }
  body:has(#touch.on) .tb.big { width: 60px; height: 60px; }
  body:has(#touch.on) #killfeed, body:has(#touch.on) #tracker { top: calc(var(--vb, 150px) + 6px); left: calc(16px + var(--sal)); right: auto; width: 200px; justify-items: start; }
  body:has(#touch.on) #killfeed:not(:empty) + #tracker { top: calc(var(--kb, 220px) + 6px); }
  body:has(#touch.on) #tracker { max-height: calc(var(--hbt, 300px) - var(--vb, 150px) - 14px); }
  body:has(#touch.on) #killfeed:not(:empty) + #tracker { max-height: calc(var(--hbt, 300px) - var(--kb, 220px) - 14px); }
  body:has(#touch.on) #tracker .to { display: none; }
  body:has(#touch.on) #tracker .tq { padding: 5px 8px; }
  body:has(#touch.on) #tracker .tt { margin-bottom: 0; font-size: 12px; }
  body:has(#touch.on) #killfeed { max-height: calc(var(--hbt, 300px) - var(--vb, 150px) - 14px); }
  body:has(#touch.on) #feed { display: none; }
  #touch .tlean { left: calc(16px + var(--sal)); top: calc(var(--vb, 150px) + 8px); }
  #touch .tzero { left: calc(16px + var(--sal)); right: auto; top: calc(var(--vb, 150px) + 62px); }
  body.w2-ln:has(#touch.on) #killfeed { top: calc(var(--vb, 150px) + 62px); max-height: calc(var(--hbt, 300px) - var(--vb, 150px) - 70px); }
  body.w2-zr:has(#touch.on) #killfeed { display: none; }
  body:has(#touch.on) #prompt { left: calc((100vw - 350px - var(--sar)) / 2); max-width: calc(100vw - 366px - var(--sar)); }
}
