/* TEXAS RP — интерфейс. Шрифты: Oswald (заголовки), Inter (текст), JetBrains Mono (цифры). */
:root {
  --font-head: 'Oswald', 'Arial Narrow', sans-serif;
  --font-ui: 'Inter', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;

  --bg: rgba(20, 15, 11, 0.86);
  --panel: rgba(26, 20, 15, 0.95);
  --line: rgba(222, 170, 98, 0.18);
  --line-2: rgba(222, 170, 98, 0.34);
  --text: #ece2cf;
  --dim: #a8997f;
  --mute: #75685a;
  --amber: #e0a854;
  --amber-2: #f5c87a;
  --rust: #b8562c;
  --good: #8cc063;
  --warn: #e0a83a;
  --bad: #e05a3e;
  --info: #8fc0e8;
  --radius: 8px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0e0b08; color: var(--text); font: 400 14px/1.45 var(--font-ui); user-select: none; -webkit-font-smoothing: antialiased; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.hidden { display: none !important; }
a { color: var(--amber-2); text-decoration: none; }
a:hover { text-decoration: underline; }
b { font-weight: 600; }
.muted { color: var(--dim); }
.small { font-size: 12px; }
.bad { color: var(--bad); }
.ok { color: var(--good); }
body.hints-off .hint-only { display: none !important; }

/* ---------- кнопки и элементы управления ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 6px;
  background: rgba(255, 220, 160, 0.06); color: var(--text); font: 500 13px var(--font-ui); cursor: pointer; transition: background .15s, border-color .15s, filter .15s; text-decoration: none; }
.btn:hover { background: rgba(255, 220, 160, 0.12); border-color: var(--amber); text-decoration: none; }
.btn:disabled { opacity: .38; cursor: default; background: transparent; border-color: var(--line); }
.btn.primary { background: linear-gradient(180deg, #d27a3a, #a5491f); border-color: #e08c4c; color: #fff4e2; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(224, 90, 62, .5); color: #f0b0a0; }
.btns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; background: rgba(0, 0, 0, .35);
  color: var(--amber-2); font: 600 11px/1.5 var(--font-mono); text-align: center; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 150px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .14); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--amber-2); border: 2px solid #3a2a18; cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--amber-2); border: 2px solid #3a2a18; cursor: pointer; }
input.switch { -webkit-appearance: none; appearance: none; width: 38px; height: 22px; margin: 0; border-radius: 11px; background: rgba(255, 255, 255, .14); position: relative; cursor: pointer; transition: background .2s; flex: none; }
input.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #d8ccb8; transition: left .2s; }
input.switch:checked { background: #b8692e; }
input.switch:checked::after { left: 19px; background: #fff3dc; }

/* ---------- оверлеи ---------- */
/* оверлей с нулевой прозрачностью скрыт совсем (класс .on ставит ui.js): иначе браузер всё равно композитит
   полноэкранный слой каждый кадр — на встроенной видеокарте это десятки мс. visibility в transition держит
   слой видимым, пока гаснет opacity */
.ovl { position: fixed; inset: 0; pointer-events: none; visibility: hidden; }
.ovl.on, #overlay-vignette { visibility: visible; }
#overlay-vignette { background: radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.5) 100%); }
#overlay-aurora { opacity: 0; mix-blend-mode: screen; background: linear-gradient(180deg, rgba(70, 255, 150, .42) 0%, rgba(180, 80, 255, .18) 22%, transparent 48%); transition: opacity 1.5s, visibility 1.5s; }
/* переливы сияния — второй градиент с анимацией opacity (дёшево для композитора, в отличие от filter: hue-rotate) */
#overlay-aurora::after { content: ''; position: absolute; inset: 0; opacity: 0; background: linear-gradient(180deg, rgba(60, 200, 255, .38) 0%, rgba(255, 80, 200, .16) 24%, transparent 48%); }
#overlay-aurora.on::after { animation: aurora 9s ease-in-out infinite alternate; }
@keyframes aurora { 100% { opacity: 1; } }
#overlay-heat { opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(255, 140, 40, .42) 100%); transition: opacity 1s, visibility 1s; mix-blend-mode: screen; }
#overlay-rad { opacity: 0; background: radial-gradient(ellipse at center, transparent 40%, rgba(120, 200, 40, .35) 100%); transition: opacity .6s, visibility .6s; mix-blend-mode: screen; }
#overlay-cold { opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(160, 200, 255, .45) 100%); transition: opacity 1s, visibility 1s; }
#overlay-hurt { opacity: 0; background: radial-gradient(ellipse at center, transparent 35%, rgba(200, 20, 10, .6) 100%); transition: opacity .25s, visibility .25s; }
body.flare #overlay-vignette { background: radial-gradient(ellipse at center, transparent 50%, rgba(20, 80, 40, .55) 100%); }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.label { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; font: 600 12px var(--font-ui); color: #f2e8d4; text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, .8); }
.label.mob { color: #f0a088; font-weight: 500; }
.label.trader { color: #a8ec94; }
.label .hpb { width: 46px; height: 4px; margin: 3px auto 0; background: rgba(0, 0, 0, .6); border-radius: 2px; overflow: hidden; }
.label .hpb b { display: block; height: 100%; background: var(--bad); }
.dmg { position: absolute; transform: translate(-50%, -50%); font: 700 15px var(--font-mono); color: #ffd47a; text-shadow: 0 0 4px #000, 0 1px 1px #000; transition: transform .8s ease-out, opacity .8s; }
.dmg.me { color: #ff6a50; }

/* ---------- полноэкранные экраны: вход, правила, внешность ---------- */
.screen { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.screen-bg { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14, 10, 7, .15), rgba(14, 10, 7, .72) 72%), url('/assets/img/login_bg.jpg') center / cover no-repeat, radial-gradient(ellipse at 40% 110%, #c8642a, #3a1a10 55%, #120c08); }
.screen-bg.dim::after { content: ''; position: absolute; inset: 0; background: rgba(10, 7, 5, .55); }
.card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 26px 28px; }
.card h2 { margin: 0 0 16px; font: 600 22px/1.2 var(--font-head); letter-spacing: .5px; text-transform: uppercase; color: var(--amber-2); }

.forum-card { display: flex; align-items: center; gap: 14px; max-width: 560px; padding: 14px 18px; border-radius: 10px; border: 1px solid rgba(240, 180, 100, .45);
  background: linear-gradient(90deg, rgba(200, 110, 50, .3), rgba(30, 22, 15, .8)); color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s; }
.forum-card:hover { transform: translateY(-1px); border-color: var(--amber-2); text-decoration: none; }
.forum-card b { display: block; font: 600 17px var(--font-head); letter-spacing: .5px; color: var(--amber-2); }
.forum-card small { display: block; color: #d2c3aa; font-size: 12.5px; margin-top: 2px; }
.forum-card.small { padding: 10px 14px; margin: 4px 0 10px; }
.forum-card.small b { font-size: 15px; }
.forum-ic { font-size: 26px; color: var(--amber-2); line-height: 1; }
.forum-go { margin-left: auto; font-size: 20px; color: var(--amber-2); }

.creator-box { display: flex; flex-direction: column; width: min(940px, 94vw); max-height: 94vh; }
.creator-head { display: flex; align-items: baseline; gap: 14px; }
#creator-name { color: var(--dim); font: 14px var(--font-mono); }
.creator-body { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.1fr); gap: 18px; min-height: 0; flex: 1; }
.creator-preview { position: relative; min-height: 460px; border-radius: 10px; overflow: hidden; background: radial-gradient(ellipse at 50% 85%, rgba(190, 90, 40, .3), rgba(0, 0, 0, .45) 70%); border: 1px solid var(--line); }
#creator-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.creator-hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: var(--mute); font-size: 11.5px; pointer-events: none; }
.seg { position: absolute; top: 10px; right: 10px; display: flex; background: rgba(0, 0, 0, .5); border-radius: 6px; padding: 2px; }
.seg button { padding: 5px 12px; border: 0; border-radius: 4px; background: transparent; color: var(--dim); font: 500 12px var(--font-ui); cursor: pointer; }
.seg button.on { background: rgba(224, 168, 84, .22); color: var(--amber-2); }
#creator-opts { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 0; max-height: 64vh; padding-right: 4px; }
.copt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 6px; }
.copt .lbl { font: 500 11.5px var(--font-ui); color: var(--dim); text-transform: uppercase; letter-spacing: .6px; min-width: 0; }
.copt .val { margin-top: 2px; font-size: 13.5px; text-transform: none; letter-spacing: 0; color: var(--text); white-space: nowrap; }
.copt .val:empty { display: none; }
.copt .sws { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; max-width: 230px; }
.copt .sws button { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .5); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); cursor: pointer; }
.copt .sws button.on { border-color: var(--amber-2); box-shadow: 0 0 0 2px rgba(245, 200, 122, .35); }
.copt .arrows { display: flex; gap: 4px; flex: none; }
.copt .arrows button { width: 30px; height: 28px; padding: 0; border-radius: 5px; background: rgba(0, 0, 0, .4); color: var(--amber-2); border: 1px solid var(--line-2); font-size: 17px; line-height: 1; cursor: pointer; }
.creator-actions { display: flex; gap: 10px; margin-top: 16px; }
.creator-actions .primary { flex: 1; font-family: var(--font-head); text-transform: uppercase; letter-spacing: 1px; font-size: 15px; }
@media (max-width: 900px) { .creator-body { grid-template-columns: 1fr; } }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud .win, #hud .hud-w, #hud button, #hud input, #hud a, .slot, #tip, #layout-bar, #death { pointer-events: auto; }
#hud #chat { pointer-events: none; }
#hud #chat input, #hud #chat a { pointer-events: auto; }
.hud-w { position: absolute; }
body.layout #hud #chat, body.layout .hud-w { pointer-events: auto; outline: 1px dashed var(--amber); outline-offset: 4px; cursor: move; }
body.layout .hud-w::before { content: attr(data-label); position: absolute; top: -24px; left: 0; padding: 1px 8px; border-radius: 4px; background: var(--amber); color: #1a1208; font: 600 11px var(--font-ui); white-space: nowrap; }
body.layout .hud-w > * { pointer-events: none; }
body.layout #chat-log { min-height: 80px; }
.hud-w.dragging, .win.dragging { opacity: .9; }
#layout-bar { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); padding: 8px 12px; background: var(--panel); border: 1px solid var(--amber); border-radius: 8px; font-size: 13px; display: flex; gap: 8px; align-items: center; box-shadow: var(--shadow); z-index: 100; }

#zone-info { left: 18px; top: 16px; text-shadow: 0 1px 4px rgba(0, 0, 0, .9); }
#zone-name { font: 600 22px/1.1 var(--font-head); letter-spacing: .5px; text-transform: uppercase; color: var(--amber-2); }
#zone-sub { display: flex; gap: 10px; margin-top: 3px; font: 500 12.5px var(--font-mono); color: #ddd0b8; }
#zone-sub .storm { color: #8affb0; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .45; } }

#minimap-wrap { right: 16px; top: 16px; text-align: right; }
#minimap { width: 190px; height: 190px; border-radius: 50%; border: 2px solid rgba(224, 168, 84, .45); background: rgba(14, 10, 7, .8); box-shadow: 0 6px 24px rgba(0, 0, 0, .6); display: block; }
#net-info { font: 11px var(--font-mono); color: var(--dim); margin-top: 6px; text-shadow: 0 1px 2px #000; }

#stats { left: 16px; bottom: 16px; width: 248px; padding: 10px 12px 8px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
.stat { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.stat i { font-style: normal; width: 18px; text-align: center; font-size: 13px; }
.stat .bar { position: relative; flex: 1; height: 8px; background: rgba(255, 255, 255, .08); border-radius: 4px; overflow: hidden; }
.stat .bar b { display: block; height: 100%; width: 50%; border-radius: 4px; transition: width .3s; }
.stat span { width: 42px; text-align: right; font: 500 12px var(--font-mono); color: #ddd0b8; }
.stat[data-k=hp] b { background: linear-gradient(90deg, #9a2e1e, #e0503a); }
.stat[data-k=food] b { background: linear-gradient(90deg, #8a6424, #d69c40); }
.stat[data-k=water] b { background: linear-gradient(90deg, #22507a, #48a0e0); }
.stat[data-k=rad] b { background: linear-gradient(90deg, #4c6a12, #b9e04a); }
.stat[data-k=stamina] b { background: linear-gradient(90deg, #6b6450, #e2dabe); }
.stat.center .bar b { position: absolute; top: 0; bottom: 0; border-radius: 0; transition: left .3s, width .3s, background .3s; }
.stat.center .bar em { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(255, 255, 255, .45); }
.stat.crit span { color: var(--bad); animation: blink .8s infinite; }
#status-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
#status-flags:empty { display: none; }
#status-flags span { padding: 2px 7px; border-radius: 10px; background: rgba(255, 255, 255, .07); font: 500 11px var(--font-ui); color: var(--dim); }
#status-flags .r { color: #c8f060; background: rgba(150, 220, 40, .12); }
#status-flags .f { color: #ffb070; background: rgba(255, 140, 60, .12); }
#status-flags .s { color: #a8d0f0; background: rgba(120, 180, 240, .1); }
#status-flags .c { color: #a8d8ff; background: rgba(120, 180, 255, .12); }
#status-flags .h { color: #ffc070; background: rgba(255, 170, 60, .12); }
#status-flags .p { color: #b0f070; background: rgba(150, 230, 80, .14); }
#status-flags .w { color: #fff; background: #b0321e; animation: blink 1s infinite; }

#hotbar { left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
#vehicle-hud { right: 16px; bottom: 16px; width: 230px; padding: 10px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
#veh-name { font: 600 14px var(--font-head); color: var(--amber-2); text-transform: uppercase; letter-spacing: .5px; }
#veh-speed { font: 600 30px/1.1 var(--font-mono); margin: 4px 0 6px; }
#veh-speed small { font-size: 12px; color: var(--dim); font-weight: 400; }
.vbar { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.vbar i { font-style: normal; width: 18px; }
.vbar .bar { flex: 1; height: 7px; background: rgba(255, 255, 255, .08); border-radius: 4px; overflow: hidden; }
.vbar .bar b { display: block; height: 100%; background: var(--amber); }
#veh-hint { margin-top: 6px; color: var(--dim); line-height: 1.4; }

#chat { left: 16px; bottom: 214px; width: 440px; }
#chat-log { max-height: 210px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.chat-line { font-size: 13.5px; line-height: 1.4; padding: 1px 0; text-shadow: 0 1px 2px #000, 0 0 5px rgba(0, 0, 0, .9); transition: opacity 1s; }
.chat-line .z { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 3px; background: rgba(0, 0, 0, .45); color: var(--dim); font: 500 10.5px/1.6 var(--font-ui); text-transform: uppercase; vertical-align: 1px; }
.chat-line .n { color: var(--amber-2); font-weight: 600; margin-right: 4px; }
.chat-line.sys { color: #a8d0f0; }
.chat-line.sys .n { color: #f5c87a; }
.chat-line a { pointer-events: auto; color: #ffd58a; text-decoration: underline; }
.chat-line.faded { opacity: 0; }
#chat.open .chat-line.faded { opacity: 1; }
#chat-input { width: 100%; margin-top: 6px; padding: 8px 12px; border-radius: 6px; background: rgba(0, 0, 0, .78); border: 1px solid var(--amber); color: var(--text); font: 13.5px var(--font-ui); outline: none; user-select: text; }

#prompt { position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%); padding: 7px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; white-space: nowrap; }
#prompt kbd { margin-right: 4px; }
#progress { position: absolute; left: 50%; bottom: 146px; transform: translateX(-50%); width: 260px; height: 20px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
#progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, #8a5a2a, var(--amber)); }
#progress-text { position: absolute; inset: 0; text-align: center; font: 500 12px/20px var(--font-ui); color: #fff; text-shadow: 0 1px 2px #000; }
#craft-mini { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); font: 500 12px var(--font-ui); color: var(--amber-2); text-shadow: 0 1px 3px #000; }
#toasts { position: absolute; right: 16px; top: 262px; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.toast { max-width: 360px; padding: 7px 12px; background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 6px; font-size: 13px; animation: tin .2s ease-out; transition: opacity .5s, transform .5s; }
.toast.good { border-left-color: var(--good); } .toast.bad { border-left-color: var(--bad); } .toast.warn { border-left-color: var(--warn); }
.toast.hint { border-left-color: var(--info); color: #d4e6f4; }
.toast.gain { border-left-color: #6a9a5a; font-size: 12.5px; }
.toast.out { opacity: 0; transform: translateX(20px); }
@keyframes tin { from { opacity: 0; transform: translateX(20px); } }
#banner { position: absolute; left: 50%; top: 20%; transform: translateX(-50%); text-align: center; transition: opacity 1.2s; text-shadow: 0 2px 12px #000, 0 0 30px rgba(0, 0, 0, .8); }
#banner-title { font: 600 48px/1.1 var(--font-head); letter-spacing: 3px; text-transform: uppercase; color: var(--amber-2); }
#banner-sub { max-width: 600px; margin-top: 6px; font-size: 14.5px; color: #e4d8c0; }
#banner.fade { opacity: 0; }
#storm-warn { position: absolute; left: 50%; top: 72px; transform: translateX(-50%); padding: 7px 18px; border-radius: 8px; background: rgba(20, 70, 45, .9); border: 1px solid #6aff9a; color: #b6ffd0; font: 600 13.5px var(--font-ui); animation: blink 1.2s infinite; }
#tip { position: absolute; left: 50%; top: 116px; transform: translateX(-50%); width: min(460px, 90vw); padding: 12px 16px; border-radius: 10px; background: rgba(18, 30, 38, .94); border: 1px solid rgba(143, 192, 232, .45); box-shadow: var(--shadow); }
#tip .tip-title { font: 600 13px var(--font-head); text-transform: uppercase; letter-spacing: .8px; color: var(--info); }
#tip .tip-text { margin: 4px 0 10px; font-size: 13.5px; color: #dce8f2; line-height: 1.5; }
#tip .tip-text kbd { color: #bfe0ff; }
#tip button { border: 0; background: none; cursor: pointer; font: 500 12px var(--font-ui); padding: 0; margin-right: 14px; }
#tip .tip-ok { color: var(--info); }
#tip .tip-off { color: #7a8a96; }

/* ---------- окна ---------- */
.win { position: absolute; z-index: 30; min-width: 280px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.win-head { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 16px; border-bottom: 1px solid var(--line); cursor: move; touch-action: none; }
.win-title { flex: 1; font: 600 15px var(--font-head); letter-spacing: .6px; text-transform: uppercase; color: var(--amber-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-head kbd { opacity: .7; }
.win-x { width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--dim); font-size: 14px; cursor: pointer; }
.win-x:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.win-body { padding: 12px 16px 14px; overflow-y: auto; min-height: 0; }
.win-body.nopad { padding: 0; }
.win-actions { margin-top: 10px; }
.sub { margin: 12px 0 6px; font: 600 11px var(--font-ui); color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }
.sub:first-child { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(6, 52px); gap: 5px; }
/* места окон по умолчанию */
#inventory { left: calc(50% - 400px); top: 90px; width: 372px; }
#inventory .hint-only { margin-top: 10px; line-height: 1.45; }
#craft { left: calc(50% + 20px); top: 90px; width: 440px; }
#container { left: calc(50% + 20px); top: 90px; }
#trade { left: calc(50% + 20px); top: 90px; width: 580px; }
#map { left: 50%; top: 50%; transform: translate(-50%, -50%); }
#help { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(680px, 94vw); }
#settings { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, 94vw); }

/* слоты */
.slot { position: relative; width: 52px; height: 52px; border-radius: 7px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 220, 160, .1); display: flex; align-items: center; justify-content: center; }
.slot .ic { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.slot.full { background: rgba(255, 220, 160, .05); }
.slot:hover { border-color: rgba(224, 168, 84, .5); }
.slot.active { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber), 0 0 14px rgba(224, 168, 84, .3); }
.slot .n { position: absolute; right: 4px; bottom: 2px; font: 600 11px var(--font-mono); color: #f6ead2; text-shadow: 0 1px 2px #000; }
.slot .key { position: absolute; left: 5px; top: 2px; font: 500 10px var(--font-mono); color: var(--mute); }
.slot .dur { position: absolute; left: 5px; right: 5px; bottom: 3px; height: 3px; border-radius: 2px; background: rgba(0, 0, 0, .6); overflow: hidden; }
.slot .dur b { display: block; height: 100%; }
.slot.drag-src { opacity: .35; }
.slot.drop-hover { border-color: var(--amber-2); background: rgba(120, 80, 30, .55); }
#hotbar .slot { width: 54px; height: 54px; }
#drag-ghost { position: fixed; z-index: 200; pointer-events: none; font-size: 30px; transform: translate(-50%, -50%); filter: drop-shadow(0 3px 6px #000); }

/* снаряжение */
.equip { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.eq { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.eq span { font-size: 10.5px; color: var(--mute); }
.wear-info { margin-left: auto; display: flex; flex-direction: column; gap: 2px; font: 500 12px var(--font-mono); color: var(--dim); }

/* ремесло */
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.chips button { padding: 4px 10px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--dim); font: 500 12px var(--font-ui); cursor: pointer; }
.chips button:hover { color: var(--text); }
.chips button.on { color: #1d140a; background: var(--amber-2); border-color: var(--amber-2); }
.list { max-height: 420px; overflow-y: auto; padding-right: 4px; }
.list::-webkit-scrollbar, .win-body::-webkit-scrollbar { width: 6px; }
.list::-webkit-scrollbar-thumb, .win-body::-webkit-scrollbar-thumb { background: rgba(255, 220, 160, .18); border-radius: 3px; }
.recipe { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 7px; }
.recipe:hover { background: rgba(255, 220, 160, .05); }
.recipe .ic { font-size: 26px; width: 34px; text-align: center; }
.recipe .info { flex: 1; min-width: 0; }
.recipe .nm { font-weight: 600; font-size: 13.5px; }
.recipe .nm small { color: var(--dim); font-weight: 500; }
.recipe .req { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 2px; font: 500 12px var(--font-mono); }
.recipe .req .no { color: var(--bad); }
.recipe .req .ok { color: var(--good); }
.recipe .req .st { font-family: var(--font-ui); font-size: 11.5px; padding: 0 6px; border-radius: 8px; background: rgba(255, 255, 255, .06); }
.recipe .act { display: flex; align-items: center; gap: 4px; }
.recipe .act small { color: var(--mute); font: 11px var(--font-mono); margin-right: 4px; }
.recipe.cant .ic, .recipe.cant .nm { opacity: .5; }
.queue { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); min-height: 40px; }
.queue .q { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; background: rgba(0, 0, 0, .3); font-size: 18px; overflow: hidden; }
.queue .q .pb { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--amber); }
.queue .btn { margin-left: auto; }

/* торговля */
.trade-cash { margin-bottom: 10px; font: 500 14px var(--font-ui); }
.trade-cash b { font: 600 18px var(--font-mono); color: var(--good); }
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 10px; }
.trade-cols .list { max-height: 380px; }
.trow { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 6px; }
.trow:hover { background: rgba(255, 220, 160, .05); }
.trow .ic { font-size: 22px; width: 28px; text-align: center; }
.trow .nm { flex: 1; font-size: 13px; min-width: 0; }
.trow .pr { display: flex; flex-direction: column; align-items: flex-end; font: 600 13px var(--font-mono); }
.trow .pr .no { color: var(--bad); }
.trow .pr small { font: 400 10.5px var(--font-ui); color: var(--mute); }
.trow.cant .nm, .trow.cant .ic { opacity: .5; }

/* контейнер */
#cont-extra { margin-bottom: 10px; }
.kv { display: flex; justify-content: space-between; font-size: 13px; margin-top: 4px; }
.kv span:last-child { font: 500 12.5px var(--font-mono); }
.mbar { height: 6px; margin: 4px 0 8px; background: rgba(255, 255, 255, .08); border-radius: 3px; overflow: hidden; }
.mbar b { display: block; height: 100%; }

/* карта */
#map-canvas { display: block; width: min(900px, 90vw); height: auto; }
#map-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 9px 14px; font-size: 12px; color: var(--dim); border-top: 1px solid var(--line); }
#map-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

/* справка */
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 20px; font-size: 13px; }
.keys kbd { margin-right: 6px; }
.help-text { margin-top: 14px; font-size: 13.5px; color: #d2c5ae; line-height: 1.55; }
.help-text p { margin: 7px 0; }
.help-text b { color: var(--amber-2); }

/* меню / настройки */
.set-group { padding-bottom: 6px; }
.set-group + .set-group { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 6px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13.5px; }
label.row { cursor: pointer; }
.row > span:first-child { display: flex; flex-direction: column; flex: 1; }
.row small { color: var(--mute); font-size: 11.5px; }
.row output { width: 42px; text-align: right; font: 500 12px var(--font-mono); color: var(--dim); }

#netstat { position: absolute; right: 16px; top: 214px; padding: 9px 13px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font: 11.5px/1.55 var(--font-mono); color: #d0c4ae; white-space: pre; pointer-events: none; }

/* смерть и обрыв */
#death { position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(70, 0, 0, .55), rgba(0, 0, 0, .88)); }
.death-title { font: 600 68px/1 var(--font-head); letter-spacing: 8px; text-transform: uppercase; color: #c8402a; text-shadow: 0 0 40px rgba(180, 40, 20, .5); }
#death-cause { margin-top: 10px; font-size: 18px; color: #ecd6c6; }
.death-sub { margin-top: 6px; color: var(--dim); }
.death-btns { display: flex; gap: 12px; margin-top: 26px; }
.death-btns .btn { padding: 11px 22px; font-size: 14px; }
.death-forum { margin-top: 24px; font-size: 12.5px; color: var(--mute); }
#reconnect { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); padding: 16px 28px; border-radius: 10px; background: var(--panel); border: 1px solid var(--bad); text-align: center; font-size: 16px; }
#reconnect small { color: var(--dim); }

/* описания предметов */
#tooltip { position: fixed; z-index: 201; pointer-events: none; max-width: 290px; padding: 10px 12px; border-radius: 8px; background: rgba(16, 12, 9, .97); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.45; }
#tooltip .tt-name { font: 600 14px var(--font-ui); color: var(--amber-2); }
#tooltip .tt-desc { margin-top: 3px; color: #c9bba2; }
#tooltip .tt-stats { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); }
#tooltip .tt-stats span { color: var(--mute); }
#tooltip .tt-stats b { font: 500 12px var(--font-mono); color: #b8e08a; }

/* автозаполнение браузера не должно ломать тёмную тему */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text); caret-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #1f1812 inset; transition: background-color 9999s;
}

/* ---------- иконки (client/js/icons.js): краска цвета кости, редкие сколы, акцент — ржаво-красный ---------- */
:root { --ico-ink: #e6d3a8; --ico-accent: #c4553c; }
.ico { width: 1em; height: 1em; display: inline-block; flex: none; vertical-align: -0.14em; overflow: visible;
  -webkit-mask: url('/assets/img/wear_ico.png') var(--wo, 0 0) / 360px; mask: url('/assets/img/wear_ico.png') var(--wo, 0 0) / 360px; }
.slot .ic, .recipe .ic, .trow .ic, #drag-ghost, .tt-name .ico, .toast .ico, #craft-queue .q { color: var(--ico-ink); }
.stat i { display: inline-flex; align-items: center; justify-content: center; }
.stat[data-k=hp] i { color: #d8644a; }
.stat[data-k=food] i { color: #d9a650; }
.stat[data-k=water] i { color: #66a8dc; }
.stat[data-k=temp] i { color: #e2b47a; }
.stat[data-k=rad] i { color: #a4cc52; }
.stat[data-k=stamina] i { color: #e6d3a8; }
.win-x .ico { font-size: 12px; vertical-align: -1px; }
.label .ico { vertical-align: -2px; }
.forum-ic .ico { font-size: 22px; }
