:root {
  --bg: #0d0f0d;
  --panel: rgba(22, 25, 22, 0.86);
  --panel-2: rgba(36, 40, 35, 0.9);
  --slot: rgba(255, 255, 255, 0.06);
  --slot-on: rgba(201, 168, 79, 0.22);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #e9e6dc;
  --muted: #a9a594;
  --faint: #78756a;
  --gold: #c9a84f;
  --gold-2: #e2c573;
  --hp: #7bbf4a;
  --food: #d9873a;
  --water: #4fa3d9;
  --bad: #e0574a;
  --good: #7bbf4a;
  --cold: #6fb6e6;
  --hot: #e88a3a;
  --team: #9fd67a;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, .slot:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; outline: none; touch-action: none; }
[hidden] { display: none !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border: 1px solid var(--line-2); border-radius: 6px; background: rgba(255, 255, 255, 0.06); color: var(--text); font-weight: 700; font-size: 14px; letter-spacing: 0.02em; transition: background 0.12s, border-color 0.12s, transform 0.08s; }
.btn:hover { background: rgba(255, 255, 255, 0.11); border-color: rgba(255, 255, 255, 0.28); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.gold { background: linear-gradient(180deg, #d8b75a, #b8933a); border-color: #e7cc7f; color: #1b1608; }
.btn.gold:hover { background: linear-gradient(180deg, #e4c46a, #c29d42); }
.btn.red { background: rgba(224, 87, 74, 0.18); border-color: rgba(224, 87, 74, 0.55); color: #ffb3aa; }
.btn.small { min-height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn.wide { width: 100%; }
.input { height: 40px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.35); color: var(--text); outline: none; width: 100%; }
.input:focus { border-color: var(--gold); }
.input:focus-visible, .chat-input:focus-visible { outline: none; }
.x { flex: none; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 5px; background: rgba(255, 255, 255, 0.06); color: var(--muted); font-size: 18px; line-height: 1; }
.x:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }

#front { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 110%, rgba(201, 168, 79, 0.16), transparent 60%), linear-gradient(180deg, #121612, #0b0d0b); overflow-y: auto; padding: 24px 16px; }
#front:empty { display: none; }
.front-card { width: min(420px, 100%); display: grid; gap: 18px; justify-items: center; text-align: center; }
.front-mark { width: 92px; height: 92px; filter: drop-shadow(0 12px 28px rgba(201, 168, 79, 0.25)); }
.front-title { margin: 0; font-size: 64px; line-height: 0.9; font-weight: 900; letter-spacing: 0.18em; text-indent: 0.18em; color: #efe6c8; text-shadow: 0 6px 30px rgba(0, 0, 0, 0.5); }
.front-world { display: flex; gap: 14px; justify-content: center; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.front-world b { color: var(--gold-2); }
.front-form { width: 100%; display: grid; gap: 10px; padding: 18px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); text-align: left; }
.front-form label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.front-err { color: #ff9c91; font-size: 13px; min-height: 18px; }
.front-row { display: flex; gap: 10px; width: 100%; }
.front-row .btn { flex: 1; }
.front-link { color: var(--gold-2); font-size: 13px; text-decoration: none; font-weight: 700; }
.front-who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.front-who img { width: 28px; height: 28px; border-radius: 6px; }
.loading { width: 100%; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.loading i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #b8933a, #e2c573); transition: width 0.2s; }
.loading-text { font-size: 13px; color: var(--muted); font-weight: 600; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 16; }
#hud:has(.chat.open) { z-index: 21; }
.cross { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); transition: transform 0.1s; }
.cross.wide { transform: scale(2.2); background: rgba(255, 255, 255, 0.55); }
.hitmark { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; opacity: 0; }
.hitmark::before, .hitmark::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 2px; margin: -1px 0 0 -11px; background: #fff; transform: rotate(45deg); box-shadow: 0 0 2px rgba(0, 0, 0, 0.6); }
.hitmark::after { transform: rotate(-45deg); }
.hitmark.on { animation: hitmark 0.28s ease-out; }
.hitmark.head::before, .hitmark.head::after { background: #ff5a4a; }
@keyframes hitmark { 0% { opacity: 1; transform: scale(0.7); } 100% { opacity: 0; transform: scale(1.15); } }
.under { position: absolute; left: 50%; top: calc(50% + 34px); transform: translateX(-50%); display: grid; justify-items: center; gap: 6px; }
.prompt { display: grid; justify-items: center; gap: 4px; }
.prompt-line { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 12px 4px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.55); font-size: 14px; font-weight: 700; white-space: nowrap; }
.prompt-line .hold { display: none; font-size: 9.5px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.prompt-line.holding .hold { display: block; }
.prompt-line.holding { padding-left: 10px; }
.prompt-line.alt { min-height: 26px; padding: 2px 10px 2px 4px; background: rgba(0, 0, 0, 0.42); font-size: 12.5px; color: var(--muted); }
.cap { position: relative; flex: none; display: grid; place-items: center; width: 26px; height: 26px; }
.cap kbd { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border: 1px solid transparent; border-radius: 4px; background: rgba(255, 255, 255, 0.16); color: var(--text); font: 800 12px var(--font); transition: transform 0.08s, background 0.08s, border-color 0.08s; }
.cap.press kbd { transform: scale(0.92); background: rgba(0, 0, 0, 0.55); border-color: var(--gold); color: var(--gold-2); transition: none; }
.cap .ring { display: none; position: absolute; left: -5px; top: -5px; width: 36px; height: 36px; }
.holding .cap .ring { display: block; }
.holding .cap kbd { min-width: 22px; padding: 0; border-radius: 50%; }
.alt .cap { width: 20px; height: 20px; }
.alt .cap kbd { min-width: 18px; height: 18px; font-size: 10.5px; }
.alt .cap .ring { left: -4px; top: -4px; width: 28px; height: 28px; }
.ring { transform: rotate(-90deg); overflow: visible; pointer-events: none; }
.ring circle { fill: none; stroke: rgba(255, 255, 255, 0.18); stroke-width: 2.5; }
.ring .ring-fill { stroke: var(--gold); stroke-linecap: round; }
.cap.full .ring-fill { animation: ringflash 0.36s ease-out; }
@keyframes ringflash { 0% { stroke: #fff; stroke-width: 4; } 100% { stroke: var(--gold); stroke-width: 2.5; } }
.look { min-width: 168px; display: grid; gap: 4px; padding: 6px 10px 7px; border-radius: 6px; background: rgba(0, 0, 0, 0.55); }
.look-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; white-space: nowrap; }
.look-head b { font-size: 13px; font-weight: 800; }
.look-head span { font-size: 11.5px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.look-bar { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.look-bar i { display: block; height: 100%; width: 0; background: var(--hp); transition: width 0.2s; }
.look.mid .look-bar i { background: var(--gold); }
.look.low .look-bar i { background: var(--bad); }
.look small { font-size: 11px; font-weight: 700; color: var(--muted); }
.look { max-width: 300px; }
.item-tip { position: fixed; z-index: 90; max-width: 260px; padding: 8px 10px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(14, 16, 14, 0.96); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); pointer-events: none; display: grid; gap: 3px; }
.item-tip b { font-size: 13px; color: var(--text); }
.item-tip p { margin: 0; font-size: 12px; line-height: 1.35; color: var(--muted); }
p.about { margin: 2px 0 0; font-size: 12px; line-height: 1.35; color: var(--muted); }
.cost-hint { position: absolute; left: calc(50% + 16px); top: calc(50% + 6px); display: flex; gap: 4px; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); }
.cost-hint span { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px 1px 2px; border-radius: 4px; background: rgba(0, 0, 0, 0.45); }
.cost-hint canvas { width: 18px; height: 18px; }
.cost-hint span.short { color: #ff8a7d; }

.stats { position: absolute; right: 14px; bottom: 14px; display: grid; gap: 4px; width: 210px; }
.stat { position: relative; display: flex; align-items: center; gap: 8px; height: 24px; padding: 0 8px; border-radius: 4px; background: rgba(12, 14, 12, 0.66); overflow: hidden; font-size: 13px; font-weight: 800; }
.stat i { position: absolute; left: 0; top: 0; bottom: 0; opacity: 0.85; transition: width 0.25s; }
.stat svg { position: relative; width: 14px; height: 14px; flex: none; }
.stat span { position: relative; margin-left: auto; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.stat.hp i { background: linear-gradient(90deg, #4f8a2c, var(--hp)); }
.stat b { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(150, 214, 104, 0.32); transition: width 0.25s; }
.stat.food i { background: linear-gradient(90deg, #9a5b20, var(--food)); }
.stat.water i { background: linear-gradient(90deg, #2c6d99, var(--water)); }
.stat.air i { background: linear-gradient(90deg, #4f8fae, #a9dcf2); }
.stat.air { color: #e6f6ff; }
.stat.low { animation: low 1s infinite; }
@keyframes low { 50% { background: rgba(120, 20, 14, 0.7); } }
.stat.hp::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.stat.hp.hit::after { animation: hpflash 0.32s ease-out; }
@keyframes hpflash { 0% { opacity: 0.75; } 100% { opacity: 0; } }
.rail { position: absolute; right: 14px; bottom: 104px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.air-on .rail { bottom: 132px; }
.low-hp { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 48%, rgba(150, 8, 0, 0.6)); opacity: 0; pointer-events: none; }
.low-hp.on { animation: lowpulse 1.15s ease-in-out infinite; }
@keyframes lowpulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.9; } }
.flags { display: grid; gap: 4px; justify-items: end; }
.flag { display: flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 800; background: rgba(12, 14, 12, 0.66); }
.flag.cold { color: var(--cold); }
.flag.hot { color: var(--hot); }
.flag.bleed { color: #ff7a6b; }
.flag.wet { color: var(--water); }
.flag.blocked { color: #ffb3aa; }
.flag.priv { color: var(--team); }
.flag.hungry { color: var(--food); }
.flag.thirsty { color: var(--water); }
.flag.rad { color: #d8e04a; }
.flag.poison { color: #9ad15a; }
.flag.comfort { color: var(--gold-2); }
.flag svg { width: 13px; height: 13px; flex: none; }
.flag.safe { color: #eef8e6; background: rgba(74, 122, 42, 0.88); }
.flag.hostile { color: #fff0ec; background: rgba(158, 42, 30, 0.9); }

.belt { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 4px; pointer-events: auto; }
.belt .slot { width: 62px; height: 62px; cursor: pointer; }
.belt .slot canvas { width: 48px; height: 48px; }
.belt .slot.held { border-color: var(--gold); background: var(--slot-on); box-shadow: 0 0 0 1px var(--gold) inset; }
.belt .key { position: absolute; right: 5px; top: 2px; font-size: 10.5px; font-weight: 800; color: rgba(255, 255, 255, 0.5); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); pointer-events: none; }
.slot .n.mag { color: var(--gold-2); }
.slot .n.mag.empty { color: #ff8a7d; }
.held-name { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); padding: 3px 12px; border-radius: 4px; background: rgba(12, 14, 12, 0.6); font-size: 13px; font-weight: 800; letter-spacing: 0.03em; white-space: nowrap; opacity: 0; pointer-events: none; }
.held-name.on { animation: heldname 1.6s forwards; }
@keyframes heldname { 0% { opacity: 0; transform: translate(-50%, 4px); } 10% { opacity: 1; transform: translate(-50%, 0); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 0); } }
.inv-open .belt, .inv-open .queue, .inv-open .held-name { visibility: hidden; }

.compass { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); width: 360px; height: 54px; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent); }
.compass-strip { position: absolute; left: 50%; top: 0; height: 26px; white-space: nowrap; font-size: 12px; font-weight: 800; color: rgba(255, 255, 255, 0.85); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); will-change: transform; }
.compass-strip span { position: absolute; top: 5px; transform: translateX(-50%); }
.compass-strip span.tick { top: 7px; font-size: 10px; color: rgba(255, 255, 255, 0.4); }
.compass::after { content: ""; position: absolute; left: 50%; top: 20px; width: 2px; height: 6px; margin-left: -1px; background: var(--gold); }
.compass-pins { position: absolute; left: 50%; top: 28px; width: 0; height: 26px; }
.cpin { position: absolute; left: 0; top: 0; width: 0; }
.cpin b { position: absolute; left: -8px; top: 0; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.6); font-size: 9.5px; font-weight: 900; line-height: 1; color: #15140f; }
.cpin small { position: absolute; left: 0; top: 16px; transform: translateX(-50%); font-size: 9.5px; font-weight: 800; color: rgba(255, 255, 255, 0.85); white-space: nowrap; text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
.cpin.mate b { left: -5px; top: 3px; width: 10px; height: 10px; border: 2px solid #0d1a0d; background: var(--team); }
.cpin.mate.off b { background: var(--faint); }
.cpin.shared b { left: -6px; top: 2px; width: 12px; height: 12px; border-radius: 2px; background: var(--team); transform: rotate(45deg); }
.cpin.warp b { background: #5dffc6; box-shadow: 0 0 6px rgba(93, 255, 198, 0.7); }
.cpin.warp b .mg { width: 12px; height: 12px; }

.feed { display: grid; gap: 4px; justify-items: end; }
.feed-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border-radius: 4px; background: rgba(12, 14, 12, 0.66); font-size: 13px; font-weight: 700; animation: feedin 0.18s ease-out; transition: opacity 0.45s; }
.feed-row.out { opacity: 0; }
.feed-row canvas { width: 24px; height: 24px; }
.feed-row b { display: inline-block; color: var(--good); font-variant-numeric: tabular-nums; }
.feed-row b.bump { animation: bump 0.26s ease-out; }
.feed-row.made b { color: var(--gold-2); }
@keyframes feedin { 0% { opacity: 0; transform: translateX(14px); } 100% { opacity: 1; transform: none; } }
@keyframes bump { 0% { transform: scale(1.35); } 100% { transform: none; } }
.notes { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; }
.note { padding: 7px 14px; border-radius: 6px; background: rgba(12, 14, 12, 0.8); font-size: 14px; font-weight: 700; animation: note 2.8s forwards; }
.note.bad { color: #ffb3aa; }
.note.good { color: #bfe7a1; }
@keyframes note { 0% { opacity: 0; transform: translateY(-6px); } 8% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; } }
.queue { position: absolute; left: calc(50% - 196px); bottom: 84px; display: flex; gap: 4px; pointer-events: auto; }
.queue .slot { width: 48px; height: 48px; cursor: pointer; }
.queue .slot canvas { width: 36px; height: 36px; }
.slot .left { position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; font-size: 10px; font-weight: 800; color: var(--gold-2); text-shadow: 0 1px 2px #000; pointer-events: none; }
.slot.making .ring { position: absolute; left: 3px; top: 3px; width: calc(100% - 6px); height: calc(100% - 6px); }
.slot.making .ring circle { stroke-width: 2; stroke: rgba(255, 255, 255, 0.1); }
.slot.making .ring .ring-fill { stroke: var(--gold); transition: stroke-dashoffset 0.25s linear; }
.netstats { position: absolute; right: 10px; top: 6px; display: flex; gap: 8px; font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, 0.7); text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
.netstats b { font-weight: 800; color: rgba(255, 255, 255, 0.85); }
.coords { position: absolute; left: 50%; top: 66px; transform: translateX(-50%); display: flex; gap: 10px; font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, 0.7); text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
.coords b { font-weight: 800; color: var(--gold-2); }
body.relock, body.relock * { cursor: none !important; }
.squad { position: absolute; left: 14px; top: 14px; display: grid; gap: 3px; width: 200px; }
.squad-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto 12px 38px; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 4px; background: rgba(12, 14, 12, 0.6); font-size: 12px; font-weight: 700; }
.squad-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d9eecb; }
.squad-row.off .name, .squad-row.fallen .name { color: var(--faint); }
.squad-row small { text-align: right; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.squad-hp { width: 36px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.squad-hp i { display: block; height: 100%; width: 0; background: var(--hp); }
.squad-arrow { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 10px solid var(--team); justify-self: center; }
.squad-row.off .squad-arrow { border-bottom-color: var(--faint); }
.ammo { position: absolute; right: 236px; bottom: 14px; display: flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 4px; background: rgba(12, 14, 12, 0.66); font-weight: 900; font-variant-numeric: tabular-nums; }
.ammo b { font-size: 24px; }
.ammo span { font-size: 13px; color: var(--muted); }
.reloadbar { position: absolute; left: 50%; top: calc(50% + 26px); width: 70px; height: 3px; margin-left: -35px; background: rgba(255, 255, 255, 0.15); }
.reloadbar i { display: block; width: 0; height: 100%; background: #fff; }
.hurt { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(170, 10, 0, 0.55)); opacity: 0; transition: opacity 0.6s; }
.hurt.on { opacity: 1; transition: none; }
.hurt-dir { position: absolute; left: 50%; top: 50%; width: 160px; height: 160px; margin: -80px 0 0 -80px; opacity: 0; }
.hurt-dir::before { content: ""; position: absolute; left: 50%; top: 0; width: 40px; height: 14px; margin-left: -20px; border-radius: 50% 50% 0 0; background: rgba(230, 40, 20, 0.8); filter: blur(1px); }
.hurt-dir.on { animation: hurtdir 1.2s forwards; }
@keyframes hurtdir { 0% { opacity: 1; } 100% { opacity: 0; } }
.underwater { position: absolute; inset: 0; background: rgba(20, 70, 100, 0.45); }

.chat { position: absolute; left: 14px; bottom: 14px; width: min(440px, calc(100vw - 28px)); display: grid; gap: 6px; }
.chat-lines { display: grid; gap: 3px; align-content: end; padding: 0 2px; overflow: hidden; }
.chat-line { font-size: 13.5px; line-height: 1.4; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9); overflow-wrap: anywhere; transition: opacity 1.4s; }
.chat-line.gone { opacity: 0; }
.chat:not(.open) .chat-line:nth-last-child(n + 9) { display: none; }
.chat.open .chat-lines { max-height: min(42vh, 360px); overflow-y: auto; padding: 8px 10px; border-radius: 6px; background: rgba(8, 10, 8, 0.66); pointer-events: auto; overscroll-behavior: contain; }
.chat.open .chat-line { opacity: 1; transition: none; }
.chat-av { width: 18px; height: 18px; margin-right: 6px; border-radius: 50%; vertical-align: -4px; background: rgba(255, 255, 255, 0.1); }
.chat-team { margin-right: 6px; font-size: 10.5px; font-weight: 900; letter-spacing: 0.08em; color: var(--team); }
.chat-pm { margin-right: 6px; font-size: 10.5px; font-weight: 900; letter-spacing: 0.08em; color: var(--cold); }
.chat-line.pm .chat-name { color: #8cc8ee; }
.chat-line.pm .chat-text { color: #c6e3f5; }
.chat.open .chat-name.link { cursor: pointer; }
.chat.open .chat-name.link:hover { text-decoration: underline; }
.chat-menu { position: absolute; z-index: 2; padding: 3px; border-radius: 4px; border: 1px solid var(--line-2); background: rgba(8, 10, 8, 0.94); pointer-events: auto; }
.chat-menu button { display: block; height: 28px; padding: 0 14px; border: 0; border-radius: 3px; background: transparent; color: var(--text); font: 700 13px var(--font); white-space: nowrap; cursor: pointer; }
.chat-menu button:hover { background: var(--slot-on); }
.chat-name { font-weight: 800; color: var(--gold-2); }
.chat-line.team .chat-text { color: #d9eecb; }
.chat-line.system { color: var(--muted); font-style: italic; }
.chat-line.system.bad { color: #ffb3aa; }
.chat-line.system.good { color: #bfe7a1; }
.chat-line.server { font-size: 12.5px; color: var(--muted); }
.chat-line.server b { font-weight: 700; color: var(--text); }
.chat-line.server.banned,
.chat-line.server.banned b { color: #ff2b2b; font-weight: 700; }
.chat-row { display: flex; gap: 6px; align-items: center; pointer-events: auto; }
.chat-to { flex: none; height: 34px; padding: 0 10px; border-radius: 4px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.7); color: var(--gold-2); font-size: 11.5px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.chat-to.team { color: var(--team); border-color: rgba(123, 191, 74, 0.55); }
.chat-input { flex: 1; min-width: 0; pointer-events: auto; height: 34px; border-radius: 4px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.7); color: var(--text); padding: 0 10px; outline: none; font: 14px var(--font); user-select: text; -webkit-user-select: text; }
.chat-input:focus { border-color: var(--gold); }
.chat-row.team .chat-input:focus { border-color: var(--team); }
.chat-picbtn { flex: none; width: 34px; height: 34px; padding: 0; border-radius: 4px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.7); color: var(--gold-2); font: 800 19px/1 var(--font); cursor: pointer; }
.chat-picbtn:hover:not(:disabled) { border-color: var(--gold); }
.chat-picbtn:disabled { opacity: 0.5; cursor: wait; }
.chat-thumb { position: relative; flex: none; width: 34px; height: 34px; }
.chat-thumb img { width: 34px; height: 34px; border-radius: 4px; object-fit: cover; border: 1px solid var(--gold); }
.chat-thumb button { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%; background: #2a2a24; color: var(--text); font: 700 12px/16px var(--font); cursor: pointer; }
.chat-pic { display: block; width: auto; height: auto; max-width: min(240px, 100%); max-height: 160px; margin-top: 4px; border-radius: 4px; }
.chat-suggest { max-height: 214px; overflow-y: auto; padding: 3px; border-radius: 6px; background: rgba(8, 10, 8, 0.92); border: 1px solid var(--line-2); pointer-events: auto; overscroll-behavior: contain; }
.sug { display: flex; align-items: center; gap: 8px; height: 26px; padding: 0 8px; border-radius: 4px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.sug canvas { width: 20px; height: 20px; flex: none; }
.sug b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.sug small { margin-left: auto; padding-left: 10px; color: var(--faint); font-size: 11.5px; }
.sug.on { background: rgba(201, 168, 79, 0.2); color: var(--gold-2); }
.sug.hint { cursor: default; color: var(--faint); font-style: italic; }
.chat-sig { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px; font-size: 12px; font-weight: 700; color: var(--faint); text-shadow: 0 1px 2px #000; }
.chat-sig b { color: var(--muted); }
.chat-sig span.on { color: var(--gold-2); }

#ui { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#ui > * { pointer-events: auto; }
#ui > .drag { pointer-events: none; }
.shade { position: fixed; inset: 0; background: rgba(6, 8, 6, 0.45); backdrop-filter: blur(2px); }
.panel { padding: 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4); }
.panel-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.panel-title .spacer { flex: 1; }
.facts { display: grid; gap: 4px; font-size: 13px; }
.facts > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.04); }
.facts > div > span { color: var(--muted); }

.inv { position: fixed; inset: 0; margin: auto; width: fit-content; height: fit-content; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: auto; display: grid; grid-template-columns: auto auto auto; grid-template-rows: minmax(0, 1fr); grid-template-areas: "wear pack side"; gap: 10px; align-items: start; padding: 4px; }
.inv-wear { grid-area: wear; }
.inv-detail { position: fixed; right: 12px; bottom: 12px; z-index: 2; width: min(330px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; }
.inv-pack { grid-area: pack; }
.inv-side { grid-area: side; display: grid; gap: 8px; align-content: start; }
.inv-belt, .inv-bag { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.inv-belt .slot.held { border-color: var(--gold); background: var(--slot-on); }
.panel-title.bag-head { min-height: 30px; margin: 10px 0 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.bag-head + .inv-bag { margin-top: 0; padding-top: 0; border-top: 0; }
.bag-head .bag-name { color: var(--text); text-transform: none; letter-spacing: 0.02em; }
.bag-head .pack-name { flex: 1; }
.pack-name .input { height: 30px; }
.grid { display: grid; gap: 4px; }
.grid.six { grid-template-columns: repeat(6, 62px); }
.grid.three { grid-template-columns: repeat(3, 62px); }
.grid.wear { grid-template-columns: repeat(9, 40px); }
.grid.wear .slot { width: 40px; height: 40px; }
.grid.wear .slot canvas { width: 31px; height: 31px; }
.slot { position: relative; width: 62px; height: 62px; border-radius: 5px; background: var(--slot); border: 1px solid var(--line); display: grid; place-items: center; touch-action: none; }
.slot canvas { width: 48px; height: 48px; pointer-events: none; }
.slot .n { position: absolute; right: 4px; bottom: 2px; font-size: 12px; font-weight: 800; text-shadow: 0 1px 2px #000; pointer-events: none; }
.slot .cond { position: absolute; left: 3px; bottom: 3px; top: 3px; width: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); pointer-events: none; }
.slot .cond i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 2px; background: var(--hp); }
.slot .cond.broke i { background: var(--bad); }
.slot.broken canvas { opacity: 0.45; }
.slot.sel { border-color: var(--gold); }
.slot.drop-on { border-color: var(--gold); background: var(--slot-on); }
.slot.picked { border-color: var(--gold-2); box-shadow: 0 0 0 1px var(--gold-2) inset; }
.slot.picked canvas { opacity: 0.4; }
.slot.carry::before, .slot.carry::after { content: ""; position: absolute; left: 4px; bottom: 3px; height: 4px; border-radius: 2px; pointer-events: none; }
.slot.carry::before { right: 4px; background: rgba(0, 0, 0, 0.6); }
.slot.carry::after { width: 0; background: #7cc04a; animation: carry var(--carry-time, 300ms) linear var(--carry-wait, 0ms) forwards; }
@keyframes carry { to { width: calc(100% - 8px); } }
.slot.empty-label::after { content: attr(data-label); position: absolute; bottom: 3px; left: 0; right: 0; text-align: center; font-size: 9.5px; font-weight: 800; color: var(--faint); letter-spacing: 0.05em; text-transform: uppercase; white-space: pre-line; line-height: 1.05; }
.drag { position: fixed; z-index: 60; width: 56px; height: 56px; pointer-events: none; transform: translate(-50%, -50%); opacity: 0.9; }
.drag canvas { width: 56px; height: 56px; }
.drag .n { position: absolute; right: 2px; bottom: 0; font-size: 12px; font-weight: 800; text-shadow: 0 1px 2px #000; }

.inv-char { display: grid; grid-template-columns: 168px 1fr; gap: 10px; margin-bottom: 10px; }
.mirror { position: relative; min-height: 340px; border-radius: 6px; overflow: hidden; background: #232723; border: 1px solid var(--line); cursor: grab; touch-action: none; }
.mirror.turning { cursor: grabbing; }
.mirror canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.mirror::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 75% 55% at 50% 40%, rgba(255, 255, 255, 0.05), transparent 70%), linear-gradient(transparent 64%, rgba(0, 0, 0, 0.3)); }
.armor { gap: 3px; align-content: start; font-size: 12.5px; }
.armor > div { padding: 3px 8px; }
.armor b { font-variant-numeric: tabular-nums; }
.armor .vital + div:not(.vital) { margin-top: 7px; }
.char-side .inv-char { margin: 0; }
.detail { min-width: 260px; display: grid; gap: 10px; align-content: start; }
.detail-head { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; }
.detail-head canvas { width: 48px; height: 48px; }
.detail h3 { margin: 0; font-size: 17px; }
.detail .kind { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.detail .facts { grid-template-columns: 1fr 1fr; }
.detail .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-row { display: grid; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.split { display: flex; gap: 10px; align-items: center; }
.split input[type="range"] { flex: 1; accent-color: var(--gold); }
.split b { min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.ammo-pick { display: flex; flex-wrap: wrap; gap: 4px; }
.ammo-pick button { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 9px 0 4px; border-radius: 5px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.05); font-size: 12px; font-weight: 800; }
.ammo-pick button.on { border-color: var(--gold); background: var(--slot-on); color: var(--gold-2); }
.ammo-pick canvas { width: 24px; height: 24px; }

.side-tabs, .menu-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); }
.side-tabs button, .menu-tabs button { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-tabs button.on, .menu-tabs button.on { background: rgba(255, 255, 255, 0.09); color: var(--text); }

.craft { width: 500px; max-width: calc(100vw - 24px); display: grid; grid-template-columns: 136px 1fr; gap: 10px; height: min(560px, calc(100vh - 40px)); }
.craft-cats { display: grid; gap: 3px; align-content: start; overflow-y: auto; }
.craft-cat { display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 32px; padding: 0 10px; border-radius: 5px; border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; text-align: left; white-space: nowrap; }
.craft-cat.on { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.craft-cat small { font-size: 11px; color: var(--gold-2); }
.craft-main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 10px; min-height: 0; min-width: 0; }
.craft-main .input { height: 34px; }
.craft-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 4px; align-content: start; overflow-y: auto; min-height: 0; padding-right: 4px; }
.craft-list .slot { width: auto; height: auto; aspect-ratio: 1; cursor: pointer; }
.craft-list .slot canvas { width: 70%; height: 70%; }
.craft-list .slot.cant canvas { opacity: 0.35; }
.craft-list .slot.picked canvas { opacity: 1; }
.craft-list .slot.cant.picked canvas { opacity: 0.35; }
.craft-list .slot.locked::after { content: ""; position: absolute; right: 4px; top: 4px; width: 8px; height: 8px; border-radius: 2px; background: var(--faint); }
.craft-pick { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.04); }
.craft-pick .slot { width: 64px; height: 64px; }
.craft-pick .slot canvas { width: 50px; height: 50px; }
.craft-pick h3 { margin: 0 0 6px; font-size: 16px; }
.craft-pick h3 small { color: var(--muted); font-size: 12px; }
.cost { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cost span { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 3px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); color: var(--text); }
.cost span canvas { width: 20px; height: 20px; }
.cost span.short { color: #ff9c91; }
.craft-go { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.craft-go .input { width: 58px; height: 30px; padding: 0 6px; text-align: center; }
.craft-go .btn.small { padding: 0 10px; }
.craft-meta { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.craft-meta .need { color: #ffb3aa; }
.craft-queue { display: flex; flex-wrap: wrap; gap: 4px; }
.craft-queue .slot { width: 44px; height: 44px; cursor: pointer; }
.craft-queue .slot canvas { width: 32px; height: 32px; }

.box-side { position: relative; display: grid; gap: 10px; }
.grid.five { grid-template-columns: repeat(5, max-content); }
.grid.four { grid-template-columns: repeat(4, max-content); }
.turret-slots { display: flex; align-items: center; gap: 12px; }
.tc-tools { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.tc-tools > span { display: block; margin-bottom: 6px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; }
.research { display: grid; gap: 10px; }
.research-slots { display: flex; align-items: center; gap: 10px; }
.research-bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.research-bar i { display: block; height: 100%; width: 0; background: var(--gold); }
.slot .grow { position: absolute; left: 4px; right: 4px; bottom: 3px; height: 3px; border-radius: 2px; background: rgba(0, 0, 0, 0.45); overflow: hidden; pointer-events: none; }
.slot .grow i { display: block; height: 100%; width: 0; background: var(--hp); transition: width 0.4s; }
.slot .grow.ripe i { background: var(--gold-2); }
.names { display: flex; flex-wrap: wrap; gap: 4px; }
.facts > .names { padding: 4px; justify-content: flex-start; background: none; }
.names span { padding: 2px 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); font-size: 12px; font-weight: 700; color: var(--text); }
.vend { display: grid; gap: 8px; width: 400px; max-width: 100%; }
.vend-tabs { background: rgba(0, 0, 0, 0.25); }
.vend-page { display: grid; gap: 8px; }
.vend-offers { display: grid; gap: 4px; max-height: min(52vh, 420px); overflow-y: auto; }
.vend-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.04); }
.vend-row.empty { opacity: 0.75; }
.vend-side { display: flex; align-items: center; gap: 4px; }
.vend-side .input { width: 62px; height: 30px; padding: 0 6px; text-align: center; }
.vend-for { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.vend-acts { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.slot.pick-item { width: 42px; height: 42px; padding: 0; cursor: pointer; }
.slot.pick-item canvas { width: 32px; height: 32px; }
.vend-name { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.vend-name .input { height: 32px; }
.offer .name small.stock { color: var(--muted); }
.empty-note { padding: 12px; text-align: center; font-size: 13px; color: var(--muted); }
.picker { position: absolute; inset: 0; z-index: 3; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; padding: 12px; border-radius: 8px; background: rgba(18, 21, 18, 0.97); }
.picker-head { display: flex; gap: 8px; align-items: center; }
.picker-head .input { height: 34px; }
.picker-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 4px; align-content: start; overflow-y: auto; }
.picker-list .slot { width: auto; height: auto; aspect-ratio: 1; padding: 0; cursor: pointer; }
.picker-list .slot canvas { width: 70%; height: 70%; }
.picker-list .slot:hover { border-color: var(--gold); }
.box-side .panel-title { margin: 0; }
.box-grid { max-height: min(46vh, 360px); overflow-y: auto; }
.box-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.box-side > .box-acts, .box-side > .box-info { width: 0; min-width: 100%; }
.btn.small.lf-cog { padding: 0 8px; }
.lf-cog svg { width: 15px; height: 15px; }
.btn.lf-cog.on { border-color: var(--gold); color: var(--gold-2); }
.loot-filter { position: absolute; top: 0; left: 0; right: 0; min-height: 100%; z-index: 3; display: grid; gap: 10px; align-content: start; padding: 12px; border-radius: 8px; border: 1px solid var(--line); background: rgba(18, 21, 18, 0.97); }
.lf-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.lf-kinds button { height: 30px; padding: 0 6px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255, 255, 255, 0.05); color: var(--muted); font: 700 12.5px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lf-kinds button:hover { border-color: var(--line-2); color: var(--text); }
.lf-kinds button.on { border-color: var(--gold); background: var(--slot-on); color: var(--gold-2); }
.lf-items { display: flex; flex-wrap: wrap; gap: 4px; }
.lf-add { font-size: 22px; color: var(--faint); }
.lf-add:hover { border-color: var(--gold); color: var(--gold-2); }
.recycle { display: flex; align-items: center; gap: 10px; }
.recycle-arrow { font-size: 22px; font-weight: 900; color: var(--faint); }
.furnace-in { display: flex; align-items: start; gap: 10px; }
.grid.one { grid-template-columns: auto; }
.grid.two { grid-template-columns: repeat(2, auto); }
.bench-side { display: grid; gap: 8px; width: 260px; max-width: 100%; }
.tree-layer { position: fixed; inset: 0; z-index: 5; background: radial-gradient(140% 100% at 50% 0%, #222720, #090b09 75%); }
.tree-top { position: absolute; left: 0; right: 0; top: 0; height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 14px 0 18px; border-bottom: 1px solid var(--line); background: rgba(9, 11, 9, 0.85); }
.tree-top .spacer { flex: 1; }
.tree-title { font-size: 14px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.tree-levels { width: min(320px, 42vw); }
.tree-levels:empty { display: none; }
.tree-scrap { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.06); font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tree-scrap canvas { width: 20px; height: 20px; }
.tree-notes { position: absolute; left: 50%; top: 70px; z-index: 1; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; pointer-events: none; }
.tree-view { position: absolute; left: 0; right: 0; top: 52px; bottom: 0; overflow: hidden; cursor: grab; touch-action: none; background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px); }
.tree-view.panning { cursor: grabbing; }
.tree-board { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.tree-lines { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.tree-lines path { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 3; stroke-linejoin: round; }
.tree-lines path.open { stroke: rgba(226, 197, 115, 0.6); }
.tree-lines path.lit { stroke: rgba(123, 191, 74, 0.85); }
.tree-node { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; padding: 0; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--line-2); background: #1c201b; color: var(--text); transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s; }
.tree-node canvas { width: 48px; height: 48px; pointer-events: none; }
.tree-node:hover { border-color: rgba(255, 255, 255, 0.4); }
.tree-node.locked { background: #111310; border-color: rgba(255, 255, 255, 0.08); }
.tree-node.locked canvas { opacity: 0.35; filter: grayscale(1); }
.tree-node.open { border-color: rgba(201, 168, 79, 0.9); box-shadow: 0 0 0 1px rgba(201, 168, 79, 0.25), 0 0 16px rgba(201, 168, 79, 0.18); }
.tree-node.open.short { border-color: rgba(201, 168, 79, 0.45); box-shadow: none; }
.tree-node.known { background: #1d2a18; border-color: rgba(123, 191, 74, 0.8); }
.tree-node.sel { box-shadow: 0 0 0 2px #f2efe4, 0 0 18px rgba(255, 255, 255, 0.2); }
.tree-node.got { animation: tree-got 0.9s ease-out; }
@keyframes tree-got { from { box-shadow: 0 0 0 0 rgba(123, 191, 74, 0.9); } to { box-shadow: 0 0 0 18px rgba(123, 191, 74, 0); } }
.tree-root { width: 76px; height: 76px; margin: -38px 0 0 -38px; border-color: var(--gold); background: #262a1f; }
.tree-root canvas { width: 56px; height: 56px; }
.tree-cost { position: absolute; right: -6px; bottom: -9px; display: inline-flex; align-items: center; gap: 2px; padding: 0 5px 0 2px; border-radius: 4px; border: 1px solid var(--line-2); background: rgba(8, 10, 8, 0.94); font-size: 11px; font-weight: 800; line-height: 16px; font-variant-numeric: tabular-nums; pointer-events: none; }
.tree-cost canvas { width: 14px; height: 14px; }
.tree-node.known .tree-cost { display: none; }
.tree-node.locked .tree-cost { color: var(--faint); }
.tree-node.short .tree-cost { color: #ff9c91; }
.tree-side { position: absolute; right: 16px; top: 68px; width: 300px; max-height: calc(100% - 84px); overflow-y: auto; display: grid; gap: 10px; align-content: start; background: #161915; }
.tree-head { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; font-size: 16px; }
.tree-head canvas { width: 64px; height: 64px; }
.tree-price { display: inline-flex; align-items: center; gap: 3px; margin-left: 2px; font-variant-numeric: tabular-nums; }
.tree-price canvas { width: 18px; height: 18px; }
.tree-confirm { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.shop { display: grid; gap: 4px; width: 400px; max-width: 100%; max-height: min(58vh, 460px); overflow-y: auto; }
.offer { display: grid; grid-template-columns: 40px 1fr auto; gap: 4px 10px; align-items: center; padding: 6px 8px; border-radius: 5px; background: rgba(255, 255, 255, 0.04); }
.offer canvas { grid-row: span 2; width: 40px; height: 40px; }
.offer .name { font-weight: 700; font-size: 13.5px; }
.offer .name small { margin-left: 6px; font-weight: 800; color: var(--gold-2); }
.offer-go { display: flex; gap: 4px; align-items: center; }
.offer-go .input { width: 46px; height: 30px; padding: 0 4px; text-align: center; }
.offer-go .btn.small { padding: 0 10px; }
.offer-cost { grid-column: 2 / 4; }

.menu { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; display: grid; gap: 12px; }
.menu h2 { margin: 0; font-size: 22px; letter-spacing: 0.12em; text-transform: uppercase; }
.menu .row, .owner .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.menu .row.three { grid-template-columns: 1fr 1fr 1fr; }
.menu .row.four { grid-template-columns: repeat(4, 1fr); }
.menu-tabs { background: rgba(0, 0, 0, 0.25); }
.menu-body { display: grid; gap: 12px; }
.set { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; font-size: 13.5px; }
.set label { color: var(--muted); font-weight: 600; }
.set .range { display: flex; align-items: center; gap: 8px; }
.set input[type="range"] { width: min(170px, 36vw); accent-color: var(--gold); }
.set .val { min-width: 48px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.set select { justify-self: end; height: 32px; border-radius: 5px; border: 1px solid var(--line-2); background: #1b1e1a; padding: 0 8px; }
.set input[type="checkbox"] { justify-self: end; width: 18px; height: 18px; margin: 0; accent-color: var(--gold); }
.binds { display: grid; gap: 10px; }
.keys { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; font-size: 13px; }
.keys span { color: var(--muted); font-weight: 600; }
.keys button { min-width: 90px; height: 28px; border-radius: 4px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.05); font-weight: 700; font-size: 12px; }
.keys button.listening { border-color: var(--gold); color: var(--gold-2); }
.ctl-panel { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(1080px, calc(100vw - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; display: grid; gap: 12px; overscroll-behavior: contain; }
.ctl-head { display: flex; align-items: center; gap: 8px; }
.ctl-head h2 { margin: 0 auto 0 0; font-size: 22px; letter-spacing: 0.12em; text-transform: uppercase; }
.ib { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(880px, calc(100vw - 24px)); height: min(600px, calc(100vh - 24px)); height: min(600px, calc(100dvh - 24px)); display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
.ib .mf-input { height: 38px; padding: 0 12px; border-radius: 6px; border-color: var(--line-2); background: rgba(0, 0, 0, 0.35); font-size: 14px; user-select: text; -webkit-user-select: text; }
.ib .mf-input:focus { border-color: var(--gold); }
.ib .mf-btn { min-height: 38px; padding: 0 16px; border-radius: 6px; border-color: var(--line-2); font-size: 13px; font-weight: 700; letter-spacing: 0.02em; text-transform: none; }
.ib .mf-btn:hover { background: rgba(255, 255, 255, 0.11); }
.ib .mf-btn.go { background: linear-gradient(180deg, #d8b75a, #b8933a); border-color: #e7cc7f; color: #1b1608; }
.ib .mf-btn.sm { min-height: 30px; padding: 0 12px; font-size: 12.5px; }
.ib .mc, .ib .dm-list, .ib .dm-found { border-radius: 6px; }
.ib .mc-form { padding: 8px; }
.ib .dm-list, .ib .mc-list { user-select: text; -webkit-user-select: text; }
.ctl { display: grid; gap: 12px; }
.ctl-tabs { background: rgba(0, 0, 0, 0.25); }
.ctl-groups { columns: 290px; column-gap: 10px; }
.ctl-group { margin: 0 0 10px; padding: 8px 12px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); break-inside: avoid; }
.ctl-group h4 { margin: 0 0 4px; font-size: 11.5px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-2); }
.ctl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.045); font-size: 13px; }
.ctl-row:last-child { border-bottom: 0; }
.ctl-name { flex: none; color: var(--muted); font-weight: 600; }
.ctl-keys { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px; }
.ctl kbd { min-width: 24px; height: 22px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 4px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: rgba(255, 255, 255, 0.07); font: 800 11.5px var(--font); color: var(--text); white-space: nowrap; }
.ctl-keys small { font-size: 10px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.ctl-keys i { font-style: normal; font-size: 12px; font-weight: 800; color: var(--faint); }
.ctl-keys i.or { padding: 0 2px; }
.ctl-alt { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ctl-groups.touch kbd { height: 24px; padding: 0 10px; border-radius: 999px; border-bottom-width: 1px; border-color: rgba(255, 255, 255, 0.3); background: rgba(10, 12, 10, 0.6); }
.team-tab { display: grid; gap: 10px; }
.team-add { display: flex; gap: 8px; }
.team-list { display: grid; gap: 4px; }
.team-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.04); }
.team-row .name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.team-row .name small { margin-left: 8px; font-size: 10.5px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-2); }
.team-row.invite { border: 1px solid rgba(201, 168, 79, 0.4); }
.team-row .chat-av { margin-right: 0; vertical-align: middle; }
.roster-top { display: flex; align-items: center; gap: 8px; }
.roster-head { flex: 1; color: var(--muted); font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; }
.team-list:has(> .team-row:nth-child(9)) { max-height: 360px; overflow-y: auto; overscroll-behavior: contain; }
.roster-empty { padding: 10px; color: var(--muted); font-style: italic; }
.bounty, .bounty-body, .bounty-form { display: grid; gap: 8px; }
.bounty-count { margin-left: 6px; padding: 0 5px; border-radius: 8px; background: var(--gold); color: #14130d; font-size: 11px; font-weight: 900; }
.bounty-list { display: grid; gap: 4px; max-height: 340px; overflow-y: auto; overscroll-behavior: contain; }
.bounty-row { display: grid; gap: 6px; padding: 8px 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.04); }
.bounty-top { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.bounty-top .name, .bounty-chosen .name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.bounty-top .name small { margin-left: 8px; font-size: 10.5px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-2); }
.bounty-left { color: var(--muted); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bounty-items { display: flex; flex-wrap: wrap; gap: 4px; }
.bounty-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 7px 2px 2px; border-radius: 4px; background: rgba(0, 0, 0, 0.3); font-size: 12px; font-variant-numeric: tabular-nums; }
.bounty-chip canvas { width: 26px; height: 26px; }
.bounty-grid { display: grid; grid-template-columns: repeat(auto-fill, 52px); gap: 4px; }
.bounty-grid .slot { width: 52px; height: 52px; }
.bounty-grid .slot canvas { width: 40px; height: 40px; }
.bounty-mine { grid-template-columns: repeat(auto-fill, 44px); max-height: 144px; overflow-y: auto; overscroll-behavior: contain; }
.bounty-mine .slot { width: 44px; height: 44px; cursor: pointer; }
.bounty-mine .slot canvas { width: 32px; height: 32px; }
.bounty-mine .slot:hover { border-color: var(--line-2); }
.bounty-mine .slot.sel { border-color: var(--gold); background: var(--slot-on); }
.bounty-who { width: 100%; border: 0; color: inherit; text-align: left; }
.bounty-who:hover { background: rgba(255, 255, 255, 0.08); }
.bounty-chosen { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 6px 0 12px; border-radius: 6px; border: 1px solid rgba(201, 168, 79, 0.55); background: rgba(201, 168, 79, 0.1); }
.bounty-picked { display: grid; gap: 4px; }
.bounty-pick { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.04); }
.bounty-pick canvas { flex: none; width: 28px; height: 28px; }
.bounty-pick .name { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bounty-pick .input { width: 80px; height: 30px; padding: 0 6px; text-align: center; }
.bounty-go .btn { width: 100%; }
.menu > .menu-tabs { min-width: 0; flex-wrap: wrap; }
.menu > .menu-tabs:has(> button:nth-child(8)) button { padding: 0 3px; font-size: 12px; }
@media (max-height: 600px) {
  .bounty-list, .bounty-mine { max-height: none; overflow-y: visible; }
}
.menu > .menu-tabs:has(> button:nth-child(8)) button { flex: 1 0 auto; }
.menu:has(.trade.deal) { width: min(640px, calc(100vw - 24px)); }
.trade { display: grid; gap: 8px; }
.trade-top { display: flex; align-items: center; gap: 10px; }
.trade-top .input { flex: 1; min-width: 0; }
.trade-toggle { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.trade-list { display: grid; gap: 4px; }
.trade-people { max-height: 320px; overflow-y: auto; overscroll-behavior: contain; }
.trade-row { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 7px 8px 7px 12px; border-radius: 6px; background: rgba(255, 255, 255, 0.04); }
.trade-row .name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.trade-row .name small { display: block; font-size: 10.5px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-2); }
.trade-row.asked { border: 1px solid rgba(201, 168, 79, 0.4); }
.trade-row .btn { min-width: 76px; }
.trade-left { color: var(--muted); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.trade-cards { position: fixed; right: 14px; top: 46px; display: grid; gap: 8px; width: min(260px, calc(100vw - 28px)); }
.touching .trade-cards, .touching .invites { top: 92px; }
.trade-head { display: flex; align-items: center; gap: 10px; min-height: 34px; color: var(--muted); font-size: 14px; }
.trade-head > span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.trade-head b { color: var(--text); }
.trade-count { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--good); color: #10170b; font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 4px rgba(123, 191, 74, 0.22); }
.trade-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.trade-side { display: grid; align-content: start; gap: 6px; padding: 8px; border-radius: 6px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); transition: border-color 0.15s, background-color 0.15s; }
.trade-side.ok { border-color: rgba(123, 191, 74, 0.75); background: rgba(123, 191, 74, 0.08); }
.trade-who { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.trade-who b { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trade-ok { visibility: hidden; font-size: 10.5px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--good); }
.trade-side.ok .trade-ok { visibility: visible; }
.trade-offer { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.trade-slot { aspect-ratio: 1; border-radius: 5px; border: 1px solid var(--line); background: var(--slot); }
.trade-offer .trade-tile { aspect-ratio: 1; align-content: center; padding: 3px 2px 6px; }
.trade-offer .trade-tile canvas { width: 38px; height: 38px; }
.trade-tile[role="button"] { cursor: pointer; }
.trade-tile[role="button"]:hover { border-color: var(--line-2); }
.trade-n { position: absolute; top: 4px; left: 5px; font-size: 11px; font-weight: 900; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000; }
.trade-mine { display: flex; align-items: center; gap: 10px; }
.trade-mine .input { flex: 1; min-width: 0; height: 32px; }
.trade-label { color: var(--muted); font-size: 12.5px; font-weight: 800; letter-spacing: 0.04em; white-space: nowrap; }
.trade-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 4px; max-height: 214px; overflow-y: auto; overscroll-behavior: contain; }
.trade-go { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.trade-go .btn.gold.on { background: linear-gradient(180deg, #8fcf5a, #6aa83c); border-color: #a9de7c; color: #10170b; }
@media (max-width: 560px) {
  .trade-sides { grid-template-columns: 1fr; }
}
@media (max-height: 600px) {
  .trade-people, .trade-pick { max-height: none; overflow-y: visible; }
}
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot.on { background: var(--good); }
.staff { display: grid; gap: 10px; }
.owner { display: grid; gap: 8px; padding: 10px; border-radius: 6px; border: 1px solid rgba(224, 87, 74, 0.35); background: rgba(224, 87, 74, 0.06); }
.owner h4 { margin: 0; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: #ffb3aa; }

.invites { position: fixed; right: 14px; top: 46px; display: grid; gap: 8px; width: min(260px, calc(100vw - 28px)); }
.invite-card { display: grid; gap: 8px; padding: 10px 12px; }
.invite-from small { display: block; font-size: 10.5px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.invite-from b { font-size: 15px; overflow-wrap: anywhere; }

.dead { position: fixed; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: 12px; background: radial-gradient(ellipse at center, rgba(40, 6, 4, 0.55), rgba(8, 2, 2, 0.88)); }
.dead-card { width: min(420px, calc(100vw - 24px)); display: grid; gap: 14px; text-align: center; }
.dead-card h2 { margin: 0; font-size: 46px; letter-spacing: 0.16em; text-transform: uppercase; color: #ff9c91; }
.dead-card p { margin: 0; color: var(--muted); font-weight: 600; }
.bags { display: grid; gap: 6px; max-height: 40vh; overflow-y: auto; text-align: left; }
.bag-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); }
.bag-row .name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.bag-row small { color: var(--muted); font-variant-numeric: tabular-nums; }
.bag-row .more { padding: 0 9px; font-size: 15px; letter-spacing: 0.05em; }
.bag-row .more.on { border-color: var(--gold); color: var(--gold-2); }
.bag-wrap { display: grid; gap: 0; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); }
.bag-wrap .bag-row { border: 0; background: none; }
.bag-edit { display: grid; gap: 6px; padding: 0 10px 10px; }
.bag-edit .row { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.bag-edit .input { height: 32px; }
.dead-card p.dead-at { margin-top: -8px; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; color: var(--faint); }
.downed { position: fixed; inset: 0; pointer-events: none; display: grid; justify-items: center; align-items: end; padding-bottom: 18vh; background: radial-gradient(ellipse at center, rgba(60, 4, 2, 0.15) 30%, rgba(70, 4, 0, 0.7)); }
.down-card { pointer-events: auto; display: grid; justify-items: center; gap: 6px; padding: 14px 22px; border-radius: 8px; background: rgba(20, 6, 5, 0.72); border: 1px solid rgba(224, 87, 74, 0.35); text-align: center; }
.down-card h2 { margin: 0; font-size: 26px; letter-spacing: 0.18em; text-transform: uppercase; color: #ff9c91; }
.down-clock { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.down-card small { color: var(--muted); font-weight: 700; }
.down-card .btn { margin-top: 4px; }

.mapview { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(6, 10, 14, 0.42); }
.map-wrap { position: relative; width: min(92vmin, 900px); aspect-ratio: 1; border-radius: 6px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.14); background: #0c2836; box-shadow: 0 0 0 4px rgba(10, 12, 10, 0.55), 0 24px 60px rgba(0, 0, 0, 0.55); touch-action: none; cursor: grab; }
.map-wrap:active { cursor: grabbing; }
.map-wrap > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-wrap::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.32); pointer-events: none; }
.touching .mapview { pointer-events: none; padding-top: 56px; }
.touching .map-wrap { width: min(92vmin, 900px, calc(100vh - 72px)); }
.touching .map-corner { left: 50%; top: 12px; transform: translateX(-50%); justify-items: center; }
.touching .map-wrap, .touching .map-tools, .touching .map-find { pointer-events: auto; }
.map-tools { position: absolute; right: 12px; top: 12px; display: flex; gap: 8px; }
.map-btn { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(10, 12, 10, 0.72); color: var(--text); font-size: 22px; line-height: 1; }
.map-btn svg { width: 22px; height: 22px; }
.map-btn.on { border-color: var(--gold); color: var(--gold-2); background: rgba(70, 58, 24, 0.85); }
.map-corner { position: absolute; left: 12px; top: 12px; display: grid; gap: 8px; justify-items: start; }
.map-cells { display: flex; gap: 6px; }
.map-where { display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 9px; border-radius: 6px; background: rgba(10, 12, 10, 0.72); font-size: 15px; font-weight: 900; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; color: var(--gold-2); pointer-events: none; }
.map-where .mg { width: 14px; height: 14px; }
.map-where.at { color: #e6e2d2; }
.map-find.input { width: 168px; height: 32px; padding: 0 10px; font-size: 13px; background: rgba(10, 12, 10, 0.72); }
.map-pane, .map-layer { position: absolute; inset: 0; pointer-events: none; }
.map-pane { will-change: transform; }
.mpt { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; }
.mb { position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #2a2d26; color: #f1ecd8; box-shadow: 0 0 0 1.5px rgba(8, 8, 6, 0.85), inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 2px 4px rgba(0, 0, 0, 0.5); }
.mb .mg { width: 15px; height: 15px; }
.mg .b, .mg .a { fill: currentColor; }
.mg .a { opacity: 0.55; }
.mg .k { fill: rgba(0, 0, 0, 0.36); }
.mg .r { fill: rgba(255, 255, 255, 0.14); stroke: rgba(255, 255, 255, 0.62); stroke-width: 0.7; }
.mb.mon { background: linear-gradient(180deg, #3b3e34, #24271f); color: #ece4c6; }
.mmon.big .mb { left: -12px; top: -12px; width: 24px; height: 24px; }
.mmon.big .mb .mg { width: 16px; height: 16px; }
.mmon.small .mb { left: -9px; top: -9px; width: 18px; height: 18px; }
.mmon.small .mb .mg { width: 12px; height: 12px; }
.mmon.live .mb { background: #c9a232; color: #1d1806; animation: mlive 1.6s ease-in-out infinite; }
.mlabel { position: absolute; left: 0; top: 13px; transform: translateX(-50%); font-size: 10px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: #f2eddc; text-shadow: 0 0 2px #000, 0 1px 3px rgba(0, 0, 0, 0.9); white-space: nowrap; }
.mmon.big .mlabel { top: 14px; font-size: 11px; }
.mmon.small .mlabel { top: 11px; font-size: 9.5px; }
.mtag { position: absolute; left: 0; top: 13px; transform: translateX(-50%); font-size: 10.5px; font-weight: 800; line-height: 1.2; color: #ecebe4; text-shadow: 0 0 2px #000, 0 1px 3px #000; white-space: nowrap; }
.mtime { font-weight: 900; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.mtag i { font-style: normal; }
.map-wrap.far .mev .mtag i, .map-wrap.far .mthing .mtag { display: none; }
.map-wrap.below { background: #0f1214; }
.map-wrap.below .map-layer.mons, .map-wrap.below .map-layer.names, .map-wrap.below .map-layer.events, .map-wrap.below .map-layer.vend, .map-wrap.below .map-layer.piles { display: none; }
.mb.hot { background: #b8392b; }
.mb.warm { background: #c76a2a; }
.mb.loot { background: #b8862c; }
.mb.sea { background: #3c6a80; }
.mb.trade { background: #4d7a39; }
.mb.off { background: #5d5c55; color: #c9c6b8; }
.mb.dig { background: #c9a232; color: #1d1806; }
.mb.death { background: #8c2a22; }
.mb.warp { background: radial-gradient(circle at 50% 40%, #9dffe0, #2fb88c); color: #0c2a21; box-shadow: 0 0 0 1.5px rgba(8, 8, 6, 0.85), 0 0 10px 2px rgba(93, 255, 198, 0.55), 0 2px 4px rgba(0, 0, 0, 0.5); }
.mwarp .mb { left: -12px; top: -12px; width: 24px; height: 24px; }
.mwarp .mb .mg { width: 17px; height: 17px; }
.map-cost { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px 0 8px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(10, 12, 10, 0.72); font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; color: #9dffe0; }
.map-cost[hidden] { display: none; }
.map-cost canvas { width: 18px; height: 18px; }
.mb.fest { background: radial-gradient(circle at 50% 40%, #3a2416, #160e0a); }
.mb.thing { left: -12px; top: -12px; width: 24px; height: 24px; background: radial-gradient(circle at 50% 38%, #f4efdf, #c3bb9f); }
.mb.thing canvas { width: 21px; height: 21px; }
.mb.mark { color: #15140f; }
.mmark .mb { left: -12px; top: -12px; width: 24px; height: 24px; }
.mmark .mtag { top: 15px; }
.mmark:not(.own) .mb { box-shadow: 0 0 0 1.5px rgba(8, 8, 6, 0.85), 0 0 0 3px var(--team), 0 2px 4px rgba(0, 0, 0, 0.5); }
.mmark .mb, .mvend .mb, .mping i { pointer-events: auto; cursor: pointer; }
.mping i { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 2px; border: 2px solid rgba(0, 0, 0, 0.65); background: var(--team); transform: rotate(45deg); }
.mping .mtag, .mmate .mtag { top: 9px; color: #d9eecb; }
.mmate i { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--team); border: 2px solid #0d1a0d; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3); }
.mmate.off i { background: var(--faint); }
.map-me i { position: absolute; left: -13px; top: -13px; width: 26px; height: 26px; border-radius: 50%; background: rgba(16, 18, 14, 0.72); box-shadow: 0 0 0 1.5px #ffd85a, 0 1px 4px rgba(0, 0, 0, 0.6); }
.map-me svg { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; color: #ffd85a; filter: drop-shadow(0 0 1px #000); }
svg.craft { position: absolute; overflow: visible; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55)); }
svg.craft .b, svg.craft .f { stroke: rgba(10, 10, 8, 0.85); stroke-width: 1.1px; paint-order: stroke; stroke-linejoin: round; }
svg.craft .k { fill: rgba(0, 0, 0, 0.42); }
.craft.heli { color: #d4473a; }
.craft.chinook { color: #8d9768; }
.craft.plane { color: #dcd8cc; }
.craft.cargo { color: #6e8a99; }
.craft.cruise { color: #f1efe8; }
.craft.ghost { color: #5f4535; }
.craft.bradley { color: #b7a46a; }
.craft.ferry { color: #7fa1b3; }
.craft.convoy { color: #9c9a6a; }
.craft.jet { color: #a9b0b8; }
.craft.train { color: #8e977a; }
.mev.heli .craft, .mev.bradley .craft, .mev.convoy .craft, .mev.jet .craft, .mev.train .craft { filter: drop-shadow(0 0 3px rgba(255, 70, 50, 0.9)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55)); }
.mev.down { opacity: 0.55; }
.mev .burst { position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7)); }
.mev.crash .mtag { top: 14px; }
.mev.live .mb::after, .mvend.hit .mb::after, .mpile.hit .mb::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid rgba(255, 206, 92, 0.9); animation: mping 1.4s ease-out infinite; }
.mvend .mb { left: -9px; top: -9px; width: 18px; height: 18px; }
.mvend .mb .mg { width: 12px; height: 12px; }
.mvend .mb.thing { left: -11px; top: -11px; width: 22px; height: 22px; }
.mvend .mb.thing canvas { width: 19px; height: 19px; }
.mvend.out .mb { opacity: 0.8; }
.mvend.dim, .mpile.dim { opacity: 0.28; }
.mvend.hit, .mpile.hit { z-index: 2; }
.mvend.hit .mb, .mpile.hit .mb { box-shadow: 0 0 0 2px #fff3c4, 0 0 12px 4px rgba(255, 216, 102, 0.8); }
.mvend.tucked { display: none; }
.mpile .mb { pointer-events: auto; cursor: pointer; }
.mpile.out .mb { opacity: 0.8; }
.mpile.open .mb { box-shadow: 0 0 0 2px #f4efdc, 0 2px 4px rgba(0, 0, 0, 0.5); }
.mcount { position: absolute; left: 3px; top: -17px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #e8c45a; color: #15140f; font-size: 10px; font-weight: 900; line-height: 16px; text-align: center; box-shadow: 0 0 0 1.5px rgba(8, 8, 6, 0.85); pointer-events: none; }
.map-layer.piles.open { z-index: 3; }
.mfan-row { position: absolute; left: 0; bottom: 18px; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: max-content; max-width: 216px; padding: 6px; border-radius: 8px; background: rgba(14, 16, 13, 0.92); border: 1px solid var(--line-2); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); pointer-events: auto; }
.mfan-row.down { bottom: auto; top: 18px; }
.mfan-row .mpt { position: relative; width: 24px; height: 24px; will-change: auto; }
.mfan-row .mvend .mb, .mfan-row .mvend .mb.thing { left: 0; top: 0; width: 24px; height: 24px; }
.mfan-row .mvend .mb .mg { width: 15px; height: 15px; }
.mfan-row .mvend .mb.thing canvas { width: 21px; height: 21px; }
@keyframes mping { from { transform: scale(0.7); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
@keyframes mlive { 50% { box-shadow: 0 0 0 1.5px rgba(8, 8, 6, 0.85), 0 0 10px 3px rgba(255, 210, 90, 0.7); } }
.mark-edit, .vend-pop, .mark-pop { position: absolute; left: 0; top: 0; z-index: 5; padding: 10px; border-radius: 8px; background: rgba(18, 20, 17, 0.95); border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55); cursor: default; }
.mark-pop { min-width: 176px; display: grid; gap: 6px; }
.mark-pop .vend-head { margin-bottom: 2px; }
.mark-edit { width: 236px; display: grid; gap: 8px; }
.mark-edit .input { height: 32px; padding: 0 10px; font-size: 13px; }
.mark-icons { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.mark-icons button { height: 30px; display: grid; place-items: center; padding: 0; border-radius: 5px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: #e9e4d0; }
.mark-icons button .mg { width: 17px; height: 17px; }
.mark-icons button.on { border-color: var(--gold); background: rgba(201, 168, 79, 0.25); color: var(--gold-2); }
.mark-colors { display: flex; justify-content: space-between; }
.mark-colors button { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.6); }
.mark-colors button.on { box-shadow: 0 0 0 2px #f4efdc; }
.mark-acts { display: flex; justify-content: space-between; gap: 8px; }
.vend-pop { width: 252px; max-height: 62%; overflow: auto; }
.vend-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.vend-head b { font-size: 14px; color: var(--gold-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vend-head small { flex: none; color: var(--muted); font-weight: 800; }
.vrows { display: grid; gap: 4px; }
.vrows.none { color: var(--muted); text-align: center; }
.vrow { display: grid; grid-template-columns: 1fr auto 1fr 30px; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.05); }
.vrow.out { opacity: 0.4; filter: grayscale(1); }
.vrow.hit { background: rgba(201, 168, 79, 0.24); }
.vcell { display: flex; align-items: center; gap: 4px; }
.vcell canvas { width: 28px; height: 28px; }
.vcell b { font-size: 12px; }
.vfor { color: var(--muted); }
.vrow small { text-align: right; color: var(--muted); font-weight: 800; font-variant-numeric: tabular-nums; }
.mark-list { position: absolute; right: 12px; top: 62px; width: min(272px, calc(100vw - 24px)); max-height: calc(100% - 80px); overflow: auto; padding: 8px; border-radius: 8px; background: rgba(18, 20, 17, 0.95); border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55); }
.touching .mark-list { pointer-events: auto; }
.ml-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 6px 4px; }
.ml-head b { font-size: 14px; color: var(--gold-2); }
.ml-title { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; padding: 2px 2px 2px 8px; border-radius: 5px; background: rgba(255, 255, 255, 0.05); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #d9d4c2; }
.ml-title.all { margin-top: 0; }
.ml-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-title:not(:has(.ml-eye)) { min-height: 30px; }
.ml-row { display: flex; align-items: center; gap: 6px; padding: 2px 2px 2px 6px; }
.ml-row.dim .ml-go { opacity: 0.45; }
.ml-pick { flex: none; width: 15px; height: 15px; margin: 0; accent-color: var(--gold); }
.ml-go { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 3px 4px; border: 0; border-radius: 5px; background: transparent; color: var(--text); font-size: 13px; font-weight: 700; text-align: left; }
.ml-go span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-go .mb { position: relative; left: 0; top: 0; flex: none; width: 20px; height: 20px; }
.ml-go .mb .mg { width: 13px; height: 13px; }
.ml-eye, .ml-del, .ml-x { flex: none; width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #d9d4c2; font-size: 18px; line-height: 1; }
.ml-eye svg { width: 17px; height: 17px; }
.ml-eye.off, .ml-del, .ml-x { color: var(--muted); }
.ml-go:hover, .ml-eye:hover, .ml-del:hover, .ml-x:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.touching .ml-eye, .touching .ml-del, .touching .ml-x { width: 34px; height: 34px; }
.touching .ml-pick { width: 20px; height: 20px; }
.ml-acts { position: sticky; bottom: -8px; display: flex; gap: 6px; margin: 8px -8px -8px; padding: 8px; background: rgba(18, 20, 17, 0.98); border-top: 1px solid var(--line); }
.ml-acts .btn { flex: 1; }
.evnotes { position: absolute; right: 14px; top: 42px; display: grid; gap: 6px; justify-items: end; pointer-events: none; }
.touching .evnotes { top: 104px; }
.evnote { display: flex; align-items: center; gap: 9px; max-width: 330px; padding: 5px 12px 5px 5px; border-radius: 6px; border-left: 3px solid var(--gold); background: rgba(14, 16, 13, 0.82); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); font-size: 13px; font-weight: 700; color: var(--text); animation: evnote-in 0.35s ease-out, evnote-out 0.6s ease-in 6.5s forwards; }
.evnote .mb { position: relative; left: 0; top: 0; flex: none; width: 26px; height: 26px; }
.evnote .mb .mg { width: 17px; height: 17px; }
@keyframes evnote-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes evnote-out { to { opacity: 0; transform: translateX(24px); } }
.stack-total { position: fixed; z-index: 30; transform: translate(-50%, calc(-100% - 6px)); display: flex; gap: 6px; padding: 3px 8px; border-radius: 4px; background: rgba(8, 10, 8, 0.92); border: 1px solid var(--line-2); font-size: 12px; font-weight: 700; white-space: nowrap; }
#ui > .stack-total { pointer-events: none; }
.stack-total span { color: var(--muted); }
.stack-total b { color: var(--gold-2); font-variant-numeric: tabular-nums; }
.slot.same { border-color: rgba(201, 168, 79, 0.55); }

.keypad { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 240px; display: grid; gap: 10px; }
.keypad .code { height: 48px; display: grid; place-items: center; border-radius: 6px; background: rgba(0, 0, 0, 0.5); font: 900 26px var(--font); letter-spacing: 0.4em; text-indent: 0.4em; color: var(--gold-2); }
.keypad .keys10 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.keypad .keys10 button { height: 48px; border-radius: 6px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.06); font-weight: 900; font-size: 18px; }
.keypad .keys10 button:active { background: var(--slot-on); }

.radial-back { position: fixed; inset: 0; }
.radial { position: fixed; left: 50%; top: 50%; }
.radial svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.radial path { fill: rgba(16, 18, 16, 0.86); stroke: rgba(255, 255, 255, 0.13); stroke-width: 1; cursor: pointer; }
.radial path.on { fill: rgba(96, 78, 30, 0.94); stroke: var(--gold); stroke-width: 1.5; }
.radial path.off { fill: rgba(16, 18, 16, 0.55); }
.radial-label { position: absolute; display: grid; justify-items: center; gap: 4px; text-align: center; font-weight: 800; line-height: 1.15; color: var(--text); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); overflow-wrap: break-word; pointer-events: none; }
.radial-label.on { color: var(--gold-2); }
.radial-label.off { opacity: 0.45; }
.radial-label svg, .radial-label canvas { width: 30px; height: 30px; }
.radial-mid { position: absolute; left: 50%; top: 50%; width: 140px; margin-left: -70px; transform: translateY(-50%); text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); pointer-events: none; }
.radial-mid b { display: block; color: var(--text); font-size: 15px; line-height: 1.2; }
.radial-mid span { display: block; margin-top: 3px; color: var(--gold-2); }

#touch { position: fixed; inset: 0; z-index: 15; pointer-events: none; --k: 1; }
.t-stick { position: absolute; left: 0; bottom: 0; width: 45%; height: 70%; pointer-events: auto; touch-action: none; }
.t-look { position: absolute; right: 0; top: 0; width: 55%; height: 100%; pointer-events: auto; touch-action: none; }
.t-knob { position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); background: rgba(0, 0, 0, 0.15); pointer-events: none; }
.t-knob.rest { left: 104px; top: calc(100% - 112px); opacity: 0.4; }
.t-knob.run { border-color: var(--gold); }
.t-knob i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.t-knob.run i { background: rgba(226, 197, 115, 0.65); }
.t-pad { display: contents; }
.t-btn { position: absolute; width: calc(54px * var(--k)); height: calc(54px * var(--k)); padding: 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.28); background: rgba(10, 12, 10, 0.5); color: #fff; font-size: calc(11px * var(--k)); font-weight: 800; line-height: 1.05; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); pointer-events: auto; touch-action: none; }
.t-btn.held { border-color: var(--gold); background: rgba(70, 58, 24, 0.75); }
.t-btn.on { border-color: var(--gold); color: var(--gold-2); background: rgba(70, 58, 24, 0.55); }
.t-btn.ready { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201, 168, 79, 0.35); }
.t-fire { right: calc(22px * var(--k)); bottom: calc(28px * var(--k)); width: calc(78px * var(--k)); height: calc(78px * var(--k)); background: rgba(140, 40, 30, 0.5); font-size: calc(13px * var(--k)); }
.t-jump { right: calc(126px * var(--k)); bottom: calc(40px * var(--k)); }
.t-aim { right: calc(99px * var(--k)); bottom: calc(105px * var(--k)); }
.t-use { right: calc(34px * var(--k)); bottom: calc(132px * var(--k)); }
.t-crouch { right: calc(194px * var(--k)); bottom: calc(40px * var(--k)); }
.t-reload { right: calc(182px * var(--k)); bottom: calc(101px * var(--k)); }
.t-alt { right: calc(147px * var(--k)); bottom: calc(153px * var(--k)); }
.t-light { right: calc(95px * var(--k)); bottom: calc(188px * var(--k)); }
.t-nvg { right: calc(158px * var(--k)); bottom: calc(214px * var(--k)); }
.t-pickup { right: calc(34px * var(--k)); bottom: calc(200px * var(--k)); }
.t-kami { right: calc(34px * var(--k)); bottom: calc(200px * var(--k)); background: rgba(120, 30, 24, 0.5); font-size: calc(9px * var(--k)); }
.t-chute { right: calc(95px * var(--k)); bottom: calc(188px * var(--k)); }
.t-hover { right: calc(182px * var(--k)); bottom: calc(101px * var(--k)); }
.t-warp { right: calc(34px * var(--k)); bottom: calc(200px * var(--k)); background: rgba(24, 110, 96, 0.5); }
.t-top { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; pointer-events: none; }
.t-top .t-btn { position: static; width: auto; min-width: calc(44px * var(--k)); height: calc(38px * var(--k)); padding: 0 9px; border-radius: 8px; }
.t-top .t-btn:has(.t-count) { position: relative; }
.t-count { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--gold); color: #14130d; font-size: 10px; font-style: normal; font-weight: 900; line-height: 17px; text-align: center; text-shadow: none; }
.t-turn { display: none; }
.t-turn svg { width: 132px; height: 132px; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.t-turn .was { stroke: var(--faint); stroke-dasharray: 4 4; }
.t-turn .now { stroke: var(--gold-2); }
.t-turn .arc { stroke: var(--text); }
@media (orientation: portrait) and (max-width: 600px) {
  .touching .t-turn { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: var(--bg); }
}
@media (min-width: 1000px) and (min-height: 700px) {
  #touch { --k: 1.2; }
}

.touching .belt { bottom: 8px; }
.touching .belt .slot { width: 50px; height: 50px; }
.touching .belt .slot canvas { width: 38px; height: 38px; }
.touching .stats { width: 150px; right: 8px; top: 8px; bottom: auto; }
.touching .rail { right: 166px; top: 64px; bottom: auto; }
.touching .air-on .rail { bottom: auto; }
.touching .compass { width: min(220px, calc(100% - 520px)); left: calc(50% + 70px); }
.touching .ammo { right: auto; left: 50%; top: auto; bottom: 66px; transform: translateX(-50%); }
.touching .feed { position: fixed; left: 50%; top: 42px; transform: translateX(-50%); justify-items: center; }
.touching .feed-row:nth-last-child(n + 4) { display: none; }
.touching .notes { top: 34%; }
.touching .queue { left: 12px; top: 58px; bottom: auto; }
.touching .queue .slot { width: 42px; height: 42px; }
.touching .queue .slot canvas { width: 30px; height: 30px; }
.touching .chat { top: 112px; bottom: auto; width: min(360px, 44vw); }
.touching .chat:not(.open) .chat-line:nth-last-child(n + 5) { display: none; }
.touching .chat.open { width: min(440px, calc(100vw - 28px)); }
.touching .chat.open .chat-lines { max-height: 30vh; }
.touching .squad { left: auto; right: 8px; top: 96px; width: 150px; }
.touching .netstats { top: auto; bottom: 4px; right: 8px; }
.touching .held-name { bottom: 64px; }
.touching .chat-suggest { max-height: 24vh; }
@media (max-width: 999px) {
  .touching .belt, .touching .ammo, .touching .held-name { left: calc(50% - 125px); }
}

@media (min-width: 1340px) and (min-height: 601px) {
  .armor { grid-auto-rows: minmax(min-content, 34px); }
}

@media (max-width: 1339px) {
  .inv { grid-template-columns: auto auto; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "wear side" "pack side"; }
  .inv-char { grid-template-columns: 148px 1fr; }
}

@media (max-width: 1339px) and (min-height: 601px) {
  .armor .vital { display: none; }
  .armor .vital + div { margin-top: 0; }
  .mirror { min-height: 160px; }
}

@media (min-width: 1190px) and (max-width: 1339px) and (min-height: 601px) {
  .inv { grid-template-columns: auto auto auto; grid-template-rows: minmax(0, 1fr); grid-template-areas: "wear pack side"; }
  .inv-char { grid-template-columns: 1fr; }
  .mirror { min-height: 236px; }
  .grid.wear { grid-template-columns: repeat(3, 40px); }
}

@media (max-width: 1060px), (max-height: 600px) {
  .panel { padding: 10px; }
  .slot { width: 46px; height: 46px; }
  .slot canvas { width: 36px; height: 36px; }
  .grid.six { grid-template-columns: repeat(6, 46px); }
  .grid.three { grid-template-columns: repeat(3, 46px); }
  .grid.wear { grid-template-columns: repeat(9, 35px); }
  .grid.wear .slot { width: 35px; height: 35px; }
  .grid.wear .slot canvas { width: 27px; height: 27px; }
  .armor .vital { display: none; }
  .armor .vital + div { margin-top: 0; }
  .mirror { min-height: 190px; }
  .craft { width: 440px; grid-template-columns: 112px 1fr; }
  .craft-cat { height: 28px; padding: 0 8px; font-size: 12px; }
  .shop { width: 360px; }
  .bench-side { width: 240px; }
}

@media (max-width: 760px) {
  .tree-side { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 46%; }
  .inv { inset: 12px 0 auto; grid-template-columns: auto; grid-template-rows: auto auto auto; grid-template-areas: "wear" "pack" "side"; }
  .craft { width: auto; grid-template-columns: 1fr; height: auto; }
  .craft-cats { display: flex; overflow-x: auto; }
  .craft-list { max-height: 36vh; }
  .belt .slot { width: 50px; height: 50px; }
  .queue { left: calc(50% - 160px); bottom: 66px; }
  .belt .slot canvas { width: 38px; height: 38px; }
  .front-title { font-size: 48px; }
}

@media (max-width: 380px) {
  .slot { width: 42px; height: 42px; }
  .slot canvas { width: 32px; height: 32px; }
  .grid.six { grid-template-columns: repeat(6, 42px); }
  .grid.three { grid-template-columns: repeat(3, 42px); }
  .grid.wear { grid-template-columns: repeat(9, 33px); }
  .grid.wear .slot { width: 33px; height: 33px; }
}

@media (max-height: 600px) and (min-width: 600px) {
  .inv { inset: 0; grid-template-columns: auto auto auto; grid-template-rows: auto; grid-template-areas: "wear pack side"; gap: 8px; }
  .inv-wear { display: flex; align-items: flex-start; gap: 8px; }
  .inv-wear .panel-title { display: none; }
  .grid.wear { grid-template-columns: 40px; order: -1; }
  .inv-char { width: 150px; grid-template-columns: 1fr; margin: 0; }
  .mirror { min-height: 236px; }
  .char-side { width: 420px; height: calc(100vh - 82px); display: grid; }
  .char-side .inv-char { width: auto; grid-template-columns: 1fr 168px; }
  .char-side .mirror { min-height: 0; }
  .side-tabs ~ .craft { height: calc(100vh - 82px); }
  .slot { width: 42px; height: 42px; }
  .slot canvas { width: 32px; height: 32px; }
  .grid.six { grid-template-columns: repeat(6, 42px); }
  .grid.three { grid-template-columns: repeat(3, 42px); }
  .panel-title { margin-bottom: 8px; }
  .inv-belt, .inv-bag { margin-top: 8px; padding-top: 8px; }
  .craft { width: 420px; height: calc(100vh - 32px); grid-template-columns: 104px 1fr; }
  .craft-list { grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); min-height: 54px; }
  .craft-pick:not([hidden]) ~ .craft-queue { display: none; }
  .craft-pick { grid-template-columns: 48px 1fr; padding: 8px; }
  .craft-pick .slot { width: 48px; height: 48px; }
  .craft-pick .slot canvas { width: 38px; height: 38px; }
  .shop { width: 360px; max-height: calc(100vh - 110px); }
  .tree-side { width: 260px; }
  .box-grid { max-height: calc(100vh - 140px); }
  .menu { gap: 10px; }
  .box-side .grid.wear { grid-template-columns: repeat(9, 35px); order: 0; }
}

@media (max-height: 600px) and (max-width: 999px) {
  .inv-wear .inv-char { display: none; }
}

@media (max-height: 600px) and (min-width: 600px) and (max-width: 759px) {
  .slot { width: 40px; height: 40px; }
  .slot canvas { width: 30px; height: 30px; }
  .grid.six { grid-template-columns: repeat(6, 40px); }
  .grid.three { grid-template-columns: repeat(3, 40px); }
  .grid.wear { grid-template-columns: 38px; }
  .grid.wear .slot { width: 38px; height: 38px; }
  .craft { width: 270px; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .craft-cats { display: flex; overflow-x: auto; }
  .craft-list { max-height: none; }
  .craft-pick { grid-template-columns: 1fr; }
  .craft-pick > .slot { display: none; }
  .shop, .bench-side, .char-side { width: 270px; }
  .char-side .inv-char { grid-template-columns: 1fr 118px; }
  .offer { grid-template-columns: 32px 1fr; }
  .offer canvas { width: 32px; height: 32px; }
  .offer-go, .offer-cost { grid-column: 2; }
  .box-side .grid.wear { grid-template-columns: repeat(5, 38px); }
}
.scope { position: absolute; inset: 0; background: radial-gradient(circle at center, transparent 0, transparent 33.6vmin, rgba(0, 0, 0, 0.6) 34vmin, #000 34.6vmin); pointer-events: none; }
.scope i { position: absolute; left: 50%; top: 50%; width: 68vmin; height: 68vmin; transform: translate(-50%, -50%); border-radius: 50%; box-shadow: inset 0 0 5vmin rgba(0, 0, 0, 0.4); background: linear-gradient(#000, #000) left center / 23vmin 3px no-repeat, linear-gradient(#000, #000) right center / 23vmin 3px no-repeat, linear-gradient(#000, #000) center top / 3px 23vmin no-repeat, linear-gradient(#000, #000) center bottom / 3px 23vmin no-repeat, linear-gradient(#000, #000) center / 100% 1px no-repeat, linear-gradient(#000, #000) center / 1px 100% no-repeat; }
.scope i::before { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: #c8352a; box-shadow: 0 0 2px rgba(255, 80, 60, 0.7); }
.scope i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: calc(var(--drop, 0px) * 3 + 1px); margin-left: -5px; background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--drop, 0px) - 1px), #000 calc(var(--drop, 0px) - 1px), #000 var(--drop, 0px)); }
.scope.flat i::after { display: none; }

@media (max-width: 560px) {
  .t-top { gap: 5px; }
  .t-top .t-btn { min-width: 38px; height: 36px; padding: 0 6px; font-size: 10px; }
  .touching .stats { width: 124px; }
  .touching .rail { right: 8px; top: 100px; }
  .touching .compass { top: 56px; left: 50%; width: 170px; }
}

.crates { display: grid; gap: 10px; width: 460px; max-width: 100%; }
.crate-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.crate-list.locked { pointer-events: none; opacity: 0.55; }
.crate-row { display: grid; justify-items: center; gap: 3px; min-width: 0; padding: 6px 4px 5px; border: 1px solid transparent; border-radius: 6px; background: rgba(255, 255, 255, 0.04); color: var(--text); font-size: 11.5px; font-weight: 700; }
.crate-row:hover { background: rgba(255, 255, 255, 0.08); }
.crate-row.on { border-color: var(--gold); background: var(--slot-on); }
.crate-row .name { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crate-price { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--gold-2); }
.crate-price canvas { width: 16px; height: 16px; }
.crate-row.short .crate-price { color: #ff8a7d; }
.crate-art { position: relative; display: grid; place-items: center; border-radius: 4px; border: 2px solid var(--t); background: linear-gradient(180deg, var(--t) 0 13%, var(--c) 13% 87%, var(--t) 87%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), inset 0 -10px 14px rgba(0, 0, 0, 0.32); }
.crate-art::before { content: ""; position: absolute; inset: 24% 7%; border-top: 1px solid rgba(0, 0, 0, 0.28); border-bottom: 1px solid rgba(0, 0, 0, 0.28); }
.crate-art canvas { position: relative; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.7)); }
.crate-pane { display: grid; gap: 10px; min-height: 0; }
.crate-head { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.04); }
.crate-head h3 { margin: 0 0 6px; font-size: 16px; }
.crate-odds { display: flex; flex-wrap: wrap; gap: 3px 9px; font-size: 11.5px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.crate-odds span { display: inline-flex; align-items: center; gap: 4px; }
.crate-odds i { width: 8px; height: 8px; border-radius: 2px; background: var(--r); box-shadow: 0 0 6px var(--r); }
.crate-buy { flex-direction: column; gap: 1px; min-height: 46px; padding: 0 16px; }
.crate-buy .crate-price { color: #2a210b; }
.crate-buy.short .crate-price { color: #7a1d12; }
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); grid-auto-rows: max-content; gap: 4px; align-content: start; max-height: min(40vh, 330px); overflow-y: auto; padding-right: 2px; }
.skin-tile { position: relative; display: grid; justify-items: center; align-content: start; gap: 3px; min-width: 0; padding: 7px 4px 8px; border-radius: 5px; border: 1px solid var(--line); background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.5)), radial-gradient(ellipse at 50% 34%, var(--p) 0%, var(--i) 38%, transparent 74%), #14171a; overflow: hidden; }
.skin-tile::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--r); box-shadow: 0 0 8px var(--r); }
.skin-tile canvas { width: 48px; height: 48px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.65)); }
.skin-tile span { max-width: 100%; font-size: 10.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
.skin-tile.owned::before { content: ""; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 4px rgba(0, 0, 0, 0.8); }
.skin-tile.big { padding: 12px; }
.skin-tile.big canvas { width: 96px; height: 96px; }
.skin-tile.big span { display: none; }
.skin-tile.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.skin-tile.locked { opacity: 0.45; }
.crate-open { display: grid; gap: 10px; }
.reel { position: relative; height: 114px; overflow: hidden; border-radius: 6px; border: 1px solid var(--line); background: #0d0f11; -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.reel-strip { display: flex; gap: 6px; padding: 9px 0; will-change: transform; }
.reel .skin-tile { flex: none; width: 92px; height: 94px; }
.reel-mark { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--gold-2); box-shadow: 0 0 8px var(--gold); }
.reel.stopped .skin-tile { transition: opacity 0.4s; }
.reel.stopped .skin-tile:not(.won) { opacity: 0.3; }
.reel .skin-tile.won { border-color: var(--r); box-shadow: 0 0 16px var(--r); }
.reveal { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px; border-radius: 6px; border: 1px solid var(--r); background: rgba(255, 255, 255, 0.04); overflow: hidden; animation: reveal-in 0.35s ease-out; }
.reveal::before { content: ""; position: absolute; inset: -40%; background: radial-gradient(circle at 30% 50%, var(--r), transparent 55%); opacity: 0.2; pointer-events: none; }
.reveal.top::before { animation: reveal-glow 1.6s ease-in-out infinite alternate; }
.reveal > * { position: relative; }
.reveal-text { display: grid; gap: 3px; }
.reveal-text b { font-size: 12px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.reveal-text h3 { margin: 0; font-size: 18px; }
.reveal-text span { font-size: 12.5px; color: var(--muted); }
.reveal-acts { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; }
@keyframes reveal-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes reveal-glow { from { opacity: 0.22; } to { opacity: 0.45; } }
.skin-book { width: 460px; max-width: calc(100vw - 24px); display: grid; grid-template-rows: auto minmax(0, 1fr); height: min(560px, calc(100vh - 82px)); }
.book-count { font-size: 12px; letter-spacing: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.book-list { display: grid; gap: 8px; align-content: start; min-height: 0; overflow-y: auto; padding-right: 2px; }
.book-list .skin-grid { max-height: none; overflow: visible; padding-right: 0; }
.book-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--r); }
.book-head i { width: 8px; height: 8px; border-radius: 2px; background: var(--r); }
.book-head small { color: var(--faint); }
.skin-pick { z-index: 3; }
.skin-pick .skin-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); max-height: min(50vh, 380px); }
.skin-pick .skin-tile:not(.locked) { cursor: pointer; }
.skin-pick .skin-tile:not(.locked):hover { border-color: var(--line-2); }
.bench-skins .skin-grid { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); max-height: min(34vh, 272px); }
.bench-skins .skin-tile:not(.locked) { cursor: pointer; }
.bench-skins .skin-tile:not(.locked):not(.on):hover { border-color: var(--line-2); }
.shop-pane { display: grid; min-height: 0; }
.emote-book .book-list .skin-tile { cursor: pointer; }
.emote-book .book-list .skin-tile:not(.on):hover { border-color: var(--line-2); }
.wheel-ring { position: relative; flex: none; width: 232px; height: 232px; margin: 2px auto 6px; border-radius: 50%; background: radial-gradient(circle, transparent 0 27%, rgba(255, 255, 255, 0.035) 28% 64%, transparent 65%); }
.wheel-slot { position: absolute; display: grid; place-items: center; width: 58px; height: 58px; margin: -29px 0 0 -29px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: rgba(16, 18, 16, 0.86); box-shadow: inset 0 -3px 0 var(--r); cursor: pointer; }
.wheel-slot:hover { border-color: var(--line-2); }
.wheel-slot.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), inset 0 -3px 0 var(--r); }
.wheel-slot.empty { background: rgba(16, 18, 16, 0.45); border-style: dashed; box-shadow: none; }
.wheel-slot.empty.on { border-style: solid; box-shadow: 0 0 0 1px var(--gold); }
.wheel-slot canvas { width: 40px; height: 40px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.7)); pointer-events: none; }
.wheel-mid { position: absolute; left: 50%; top: 50%; width: 100px; transform: translate(-50%, -50%); text-align: center; font-size: 12.5px; font-weight: 800; line-height: 1.2; color: var(--text); pointer-events: none; }
.radial-label canvas.emote-pic { width: 46px; height: 46px; margin: -6px 0 -4px; }
.slot .skin-mark { position: absolute; right: 0; top: 0; width: 0; height: 0; border-top: 10px solid var(--r); border-left: 10px solid transparent; border-top-right-radius: 4px; pointer-events: none; }
@media (max-width: 1060px), (max-height: 600px) {
  .crates, .skin-book { width: 400px; }
}

.mkt-list { max-height: min(38vh, 330px); overflow-x: hidden; }
.mkt-list .offer .name { min-width: 0; }
.mkt-from { margin-top: 2px; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt-sort { width: auto; height: 32px; padding: 0 8px; background: #1b1e1a; }
.mkt-fee { display: inline-flex; align-items: center; gap: 4px; }
.mkt-orders:empty { display: none; }
.mkt-order { display: inline-flex; align-items: center; gap: 6px; color: var(--text) !important; font-weight: 700; }
.vend-cast { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vend-drone { font-size: 12px; font-weight: 700; color: #7fd49a; }
.vend-drone.off { color: #ff9c91; }
@media (max-width: 860px), (max-height: 500px) {
  .ib { left: 0; top: 0; transform: none; width: 100vw; height: 100vh; height: 100dvh; padding: 10px; border-radius: 0; border: 0; }
}

.reader { text-transform: none; --book-font: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif; position: fixed; inset: 0; z-index: 8; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; background: radial-gradient(120% 90% at 50% 40%, rgba(30, 27, 20, 0.82), rgba(6, 7, 6, 0.94)); }
.reader-top { display: flex; align-items: center; gap: 12px; padding: 14px 18px 8px; }
.reader-head { flex: 1; min-width: 0; display: grid; gap: 2px; justify-items: center; text-align: center; padding-left: 40px; }
.reader-head h2 { margin: 0; max-width: 100%; font: 700 22px/1.2 var(--book-font); letter-spacing: 0.01em; text-transform: none; color: #efe6c8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-head span { font: italic 14px/1.3 var(--book-font); letter-spacing: 0.01em; text-transform: none; color: var(--muted); }
.reader-name { width: min(460px, 100%); padding: 4px 6px; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; color: #efe6c8; font: 700 21px/1.25 var(--book-font); text-align: center; outline: none; user-select: text; -webkit-user-select: text; }
.reader-name:focus { border-bottom-color: var(--gold); }
.reader-name::placeholder { color: rgba(239, 230, 200, 0.35); }
.reader-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 0 16px 6px; }
.reader-tools i { width: 1px; margin: 5px 5px; background: var(--line-2); }
.reader-tool { width: 34px; height: 30px; display: grid; place-items: center; padding: 0; border-radius: 5px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--text); font: 15px/1 Georgia, "Times New Roman", serif; }
.reader-tool:hover { background: rgba(255, 255, 255, 0.1); }
.reader-tool.on { background: var(--slot-on); border-color: rgba(201, 168, 79, 0.7); color: var(--gold-2); }
.reader-stage { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; }
.reader-stage.one { overflow: hidden auto; padding: 6px 0 10px; }
.reader-book.one { margin: auto; }
.reader-book { --cover: #6e3b24; position: relative; display: flex; padding: 14px; border-radius: 5px 9px 9px 5px; background: radial-gradient(140% 120% at 30% 20%, rgba(255, 255, 255, 0.1), transparent 55%), linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 8%, transparent 92%, rgba(0, 0, 0, 0.25)), var(--cover); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 2px 0 rgba(255, 255, 255, 0.06) inset, 0 0 0 1px rgba(0, 0, 0, 0.35); perspective: 2600px; transform-origin: center; }
.reader-book::after { content: ""; position: absolute; left: 50%; top: 14px; bottom: 14px; width: 2px; margin-left: -1px; background: rgba(70, 50, 25, 0.28); pointer-events: none; }
.reader-book.one::after { display: none; }
.reader-page { position: relative; width: 360px; height: 500px; flex: none; color: #2b2119; background: #f2e9d4; overflow: hidden; }
.reader-page.l { border-radius: 3px 0 0 3px; background: linear-gradient(90deg, #ece2c8, #f3ead6 12%, #f2e8d3 82%, #ddd0ae); }
.reader-page.r { border-radius: 0 3px 3px 0; background: linear-gradient(90deg, #dbcdab, #f1e7d1 16%, #f4ebd8 88%, #ebe0c5); }
.reader-book.one .reader-page.l { border-radius: 3px; background: linear-gradient(90deg, #e6dabd, #f3ead6 10%, #f3ead6 90%, #e8ddc1); }
.reader-page.full { animation: reader-full 0.35s ease-out; }
@keyframes reader-full { 0% { box-shadow: inset 0 -26px 22px -18px rgba(170, 60, 40, 0.45); } 100% { box-shadow: inset 0 -26px 22px -18px rgba(170, 60, 40, 0); } }
.reader-text { position: absolute; inset: 38px 34px 50px; overflow: hidden; font: 15px/1.5 var(--book-font); white-space: pre-wrap; overflow-wrap: break-word; outline: none; user-select: text; -webkit-user-select: text; cursor: text; caret-color: #6e3b24; }
.reader-text[contenteditable="false"] { cursor: default; }
.reader-text p, .reader-text li { margin: 0 0 0.35em; }
.reader-text h1 { margin: 0.1em 0 0.45em; font-size: 23px; line-height: 1.2; }
.reader-text h2 { margin: 0.25em 0 0.35em; font-size: 18px; line-height: 1.25; }
.reader-text ul, .reader-text ol { margin: 0 0 0.35em; padding-left: 22px; }
.reader-text ::selection { background: rgba(201, 168, 79, 0.4); }
.reader-num { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; font: italic 12px var(--book-font); color: #8b7a5a; pointer-events: none; }
.reader-page.blank .reader-num { display: none; }
.reader-leaf { position: absolute; top: 14px; width: 360px; height: 500px; z-index: 2; transform-style: preserve-3d; transition: transform 0.55s cubic-bezier(0.32, 0.08, 0.22, 1); pointer-events: none; }
.reader-leaf > .reader-page { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.reader-leaf > .reader-page.back { transform: rotateY(180deg); }
.reader-leaf.fwd { left: 374px; transform-origin: left center; }
.reader-leaf.fwd.go { transform: rotateY(-180deg); }
.reader-leaf.rev { left: 14px; transform-origin: right center; }
.reader-leaf.rev.go { transform: rotateY(180deg); }
.reader-turn { position: absolute; top: 50%; z-index: 3; width: 44px; height: 72px; margin-top: -36px; display: grid; place-items: center; padding: 0 0 4px; border-radius: 7px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.4); color: var(--text); font-size: 34px; line-height: 1; }
.reader-turn:hover { background: rgba(0, 0, 0, 0.6); border-color: rgba(255, 255, 255, 0.3); }
.reader-turn:disabled { opacity: 0; pointer-events: none; }
.reader-turn.back { left: 14px; }
.reader-turn.next { right: 14px; }
.reader-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px 18px; }
.reader-foot .btn svg { width: 16px; height: 16px; }
.reader-foot .btn.sure { background: rgba(224, 87, 74, 0.3); border-color: rgba(224, 87, 74, 0.8); color: #ffd2cc; }
.reader-gap { width: 10px; }
.reader-covers { display: flex; flex-wrap: wrap; gap: 4px; }
.reader-covers button { width: 22px; height: 22px; padding: 0; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.22); background: var(--c); }
.reader-covers button.on { outline: 2px solid #fff; outline-offset: 1px; }
.lib-grid { align-items: start; }
.lib-cell { display: grid; gap: 3px; width: 62px; }
.lib-cell i { height: 3px; border-radius: 2px; background: var(--c, transparent); }
.lib-cell span { min-height: 12px; font: 600 10px/1.2 var(--font); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lectern-box { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.lectern-box > div { display: grid; gap: 2px; min-width: 0; }
.lectern-box b { font: 700 15px/1.25 "Iowan Old Style", "Palatino Linotype", Georgia, serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lectern-box span { font-size: 12px; color: var(--muted); }
@media (max-width: 760px), (max-height: 560px) {
  .reader-top { padding: 6px 10px 4px; }
  .reader-head { padding-left: 0; }
  .reader-head h2 { font-size: 18px; }
  .reader-name { font-size: 18px; }
  .reader-tools { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding-bottom: 4px; }
  .reader-foot { padding: 6px 10px 8px; }
  .reader-tool { width: 32px; height: 30px; }
  .reader-turn { width: 36px; height: 60px; margin-top: -30px; background: rgba(0, 0, 0, 0.55); }
  .reader-turn.back { left: 4px; }
  .reader-turn.next { right: 4px; }
}
.hp-desk { display: grid; gap: 10px; min-width: 0; }
.hp-ask { display: flex; gap: 8px; }
.hp-ask .input, .hp-ask .mf-input { flex: 1; min-width: 0; user-select: text; -webkit-user-select: text; }
.hp-list { display: grid; gap: 8px; max-height: min(50vh, 420px); overflow-y: auto; }
.hp-item { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; background: rgba(0, 0, 0, 0.3); }
.hp-q { color: var(--muted); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.hp-a { color: var(--text); font-size: 14px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.hp-a.wait { color: var(--faint); }
.mf-help { max-width: 760px; }
.mf-help .hp-list { max-height: none; overflow: visible; }
