:root {
  --panel: rgba(24, 23, 20, 0.9);
  --panel2: rgba(40, 38, 33, 0.94);
  --panel3: rgba(58, 54, 47, 0.9);
  --slot: rgba(64, 60, 52, 0.55);
  --slot-hi: rgba(104, 96, 82, 0.75);
  --line: rgba(255, 240, 210, 0.08);
  --text: #e8e2d6;
  --dim: #9a9387;
  --accent: #cd5a24;
  --accent2: #8bb04a;
  --blue: #5d9bd0;
  --bad: #c0443a;
  --warn: #d6a33a;
  --hp: #8aa83e;
  --hyd: #3f8fc4;
  --cal: #c48a3a;
  --font: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d0d0c; color: var(--text); font-family: var(--font); user-select: none; -webkit-user-select: none; }
canvas#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font-family: var(--font); }
.btn { background: var(--accent); color: #fff; border: 0; padding: 8px 16px; font-weight: 700; letter-spacing: 0.06em; cursor: pointer; border-radius: 2px; font-size: 14px; }
.btn:hover { filter: brightness(1.12); }
.btn:disabled { background: #4c4740; color: #8a8478; cursor: default; filter: none; }
.btn.alt { background: #4a463e; }
.btn.green { background: #5d7a32; }
.btn.blue { background: #3d6a92; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.big { font-size: 22px; padding: 12px 34px; }
h3 { margin: 0 0 8px; font-size: 12px; letter-spacing: 0.14em; color: var(--dim); font-weight: 700; text-transform: uppercase; }
input[type=text], input:not([type]), input[type=number] { background: rgba(0,0,0,0.5); border: 1px solid #4a463e; color: var(--text); font-family: var(--font); padding: 6px 8px; outline: none; }
input[type=range] { accent-color: var(--accent); }

/* ---------- title ---------- */
#title { position: fixed; inset: 0; display: grid; place-items: center; z-index: 50; }
.title-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(70,48,28,0.55), rgba(8,7,6,0.95)), repeating-linear-gradient(0deg, rgba(255,255,255,0.015) 0 2px, transparent 2px 4px); }
.title-box { position: relative; width: 600px; max-width: calc(100vw - 32px); text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.logo { font-size: 84px; font-weight: 900; letter-spacing: 0.16em; color: #ebdfcb; text-shadow: 0 4px 0 #6a3416, 0 10px 30px #000; }
.tag { color: var(--dim); font-size: 17px; }
#name { width: 300px; font-size: 19px; text-align: center; padding: 10px; }
#title-status { min-height: 20px; color: var(--dim); font-size: 14px; }
.howto { text-align: left; font-size: 13px; color: var(--dim); line-height: 1.65; background: rgba(0,0,0,0.4); padding: 12px 16px; border-left: 3px solid var(--accent); }
.howto b { color: var(--text); }
.title-foot { font-size: 12px; color: #6f695f; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.crosshair { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; background: rgba(255,255,255,0.9); border-radius: 50%; box-shadow: 0 0 2px #000; }
.crosshair.ads { opacity: 0; }
.hitmarker { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px; opacity: 0; }
.hitmarker::before, .hitmarker::after { content: ''; position: absolute; left: 50%; top: 0; width: 2px; height: 100%; background: #fff; transform: rotate(45deg); }
.hitmarker::after { transform: rotate(-45deg); }
.hitmarker.show { opacity: 1; }
.hitmarker.head::before, .hitmarker.head::after { background: #ff4a3a; }
.hitmarker.kill::before, .hitmarker.kill::after { background: #ff4a3a; width: 3px; }
.scope { position: absolute; inset: 0; background: radial-gradient(circle at center, transparent 0 32vh, #000 32.2vh); }
.scope::before { content: ''; position: absolute; left: 50%; top: 18vh; bottom: 18vh; width: 1px; background: #000; }
.scope::after { content: ''; position: absolute; top: 50%; left: calc(50% - 32vh); right: calc(50% - 32vh); height: 1px; background: #000; }
.hint { position: absolute; left: 50%; top: calc(50% + 36px); transform: translateX(-50%); font-size: 15px; text-shadow: 0 1px 3px #000; text-align: center; white-space: pre; line-height: 1.6; }
.hint .k { display: inline-block; background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.35); padding: 0 6px; margin-right: 6px; border-radius: 2px; font-size: 13px; }
.hint .bad { color: #ff9a8a; }
.hint .sub { color: var(--dim); font-size: 12px; }
.hpbar { display: inline-block; width: 120px; height: 5px; background: rgba(0,0,0,0.6); vertical-align: middle; margin-left: 6px; }
.hpbar i { display: block; height: 100%; background: var(--accent2); }
.progress { position: absolute; left: 50%; top: calc(50% + 74px); width: 200px; margin-left: -100px; height: 6px; background: rgba(0,0,0,0.55); }
.progress i { display: block; height: 100%; background: var(--accent2); width: 0; }
.notices { position: absolute; left: 50%; bottom: 140px; transform: translateX(-50%); display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; }
.notice { background: rgba(0,0,0,0.6); padding: 6px 14px; font-size: 15px; border-left: 3px solid var(--dim); animation: fadeout 3s forwards; }
.notice.bad { border-color: var(--bad); }
.notice.good { border-color: var(--accent2); }
.notice.warn { border-color: var(--warn); }
.bignotice { position: absolute; left: 50%; top: 13%; transform: translateX(-50%); font-size: 24px; font-weight: 700; color: #ffd27a; text-shadow: 0 2px 6px #000; animation: fadeout 7s forwards; text-align: center; }
@keyframes fadeout { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
.damage { position: absolute; inset: 0; box-shadow: inset 0 0 180px rgba(200, 20, 10, 0.8); opacity: 0; transition: opacity 0.5s; }
.damage.show { opacity: 1; transition: none; }
.dmgdir { position: absolute; left: 50%; top: 50%; width: 240px; height: 240px; margin: -120px; opacity: 0; transition: opacity 0.9s; }
.dmgdir::before { content: ''; position: absolute; left: 50%; top: 0; margin-left: -30px; border: 30px solid transparent; border-bottom: 16px solid rgba(220, 40, 30, 0.9); border-top: 0; }
.dmgdir.show { opacity: 1; transition: none; }
.lowhp { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 50%, rgba(120,0,0,0.45)); opacity: 0; transition: opacity 1s; }
.feed { position: absolute; right: 24px; bottom: 170px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.gain { background: rgba(58, 78, 38, 0.8); padding: 3px 10px 3px 4px; font-size: 14px; display: flex; align-items: center; gap: 6px; animation: gainout 3.6s forwards; }
.gain img { width: 24px; height: 24px; }
.gain.neg { background: rgba(110, 40, 30, 0.8); }
@keyframes gainout { 0% { opacity: 0; transform: translateX(20px); } 8% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
.queue { position: absolute; right: 24px; top: 80px; display: flex; flex-direction: column; gap: 4px; pointer-events: auto; }
.qitem { width: 56px; height: 56px; background: var(--panel); position: relative; cursor: pointer; border: 1px solid var(--line); }
.qitem img { width: 100%; height: 100%; }
.qitem .n { position: absolute; right: 3px; bottom: 1px; font-size: 13px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.qitem .p { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent2); }
.qitem:hover::after { content: 'CANCEL'; position: absolute; inset: 0; background: rgba(150,30,20,0.65); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.status { position: absolute; right: 24px; bottom: 120px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.stat { font-size: 13px; padding: 3px 10px; background: rgba(0,0,0,0.55); border-right: 3px solid var(--dim); font-weight: 700; letter-spacing: 0.04em; }
.stat.good { border-color: var(--accent2); }
.stat.bad { border-color: var(--bad); color: #ffb0a0; }
.stat.warn { border-color: var(--warn); color: #ffe0a0; }
.stat.blue { border-color: var(--blue); color: #bfe0ff; }
.vitals { position: absolute; right: 24px; bottom: 24px; width: 240px; display: flex; flex-direction: column; gap: 3px; }
.vital { display: flex; align-items: center; gap: 8px; background: rgba(18,18,16,0.7); padding: 3px 8px; height: 27px; }
.vital .l { font-size: 11px; width: 56px; color: var(--dim); font-weight: 700; letter-spacing: 0.08em; }
.vital .bar { flex: 1; height: 15px; background: rgba(255,255,255,0.07); position: relative; }
.vital .fill { height: 100%; transition: width 0.25s; }
.vital .over { position: absolute; top: 0; height: 100%; background: rgba(160, 220, 120, 0.35); }
.vital.hp .fill { background: var(--hp); }
.vital.hyd .fill { background: var(--hyd); }
.vital.cal .fill { background: var(--cal); }
.vital.low .fill { background: var(--bad) !important; animation: pulse 0.8s infinite alternate; }
@keyframes pulse { from { opacity: 0.5; } to { opacity: 1; } }
.vital .v { font-size: 13px; width: 32px; text-align: right; font-weight: 700; }
.ammo { position: absolute; right: 280px; bottom: 28px; font-size: 28px; font-weight: 900; text-shadow: 0 2px 4px #000; text-align: right; }
.ammo small { font-size: 15px; color: var(--dim); font-weight: 700; }
.ammo .t { display: block; font-size: 11px; color: var(--dim); font-weight: 700; letter-spacing: 0.08em; }
.hotbar { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; gap: 4px; }
.hslot { width: 70px; height: 70px; background: rgba(28,26,23,0.72); border: 2px solid rgba(255,255,255,0.05); position: relative; }
.hslot.sel { border-color: rgba(225, 195, 140, 0.95); background: rgba(64,58,48,0.85); }
.hslot img { width: 100%; height: 100%; }
.hslot .key { position: absolute; left: 4px; top: 1px; font-size: 11px; color: var(--dim); }
.hslot .n, .slot .n { position: absolute; right: 4px; bottom: 1px; font-size: 13px; font-weight: 700; text-shadow: 0 1px 2px #000; pointer-events: none; }
.hslot .a, .slot .a { position: absolute; left: 6px; bottom: 1px; font-size: 11px; color: #f0d070; pointer-events: none; }
.cond { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: rgba(0,0,0,0.4); pointer-events: none; }
.cond i { position: absolute; bottom: 0; left: 0; width: 100%; background: var(--accent2); }
.cond.low i { background: var(--bad); }
.chat { position: absolute; left: 22px; bottom: 120px; width: 440px; }
.chatlog { display: flex; flex-direction: column; gap: 2px; font-size: 14px; text-shadow: 0 1px 2px #000; }
.chatlog .line { animation: chatfade 14s forwards; }
.chat.open .chatlog .line { animation: none; opacity: 1; }
.chatlog .who { color: #f0c27a; font-weight: 700; }
.chatlog .team .who { color: #8fd06a; }
.chatlog .sys { color: #b8c8a8; }
@keyframes chatfade { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
.chat input { display: none; width: 100%; margin-top: 6px; pointer-events: auto; font-size: 14px; }
.chat.open input { display: block; }
.chat .mode { display: none; font-size: 11px; color: var(--dim); margin-top: 2px; }
.chat.open .mode { display: block; }
.compass { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); width: 460px; height: 26px; overflow: hidden; background: linear-gradient(90deg, transparent, rgba(0,0,0,0.42) 20%, rgba(0,0,0,0.42) 80%, transparent); }
.compass .strip { position: absolute; top: 4px; height: 20px; white-space: nowrap; font-size: 13px; }
.compass .strip span { position: absolute; transform: translateX(-50%); color: var(--dim); }
.compass .strip span.c { color: #fff; font-weight: 700; }
.compass .mark { position: absolute; left: 50%; top: 0; width: 2px; height: 6px; background: var(--accent); }
.topleft { position: absolute; left: 22px; top: 14px; font-size: 13px; color: var(--dim); text-shadow: 0 1px 2px #000; line-height: 1.5; }
.teamlist { position: absolute; left: 22px; top: 56px; display: flex; flex-direction: column; gap: 3px; }
.teamlist div { font-size: 13px; background: rgba(0,0,0,0.45); padding: 2px 8px; border-left: 3px solid #8fd06a; }
.teamlist .off { opacity: 0.5; }
.teamlist .dead { border-color: var(--bad); }
.wounded { position: absolute; inset: 0; background: rgba(60, 0, 0, 0.45); display: grid; place-items: center; pointer-events: auto; }
.wounded .box { text-align: center; }
.wounded h2 { font-size: 40px; margin: 0; letter-spacing: 0.1em; }

/* ---------- panels ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; }
.inventory { background: rgba(8, 8, 6, 0.6); display: flex; justify-content: center; align-items: flex-start; gap: 10px; padding: 64px 16px 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 14px; }
.inv-left { width: 270px; }
.inv-mid { width: 460px; }
.inv-right { width: 470px; max-height: calc(100vh - 90px); overflow-y: auto; overflow-x: hidden; }
.slots { display: grid; grid-template-columns: repeat(6, 70px); gap: 4px; margin-bottom: 12px; }
.slots.wear { grid-template-columns: repeat(4, 58px); }
.slots.wear .slot { width: 58px; height: 58px; }
.slot { width: 70px; height: 70px; background: var(--slot); position: relative; cursor: pointer; border: 1px solid transparent; }
.slot:hover { background: var(--slot-hi); border-color: rgba(255,255,255,0.15); }
.slot.over { border-color: var(--accent); }
.slot.sel { border-color: rgba(225, 195, 140, 0.9); }
.slot img { width: 100%; height: 100%; pointer-events: none; }
.slot .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10px; color: rgba(255,255,255,0.22); letter-spacing: 0.08em; pointer-events: none; text-align: center; }
.slot.out { background: rgba(70, 88, 52, 0.4); }
.drag-ghost { position: fixed; width: 66px; height: 66px; pointer-events: none; z-index: 60; opacity: 0.85; }
.drag-ghost img { width: 100%; height: 100%; }
.tabs { display: flex; gap: 3px; margin-bottom: 10px; flex-wrap: wrap; }
.tabs button { background: #3a362f; color: var(--dim); border: 0; font-size: 12px; padding: 5px 9px; cursor: pointer; font-weight: 700; letter-spacing: 0.05em; }
.tabs button.on { background: var(--accent); color: #fff; }
.info { border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; line-height: 1.5; min-height: 140px; }
.info .nm { font-size: 18px; font-weight: 700; color: #fff; }
.info .rar { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.info .d { color: var(--dim); margin: 4px 0 8px; }
.info table { width: 100%; border-collapse: collapse; }
.info td { padding: 1px 0; }
.info td:last-child { text-align: right; color: #fff; }
.info .acts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.info .mods { display: flex; gap: 4px; margin-top: 8px; }
.info .mods .slot { width: 50px; height: 50px; }
.stats { font-size: 13px; color: var(--dim); line-height: 1.6; margin-bottom: 10px; }
.stats b { color: var(--text); }
.prot { display: grid; grid-template-columns: 1fr auto; font-size: 12px; color: var(--dim); gap: 1px 8px; margin-bottom: 10px; }
.prot b { color: var(--text); text-align: right; }
.craft-search { width: 100%; margin-bottom: 8px; }
.craft-list { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-bottom: 10px; }
.recipe { aspect-ratio: 1; background: var(--slot); position: relative; cursor: pointer; border: 1px solid transparent; }
.recipe img { width: 100%; height: 100%; opacity: 0.35; }
.recipe.can img { opacity: 1; }
.recipe.can { background: rgba(78, 98, 58, 0.45); }
.recipe.locked { background: rgba(40, 36, 32, 0.6); }
.recipe.locked::after { content: 'BP'; position: absolute; right: 2px; bottom: 1px; font-size: 9px; color: #b06a5a; font-weight: 700; }
.recipe.sel { border-color: var(--accent); }
.recipe .wb { position: absolute; right: 2px; top: 1px; font-size: 10px; color: #8fb0d0; font-weight: 700; }
.detail .nm { font-size: 19px; font-weight: 700; color: #fff; }
.detail .d { color: var(--dim); font-size: 13px; margin: 2px 0 8px; }
.detail table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; }
.detail td { padding: 3px 4px; border-bottom: 1px solid var(--line); }
.detail td.short { color: #ff8a7a; }
.row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row input { width: 56px; text-align: center; }
.cont-extra { margin-bottom: 10px; font-size: 13px; color: var(--dim); line-height: 1.5; }
.cont-extra .row { margin-bottom: 6px; }
.shoprow { display: flex; align-items: center; gap: 8px; padding: 4px; border-bottom: 1px solid var(--line); }
.shoprow img { width: 40px; height: 40px; background: var(--slot); }
.shoprow .t { flex: 1; font-size: 13px; }
.shoprow .t small { color: var(--dim); display: block; }
.tech { position: fixed; inset: 0; z-index: 25; background: rgba(8,8,6,0.9); padding: 40px; overflow: auto; }
.tech .cols { display: flex; gap: 16px; }
.tech .col { flex: 1; background: var(--panel); padding: 12px; }
.tech .nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.tnode { background: var(--slot); padding: 4px; text-align: center; cursor: pointer; border: 1px solid transparent; font-size: 10px; }
.tnode img { width: 56px; height: 56px; display: block; margin: 0 auto; opacity: 0.45; }
.tnode.known { background: rgba(78, 98, 58, 0.5); }
.tnode.known img { opacity: 1; }
.tnode.avail { border-color: rgba(205, 90, 36, 0.6); }
.tnode.avail img { opacity: 0.8; }
.tnode .c { color: #f0c27a; font-weight: 700; }
.map { background: rgba(5, 8, 10, 0.82); display: grid; place-items: center; }
.map canvas { width: min(92vh, 92vw); height: min(92vh, 92vw); border: 2px solid #3a362f; cursor: crosshair; }
.map .legend { position: absolute; bottom: 10px; font-size: 13px; color: var(--dim); }
.death { background: radial-gradient(ellipse at center, rgba(60, 10, 8, 0.6), rgba(0,0,0,0.94)); display: grid; place-items: center; }
.death .box { text-align: center; width: 460px; }
.death h1 { font-size: 52px; letter-spacing: 0.1em; margin: 0 0 6px; color: #e4d4c4; }
.death .why { color: var(--dim); margin: 0 0 22px; }
.death .bags { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.death .btn { width: 100%; }
.modal { background: rgba(0,0,0,0.6); display: grid; place-items: center; }
.modal .box { background: var(--panel); padding: 22px 26px; width: 480px; max-width: calc(100vw - 32px); display: flex; flex-direction: column; gap: 12px; }
.modal h2 { margin: 0; letter-spacing: 0.12em; }
.keypad .digits { font-size: 40px; letter-spacing: 0.4em; text-align: center; background: #111; padding: 8px; color: #8fe08a; font-family: monospace; }
.keypad .keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.keypad .keys button { padding: 14px; font-size: 20px; background: #3a362f; color: var(--text); border: 0; cursor: pointer; }
.keypad .keys button:hover { background: #55504a; }
.setting { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--dim); gap: 10px; }
.setting select { background: #222; color: var(--text); border: 1px solid #444; font-family: var(--font); padding: 4px; }
.keys-list { font-size: 13px; color: var(--dim); line-height: 1.7; border-top: 1px solid var(--line); padding-top: 10px; columns: 2; }
.keys-list b { color: var(--text); }
.radial { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 22; display: grid; grid-template-columns: repeat(4, 118px); gap: 6px; }
.radial .opt { background: var(--panel); border: 1px solid var(--line); padding: 10px 6px; text-align: center; cursor: pointer; }
.radial .opt:hover, .radial .opt.cur { background: var(--panel3); border-color: var(--accent); }
.radial .opt b { display: block; font-size: 14px; }
.radial .opt span { font-size: 11px; color: var(--dim); }
.radial .opt.no { opacity: 0.45; }
.team .member { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.wheelui .bets { display: flex; gap: 6px; flex-wrap: wrap; }
.wheelui .bets button { flex: 1; }

@media (max-width: 1280px) {
  .slots { grid-template-columns: repeat(6, 56px); }
  .slot { width: 56px; height: 56px; }
  .slots.wear { grid-template-columns: repeat(4, 46px); }
  .slots.wear .slot { width: 46px; height: 46px; }
  .inv-left { width: 220px; }
  .inv-mid { width: 380px; }
  .inv-right { width: 400px; }
  .craft-list { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 1000px) {
  .inventory { flex-wrap: wrap; overflow-y: auto; }
  .logo { font-size: 48px; }
  .hslot { width: 52px; height: 52px; }
  .vitals { width: 170px; }
  .compass { width: 260px; }
}
