/* Вільні Землі — інтерфейс v2 (2026-11-05): темна промаслена шкіра, кована бронза, пергамент для читання.
   Матеріали: вікна — шкіра з ледь помітною фактурою; краї — «ковані» (темна лінія, бронзова, темна);
   комірки й поля — заглиблені колодязі; кутові скоби — лише на вікнах, мапі, панелі дій і портреті. */
:root {
  --ink: #0b0806; --edge: #070504; --leather: #1d1711; --leather-2: #261e16; --leather-3: #30261b; --well: #110d09;
  --bronze-lo: #4e3a20; --bronze: #8a6a3a; --bronze-hi: #c9a15a; --gold: #e8c170; --gold-hot: #ffdc8f;
  --parch: #e6d6b2; --parch-2: #cfb98c; --parch-ink: #2b2016;
  --tx: #ece0c6; --tx-2: #b5a385; --tx-3: #7a6b55;
  --hp-a: #e4523f; --hp-b: #8e1f16; --en-a: #5aa6ec; --en-b: #1f4f93;
  --good: #86b65e; --bad: #d9583f; --warn: #e3a33b; --info: #6fa8c9;
  --z-blue: #4f86c6; --z-yellow: #d9a62e; --z-red: #c8402e;
  --f-display: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, Cambria, "Noto Serif", "Droid Serif", serif;
  --f-ui: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --frame: 0 0 0 1px var(--edge), inset 0 0 0 1px var(--bronze), inset 0 0 0 2px var(--ink), 0 14px 36px rgba(0, 0, 0, 0.6);
  --frame-s: 0 0 0 1px var(--edge), inset 0 0 0 1px rgba(201, 161, 90, 0.55), 0 4px 12px rgba(0, 0, 0, 0.5);
  --well-sh: inset 0 2px 5px rgba(0, 0, 0, 0.75), inset 0 0 0 1px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 220, 160, 0.06);
  --leather-bg: radial-gradient(140% 70% at 50% 0, rgba(255, 200, 130, 0.07), transparent 60%), repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 6px), linear-gradient(#211a13, #16110c);
  --sat: env(safe-area-inset-top); --sab: env(safe-area-inset-bottom);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #16120e; color: var(--tx); font: 13px/1.45 var(--f-ui); font-variant-numeric: tabular-nums; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
#cv { position: fixed; inset: 0; display: block; }
/* віньєтка й тон зони — один раз шаром поверх полотна, а не заливкою на кожен кадр */
#vig { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse 72% 72% at 50% 50%, transparent 46%, rgba(10, 14, 20, 0.38) 100%); }
#vig.yellow { background: radial-gradient(ellipse 72% 72% at 50% 50%, transparent 46%, rgba(60, 40, 0, 0.42) 100%); }
#vig.red { background: radial-gradient(ellipse 72% 72% at 50% 50%, transparent 46%, rgba(70, 12, 0, 0.5) 100%); }
.hidden { display: none !important; }
.dim { color: var(--tx-2); }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
kbd { font: 700 9px/13px var(--f-ui); }
h2, h3, h4 { font-family: var(--f-display); }

/* ---------- матеріали ---------- */
.win { position: relative; border-radius: 6px; box-shadow: var(--frame); background: var(--leather-bg); }
.win::before { content: ""; position: absolute; inset: -3px; pointer-events: none; --c: var(--bronze-hi); background:
  linear-gradient(var(--c) 0 0) 0 0 / 14px 2px no-repeat, linear-gradient(var(--c) 0 0) 0 0 / 2px 14px no-repeat,
  linear-gradient(var(--c) 0 0) 100% 0 / 14px 2px no-repeat, linear-gradient(var(--c) 0 0) 100% 0 / 2px 14px no-repeat,
  linear-gradient(var(--c) 0 0) 0 100% / 14px 2px no-repeat, linear-gradient(var(--c) 0 0) 0 100% / 2px 14px no-repeat,
  linear-gradient(var(--c) 0 0) 100% 100% / 14px 2px no-repeat, linear-gradient(var(--c) 0 0) 100% 100% / 2px 14px no-repeat; }
.frame { background: linear-gradient(#231b13, #16110c); border-radius: 4px; box-shadow: var(--frame-s); }

/* смуги прокрутки: бронзовий повзунок у темному жолобі; тіні зверху/знизу показують, що є ще */
.scroll { overflow: auto; overscroll-behavior: contain; }
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-track { background: var(--well); box-shadow: inset 0 0 3px #000; border-radius: 5px; }
.scroll::-webkit-scrollbar-thumb { background: linear-gradient(90deg, #8a6a3a, #5e4524); border: 2px solid var(--well); border-radius: 5px; }
.scroll::-webkit-scrollbar-thumb:hover { background: linear-gradient(90deg, #c9a15a, #8a6a3a); }
.scroll::-webkit-scrollbar-button { display: none; }
.scroll::-webkit-scrollbar-corner { background: transparent; }
@supports (-moz-appearance: none) { .scroll { scrollbar-width: thin; scrollbar-color: #7a5c30 #110d09; } }
#panel .body { background: linear-gradient(#1b150f 30%, transparent) top / 100% 24px no-repeat local, linear-gradient(transparent, #18130d 70%) bottom / 100% 24px no-repeat local,
  radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, 0.6), transparent) top / 100% 10px no-repeat, radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.6), transparent) bottom / 100% 10px no-repeat; }

/* ---------- кнопки: основна, звичайна, купівля, небезпечна ---------- */
.btn, .rc button, .repair button, .macts button, .mbtns button, .back, .morder button, #net button, #pinv button, #ask button, #pmenu button, .go.big button, .rot button, #party .pl, #create .go {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 16px; border-radius: 4px;
  font: 700 14px/1 var(--f-display); color: var(--tx); background: linear-gradient(#3a2e22, #2a2118);
  box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px rgba(201, 161, 90, 0.35), inset 0 1px 0 rgba(255, 236, 190, 0.08), 0 2px 4px rgba(0, 0, 0, 0.45); white-space: nowrap; }
.btn:hover, .rc button:hover, .repair button:hover, .macts button:hover, .mbtns button:hover, .back:hover, .morder button:hover, #net button:hover, #pinv button:hover, #ask button:hover, #pmenu button:hover, .rot button:hover, #party .pl:hover { box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px var(--bronze-hi), inset 0 1px 0 rgba(255, 236, 190, 0.12), 0 2px 4px rgba(0, 0, 0, 0.45); color: #fff4dc; }
button:active:not(:disabled) { transform: translateY(1px); }
button.primary, .rc .go button, .repair button, .go.big button, #create .go {
  background: linear-gradient(#b0802f, #7a5420); color: #fff4dc; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 1px #2a1a08, inset 0 1px 0 rgba(255, 236, 190, 0.45), inset 0 -2px 0 rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.5); }
button.primary:hover, .rc .go button:hover, .repair button:hover, .go.big button:hover, #create .go:hover { background: linear-gradient(#c8963a, #8a6026); }
.macts button.buy { background: linear-gradient(#5b7f3a, #3a5522); color: #f2ffe0; box-shadow: 0 0 0 1px #14200a, inset 0 1px 0 rgba(220, 255, 190, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.5); }
#ask button.primary, .btn.danger { background: linear-gradient(#a33a26, #6e2116); color: #fff0e8; box-shadow: 0 0 0 1px #2a0a04, inset 0 1px 0 rgba(255, 200, 180, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.5); }
button:disabled, button:disabled:hover { background: #241c14 !important; color: #6e604c !important; text-shadow: none !important; box-shadow: 0 0 0 1px #3a2e22 !important; cursor: default; transform: none; }
.x { position: relative; width: 28px; height: 28px; flex: none; border-radius: 4px; background: #2a1f15; box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px rgba(201, 161, 90, 0.3); }
.x::before, .x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 2px; height: 14px; margin: -7px 0 0 -1px; background: var(--bronze-hi); border-radius: 1px; transform: rotate(45deg); }
.x::after { transform: rotate(-45deg); }
.x:hover { background: #4a2a1c; } .x:hover::before, .x:hover::after { background: var(--gold-hot); }
.help-q { width: 22px; height: 22px; border-radius: 50%; font: 700 13px/22px var(--f-display); color: var(--bronze-hi); background: #2a1f15; box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px rgba(201, 161, 90, 0.35); cursor: help; text-align: center; flex: none; }

/* поля вводу */
input { font: inherit; color: var(--tx); }
.mform input, #chat input { height: 36px; border: 0; border-radius: 3px; background: #0f0c09; box-shadow: var(--well-sh); padding: 0 10px; outline: none; -webkit-user-select: text; user-select: text; }
.mform input:focus, #chat input:focus { box-shadow: inset 0 0 0 1px var(--bronze-hi), 0 0 0 3px rgba(232, 193, 112, 0.18); }
input::placeholder { color: var(--tx-3); }

/* ---------- смуги ---------- */
.bar { position: relative; height: 14px; border-radius: 3px; background: #0c0907; box-shadow: var(--well-sh); overflow: hidden; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#f07a5c, var(--hp-a) 45%, var(--hp-b)); box-shadow: inset 0 1px 0 rgba(255, 220, 200, 0.35); transition: width 0.12s; }
.bar.en i { background: linear-gradient(#8ac4f4, var(--en-a) 45%, var(--en-b)); }
.bar.cap i { background: linear-gradient(#ffd890, #e0a040 50%, #8a5a18); }
.bar.mx i, .bar.qx i { background: linear-gradient(#ffe8a8, #d9a441 50%, #8a6420); }
.bar span { position: relative; display: block; padding: 0 6px; text-align: right; font: 700 10px/14px var(--f-ui); color: #fff; text-shadow: 0 1px 1px #000, 0 0 3px #000; }

/* ---------- права колонка: мапа з назвою місцевості, велет, завдання ---------- */
#rcol { position: fixed; right: 16px; top: 16px; width: 220px; display: flex; flex-direction: column; gap: 8px; z-index: 3; }
#mini { width: 220px; cursor: pointer; padding: 3px; }
.zbar { display: flex; align-items: center; gap: 7px; height: 26px; padding: 0 8px; margin: -1px -1px 3px; border-radius: 4px 4px 0 0; background: linear-gradient(#2c2218, #1d1610); box-shadow: 0 1px 0 var(--edge), 0 2px 0 rgba(201, 161, 90, 0.2); }
.zbar .n { flex: 1; min-width: 0; font: 700 14px/1 var(--f-display); color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 0 #000; }
.zbar .s { font: 700 10px/1 var(--f-ui); color: var(--tx-2); white-space: nowrap; }
.gem { flex: none; width: 10px; height: 10px; transform: rotate(45deg); border-radius: 2px; background: radial-gradient(circle at 35% 35%, #cfe4ff, var(--z-blue) 60%, #1a3a66); box-shadow: 0 0 0 1px var(--edge), 0 0 6px rgba(79, 134, 198, 0.7); }
.zbar.yellow .gem { background: radial-gradient(circle at 35% 35%, #fff2c0, var(--z-yellow) 60%, #6a4a0a); box-shadow: 0 0 0 1px var(--edge), 0 0 6px rgba(217, 166, 46, 0.7); }
.zbar.red .gem { background: radial-gradient(circle at 35% 35%, #ffd0c0, var(--z-red) 60%, #5a1408); box-shadow: 0 0 0 1px var(--edge), 0 0 8px rgba(200, 64, 46, 0.9); }
.zbar.dungeon .gem { background: radial-gradient(circle at 35% 35%, #ecdcff, #8a62c8 60%, #2a1450); }
.mmw { position: relative; height: 190px; border-radius: 3px; overflow: hidden; box-shadow: var(--well-sh); background: #1a2a1c; }
#mm { width: 100%; height: 100%; display: block; }
.mmw::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.55); border-radius: 3px; }
#clock { position: absolute; right: 4px; bottom: 4px; padding: 1px 6px; border-radius: 2px; font: 700 11px/16px var(--f-ui); color: var(--tx); background: rgba(11, 8, 6, 0.8); box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.35); z-index: 1; }
.chip { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 6px; border-radius: 4px; cursor: pointer; background: linear-gradient(#231b13, #16110c); box-shadow: var(--frame-s); }
.chip .ico { flex: none; width: 24px; height: 24px; }
.chip .t { flex: 1; min-width: 0; font: 600 12px/1.15 var(--f-ui); color: var(--tx-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .t b { display: block; font: 700 12px/1.2 var(--f-display); color: var(--tx); }
.chip .v { font: 700 14px/1 var(--f-ui); color: var(--gold); white-space: nowrap; }
#wb.soon .v { color: var(--gold-hot); }
#wb.live { box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px #c8402e, 0 4px 12px rgba(0, 0, 0, 0.5); animation: wbpulse 1.6s infinite; }
#wb.live .v { color: #ff9a70; }
@keyframes wbpulse { 50% { box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px #ff6a40, 0 0 14px rgba(224, 74, 48, 0.55); } }
#quest { position: relative; padding: 6px 4px 6px 30px; cursor: pointer; background: linear-gradient(270deg, rgba(10, 8, 6, 0.72), rgba(10, 8, 6, 0.45) 70%, transparent); border-radius: 4px; }
#quest::before { content: "!"; position: absolute; left: 4px; top: 6px; width: 18px; height: 18px; border-radius: 50%; font: 900 12px/18px var(--f-display); text-align: center; color: #2a1a06; background: radial-gradient(circle at 35% 30%, #fff0b0, #f0b83c 60%, #8a5a10); box-shadow: 0 0 0 1px var(--edge), 0 0 8px rgba(240, 184, 60, 0.6); }
#quest b { display: block; font: 700 15px/1.2 var(--f-display); color: var(--gold); text-shadow: 0 1px 2px #000; }
#quest .obj { display: flex; gap: 6px; align-items: baseline; margin-top: 3px; font-size: 12px; line-height: 1.35; color: var(--tx); text-shadow: 0 1px 2px #000; }
#quest .obj i { flex: none; width: 10px; height: 10px; border-radius: 2px; box-shadow: inset 0 0 0 1px var(--bronze-hi); }
#quest .obj em { font-style: normal; color: var(--gold); font-weight: 700; margin-left: auto; padding-left: 6px; white-space: nowrap; }
#quest:hover b { color: var(--gold-hot); }

/* ---------- згори посередині: ціль, бос, вежа ---------- */
#target, #boss, #cap { position: fixed; left: 50%; transform: translateX(-50%); top: 16px; padding: 7px 12px 9px; width: 320px; text-align: center; z-index: 3; }
#boss { width: 480px; box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px #8a3024, 0 6px 18px rgba(0, 0, 0, 0.55); }
#boss:not(.hidden) + #target { top: 88px; }
#target .n, #boss .n, #cap .n { font: 700 14px/1.2 var(--f-display); margin-bottom: 5px; color: var(--tx); text-shadow: 0 1px 0 #000; }
#boss .n { color: #ffb8a0; font-size: 16px; }
#boss .skull { position: absolute; left: 12px; top: 8px; width: 22px; height: 22px; opacity: 0.8; background: radial-gradient(circle at 50% 40%, #e8dcc4 0 45%, transparent 47%); }
#boss .bar { height: 16px; } #boss .bar span { line-height: 16px; }
#cap { top: 120px; }
#cap .n { color: #ffcf9a; font-size: 13px; }
#cap.ct { box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px #a03020, 0 6px 18px rgba(0, 0, 0, 0.55); } #cap.ct .n { color: #ff8a70; }

/* ---------- група ---------- */
#party { position: fixed; left: 16px; top: 16px; width: 200px; display: grid; gap: 4px; z-index: 4; }
#party .ph { display: flex; justify-content: space-between; align-items: center; height: 24px; padding: 0 2px; font: 700 13px/1 var(--f-display); color: var(--gold); text-shadow: 0 1px 2px #000; }
#party .pl { min-height: 22px; padding: 0 8px; font-size: 11px; }
#party .pm { position: relative; display: grid; gap: 3px; padding: 5px 8px 6px; border-radius: 4px; background: linear-gradient(#231b13ee, #16110cee); box-shadow: var(--frame-s); }
#party .pm .nm { font: 600 12px/1.2 var(--f-ui); color: #b8e890; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 18px; }
#party .pm.off { opacity: 0.5; } #party .pm.dead .nm { color: var(--bad); }
#party .pm .bar { height: 6px; }
#party .zn { font-size: 11px; color: var(--tx-2); } #party .zn:empty { display: none; }
#party .kick { position: absolute; right: 4px; top: 4px; width: 18px; height: 18px; color: var(--tx-3); font-size: 11px; }
#party .kick:hover { color: var(--bad); }
.crown { color: var(--gold); font-style: normal; margin-right: 4px; }
.ctag { color: #7fe0d0; font-weight: 600; }

/* ---------- панель дій: портрет, здоров'я/енергія, уміння, зілля ---------- */
#barwrap { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 10px; padding: 8px 10px 8px 52px; z-index: 5; }
#portrait { position: absolute; left: -34px; bottom: 8px; width: 76px; height: 76px; border-radius: 50%; overflow: visible; background: radial-gradient(circle at 50% 35%, #4a3a28, #1a130c 75%);
  box-shadow: 0 0 0 1px var(--edge), 0 0 0 4px var(--bronze), 0 0 0 5px var(--edge), inset 0 0 12px rgba(0, 0, 0, 0.8), 0 6px 14px rgba(0, 0, 0, 0.6); }
#portrait canvas { width: 100%; height: 100%; display: block; border-radius: 50%; }
#portrait:hover { box-shadow: 0 0 0 1px var(--edge), 0 0 0 4px var(--bronze-hi), 0 0 0 5px var(--edge), inset 0 0 12px rgba(0, 0, 0, 0.8), 0 0 16px rgba(232, 193, 112, 0.35); }
#plv { position: absolute; right: -4px; bottom: -2px; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 11px; font: 700 12px/22px var(--f-display); font-style: normal; text-align: center; color: #2a1a06; background: radial-gradient(circle at 35% 30%, #fff0b0, #e0aa40 60%, #8a5a10); box-shadow: 0 0 0 1px var(--edge), 0 2px 4px rgba(0, 0, 0, 0.6); }
#plv:empty { display: none; }
.ab { display: flex; flex-direction: column; gap: 6px; }
#bars { display: grid; gap: 3px; }
#hp { height: 16px; } #hp span { line-height: 16px; }
#en { height: 9px; } #en span { display: none; }
#row { display: flex; align-items: center; gap: 0; }
#skills { display: flex; gap: 6px; }
#cons { display: flex; gap: 6px; padding-left: 12px; margin-left: 12px; align-items: center; box-shadow: -1px 0 0 rgba(201, 161, 90, 0.25), -2px 0 0 var(--edge); }
.sk { position: relative; width: 56px; height: 56px; padding: 3px; border-radius: 4px; background: var(--ink); touch-action: none;
  box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px var(--bronze), inset 0 0 0 2px var(--ink), 0 2px 4px rgba(0, 0, 0, 0.6); }
.sk.gap { margin-left: 10px; }
.sk.gap::before { content: ""; position: absolute; left: -9px; top: 50%; width: 6px; height: 6px; margin-top: -3px; transform: rotate(45deg); background: var(--bronze-hi); box-shadow: 0 0 0 1px var(--edge); }
.sk img { width: 100%; height: 100%; display: block; border-radius: 2px; }
.sk .cd { position: absolute; inset: 3px; border-radius: 2px; pointer-events: none; background: conic-gradient(transparent 0 calc(var(--done, 1) * 360deg), rgba(8, 6, 4, 0.74) 0); }
.sk b { position: absolute; left: 2px; top: 2px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 2px; font: 700 10px/15px var(--f-display); text-align: center; color: var(--gold); background: rgba(11, 8, 6, 0.85); box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.45); }
.sk em { position: absolute; right: 2px; bottom: 1px; font: 700 11px/1 var(--f-ui); font-style: normal; color: #fff; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; }
.sk .sec { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-decoration: none; font: 800 18px/1 var(--f-ui); color: #fff; text-shadow: 0 1px 3px #000, 0 0 8px #000; pointer-events: none; }
.sk .cost { position: absolute; right: 2px; bottom: 2px; padding: 0 3px; border-radius: 2px; font: 700 10px/13px var(--f-ui); color: #cfe6ff; background: rgba(20, 40, 90, 0.9); display: none; }
.sk.noen img { filter: grayscale(0.7) brightness(0.55); }
.sk.noen::after { content: ""; position: absolute; inset: 3px; border-radius: 2px; background: rgba(40, 80, 160, 0.35); pointer-events: none; }
.sk.noen .cost { display: block; }
.sk:hover { box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px var(--bronze-hi), inset 0 0 0 2px var(--ink), 0 2px 4px rgba(0, 0, 0, 0.6); }
.sk.ready { animation: rdy 0.45s; }
@keyframes rdy { 0% { box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 2px var(--gold-hot), 0 0 16px var(--gold-hot); } }
.sk.fl { animation: skfl 0.25s; }
@keyframes skfl { 0% { transform: scale(0.93); box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 2px #fff4c0, 0 0 10px rgba(255, 244, 192, 0.6); } }
.sk.no { animation: skno 0.3s; }
@keyframes skno { 0%, 100% { transform: none; } 25% { transform: translateX(-3px); box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 2px var(--bad); } 75% { transform: translateX(3px); box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 2px var(--bad); } }
.sk.aiming { box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 2px var(--gold), 0 0 10px rgba(232, 193, 112, 0.5); }
.sk.pot { width: 46px; height: 46px; border-radius: 50%; padding: 4px; background: radial-gradient(circle at 50% 40%, #2a2118, #0b0806 75%); }
.sk.pot img { border-radius: 50%; }
.sk.pot .cd { inset: 4px; border-radius: 50%; }
.sk.pot b { left: -3px; top: -3px; border-radius: 8px; }
.sk.pot em { right: -2px; bottom: -2px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; font-size: 10px; line-height: 16px; text-align: center; background: var(--ink); box-shadow: 0 0 0 1px var(--bronze); text-shadow: none; }
.sk.pot.empty img { filter: grayscale(1) brightness(0.45); }
.sk.pot.empty em { color: #fff; background: #8e1f16; box-shadow: 0 0 0 1px #2a0a04; }

/* ---------- меню-лоток праворуч унизу ---------- */
#tray { position: fixed; right: 16px; bottom: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 5; }
#purse { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 6px; border-radius: 13px; font: 700 13px/1 var(--f-ui); color: var(--gold); background: linear-gradient(#231b13, #16110c); box-shadow: var(--frame-s); }
.coin { width: 16px; height: 16px; border-radius: 50%; display: inline-block; background: radial-gradient(circle at 35% 35%, #fff4c0, #e2b44c 55%, #8a6a22); box-shadow: 0 0 0 1px #3a2a08, inset 0 0 0 2px rgba(138, 106, 34, 0.5); }
#menu { display: flex; gap: 4px; padding: 6px; }
#menu button { position: relative; width: 40px; height: 40px; border-radius: 4px; display: flex; align-items: center; justify-content: center; background: linear-gradient(#2c2218, #1a140e); box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.18), 0 0 0 1px var(--edge); }
#menu button:hover, #menu button.on { background: linear-gradient(#3e3022, #241b12); box-shadow: inset 0 0 0 1px var(--bronze-hi), 0 0 0 1px var(--edge); }
#menu svg { width: 26px; height: 26px; fill: var(--bronze-hi); stroke: var(--edge); stroke-width: 1.1; stroke-linejoin: round; }
#menu svg .d { fill: var(--edge); stroke: var(--edge); }
#menu svg .seal { fill: #b8341e; stroke: var(--edge); }
#menu button:hover svg, #menu button.on svg { fill: var(--gold-hot); }
#menu kbd { position: absolute; right: 1px; bottom: 1px; min-width: 11px; padding: 0 2px; border-radius: 2px; text-align: center; color: var(--tx-2); background: rgba(11, 8, 6, 0.85); }
#menu .dot { position: absolute; right: 3px; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 1px var(--edge); }
#btnMenu { display: none !important; }

/* ---------- чат і події ---------- */
/* вікно чату прозоре для кліків: земля під ним клікається; інтерактивні лише вкладки, а під час набору — ще й історія */
#chatw { position: fixed; left: 16px; bottom: 12px; width: 380px; height: 200px; display: flex; flex-direction: column; border-radius: 4px; background: transparent; transition: background 0.2s, box-shadow 0.2s; z-index: 4; pointer-events: none; }
#chatw.typing { background: rgba(14, 11, 8, 0.86); box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px rgba(201, 161, 90, 0.3); }
.ctabs { display: flex; gap: 2px; padding: 4px 4px 0; opacity: 0.4; transition: opacity 0.2s; pointer-events: auto; align-self: flex-start; }
.ctabs:hover, #chatw.typing .ctabs { opacity: 1; }
.ctabs button { height: 22px; padding: 0 10px; border-radius: 3px 3px 0 0; font: 700 12px/22px var(--f-display); color: var(--tx-2); }
.ctabs button.on { color: #f3e3bd; background: rgba(48, 38, 27, 0.9); box-shadow: inset 0 2px 0 var(--gold); }
#log { flex: 1; min-height: 0; padding: 4px 8px 6px; font-size: 12.5px; line-height: 1.4; text-shadow: 0 1px 2px #000, 0 0 4px rgba(0, 0, 0, 0.8); pointer-events: none; }
#chatw.typing #log { pointer-events: auto; }
#log { display: flex; flex-direction: column; }
#log div { flex: none; margin-top: 1px; word-wrap: break-word; }
#log > div:first-child { margin-top: auto; } /* нові внизу, як у чаті */
#log div .ch { color: var(--tx-3); font-size: 11px; margin-right: 4px; }
#chatw:not(.typing) #log { overflow: hidden; -webkit-mask-image: linear-gradient(transparent, #000 30%); mask-image: linear-gradient(transparent, #000 30%); }
#chat { padding: 4px; pointer-events: auto; }
#chat input { width: 100%; }

/* ---------- сповіщення: банер місцевості й стос подій ---------- */
#toast { position: fixed; left: 50%; top: 17%; transform: translate(-50%, -8px); text-align: center; pointer-events: none; opacity: 0; transition: opacity 0.3s, transform 0.3s; max-width: min(92vw, 640px); z-index: 6; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast b { display: flex; align-items: center; gap: 16px; justify-content: center; font: 700 32px/1.15 var(--f-display); color: #f3e3bd; text-shadow: 0 2px 8px #000, 0 0 22px rgba(0, 0, 0, 0.7); }
#toast b::before, #toast b::after { content: ""; flex: none; width: 80px; height: 1px; background: linear-gradient(90deg, transparent, var(--bronze-hi)); }
#toast b::after { background: linear-gradient(270deg, transparent, var(--bronze-hi)); }
#toast small { display: block; margin-top: 6px; font: 600 13px/1.4 var(--f-ui); color: #9ec4ec; text-shadow: 0 1px 3px #000, 0 0 8px #000; }
#toast.yellow small { color: #f0c860; } #toast.red small { color: #ff9a80; } #toast.dungeon small { color: #d8b8ff; }
#toasts { position: fixed; right: 16px; bottom: 132px; width: 340px; display: flex; flex-direction: column; gap: 6px; align-items: stretch; pointer-events: none; z-index: 6; }
.tst { display: flex; gap: 10px; align-items: center; min-height: 40px; padding: 6px 10px 6px 12px; border-radius: 4px; background: linear-gradient(#231b13f2, #16110cf2); box-shadow: 0 0 0 1px var(--edge), inset 3px 0 0 var(--bronze-hi), 0 6px 16px rgba(0, 0, 0, 0.5); animation: tin 0.25s; }
.tst.warn { box-shadow: 0 0 0 1px var(--edge), inset 3px 0 0 var(--warn), 0 6px 16px rgba(0, 0, 0, 0.5); }
.tst.good { box-shadow: 0 0 0 1px var(--edge), inset 3px 0 0 var(--good), 0 6px 16px rgba(0, 0, 0, 0.5); }
.tst.bad { box-shadow: 0 0 0 1px var(--edge), inset 3px 0 0 var(--bad), 0 6px 16px rgba(0, 0, 0, 0.5); }
.tst .ti { flex: none; width: 26px; height: 26px; border-radius: 3px; background: center / cover no-repeat; box-shadow: var(--well-sh); }
.tst b { display: block; font: 700 14px/1.2 var(--f-display); color: var(--tx); }
.tst span { display: block; font-size: 12px; line-height: 1.35; color: var(--tx-2); }
.tst.out { opacity: 0; transform: translateX(14px); transition: opacity 0.4s, transform 0.4s; }
@keyframes tin { from { opacity: 0; transform: translateX(14px); } }
#dbg { position: fixed; left: 16px; top: 230px; font-size: 11px; color: #fff; text-shadow: 0 1px 2px #000; pointer-events: none; }

/* ---------- підказки ---------- */
#tip, #tip2 { position: fixed; display: none; pointer-events: none; z-index: 70; border-radius: 4px; background: linear-gradient(#231b13, #16110c); box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px rgba(201, 161, 90, 0.4), 0 8px 20px rgba(0, 0, 0, 0.55); }
#tip { padding: 4px 9px; font-size: 12px; }
#tip2 { padding: 10px 12px; font-size: 12px; line-height: 1.45; max-width: 300px; }
#tip2 b:first-child { font: 700 15px/1.2 var(--f-display); }
#tip2 hr { border: 0; height: 1px; margin: 6px 0; background: linear-gradient(90deg, rgba(201, 161, 90, 0.35), transparent); }
#tip2 .kb { display: block; margin-top: 6px; font-size: 11px; color: var(--tx-3); }

/* ---------- вікна ---------- */
#panel { position: fixed; z-index: 20; display: flex; flex-direction: column; left: 50%; top: 24px; transform: translateX(-50%); width: 560px; max-width: calc(100vw - 32px); max-height: calc(100vh - 152px); }
#panel > header { flex: none; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px 8px 16px; border-radius: 6px 6px 0 0; background: linear-gradient(#2c2218, #1d1610); box-shadow: 0 1px 0 var(--edge), 0 2px 0 rgba(201, 161, 90, 0.22); }
#panel > header .ht { flex: 1; min-width: 0; }
#panel h2 { margin: 0; font: 700 18px/1.2 var(--f-display); color: var(--gold); text-shadow: 0 1px 0 #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel header p { margin: 1px 0 0; font-size: 12px; color: var(--tx-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel > .tabs { flex: none; margin: 0; padding: 8px 12px 0; box-shadow: inset 0 -1px 0 rgba(201, 161, 90, 0.25); }
#panel .body { flex: 1 1 auto; min-height: 0; padding: 12px 16px 16px; }
#panel h3 { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; font: 700 14px/1.2 var(--f-display); color: var(--bronze-hi); }
#panel h3::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(201, 161, 90, 0.45), transparent); }
#panel h3:first-child { margin-top: 0; }
#panel p { margin: 6px 0; }
.hint { font-size: 12px; margin: 10px 0 0; color: var(--tx-3); }
.err { color: var(--bad); font-size: 13px; margin: 4px 0 8px; }
/* вікна майстерень і торговців — ліворуч, щоб не закривати героя; модальні — посередині */
#panel.panel-market, #panel.panel-forge, #panel.panel-refine, #panel.panel-bank, #panel.panel-dungeon { left: 16px; transform: none; top: 16px; width: 560px; }
#panel.panel-dungeon { width: 480px; }
#panel.panel-char { width: 780px; }
#panel.panel-help { width: 600px; }
#panel.panel-skills { width: 760px; }
#panel.panel-mastery { width: 900px; }
#panel.panel-mentor { width: 580px; }
#panel.panel-map { width: 760px; }
#panel.panel-menu { width: 420px; }

/* вкладки-«теки» */
.tabs { display: flex; gap: 2px; margin-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 4px 4px 0 0; font: 700 14px/1 var(--f-display); color: var(--tx-2); background: transparent; position: relative; }
.tabs button:hover { color: var(--tx); background: rgba(255, 235, 200, 0.04); }
.tabs button.on { color: #f3e3bd; background: linear-gradient(#30261b, #241c14); box-shadow: inset 0 2px 0 var(--gold), inset 1px 0 0 rgba(201, 161, 90, 0.2), inset -1px 0 0 rgba(201, 161, 90, 0.2); }
/* фільтри — з'єднаний перемикач */
.chips { display: inline-flex; flex-wrap: wrap; margin: 0 8px 8px 0; border-radius: 4px; box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px rgba(201, 161, 90, 0.25); overflow: hidden; vertical-align: top; }
.chips button { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; font: 600 12px/1 var(--f-ui); color: var(--tx-2); background: #1a140e; box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.6); }
.chips button:hover { color: var(--tx); }
.chips button.on { color: #2a1a06; background: linear-gradient(#e8c170, #b08030); }
.chips .td { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 1px var(--edge); }

/* ---------- комірки предметів ---------- */
.it { --tc: #a39e94; position: relative; width: 48px; height: 48px; flex: none; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  background: radial-gradient(circle at 50% 40%, #2a2118, #110d09 75%); box-shadow: var(--well-sh), inset 0 0 0 2px color-mix(in srgb, var(--tc) 70%, transparent); }
.it.t4, .it.t5, .it.t6 { box-shadow: var(--well-sh), inset 0 0 0 2px color-mix(in srgb, var(--tc) 80%, transparent), inset 0 0 12px -2px var(--tc); }
.it img { width: 42px; height: 42px; }
.it .tier { position: absolute; left: 0; bottom: 0; min-width: 14px; height: 14px; padding: 0 2px; border-radius: 0 3px 0 3px; font: 700 10px/14px var(--f-display); text-align: center; color: var(--tc); background: var(--ink); }
.it .tier:empty { display: none; }
.it em { position: absolute; right: 3px; top: 1px; font: 700 11px/1.2 var(--f-ui); font-style: normal; color: #fff; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; }
.it:hover { box-shadow: var(--well-sh), inset 0 0 0 2px var(--gold), 0 0 8px rgba(232, 193, 112, 0.3); }
.it.empty { cursor: default; box-shadow: var(--well-sh); }
.it.empty:hover { box-shadow: var(--well-sh); }
.it.empty svg { width: 30px; height: 30px; fill: var(--tx-2); opacity: 0.32; }
.it.well { cursor: default; } .it.well:hover { box-shadow: var(--well-sh), inset 0 0 0 2px color-mix(in srgb, var(--tc) 70%, transparent); }
.it .dur { position: absolute; left: 4px; right: 4px; bottom: 3px; height: 3px; background: rgba(0, 0, 0, 0.75); border-radius: 2px; overflow: hidden; }
.it .dur i { display: block; height: 100%; background: var(--warn); }
.it.broken img { filter: grayscale(1) brightness(0.6); } .it.broken .dur i { background: var(--bad); }

/* ---------- персонаж ---------- */
.charwrap { display: grid; grid-template-columns: 250px 1fr; gap: 12px 18px; }
.doll { position: relative; height: 340px; border-radius: 4px; background: radial-gradient(ellipse at 50% 72%, #3a2e20, #140f0a 72%); box-shadow: var(--well-sh); grid-row: span 2; }
.doll canvas { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); width: 140px; height: 270px; }
.doll .slot { position: absolute; }
.s-head { left: 12px; top: 14px; } .s-chest { left: 12px; top: 110px; } .s-feet { left: 12px; top: 206px; }
.s-cape { right: 12px; top: 14px; } .s-main { right: 12px; top: 110px; } .s-off { right: 12px; top: 206px; }
.doll .slot .it { width: 54px; height: 54px; } .doll .slot .it img { width: 48px; height: 48px; }
.rot { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.rot button { min-height: 28px; padding: 0 10px; font-size: 15px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; align-content: start; }
.stats h3 { grid-column: span 2; }
.st { display: flex; justify-content: space-between; padding: 6px 10px; font-size: 13px; border-radius: 3px; background: rgba(255, 235, 200, 0.025); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); }
.st b { color: var(--tx); font-weight: 700; }
.st.wide { grid-column: span 2; } .st.wide b { color: var(--warn); }
.fm { grid-column: span 2; position: relative; display: flex; justify-content: space-between; align-items: center; font-size: 12px; padding: 5px 10px 7px; border-radius: 3px; background: rgba(255, 235, 200, 0.025); overflow: hidden; }
.fm b { font: 700 11px/16px var(--f-display); color: var(--gold); padding: 0 6px; border-radius: 2px; background: rgba(11, 8, 6, 0.7); }
.fm i { position: absolute; left: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, #8a6420, var(--gold)); }
.bagbox { grid-column: 2; }
.bag { display: grid; grid-template-columns: repeat(auto-fill, 48px); gap: 4px; }
.sell { grid-template-columns: repeat(auto-fill, 52px); }
.sl { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--gold); }

/* ---------- майстерні, кузня, крамниця ---------- */
.rcs { display: grid; gap: 0; }
.rc { display: grid; grid-template-columns: 1.3fr 1.4fr auto; gap: 10px; align-items: center; min-height: 56px; padding: 6px 10px; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); }
.rc:nth-child(odd) { background: rgba(255, 235, 200, 0.025); }
.rc.ok { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5), inset 2px 0 0 var(--good); }
.rc .out { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.rc .need { display: flex; gap: 8px; flex-wrap: wrap; }
.rc .need span { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.rc .need .it { width: 34px; height: 34px; } .rc .need .it img { width: 28px; height: 28px; } .rc .need .it .tier { display: none; }
.rc .need .miss b { color: var(--bad); }
.rc .go { display: flex; gap: 6px; }
.rc .go button { min-height: 32px; padding: 0 12px; font-size: 13px; }
.price { color: var(--gold); font-weight: 700; }
.repair { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; margin-bottom: 10px; font-size: 13px; border-radius: 4px; background: rgba(255, 235, 200, 0.03); box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.2); }
.repair.need { box-shadow: inset 0 0 0 1px rgba(227, 163, 59, 0.55); }
.repair b { color: var(--gold); }
.help p { margin: 6px 0; line-height: 1.5; }
.help b { color: #f3e3bd; }
.go.big { display: flex; justify-content: center; margin-top: 14px; }
.go.big button { min-height: 44px; padding: 0 30px; font-size: 16px; }

/* ---------- ринок ---------- */
.mlist { display: grid; }
.mrow { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; min-height: 56px; padding: 4px 10px; cursor: pointer; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); }
.mrow:nth-child(odd) { background: rgba(255, 235, 200, 0.025); }
.mrow:hover { background: rgba(232, 193, 112, 0.08); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5), inset 2px 0 0 var(--gold); }
.mrow .nm { font-size: 13px; }
.mrow .pr { text-align: right; font-size: 12px; }
.mrow .pr b { color: var(--gold); }
.mrow.none { opacity: 0.6; }
.mitem .top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.mitem .top .nm { font: 700 16px/1.2 var(--f-display); }
.mitem .top .dim { font-size: 12px; }
.back { min-height: 30px; padding: 0 12px; font-size: 13px; margin-bottom: 10px; }
.book { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.book h4 { margin: 0 0 4px; font: 700 13px/1.2 var(--f-display); color: var(--tx-2); }
.book p { margin: 2px 0; font-size: 12px; }
.book .lv { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 8px; background: rgba(255, 235, 200, 0.025); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); }
.book .sellc .lv b { color: #ffb090; } .book .buyc .lv b { color: #a8e070; }
.mform { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.mform label { display: grid; gap: 4px; font-size: 12px; color: var(--tx-2); }
.mform input::-webkit-outer-spin-button, .mform input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mform input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.stepper { display: flex; gap: 0; }
.stepper input { flex: 1; min-width: 0; border-radius: 0; text-align: center; }
.stepper button { width: 34px; height: 36px; font: 700 16px/1 var(--f-ui); color: var(--bronze-hi); background: linear-gradient(#2c2218, #1a140e); box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.3); }
.stepper button:first-child { border-radius: 3px 0 0 3px; } .stepper button:last-child { border-radius: 0 3px 3px 0; }
#mTot { margin: 2px 0 10px; font-size: 12px; }
.macts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.macts button { min-height: 40px; padding: 0 8px; font-size: 14px; }
.morder { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; min-height: 56px; padding: 4px 10px; font-size: 12px; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); }
.morder:nth-child(odd) { background: rgba(255, 235, 200, 0.025); }
.morder .sd { font-weight: 700; } .morder .sd.s { color: #ffb090; } .morder .sd.b { color: #a8e070; }
.morder button { min-height: 30px; padding: 0 12px; font-size: 13px; }
.hist { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; margin-bottom: 10px; font-size: 12px; border-radius: 4px; background: rgba(255, 235, 200, 0.025); box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.15); }
.hist b { color: var(--gold); } .hist.dim { display: block; }
.spark { display: flex; gap: 3px; align-items: flex-end; height: 28px; width: 98px; }
.spark i { flex: 1; background: linear-gradient(#f0d070, #a07a30); border-radius: 2px 2px 0 0; min-height: 2px; }
.spark i.no { background: rgba(255, 255, 255, 0.12); }

/* ---------- уміння ---------- */
.skwrap { display: grid; grid-template-columns: 64px 1fr; gap: 14px; }
.wrail { display: flex; flex-direction: column; gap: 6px; }
.wrail button { position: relative; width: 56px; height: 56px; border-radius: 4px; background: radial-gradient(circle at 50% 40%, #2a2118, #110d09 75%); box-shadow: var(--well-sh); }
.wrail button img { width: 44px; height: 44px; display: block; margin: auto; }
.wrail button:hover { box-shadow: var(--well-sh), inset 0 0 0 1px var(--bronze-hi); }
.wrail button.on { box-shadow: var(--well-sh), inset 0 0 0 2px var(--gold), 0 0 10px rgba(232, 193, 112, 0.3); }
.wrail button i { position: absolute; right: -4px; top: -4px; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #d8ffb0, #6aa83a 60%, #2a5010); box-shadow: 0 0 0 1px var(--edge); }
.mlv { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 12px; border-radius: 4px; background: rgba(255, 235, 200, 0.03); box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.2); }
.mlv .wn { font: 700 16px/1.2 var(--f-display); color: var(--gold); }
.lvb { display: inline-block; padding: 1px 7px; border-radius: 2px; font: 700 12px/18px var(--f-display); color: #2a1a06; background: linear-gradient(#f0d080, #c08a30); box-shadow: 0 0 0 1px var(--edge); white-space: nowrap; }
.skrow { display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.skrow .key { display: flex; align-items: center; justify-content: center; height: 30px; border-radius: 3px; font: 700 15px/1 var(--f-display); color: var(--gold); background: var(--ink); box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.45); }
.skrow .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.skrow.arm .opts { grid-template-columns: 1fr; }
.skc { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: start; text-align: left; padding: 8px; min-height: 74px; border-radius: 4px; background: rgba(255, 235, 200, 0.025); box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.18); }
.skc img { width: 56px; height: 56px; border-radius: 3px; box-shadow: 0 0 0 1px var(--edge), 0 0 0 2px var(--bronze-lo); }
.skc b { display: block; font: 700 14px/1.2 var(--f-display); color: var(--tx); }
.skc span { display: block; font-size: 12px; color: var(--tx); margin: 3px 0; line-height: 1.35; }
.skc small { display: block; font-size: 11px; color: var(--tx-3); }
.skc em { position: absolute; right: 8px; top: 8px; font-style: normal; font: 700 11px/1 var(--f-ui); color: var(--tx-3); }
.skc.on { background: rgba(232, 193, 112, 0.08); box-shadow: inset 0 0 0 2px var(--gold); }
.skc.on b { color: var(--gold); }
.skc.lock { cursor: default; } .skc.lock img { filter: grayscale(1) brightness(0.6); } .skc.lock b, .skc.lock span { color: var(--tx-3); }
.skc.lock em { color: var(--tx-2); }
.skc:not(.lock):not(.fixed):not(.on):hover { box-shadow: inset 0 0 0 1px var(--bronze-hi); }

/* ---------- майстерність ---------- */
.mtree { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.mroot { margin-bottom: 8px; padding: 6px 8px; text-align: center; font: 700 14px/1.2 var(--f-display); color: var(--gold); border-radius: 3px; background: linear-gradient(#2c2218, #1d1610); box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px rgba(201, 161, 90, 0.3); }
.mnodes { display: grid; gap: 6px; }
.mnode { display: grid; grid-template-columns: 40px 1fr; column-gap: 8px; row-gap: 2px; padding: 6px 8px; border-radius: 4px; background: rgba(255, 235, 200, 0.025); box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.15); }
.mnode.got { box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.45); }
.mnode.lock { opacity: 0.55; } .mnode.lock img { filter: grayscale(0.8); }
.mnode img { grid-row: span 3; width: 40px; height: 40px; border-radius: 3px; background: radial-gradient(circle at 50% 40%, #2a2118, #110d09 75%); box-shadow: var(--well-sh); }
.mnode .mt { display: flex; justify-content: space-between; align-items: center; gap: 6px; font: 700 13px/1.2 var(--f-display); }
.mnode small { font-size: 11px; color: var(--tx-2); line-height: 1.35; }
.bar.mx, .bar.qx { height: 12px; margin: 2px 0; } .bar.mx span, .bar.qx span { font-size: 10px; line-height: 12px; text-align: center; }

/* ---------- наставниця ---------- */
.mentor .who { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: start; margin-bottom: 12px; }
.mentor .face { width: 72px; height: 72px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #4a3a28, #1a130c 75%); box-shadow: 0 0 0 1px var(--edge), 0 0 0 3px var(--bronze), 0 0 0 4px var(--edge); overflow: hidden; }
.mentor .face canvas { width: 100%; height: 100%; display: block; }
.parch { position: relative; padding: 10px 14px; border-radius: 3px; color: var(--parch-ink); font: italic 14px/1.5 var(--f-display); background: radial-gradient(ellipse at 30% 20%, #f2e6c8, var(--parch) 55%, var(--parch-2)); box-shadow: 0 0 0 1px var(--edge), inset 0 0 18px rgba(120, 80, 30, 0.35), 0 3px 8px rgba(0, 0, 0, 0.45); }
.parch::before { content: ""; position: absolute; left: -8px; top: 16px; border: 8px solid transparent; border-right-color: var(--parch); border-left: 0; }
.qcard { padding: 12px 14px; margin-bottom: 12px; border-radius: 4px; background: rgba(255, 235, 200, 0.03); box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.4); }
.qcard.done { text-align: center; color: var(--good); font: 700 15px/1.3 var(--f-display); box-shadow: inset 0 0 0 1px rgba(134, 182, 94, 0.5); }
.qcard .qt { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font: 700 16px/1.2 var(--f-display); color: var(--gold); }
.qcard .qt span { font: 600 12px/1 var(--f-ui); color: var(--tx-2); }
.qcard p { margin: 6px 0 8px; }
.qcard small { display: block; margin-top: 6px; color: var(--tx-2); } .qcard small b { color: var(--gold); }
.mbtns { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.mbtns button { min-height: 32px; padding: 0 12px; font-size: 13px; }
.qlist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; font-size: 13px; }
.qlist li { display: flex; align-items: center; gap: 8px; min-height: 26px; color: var(--tx-3); }
.qlist li i { flex: none; width: 18px; height: 18px; border-radius: 50%; font: 700 11px/18px var(--f-ui); font-style: normal; text-align: center; color: var(--tx-3); box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.3); }
.qlist li.ok { color: var(--tx-2); } .qlist li.ok i { color: #14200a; background: var(--good); box-shadow: none; }
.qlist li.cur { color: var(--gold); font-weight: 700; } .qlist li.cur i { color: #2a1a06; background: var(--gold); box-shadow: 0 0 8px rgba(232, 193, 112, 0.5); }

/* ---------- мапи ---------- */
#zmap { display: block; width: 100%; border-radius: 3px; box-shadow: var(--well-sh); cursor: crosshair; }
.wmap { display: block; width: 100%; height: auto; border-radius: 3px; box-shadow: var(--well-sh); background: radial-gradient(ellipse at 50% 50%, #3a3424, #1a1610 78%); }
.mlegend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--tx-2); margin-top: 8px; }
.mlegend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; box-shadow: 0 0 0 1px var(--edge); }

/* ---------- меню (телефон) ---------- */
.mgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mgrid button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 78px; border-radius: 4px; font: 700 12px/1.1 var(--f-display); color: var(--tx); background: linear-gradient(#2c2218, #1a140e); box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.25), 0 0 0 1px var(--edge); }
.mgrid button svg { width: 30px; height: 30px; fill: var(--bronze-hi); stroke: var(--edge); stroke-width: 1.1; stroke-linejoin: round; }
.mgrid button svg .d { fill: var(--edge); } .mgrid button svg .seal { fill: #b8341e; }
.mgrid button:active { background: linear-gradient(#3e3022, #241b12); }
.mpurse { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font: 700 15px/1 var(--f-ui); color: var(--gold); }

/* ---------- екрани поверх гри ---------- */
#death { position: fixed; inset: 0; background: radial-gradient(ellipse, rgba(60, 0, 0, 0.35), rgba(0, 0, 0, 0.75)); display: flex; align-items: center; justify-content: center; z-index: 50; }
#death .box { text-align: center; max-width: 440px; padding: 20px; }
#death h2 { font: 700 40px/1.1 var(--f-display); margin: 0 0 10px; color: #ff8a70; text-shadow: 0 2px 10px #000; }
#death p { text-shadow: 0 1px 3px #000; }
#net, #create { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 40%, rgba(40, 32, 22, 0.88), rgba(10, 8, 6, 0.96)); }
#net .box, #create .box, #ask .box { position: relative; width: min(92vw, 440px); padding: 22px 22px 18px; text-align: center; border-radius: 6px; box-shadow: var(--frame); background: var(--leather-bg); }
.logo { font: 700 30px/1.1 var(--f-display); color: var(--gold); margin-bottom: 8px; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
#net .msg { margin: 6px 0 14px; line-height: 1.5; }
#net .btns, #ask .btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
#net button, #ask button { min-height: 42px; padding: 0 20px; }
#create canvas { display: block; width: 100%; height: 190px; margin: 6px 0 4px; border-radius: 4px; background: radial-gradient(ellipse at 50% 80%, #4a5a30, #20281a 70%); box-shadow: var(--well-sh); }
#create .lab { text-align: left; font: 700 13px/1.2 var(--f-display); color: var(--bronze-hi); margin: 10px 0 5px; }
#create .opts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-start; }
#create .opt { min-width: 40px; min-height: 34px; border-radius: 4px; font-size: 12px; padding: 0 8px; background: #2a2219; box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px rgba(201, 161, 90, 0.25); }
#create .opt.on { box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 2px var(--gold), 0 0 8px rgba(232, 193, 112, 0.35); }
#create .go { width: 100%; margin-top: 16px; min-height: 46px; font-size: 16px; }
#create .small { font-size: 12px; margin: 10px 0 0; }
#ask { position: fixed; inset: 0; z-index: 55; display: flex; align-items: center; justify-content: center; background: rgba(20, 4, 0, 0.55); }
#ask .box { box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px #8a2a1c, inset 0 0 0 2px var(--ink), 0 14px 36px rgba(0, 0, 0, 0.6); }
#ask h2 { margin: 0 0 8px; color: #ff8a6a; font: 700 22px/1.2 var(--f-display); }
#ask p { margin: 0 0 14px; line-height: 1.5; }
#pinv { position: fixed; left: 50%; top: 120px; transform: translateX(-50%); padding: 14px 18px; z-index: 30; text-align: center; min-width: 300px; }
#pinv p { margin: 0 0 10px; }
#pinv .btns, #pmenu .btns { display: flex; gap: 8px; justify-content: center; }
#pmenu { position: fixed; z-index: 30; padding: 10px 12px; min-width: 210px; }
#pmenu b { display: block; margin-bottom: 8px; font: 700 15px/1.2 var(--f-display); color: var(--gold); }
#pmenu p { margin: 0; font-size: 12px; }
#aimx { position: fixed; left: 50%; top: calc(18px + var(--sat)); transform: translateX(-50%); z-index: 40; padding: 12px 22px; border-radius: 26px; background: rgba(40, 14, 10, 0.9); box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 2px #8a3a2a; color: #ffb8a0; font: 700 15px/1 var(--f-display); pointer-events: none; }
#aimx.on { background: #a02a18; color: #fff; box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 2px #ff8a70; transform: translateX(-50%) scale(1.08); }

/* ---------- вужчі екрани ПК ---------- */
@media (max-width: 1280px) { #chatw { width: 320px; height: 170px; } #toasts { width: 300px; } }
@media (max-height: 760px) { .mmw { height: 150px; } #chatw { height: 150px; } }

/* =================== ТЕЛЕФОН (вертикально) =================== */
body.phone #rcol { right: 8px; top: calc(8px + var(--sat)); width: 92px; gap: 6px; }
body.phone #mini { width: 92px; padding: 2px; }
body.phone .mmw { height: 86px; }
body.phone #clock { font-size: 9px; line-height: 13px; padding: 0 3px; }
/* назва місцевості — під смугами ліворуч угорі */
body.phone #zone { position: fixed; left: 62px; top: calc(40px + var(--sat)); right: 108px; height: 18px; margin: 0; padding: 0; gap: 6px; background: none; box-shadow: none; }
body.phone #zone .n { font-size: 12px; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
body.phone #zone .s { display: none; }
body.phone #zone .gem { width: 8px; height: 8px; }
body.phone #wb { height: 30px; padding: 0 6px; gap: 4px; }
body.phone #wb .ico { width: 18px; height: 18px; }
body.phone #wb .t { display: none; }
body.phone #wb .v { font-size: 12px; margin-left: auto; }
body.phone #quest { position: fixed; left: 8px; top: calc(64px + var(--sat)); right: 108px; padding: 3px 6px 3px 26px; }
body.phone #quest::before { top: 3px; width: 16px; height: 16px; line-height: 16px; font-size: 11px; }
body.phone #quest b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.phone #quest .obj { display: none; }
body.phone #target, body.phone #boss { top: calc(96px + var(--sat)); width: min(240px, 62vw); padding: 4px 8px 6px; left: 8px; transform: none; }
body.phone #target .n, body.phone #boss .n { font-size: 12px; margin-bottom: 3px; }
body.phone #boss:not(.hidden) + #target { top: calc(150px + var(--sat)); }
body.phone #boss .skull { display: none; }
body.phone #cap { top: auto; bottom: calc(150px + var(--sab)); width: 76vw; }
body.phone #party { top: calc(130px + var(--sat)); left: 8px; width: 46vw; }
/* панель дій: портрет і смуги — угорі, уміння — внизу на всю ширину */
body.phone #barwrap { left: 0; right: 0; bottom: 0; transform: none; padding: 6px 8px calc(8px + var(--sab)); border-radius: 0; justify-content: center; box-shadow: 0 -1px 0 var(--edge), 0 -2px 0 rgba(201, 161, 90, 0.35); }
body.phone #barwrap::before { display: none; }
body.phone #portrait { position: fixed; left: 8px; top: calc(8px + var(--sat)); bottom: auto; width: 46px; height: 46px; box-shadow: 0 0 0 1px var(--edge), 0 0 0 3px var(--bronze), 0 0 0 4px var(--edge), inset 0 0 8px rgba(0, 0, 0, 0.8); }
body.phone #plv { min-width: 18px; height: 18px; font-size: 10px; line-height: 18px; right: -6px; bottom: -4px; }
body.phone #bars { position: fixed; left: 62px; right: 108px; top: calc(10px + var(--sat)); }
body.phone #hp { height: 15px; } body.phone #hp span { line-height: 15px; font-size: 10px; }
body.phone #en { height: 7px; }
body.phone #row { width: 100%; justify-content: center; }
body.phone #skills { gap: 5px; }
body.phone .sk { width: min(56px, calc((100vw - 16px - 25px - 8px) / 6)); height: min(56px, calc((100vw - 16px - 25px - 8px) / 6)); }
body.phone .sk.gap { margin-left: 8px; }
body.phone .sk.gap::before { left: -7px; width: 5px; height: 5px; }
body.phone .sk b { display: none; }
body.phone #cons { position: fixed; right: 8px; bottom: calc(80px + var(--sab)); padding: 0; margin: 0; box-shadow: none; gap: 8px; }
body.phone .sk.pot { width: 50px; height: 50px; }
body.phone .sk.pot b { display: none; }
/* лоток: лише чат і меню, ліворуч над уміннями */
body.phone #tray { left: 8px; right: auto; bottom: calc(80px + var(--sab)); flex-direction: row; align-items: center; }
body.phone #purse { display: none; }
body.phone #menu { padding: 4px; gap: 4px; }
body.phone #menu button { display: none; width: 44px; height: 44px; }
body.phone #menu #btnChat, body.phone #menu #btnMenu { display: flex !important; }
body.phone #menu kbd { display: none; }
body.phone #chatw { left: 8px; bottom: calc(136px + var(--sab)); width: 64vw; height: auto; max-height: 96px; background: none !important; box-shadow: none !important; pointer-events: none; }
body.phone .ctabs { display: none; }
body.phone #log { overflow: hidden; font-size: 11.5px; line-height: 1.3; padding: 0; -webkit-mask-image: none; mask-image: none; }
body.phone #chatw.typing #log { pointer-events: none; } /* на телефоні журнал ніколи не забирає дотики в зоні джойстика */
body.phone #log div:nth-last-child(n+4) { display: none; }
body.phone #log div.old { opacity: 0; transition: opacity 1s; }
body.phone #chat { position: fixed; left: 8px; right: 8px; top: calc(120px + var(--sat)); padding: 0; pointer-events: auto; z-index: 15; }
body.phone #chat input { height: 44px; font-size: 16px; }
body.phone #toast { top: 30%; }
body.phone #toast b { font-size: 24px; gap: 10px; } body.phone #toast b::before, body.phone #toast b::after { width: 36px; }
body.phone #toasts { right: 8px; left: 8px; width: auto; bottom: auto; top: calc(96px + var(--sat)); }
body.phone .tst { min-height: 36px; padding: 4px 8px 4px 10px; }
body.phone #dbg { top: calc(150px + var(--sat)); left: 8px; }
/* вікна — непрозорі аркуші знизу; поки відкрито, зайве з екрана ховаємо */
body.phone #panel, body.phone #panel[class] { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; transform: none; max-height: calc(100dvh - 72px - var(--sat)); border-radius: 10px 10px 0 0; z-index: 45; background: linear-gradient(#211a13, #16110c); }
body.phone #panel::before { display: none; }
body.phone #panel > header { position: relative; min-height: 52px; padding: 14px 10px 8px 14px; border-radius: 10px 10px 0 0; }
body.phone #panel > header::before { content: ""; position: absolute; left: 50%; top: 5px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: rgba(201, 161, 90, 0.4); }
body.phone #panel .x { width: 36px; height: 36px; }
body.phone #panel .body { padding: 10px 12px calc(16px + var(--sab)); }
body.phone.sheet-open #cons, body.phone.sheet-open #quest, body.phone.sheet-open #rcol, body.phone.sheet-open #tray, body.phone.sheet-open #chatw, body.phone.sheet-open #party, body.phone.sheet-open #target, body.phone.sheet-open #boss, body.phone.sheet-open #cap { visibility: hidden; }
body.phone .charwrap { grid-template-columns: 1fr; }
body.phone .doll { height: 300px; grid-row: auto; }
body.phone .bagbox { grid-column: 1; }
body.phone .bag { grid-template-columns: repeat(auto-fill, 52px); }
body.phone .bag .it { width: 52px; height: 52px; }
body.phone .rc { grid-template-columns: 1fr auto; } body.phone .rc .need { grid-column: 1 / -1; grid-row: 2; }
body.phone .mrow { grid-template-columns: 48px 1fr; row-gap: 2px; } body.phone .mrow .it { grid-row: span 2; } body.phone .mrow .nm { align-self: end; } body.phone .mrow .pr { grid-column: 2; align-self: start; text-align: left; font-size: 11px; color: var(--tx-2); }
body.phone .mgrid button { font-size: 11px; letter-spacing: -0.2px; padding: 0 2px; }
body.phone .mform input { height: 44px; font-size: 16px; } body.phone .stepper button { height: 44px; width: 44px; }
body.phone .macts button { min-height: 44px; }
body.phone .skwrap { grid-template-columns: 1fr; }
body.phone .wrail { flex-direction: row; overflow-x: auto; padding-bottom: 2px; }
body.phone .wrail button { flex: none; }
body.phone .skrow { grid-template-columns: 1fr; gap: 4px; }
body.phone .skrow .key { width: 30px; }
body.phone .skrow .opts { grid-template-columns: 1fr; }
body.phone .mtree { grid-template-columns: 1fr 1fr; gap: 10px; }
body.phone .qlist { grid-template-columns: 1fr; }
body.phone .hist { grid-template-columns: 1fr; }
body.phone .mentor .who { grid-template-columns: 52px 1fr; } body.phone .mentor .face { width: 52px; height: 52px; }
body.phone #pinv { top: 30%; width: 92vw; min-width: 0; }
body.phone #aimx { top: calc(64px + var(--sat)); }
body.phone .tabs button { height: 36px; padding: 0 12px; }
body.phone .btn, body.phone .rc button, body.phone .repair button, body.phone .mbtns button, body.phone .morder button { min-height: 40px; }

/* якість графіки */
.qsel { margin-bottom: 4px; }

/* ---------- телефон: як у MOBA (2026-11-05) ----------
   Ліва нижня частина екрана — джойстик руху. Праворуч велика кнопка атаки й дуга Q W E, піднята над краєм,
   щоб уміння можна було тягнути й униз. Унизу рядком — зілля й R D F. Чат і меню — під мапою праворуч.
   --k (задає resize) стискає розкладку на вузьких екранах. */
#atk { display: none; }
body.phone #barwrap { background: none; box-shadow: none; padding: 0; height: 0; }
body.phone #row { display: block; }
body.phone .sk.gap { margin: 0; } body.phone .sk.gap::before { display: none; }
body.phone #skills .sk, body.phone #atk { position: fixed; width: calc(60px * var(--k)); height: calc(60px * var(--k)); max-width: none; max-height: none; padding: 3px; border-radius: 50%; }
body.phone #skills .sk img, body.phone #skills .sk .cd, body.phone #skills .sk.noen::after { border-radius: 50%; }
body.phone #skills .sk .cost { right: 50%; bottom: -3px; transform: translateX(50%); border-radius: 6px; }
body.phone .sk[data-i="0"] { right: calc(118px * var(--k)); bottom: calc(var(--sab) + 80px * var(--k)); }
body.phone .sk[data-i="1"] { right: calc(90px * var(--k)); bottom: calc(var(--sab) + 148px * var(--k)); }
body.phone .sk[data-i="2"] { right: calc(22px * var(--k)); bottom: calc(var(--sab) + 176px * var(--k)); }
body.phone .sk[data-i="3"], body.phone .sk[data-i="4"], body.phone .sk[data-i="5"] { width: calc(54px * var(--k)); height: calc(54px * var(--k)); bottom: calc(var(--sab) + 8px); }
body.phone .sk[data-i="3"] { left: calc(122px * var(--k)); }
body.phone .sk[data-i="4"] { left: calc(181px * var(--k)); }
body.phone .sk[data-i="5"] { left: calc(240px * var(--k)); }
body.phone #atk { display: block; right: calc(14px * var(--k)); bottom: calc(var(--sab) + 72px * var(--k)); width: calc(76px * var(--k)); height: calc(76px * var(--k)); padding: 0;
  background: radial-gradient(circle at 50% 38%, #4a3826, #0b0806 74%); box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 2px var(--bronze-hi), inset 0 0 0 4px var(--ink), inset 0 0 14px rgba(232, 193, 112, 0.25), 0 4px 12px rgba(0, 0, 0, 0.6); }
body.phone #atk img { display: block; width: 66%; height: 66%; margin: 17%; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.7)); }
body.phone #atk:active { transform: scale(0.95); }
body.phone #cons { position: static; padding: 0; margin: 0; box-shadow: none; }
body.phone #pot1, body.phone #pot2 { position: fixed; bottom: calc(var(--sab) + 11px); width: calc(48px * var(--k)); height: calc(48px * var(--k)); }
body.phone #pot1 { left: calc(10px * var(--k)); }
body.phone #pot2 { left: calc(64px * var(--k)); }
body.phone #tray { left: auto; right: 8px; top: calc(var(--sat) + 142px); bottom: auto; transform: none; }
body.phone #chatw { bottom: calc(var(--sab) + 250px * var(--k)); width: 60vw; }
body.phone #cap { bottom: auto; top: calc(205px + var(--sat)); }
body.phone #aimx { top: auto; transform: none; padding: 10px 16px; font-size: 14px; }
body.phone #aimx.r { right: 12px; left: auto; bottom: calc(var(--sab) + 274px * var(--k)); }
body.phone #aimx.c { left: 50%; right: auto; transform: translateX(-50%); bottom: calc(var(--sab) + 150px * var(--k)); }
body.phone #aimx.r.on { transform: scale(1.08); } body.phone #aimx.c.on { transform: translateX(-50%) scale(1.08); }
/* джойстик: у спокої — ледь помітне коло-підказка, під пальцем — там, де торкнувся */
#joy { display: none; }
body.phone #joy { display: block; position: fixed; left: calc(34px + 56px * var(--k)); top: calc(100% - var(--sab) - 170px * var(--k)); width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; pointer-events: none; z-index: 4; opacity: 0.32;
  background: radial-gradient(circle, rgba(11, 8, 6, 0.15) 40%, rgba(11, 8, 6, 0.45)); box-shadow: inset 0 0 0 2px rgba(201, 161, 90, 0.6), 0 0 0 1px rgba(7, 5, 4, 0.5); transition: opacity 0.2s; }
body.phone #joy.on { opacity: 0.9; transition: none; }
body.phone #joy i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #e8c170, #8a6a3a 70%); box-shadow: 0 0 0 1px var(--edge), 0 3px 8px rgba(0, 0, 0, 0.6); }
body.phone.sheet-open #joy { visibility: hidden; }

/* ---------- аудит 2026-11-05 ---------- */
/* довге натискання на кнопки не відкриває меню картинки й не тягне її */
.sk img, #atk img, .it img, #menu svg { pointer-events: none; -webkit-user-drag: none; user-select: none; }
#hud, #panel { -webkit-touch-callout: none; }
/* телефон: сповіщення й запрошення видно й поверх відкритого аркуша; рядок чату — над усім, поки пишеш */
body.phone.sheet-open #toasts { top: calc(var(--sat) + 4px); z-index: 50; }
body.phone #pinv, body.phone #pmenu { z-index: 52; }
body.phone #chatw.typing { z-index: 60; }
body.phone #chat { top: calc(64px + var(--sat)); }
/* вузьке вікно ПК (760–1260 px): лоток і чат — над панеллю дій, рамки цілі — лівіше від мапи */
@media (min-width: 760px) and (max-width: 1260px) {
  body:not(.phone) #tray { bottom: 124px; }
  body:not(.phone) #chatw { bottom: 124px; height: 150px; }
  body:not(.phone) #toasts { bottom: 222px; }
}
@media (min-width: 760px) and (max-width: 1000px) {
  body:not(.phone) #target, body:not(.phone) #boss, body:not(.phone) #cap { left: calc((100% - 236px) / 2); }
  body:not(.phone) #boss { width: min(480px, calc(100% - 260px)); }
}
