/* CLODIA — інтерфейс. Одна система на все: темні шаруваті панелі, карбована золота рамка, блакитний «ефір» для акцентів.
   Малюнків-файлів немає: фактура, орнамент і блиск — градієнти й тіні. Розміри множаться на --k (1 на 1366×768, 1.15 на 1920×1080). */
:root {
  --k: 1;
  --slot: calc(46px * var(--k));
  --gold: #e6c877; --gold-hi: #fff1c2; --gold-lo: #8d7638; --bronze: #4b3e1c; --line: #6f6238;
  --bg0: #07080d; --bg1: #0e1018; --bg2: #151824; --bg3: #1e2232; --bg4: #2a2f45;
  --bg: rgba(13, 15, 24, .92);
  --text: #e9e5d8; --dim: #9d9988; --cyan: #72e4ff; --good: #8dffa0; --bad: #ff8d7a; --warn: #ffb347;
  --hp: #c8323c; --mp: #2f7de0; --xp: #d6a93a;
  --pvp: #c58cff; --pk: #ff5a5a;   /* імена гравців: у бою з гравцем і вбивця (ті самі кольори — PK.colors у shared/rules.js) */
  --title: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  --body: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --metal: linear-gradient(155deg, #f3dc92 0%, #b3943f 10%, #55461e 30%, #2c240f 52%, #6f5c2b 74%, #d6bb69 92%, #fff0b8 100%);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .055 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --weave: repeating-linear-gradient(45deg, rgba(255, 255, 255, .012) 0 2px, transparent 2px 6px), repeating-linear-gradient(-45deg, rgba(0, 0, 0, .10) 0 2px, transparent 2px 6px);
  --hair: linear-gradient(90deg, transparent, rgba(230, 200, 119, .75) 18%, var(--gold-hi) 50%, rgba(230, 200, 119, .75) 82%, transparent);
}
@media (min-width: 1700px) and (min-height: 900px) { :root { --k: 1.15; } }

* { box-sizing: border-box; }
html { font-size: calc(13px * var(--k)); }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0d16; color: var(--text); font-family: var(--body); line-height: 1.38; user-select: none; }
body { font-size: 1rem; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#icDefs { position: absolute; left: -10px; top: -10px; pointer-events: none; }
.hidden { display: none !important; }
h1, h2, h3 { font-family: var(--title); font-weight: 600; margin: 0; color: var(--gold); }
b { font-weight: 600; }
input { font-family: var(--body); }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.good { color: var(--good); } .bad { color: var(--bad); } .dimtxt, .dim { color: var(--dim); } .gd { color: var(--gold); } .cy { color: var(--cyan); } .risk, .soon { color: var(--warn); }
.small { color: var(--dim); font-size: .92rem; }
.row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.num { font-variant-numeric: tabular-nums; }

/* Іконки: SVG із набору, залиті градієнтом (#icDefs в index.html). */
.ic { display: block; width: 1.15em; height: 1.15em; flex: none; fill: url(#gGold); }
.ic.i-ivory { fill: url(#gIvory); } .ic.i-steel { fill: url(#gSteel); } .ic.i-cyan { fill: url(#gCyan); } .ic.i-green { fill: url(#gGreen); } .ic.i-red { fill: url(#gRed); } .ic.i-dim { fill: url(#gDim); }
.inl { display: inline-flex; align-items: center; gap: .35em; vertical-align: middle; }

*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: #06070b; border-radius: 6px; box-shadow: inset 0 0 0 1px #000, inset 0 0 4px rgba(0, 0, 0, .9); }
*::-webkit-scrollbar-thumb { border: 2px solid #06070b; border-radius: 6px; background: linear-gradient(90deg, #5f4f24, #c9ac5c 45%, #6d5a28); }
*::-webkit-scrollbar-thumb:hover { background: linear-gradient(90deg, #7a662e, #f0d27c 45%, #8a7334); }
*::-webkit-scrollbar-corner { background: transparent; }

/* ── Панель: основа рамок HUD, плашок і бічних колонок ── */
.panel, .frame, .side, .card, #popup {
  position: relative; border-radius: 8px; background: var(--grain), radial-gradient(130% 80% at 50% 0, #1d2131 0, #121420 55%, #0b0d15 100%);
  border: 1px solid #000; box-shadow: inset 0 0 0 1px rgba(230, 200, 119, .42), inset 0 0 0 2px rgba(0, 0, 0, .7), inset 0 1px 0 2px rgba(255, 255, 255, .03), 0 10px 30px rgba(0, 0, 0, .6); }

/* ── Кнопки ── */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: .42em 1em; border: 1px solid #000; border-radius: 5px; cursor: pointer; white-space: nowrap;
  font: 600 1rem var(--body); color: var(--gold-hi); text-shadow: 0 1px 1px #000;
  background: linear-gradient(#57471f, #3a2f15 48%, #2a220f 52%, #201a0b);
  box-shadow: inset 0 0 0 1px rgba(230, 200, 119, .5), inset 0 1px 0 1px rgba(255, 241, 194, .28), 0 1px 2px rgba(0, 0, 0, .7); transition: filter .12s, box-shadow .12s, transform .06s; }
.btn:hover { filter: brightness(1.22); box-shadow: inset 0 0 0 1px var(--gold), inset 0 1px 0 1px rgba(255, 241, 194, .4), 0 0 10px rgba(230, 200, 119, .28), 0 1px 2px rgba(0, 0, 0, .7); }
.btn:active { transform: translateY(1px); filter: brightness(.92); box-shadow: inset 0 0 0 1px rgba(230, 200, 119, .5), inset 0 3px 6px rgba(0, 0, 0, .7); }
.btn:disabled { cursor: default; filter: saturate(.25) brightness(.62); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); transform: none; color: #9a9584; }
.btn .ic { width: 1.1em; height: 1.1em; }
.btn.big { padding: .62em 1.7em; font: 600 1.3rem var(--title); letter-spacing: .06em; }
.btn.sm { padding: .18em .7em; font-size: .92rem; }
.btn.wide { width: 100%; }
.btn.pri { color: #1b1404; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); background: linear-gradient(#fff0b8, #e6c877 42%, #b89443 58%, #8d7030);
  box-shadow: inset 0 0 0 1px rgba(255, 246, 207, .8), inset 0 -2px 4px rgba(90, 60, 0, .45), 0 0 14px rgba(230, 200, 119, .25), 0 2px 4px rgba(0, 0, 0, .7); }
.btn.pri:hover { filter: brightness(1.1); box-shadow: inset 0 0 0 1px #fff, inset 0 -2px 4px rgba(90, 60, 0, .45), 0 0 22px rgba(230, 200, 119, .5), 0 2px 4px rgba(0, 0, 0, .7); }
.btn.pri:disabled { color: #4b4636; text-shadow: none; filter: saturate(.15) brightness(.55); }
.btn.ghost { background: rgba(255, 255, 255, .03); color: var(--dim); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.btn.ghost:hover { color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); filter: none; }
.btn.danger { background: linear-gradient(#4a2420, #2d1512 52%, #1e0d0b); color: #ffc9bd; box-shadow: inset 0 0 0 1px rgba(255, 141, 122, .45), inset 0 1px 0 1px rgba(255, 200, 190, .16), 0 1px 2px rgba(0, 0, 0, .7); }
.btn.danger:hover { box-shadow: inset 0 0 0 1px var(--bad), 0 0 10px rgba(255, 110, 90, .3); }

/* ── Вкладки ── */
.tabs { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 9px; padding: 3px; border-radius: 6px; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .8), inset 0 1px 4px rgba(0, 0, 0, .7); }
.tab { display: inline-flex; align-items: center; gap: .4em; padding: .28em .95em; border-radius: 4px; cursor: pointer; color: var(--dim); font-weight: 600; white-space: nowrap;
  background: linear-gradient(#1c1f2c, #12141d); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); transition: color .12s, box-shadow .12s; }
.tab:hover { color: var(--text); box-shadow: inset 0 0 0 1px rgba(230, 200, 119, .4); }
.tab.sel { color: var(--gold-hi); background: linear-gradient(#4d4020, #2a2310); box-shadow: inset 0 0 0 1px var(--gold), inset 0 -2px 0 0 var(--gold-hi), 0 0 10px rgba(230, 200, 119, .18); }
.tab .ic { width: 1.2em; height: 1.2em; fill: url(#gDim); }
.tab.sel .ic, .tab:hover .ic { fill: url(#gGold); }
.tab small { font-size: .82rem; opacity: .75; font-weight: 400; }

/* ── Смуги ── */
.bar { position: relative; height: 1.25rem; border-radius: 4px; overflow: hidden; background: linear-gradient(#030407, #0d0f16); border: 1px solid #000;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .9), 0 0 0 1px rgba(230, 200, 119, .22), 0 1px 0 1px rgba(255, 255, 255, .04); }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; transition: width .18s linear; }
.bar i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(255, 255, 255, .38), rgba(255, 255, 255, .06) 45%, rgba(0, 0, 0, .0) 55%, rgba(0, 0, 0, .28)); box-shadow: inset -1px 0 0 rgba(255, 255, 255, .35); }
.bar b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .82rem; font-weight: 700; letter-spacing: .02em; color: #fff;
  text-shadow: 0 0 2px #000, 0 1px 2px #000, 0 0 4px #000; font-variant-numeric: tabular-nums; }
.bar.hp i { background: linear-gradient(90deg, #7d141c, #d93a45 55%, #f0606a); }
.bar.mp i { background: linear-gradient(90deg, #143f86, #2f7de0 55%, #5aa6ff); }
.bar.mp { height: 1.05rem; }
.bar.xp i { background: linear-gradient(90deg, #7a5a14, #d6a93a 60%, #f6da7c); }
.bar.thin { height: .5rem; }

/* ── Слот: рамка кольору грейду (--g), кольорова «плита» під малюнком (--p) ── */
.slot { --g: #4a4534; --p: #1a1d29; --glow: 0%; position: relative; width: var(--slot); height: var(--slot); flex: none; border: 1px solid #000; border-radius: 5px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(95% 95% at 50% 36%, color-mix(in srgb, var(--p) 62%, #000) 0, color-mix(in srgb, var(--p) 26%, #000) 62%, #05060a 100%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--g) 80%, #000), inset 0 0 0 2px rgba(0, 0, 0, .72), inset 0 0 calc(var(--slot) * .3) color-mix(in srgb, var(--g) var(--glow), transparent), inset 0 3px 6px rgba(0, 0, 0, .55), 0 1px 0 rgba(255, 255, 255, .06);
  transition: filter .1s, transform .06s; }
.slot::after { content: ''; position: absolute; inset: 0; border-radius: 4px; pointer-events: none; opacity: 0; box-shadow: inset 0 0 0 1px var(--gold-hi), 0 0 9px rgba(230, 200, 119, .55); transition: opacity .1s; }
.slot:hover::after { opacity: 1; }
.slot:hover { filter: brightness(1.18); }
.slot:active { transform: scale(.94); filter: brightness(.9); }
.slot > .ic { width: 66%; height: 66%; fill: url(#gIvory); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .95)) drop-shadow(0 0 3px rgba(0, 0, 0, .5)); pointer-events: none; }
/* Мальована іконка займає весь слот; рамка в кольорі грейду лишається довкола неї. */
.ic.art { fill: none; object-fit: cover; border-radius: 3px; filter: none; }
.slot > .ic.art { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); border-radius: 2px; filter: saturate(1.06) contrast(1.03);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--g) 90%, #000), 0 0 calc(var(--slot) * .16) color-mix(in srgb, var(--g) var(--glow), transparent); }
.slot:has(> .ic.art)::before { left: 3px; right: 3px; top: 3px; height: 36%; background: linear-gradient(rgba(255, 255, 255, .14), rgba(255, 255, 255, 0)); z-index: 1; }
.slot:has(> .ic.art) > *:not(.ic) { z-index: 2; }
.slot.has::before { content: ''; position: absolute; left: 2px; right: 2px; top: 2px; height: 46%; border-radius: 3px 3px 50% 50% / 3px 3px 22% 22%; pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, .17), rgba(255, 255, 255, .02)); }
.slot.empty { cursor: default; background: var(--weave), linear-gradient(#0d0f17, #090a10); box-shadow: inset 0 0 0 1px #2c2a22, inset 0 0 0 2px rgba(0, 0, 0, .7), inset 0 3px 8px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .04); }
.slot.empty:hover { filter: none; } .slot.empty:hover::after { opacity: 0; } .slot.empty:active { transform: none; }
.slot > .ic.ghost { width: 58%; height: 58%; fill: #cfd6e8; opacity: .13; filter: none; }
.slot.g0 { --glow: 14%; } .slot.g1 { --glow: 34%; } .slot.g2 { --glow: 48%; } .slot.g3 { --glow: 62%; }
.slot.g3::before { background: linear-gradient(rgba(255, 235, 190, .26), rgba(255, 255, 255, .02)); }
.slot.sm { width: calc(var(--slot) * .78); height: calc(var(--slot) * .78); border-radius: 4px; }
.slot.lg { width: calc(var(--slot) * 1.15); height: calc(var(--slot) * 1.15); }
.slot .key { position: absolute; left: 2px; top: 2px; min-width: 1.15em; padding: 0 .28em; font: 700 .74rem/1.25 var(--body); text-align: center; color: var(--gold-hi); border-radius: 3px 0 4px 0;
  background: rgba(0, 0, 0, .78); box-shadow: 0 0 0 1px rgba(230, 200, 119, .35); pointer-events: none; z-index: 2; }
.slot .cnt { position: absolute; right: 3px; bottom: 1px; font: 700 .82rem/1.1 var(--body); color: #fff; pointer-events: none; z-index: 2; font-variant-numeric: tabular-nums;
  text-shadow: -1px 0 #000, 1px 0 #000, 0 -1px #000, 0 1px #000, 0 0 3px #000; }
.slot .ench { position: absolute; right: 3px; top: 1px; font: 700 .82rem/1.1 var(--body); color: #9ff3ff; pointer-events: none; z-index: 2;
  text-shadow: -1px 0 #000, 1px 0 #000, 0 -1px #000, 0 1px #000, 0 0 5px #19a9d6; }
.slot .setm { position: absolute; left: 4px; bottom: 4px; width: 7px; height: 7px; transform: rotate(45deg); background: linear-gradient(135deg, var(--gold-hi), var(--gold-lo)); box-shadow: 0 0 0 1px #000, 0 0 5px rgba(230, 200, 119, .8); pointer-events: none; z-index: 2; }
.slot .cd { position: absolute; inset: 1px; border-radius: 4px; pointer-events: none; display: none; z-index: 3; --cd: 0;
  background: conic-gradient(rgba(4, 5, 10, 0) calc((1 - var(--cd)) * 360deg), rgba(4, 5, 10, .82) calc((1 - var(--cd)) * 360deg)); box-shadow: inset 0 0 0 1px rgba(114, 228, 255, .35); }
.slot .cdt { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font: 700 1.15rem var(--body); color: #fff; pointer-events: none; z-index: 4;
  text-shadow: -1px 0 #000, 1px 0 #000, 0 -1px #000, 0 1px #000, 0 0 6px #000; font-variant-numeric: tabular-nums; }
.slot.off { filter: grayscale(1) brightness(.5); }
.slot.off:hover { filter: grayscale(.8) brightness(.62); }
.slot.dim { filter: brightness(.38) saturate(.5); }
.slot.pick { animation: pick 1.1s ease-in-out infinite; }
@keyframes pick { 0%, 100% { box-shadow: inset 0 0 0 1px var(--cyan), 0 0 4px rgba(114, 228, 255, .5); } 50% { box-shadow: inset 0 0 0 2px var(--cyan), 0 0 14px rgba(114, 228, 255, .9); } }
.slot.on { box-shadow: inset 0 0 0 1px var(--cyan), inset 0 0 12px rgba(114, 228, 255, .7), 0 0 8px rgba(114, 228, 255, .45); }
.slot.over { box-shadow: inset 0 0 0 2px var(--cyan), inset 0 0 14px rgba(114, 228, 255, .8), 0 0 12px rgba(114, 228, 255, .6); }
.slot[draggable="true"], .sk[draggable="true"] { cursor: grab; }
.dragging { opacity: .45; }
.lockm { position: absolute; right: -3px; bottom: -3px; width: 44%; height: 44%; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #0a0b11; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(255, 255, 255, .18); z-index: 3; }
.lockm .ic { width: 68%; height: 68%; fill: url(#gDim); filter: none; }
.upm { position: absolute; right: -3px; top: -3px; width: 40%; height: 40%; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #10210f; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px var(--good), 0 0 8px rgba(141, 255, 160, .6); z-index: 3; }
.upm .ic { width: 70%; height: 70%; fill: url(#gGreen); filter: none; }

/* ── Оверлеї та картки ── */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 50;
  background: radial-gradient(ellipse at center, rgba(8, 10, 20, .30), rgba(3, 4, 8, .86)); }
#dead.overlay { background: radial-gradient(ellipse at center, rgba(60, 4, 6, .35), rgba(14, 0, 0, .82)); }
.card { width: calc(430px * var(--k)); max-width: 94vw; padding: 26px 30px 24px; text-align: center; }
.card::before, .side::before, #popup::before { content: ''; position: absolute; inset: 5px; border-radius: 5px; pointer-events: none;
  background: linear-gradient(var(--gold), var(--gold)) left top / 16px 1px no-repeat, linear-gradient(var(--gold), var(--gold)) left top / 1px 16px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right top / 16px 1px no-repeat, linear-gradient(var(--gold), var(--gold)) right top / 1px 16px no-repeat,
    linear-gradient(var(--gold), var(--gold)) left bottom / 16px 1px no-repeat, linear-gradient(var(--gold), var(--gold)) left bottom / 1px 16px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right bottom / 16px 1px no-repeat, linear-gradient(var(--gold), var(--gold)) right bottom / 1px 16px no-repeat; opacity: .8; }
.card h2 { font-size: 1.9rem; letter-spacing: .06em; margin-bottom: 10px; color: var(--gold-hi); text-shadow: 0 2px 0 #000, 0 0 18px rgba(230, 200, 119, .35); }
.lead { color: #cfcab8; margin: 0 0 16px; line-height: 1.5; }
.msg { min-height: 1.5em; margin: 10px 0 4px; color: var(--bad); }
.crest { width: 64px; height: 64px; margin: 0 auto 8px; }
.crest .ic { width: 100%; height: 100%; fill: url(#gRed); filter: drop-shadow(0 2px 2px #000) drop-shadow(0 0 14px rgba(255, 60, 60, .5)); }

/* ── Рамки героя й цілі ── */
#me { position: fixed; left: 12px; top: 12px; width: calc(292px * var(--k)); height: calc(70px * var(--k)); padding: 0 12px 0 calc(74px * var(--k)); display: flex; align-items: center; border-radius: 36px 8px 8px 36px; }
.medal { position: absolute; left: -4px; top: 50%; width: calc(76px * var(--k)); height: calc(76px * var(--k)); transform: translateY(-50%); border-radius: 50%; background: var(--metal);
  box-shadow: 0 0 0 1px #000, 0 4px 12px rgba(0, 0, 0, .7); }
.medal .face { position: absolute; inset: 4px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 35%, #33415f, #151a2a 60%, #090b12);
  box-shadow: inset 0 0 0 1px #000, inset 0 0 14px rgba(0, 0, 0, .8), inset 0 0 0 2px rgba(114, 228, 255, .18); }
.medal .face .ic { width: 60%; height: 60%; fill: url(#gIvory); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .9)); }
.lvb { position: absolute; right: -4px; bottom: -3px; min-width: 2.15em; height: 2.15em; padding: 0 .3em; display: flex; align-items: center; justify-content: center; border-radius: 1.1em;
  font: 700 .95rem var(--title); color: var(--gold-hi); background: radial-gradient(circle at 50% 30%, #40351a, #17130a); box-shadow: 0 0 0 1px #000, inset 0 0 0 1px var(--gold), 0 2px 4px rgba(0, 0, 0, .7); font-variant-numeric: tabular-nums; }
.meinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#meName, #tgName { font: 600 1.15rem var(--title); letter-spacing: .03em; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px #000; }
#meName { padding-left: 2px; margin-bottom: 1px; }

#status { position: fixed; left: 12px; top: calc(12px + 82px * var(--k)); width: calc(330px * var(--k)); }
#sub { margin-bottom: 5px; padding-left: 2px; }
.subBadge { --c: var(--gold); display: inline-flex; align-items: center; gap: .5em; height: 1.9em; padding: 0 .9em 0 .25em; border-radius: 1em; font-size: .92rem; border: 1px solid #000;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 30%, #0d0f18), #0d0f18 70%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 70%, #000), 0 2px 6px rgba(0, 0, 0, .6); }
.subBadge .pic { width: 1.5em; height: 1.5em; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--c) 55%, #000); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.subBadge .pic .ic { width: 70%; height: 70%; fill: #fff; }
.subBadge b { color: color-mix(in srgb, var(--c) 70%, #fff); }
.subBadge .tm { color: var(--dim); font-variant-numeric: tabular-nums; }
.subBadge.none { color: var(--dim); padding-left: .9em; background: rgba(13, 15, 24, .8); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
#buffs { display: flex; flex-wrap: wrap; gap: 4px; padding-left: 2px; }
.buff { --c: #57c46f; position: relative; width: calc(32px * var(--k)); text-align: center; }
.buff .bi { width: calc(32px * var(--k)); height: calc(32px * var(--k)); border-radius: 5px; border: 1px solid #000; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--c) 55%, #000), color-mix(in srgb, var(--c) 18%, #000)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 85%, #fff), inset 0 0 0 2px rgba(0, 0, 0, .6), 0 2px 5px rgba(0, 0, 0, .6); }
.buff .bi .ic { width: 68%; height: 68%; fill: url(#gIvory); filter: drop-shadow(0 1px 1px #000); }
.buff.bad { --c: #d0463c; }
.buff small { display: block; margin-top: 1px; font-size: .74rem; line-height: 1.1; color: #fff; text-shadow: 0 0 3px #000, 0 1px 2px #000; font-variant-numeric: tabular-nums; }

#target { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); width: calc(330px * var(--k)); padding: 7px 12px 9px; }
#target::before { content: ''; position: absolute; left: 12%; right: 12%; top: -1px; height: 2px; background: var(--hair); }
.tghead { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
#tgName { flex: 1; text-align: center; padding-right: 2.2em; }
#tgLvl { min-width: 2.2em; height: 1.7em; padding: 0 .4em; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; font: 700 .95rem var(--title); color: var(--gold-hi);
  background: #0a0b11; box-shadow: inset 0 0 0 1px rgba(230, 200, 119, .5); font-variant-numeric: tabular-nums; }
#tgLvl:empty { visibility: hidden; }
#target.aggro #tgName { color: #ff9c8a; } #target.aggro { box-shadow: inset 0 0 0 1px rgba(255, 110, 90, .6), inset 0 0 0 2px rgba(0, 0, 0, .7), inset 0 0 22px rgba(160, 20, 20, .25), 0 10px 30px rgba(0, 0, 0, .6); }
#target.npc #tgName { color: #9dffb0; } #target.npc .bar.hp i { background: linear-gradient(90deg, #1b5a2c, #3fae5a); }
#target.player #tgName { color: #cfe6ff; } #target.player.pk1 #tgName { color: var(--pvp); } #target.player.pk2 #tgName { color: var(--pk); }
#tgBtns { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; justify-content: center; margin-top: 7px; }
#tgBtns:empty { display: none; }
#tgBtns .small { flex-basis: 100%; text-align: center; }

/* ── Мінікарта і трекер ── */
#right { position: fixed; right: 12px; top: 14px; width: 224px; text-align: center; }
#mapBox { position: relative; width: 224px; height: 224px; }
#mapWrap { position: relative; width: 224px; height: 224px; border-radius: 50%; overflow: hidden; border: 2px solid var(--gold); background: #0d1018;
  box-shadow: 0 0 0 1px #000, 0 0 0 4px #2c2612, 0 0 0 5px var(--line), 0 0 0 6px #000, 0 5px 20px rgba(0, 0, 0, .65); }
#mapWrap::after { content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .75), inset 0 0 20px rgba(0, 0, 0, .5); }
#minimap { display: block; width: 220px; height: 220px; }
#mapNorth { position: absolute; left: 50%; top: -9px; transform: translateX(-50%); padding: 0 7px; height: 17px; font: 700 11px/15px var(--title); color: var(--gold-hi);
  background: linear-gradient(#57471f, #2a220f); border: 1px solid #000; border-radius: 9px; box-shadow: inset 0 0 0 1px rgba(230, 200, 119, .55), 0 2px 5px rgba(0, 0, 0, .6); pointer-events: none; }
.mapBtn { position: absolute; width: 25px; height: 25px; border-radius: 50%; font: 700 17px/22px var(--body); color: var(--gold-hi); cursor: pointer;
  background: linear-gradient(#57471f, #2a220f); border: 1px solid #000; box-shadow: inset 0 0 0 1px rgba(230, 200, 119, .55), 0 2px 6px rgba(0, 0, 0, .65); }
.mapBtn:hover { filter: brightness(1.3); box-shadow: inset 0 0 0 1px var(--gold-hi), 0 0 8px rgba(230, 200, 119, .4), 0 2px 6px rgba(0, 0, 0, .65); }
.mapBtn.off { opacity: .45; cursor: default; filter: none; }
#mapZoomIn { left: 196px; top: 156px; }
#mapZoomOut { left: 156px; top: 196px; }
#zoneName { margin-top: 11px; font: 600 15px/1.2 var(--title); letter-spacing: .04em; color: var(--gold-hi); text-shadow: 0 1px 3px #000, 0 0 6px #000; }
#mapCoords { color: #c9c5b4; font-size: 11px; text-shadow: 0 1px 2px #000, 0 0 4px #000; font-variant-numeric: tabular-nums; }
#tracker { margin-top: 10px; padding: 8px 10px 3px 12px; text-align: left; font-size: 13.5px; line-height: 1.4; color: #f4f0e2; border-radius: 6px; text-shadow: 0 1px 2px #000;
  background: linear-gradient(90deg, rgba(8, 10, 18, .78), rgba(8, 10, 18, .5)); border: 1px solid rgba(0, 0, 0, .8); box-shadow: inset 2px 0 0 0 var(--gold), inset 0 0 0 1px rgba(230, 200, 119, .22); }
#tracker:empty { display: none; }
#tracker .q { margin-bottom: 7px; }
#tracker .q b { color: var(--gold-hi); font: 600 15px var(--title); display: block; }
#tracker .q.next .where { color: #cfcab8; font-size: 12.5px; }
#tracker .q .ok { color: var(--good); }
#tracker .q .rdy { color: var(--cyan); }

/* ── Чат ── */
#chat { position: fixed; left: 12px; bottom: 12px; width: min(calc(372px * var(--k)), calc(50vw - 345px * var(--k))); height: calc(196px * var(--k)); display: flex; flex-direction: column; border-radius: 7px; overflow: hidden;
  background: linear-gradient(rgba(9, 10, 17, .34), rgba(9, 10, 17, .66)); border: 1px solid rgba(0, 0, 0, .7); box-shadow: inset 0 0 0 1px rgba(230, 200, 119, .2), 0 6px 20px rgba(0, 0, 0, .35); }
#chatLog { flex: 1; overflow-y: auto; padding: 7px 9px; user-select: text; }
#chatLog::-webkit-scrollbar { width: 8px; }
#chatLog::-webkit-scrollbar-track { background: transparent; box-shadow: none; }
#chatLog div { margin-bottom: 1px; text-shadow: 0 1px 2px #000, 0 0 3px #000; word-break: break-word; }
#chatLog .sys { color: #bcc5d3; } #chatLog .warn { color: #ff9f84; } #chatLog .gold { color: var(--gold); }
#chatLog .loot { color: #9ee08a; } #chatLog .xp { color: #b0a3ea; } #chatLog .quest { color: var(--cyan); }
#chatLog .dmgIn { color: #e58587; } #chatLog .say b { color: #ffd98a; }
#chatLog .pty b, #chatLog .pty { color: #8fd0ff; }
#chatIn { background: rgba(0, 0, 0, .55); border: 0; border-top: 1px solid rgba(230, 200, 119, .25); color: var(--text); padding: 7px 10px; font: inherit; outline: none; }
#chatIn::placeholder { color: #77745f; }
#chatIn:focus { background: rgba(0, 0, 0, .8); box-shadow: inset 0 1px 0 0 var(--cyan); }

/* ── Панель дій, досвід, меню ── */
#bottom { position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 5px; }
#barRow { position: relative; padding: 2px; border-radius: 9px; background: var(--metal); box-shadow: 0 0 0 1px #000, 0 8px 26px rgba(0, 0, 0, .7); }
#barRow::before, #barRow::after { content: ''; position: absolute; top: 50%; width: 15px; height: 15px; transform: translateY(-50%) rotate(45deg); background: var(--metal); box-shadow: 0 0 0 1px #000, inset 0 0 0 3px #12141d, inset 0 0 0 4px rgba(114, 228, 255, .55); }
#barRow::before { left: -9px; } #barRow::after { right: -9px; }
#hotbar { position: relative; z-index: 1; display: flex; gap: 4px; padding: 6px 8px; border-radius: 7px; background: var(--grain), linear-gradient(#1c2030, #0d0f17); box-shadow: inset 0 0 0 1px #000, inset 0 2px 8px rgba(0, 0, 0, .8); }
#hotbar .slot:nth-child(4n + 1):not(:first-child) { margin-left: 5px; }
#hotbar .slot.action { --p: #7a5a22; }
#hotbar .slot.patron { --g: #b08cff; --glow: 40%; }
#xpBar { width: 100%; height: .62rem; border-radius: 3px; }
#xpBar::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(0, 0, 0, .8) calc(10% - 1px) 10%); }
#xpBar b { font-size: .7rem; line-height: 1; z-index: 1; }
#menu { position: fixed; right: 12px; bottom: 12px; display: flex; gap: 4px; padding: 5px 6px; border-radius: 8px; background: var(--grain), linear-gradient(#1c2030, #0d0f17); border: 1px solid #000;
  box-shadow: inset 0 0 0 1px rgba(230, 200, 119, .45), inset 0 0 0 2px rgba(0, 0, 0, .7), 0 8px 22px rgba(0, 0, 0, .6); }
#menu .slot { width: calc(38px * var(--k)); height: calc(38px * var(--k)); --p: #2b3044; --g: #6f6238; border-radius: 50%; }
#menu .slot::after { border-radius: 50%; }
#menu .slot > .ic, #menu .sndIco .ic { width: 58%; height: 58%; fill: url(#gGold); }
#menu .slot.open { --g: var(--cyan); --glow: 60%; }
#menu .snd { overflow: visible; }
#menu .sndIco { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; pointer-events: none; }
#menu .snd.muted .sndIco .ic { fill: url(#gDim); }
.sndBox { display: none; position: absolute; right: -6px; bottom: calc(100% + 2px); padding: 9px 12px 11px; text-align: center; cursor: default; border-radius: 7px; z-index: 5;
  background: #11131c; border: 1px solid #000; box-shadow: inset 0 0 0 1px rgba(230, 200, 119, .45), 0 6px 18px rgba(0, 0, 0, .7); }
.sndBox small { display: block; font-size: .85rem; color: var(--dim); margin-bottom: 4px; }
.sndBox input { width: 120px; accent-color: var(--gold); cursor: pointer; }
html:not(.touch) #menu .snd:hover .sndBox { display: block; }   /* на телефоні плашку відкриває дотик — touch.css */
.sndBox input + small { margin-top: 9px; }
.gfxPick { display: flex; gap: 3px; }
.gfxPick b { flex: 1; padding: 3px 7px; font-weight: 600; font-size: .78rem; line-height: 1.3; color: var(--dim); white-space: nowrap; cursor: pointer; border-radius: 4px; background: #0a0c12; border: 1px solid #000; box-shadow: inset 0 0 0 1px rgba(230, 200, 119, .18); }
.gfxPick b:hover { color: #fff; }
.gfxPick b.on { color: #1a1408; background: linear-gradient(#f1d98c, #b8923c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
#castbar { position: relative; width: calc(320px * var(--k)); height: 1.55rem; margin-bottom: 4px; border-radius: 4px; overflow: hidden; background: linear-gradient(#030407, #0d0f16); border: 1px solid #000;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .9), 0 0 0 1px var(--gold-lo), 0 0 16px rgba(114, 228, 255, .25); }
#castbar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #1c5fae, #58b6ff 70%, #c9f1ff); box-shadow: 0 0 10px #58b6ff; }
#castbar i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(255, 255, 255, .4), rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, .25)); }
#castbar b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 600 .95rem var(--title); letter-spacing: .05em; color: #fff; text-shadow: 0 0 3px #000, 0 1px 2px #000; }

#banner { position: fixed; left: 0; right: 0; top: 17%; text-align: center; pointer-events: none; font: 600 2.9rem var(--title); letter-spacing: .1em; color: var(--gold-hi);
  text-shadow: 0 2px 0 #3a2c0a, 0 0 26px rgba(0, 0, 0, .95), 0 3px 6px #000; opacity: 0; transition: opacity 1.2s; }
#banner::after { content: ''; display: block; width: min(420px, 60vw); height: 1px; margin: 6px auto 8px; background: var(--hair); }
#banner small { display: block; font: 600 1.15rem var(--body); color: var(--cyan); letter-spacing: .3em; text-transform: uppercase; }
#banner.show { opacity: 1; }
#hint { position: fixed; left: 50%; bottom: calc(96px * var(--k)); z-index: 30; transform: translateX(-50%); max-width: 60vw; padding: .35em 1.1em; border-radius: 1.2em; color: var(--cyan); text-align: center; pointer-events: none;
  background: rgba(6, 8, 14, .78); box-shadow: inset 0 0 0 1px rgba(114, 228, 255, .45), 0 4px 14px rgba(0, 0, 0, .5); }
#hint:empty { display: none; }

/* ── Вікна ── */
/* Вікна живуть у власному шарі: кожен клік піднімає вікно на одиницю z-index, і без цього шару за кілька хвилин гри
   вони опинялися б над підказками (100), запрошеннями (60) й екраном смерті (50). */
#windows { position: relative; z-index: 20; }
.win { position: fixed; z-index: 20; padding: 2px; border-radius: 9px; background: var(--metal); box-shadow: 0 0 0 1px #000, 0 22px 56px rgba(0, 0, 0, .72), 0 4px 14px rgba(0, 0, 0, .6); }
.win::before { content: ''; position: absolute; inset: -2px; border-radius: 10px; pointer-events: none; z-index: 2;
  background: linear-gradient(var(--gold-hi), var(--gold-hi)) left top / 20px 2px no-repeat, linear-gradient(var(--gold-hi), var(--gold-hi)) left top / 2px 20px no-repeat,
    linear-gradient(var(--gold-hi), var(--gold-hi)) right top / 20px 2px no-repeat, linear-gradient(var(--gold-hi), var(--gold-hi)) right top / 2px 20px no-repeat,
    linear-gradient(var(--gold-hi), var(--gold-hi)) left bottom / 20px 2px no-repeat, linear-gradient(var(--gold-hi), var(--gold-hi)) left bottom / 2px 20px no-repeat,
    linear-gradient(var(--gold-hi), var(--gold-hi)) right bottom / 20px 2px no-repeat, linear-gradient(var(--gold-hi), var(--gold-hi)) right bottom / 2px 20px no-repeat; }
.winIn { position: relative; border-radius: 7px; overflow: hidden; background: var(--grain), radial-gradient(130% 70% at 50% 0, #1d2132 0, #121420 52%, #0b0d15 100%);
  box-shadow: inset 0 0 0 1px #000, inset 0 0 0 2px rgba(255, 255, 255, .04), inset 0 0 46px rgba(0, 0, 0, .5); }
.win .head { position: relative; height: calc(34px * var(--k)); display: flex; align-items: center; gap: 8px; padding: 0 7px 0 10px; cursor: move;
  background: linear-gradient(#2d3249, #181b29 55%, #0f111a); border-bottom: 1px solid #000; }
.win .head::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--hair); opacity: .8; }
.win .head::before { content: ''; position: absolute; left: 50%; bottom: -5px; width: 7px; height: 7px; transform: translateX(-50%) rotate(45deg); background: linear-gradient(135deg, var(--gold-hi), var(--gold-lo)); box-shadow: 0 0 0 1px #000; z-index: 1; }
.win .head .wic { display: flex; } .win .head .wic .ic { width: 1.45rem; height: 1.45rem; filter: drop-shadow(0 1px 1px #000); }
.win .head .ttl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 1.08rem var(--title); letter-spacing: .13em; text-transform: uppercase;
  background: linear-gradient(#fff5cf, #e6c877 55%, #a98a40); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .9)); }
.win .x { position: relative; width: calc(22px * var(--k)); height: calc(22px * var(--k)); flex: none; border-radius: 4px; cursor: pointer; background: linear-gradient(#3b2420, #1f100e);
  box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(255, 141, 122, .4), inset 0 1px 0 1px rgba(255, 255, 255, .08); }
.win .x::before, .win .x::after { content: ''; position: absolute; left: 50%; top: 50%; width: 56%; height: 2px; background: #ffc9bd; border-radius: 1px; transform: translate(-50%, -50%) rotate(45deg); }
.win .x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.win .x:hover { filter: brightness(1.5); box-shadow: 0 0 0 1px #000, inset 0 0 0 1px var(--bad), 0 0 8px rgba(255, 110, 90, .5); }
.win .body { position: relative; padding: 14px 12px 12px; max-height: min(calc(100vh - 222px * var(--k)), calc(700px * var(--k))); overflow-y: auto; overflow-x: hidden; }
.sec { display: flex; align-items: center; gap: 8px; margin: 13px 0 7px; font: 600 1.02rem var(--title); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); white-space: nowrap; }
.sec::before { content: ''; width: 6px; height: 6px; flex: none; transform: rotate(45deg); background: var(--gold); box-shadow: 0 0 6px rgba(230, 200, 119, .7); }
.sec::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(230, 200, 119, .55), rgba(230, 200, 119, 0)); }
.sec::after { order: 1; }
.sec > .cur, .sec > .tag { order: 2; }
.sec > .cur + .cur { margin-left: 4px; }
.sec:first-child { margin-top: 0; }
.sec .aux { font: 400 .92rem var(--body); letter-spacing: 0; text-transform: none; color: var(--dim); }
.sec .ic { width: 1.2em; height: 1.2em; }
.well { padding: 8px 10px; border-radius: 6px; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .8), inset 0 2px 6px rgba(0, 0, 0, .55), 0 1px 0 rgba(255, 255, 255, .04); }
.note { color: var(--dim); font-size: .92rem; line-height: 1.45; }
.cur { display: inline-flex; align-items: center; gap: .3em; color: var(--gold-hi); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cur .ic { width: 1.15em; height: 1.15em; }
.cur.sp { color: #c9b8ff; } .cur.sp .ic { fill: url(#gSteel); }
.cur.short { color: var(--bad); }

/* ── Рюкзак ── */
.grid { display: grid; grid-template-columns: repeat(6, var(--slot)); gap: 4px; justify-content: center; padding: 6px; border-radius: 6px; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px #000, inset 0 2px 8px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .04); }
.grid.g4 { grid-template-columns: repeat(4, var(--slot)); }
.invbar { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.invbar .tabs { margin: 0; flex: 1; flex-wrap: nowrap; }
.invbar .tab { flex: 1; justify-content: center; padding: .3em .2em; }
.invbar .tab .ic { width: 1.35em; height: 1.35em; }
.purse { display: flex; align-items: center; gap: 6px; margin-top: 9px; }
.pill { display: inline-flex; align-items: center; gap: .4em; height: 2.15em; padding: 0 .8em 0 .5em; border-radius: 5px; background: linear-gradient(#0a0b11, #12141d); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .9), inset 0 2px 4px rgba(0, 0, 0, .8), 0 0 0 1px rgba(230, 200, 119, .25);
  font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill .ic { width: 1.35em; height: 1.35em; }
.pill.cr { flex: 1; color: var(--gold-hi); }
.pill.tok { cursor: pointer; color: var(--dim); }
.pill.tok .ic { fill: url(#gDim); }
.pill.tok.on { color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .9), inset 0 0 8px rgba(114, 228, 255, .35), 0 0 0 1px var(--cyan); } .pill.tok.on .ic { fill: url(#gCyan); }
.pill.tok:hover { filter: brightness(1.25); }
.pill.cap { color: var(--dim); }

/* ── Персонаж: лялька й характеристики ── */
.charwin { display: grid; grid-template-columns: calc(318px * var(--k)) 1fr; gap: 12px; }
.pdoll { display: flex; flex-direction: column; gap: 8px; }
.pd-name { text-align: center; }
.pd-name b { display: block; font: 600 1.38rem var(--title); letter-spacing: .04em; color: #fff; text-shadow: 0 1px 2px #000; line-height: 1.15; }
.pd-name span { color: var(--cyan); font-size: .92rem; letter-spacing: .04em; }
.pd-stage { position: relative; height: calc(290px * var(--k)); border-radius: 7px; overflow: hidden; border: 1px solid #000;
  background: radial-gradient(42% 9% at 50% 89%, rgba(114, 228, 255, .5), transparent 72%), radial-gradient(46% 52% at 50% 44%, rgba(122, 150, 255, .30), transparent 72%),
    repeating-conic-gradient(from 0deg at 50% 44%, rgba(255, 255, 255, .028) 0 5deg, transparent 5deg 15deg), linear-gradient(#1f2742, #0d1020 62%, #06070c);
  box-shadow: inset 0 0 0 1px rgba(230, 200, 119, .45), inset 0 0 0 2px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .05); }
.pd-stage .ringf { position: absolute; left: 50%; bottom: 6.5%; width: 60%; height: 11%; transform: translateX(-50%); border-radius: 50%; border: 1px solid rgba(230, 200, 119, .6); pointer-events: none;
  box-shadow: 0 0 18px rgba(114, 228, 255, .5), inset 0 0 16px rgba(114, 228, 255, .4); }
.pd-stage .ringf::before { content: ''; position: absolute; inset: 14% 12%; border-radius: 50%; border: 1px dashed rgba(114, 228, 255, .45); }
.pd-stage .arch { position: absolute; left: 50%; top: 6%; width: 56%; height: 78%; transform: translateX(-50%); border-radius: 50% 50% 0 0 / 34% 34% 0 0; pointer-events: none;
  border: 1px solid rgba(230, 200, 119, .16); border-bottom: 0; box-shadow: inset 0 14px 30px rgba(114, 160, 255, .10); }
.pd-stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2; background: radial-gradient(ellipse 72% 78% at 50% 46%, transparent 52%, rgba(0, 0, 0, .78) 100%); }
canvas.doll { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; cursor: grab; outline: none; }
canvas.doll:active { cursor: grabbing; }
.pd-col { position: absolute; top: 0; bottom: 0; z-index: 3; display: flex; flex-direction: column; justify-content: space-evenly; padding: 4px 0; }
.pd-col.l { left: 8px; } .pd-col.r { right: 8px; }
.pd-col .slot.empty { background: linear-gradient(rgba(10, 12, 20, .82), rgba(6, 7, 12, .9)); box-shadow: inset 0 0 0 1px rgba(230, 200, 119, .32), inset 0 0 0 2px rgba(0, 0, 0, .7), inset 0 3px 8px rgba(0, 0, 0, .7); cursor: default; }
.pd-col .slot > .ic.ghost { opacity: .26; }
.pd-foot { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 8px; font-size: .92rem; color: var(--dim); }
.pd-foot b.good { font-weight: 400; }
.pd-foot .bar { height: .8rem; } .pd-foot .bar b { font-size: .7rem; }
.ccol { display: flex; flex-direction: column; min-width: 0; }
.cstats { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.pd-sets .sec, .pd-patron .sec { margin-top: 11px; }
.sgroup { padding: 6px 9px 7px; border-radius: 6px; background: rgba(0, 0, 0, .26); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .8), inset 0 2px 6px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 255, 255, .04); }
.sgroup h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font: 600 .95rem var(--title); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.sgroup h4 .ic { width: 1.25em; height: 1.25em; }
.sgroup h4::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(230, 200, 119, .45), transparent); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 14px; }
.stats div { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 1px 0; border-bottom: 1px dotted rgba(255, 255, 255, .07); }
.stats span { color: var(--dim); white-space: nowrap; }
.stats b { color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.setline { margin-bottom: 7px; line-height: 1.4; }
.setline .sn { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 7px; height: 7px; transform: rotate(45deg); background: #1c1e28; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(255, 255, 255, .14); }
.pips i.f { background: linear-gradient(135deg, var(--gold-hi), var(--gold-lo)); box-shadow: 0 0 0 1px #000, 0 0 5px rgba(230, 200, 119, .7); }
.setline .bl { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; font-size: .92rem; }
.setline .bl span:nth-child(odd) { color: var(--dim); white-space: nowrap; }
.setline .bl .on { color: var(--good); } .setline .bl .offb { color: #6f6c60; }
.pcard { --c: var(--gold); display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; padding: 8px 10px; border-radius: 6px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--c) 22%, #0d0f18), #0d0f18 65%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 55%, #000), inset 0 0 0 2px rgba(0, 0, 0, .6); }
.pcard .pic { width: 3.1rem; height: 3.1rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--c) 75%, #fff), color-mix(in srgb, var(--c) 45%, #000));
  box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(255, 255, 255, .4), 0 0 14px color-mix(in srgb, var(--c) 45%, transparent); }
.pcard .pic .ic { width: 62%; height: 62%; fill: #fff; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .7)); }
.pcard .pn b { display: block; font: 600 1.15rem var(--title); color: color-mix(in srgb, var(--c) 60%, #fff); }
.pcard .pn span { color: var(--dim); font-size: .92rem; }
.pcard .pb { grid-column: 1 / -1; font-size: .92rem; line-height: 1.45; }

/* ── Скіли ── */
.actrow { display: flex; gap: 5px; align-items: center; }
.actrow .slot { --p: #7a5a22; }
.acthead { display: flex; align-items: center; gap: 12px; }
.acthead .note { flex: 1; }
.skgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sk { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; padding: 6px 8px 6px 6px; border-radius: 6px; cursor: pointer;
  background: linear-gradient(#1a1d2a, #11131c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .9), inset 0 0 0 2px rgba(255, 255, 255, .035), 0 1px 3px rgba(0, 0, 0, .5); transition: box-shadow .12s, filter .12s; }
.sk:hover { filter: brightness(1.14); box-shadow: inset 0 0 0 1px rgba(230, 200, 119, .6), inset 0 0 0 2px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .5); }
.sk .slot { pointer-events: none; }
.sk .skt { flex: 1; min-width: 0; }
.sk .skn { display: flex; align-items: center; gap: 6px; }
.sk .skn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-size: 1.02rem; }
.sk .skm { display: flex; flex-wrap: wrap; gap: 2px 9px; margin-top: 3px; color: var(--dim); font-size: .88rem; font-variant-numeric: tabular-nums; }
.sk .skm span { display: inline-flex; align-items: center; gap: .25em; white-space: nowrap; }
.sk .skm .ic { width: 1.05em; height: 1.05em; fill: url(#gDim); }
.sk .skm .mp { color: #8fc4ff; } .sk .skm .mp .ic { fill: url(#gCyan); }
.sk .sks { margin-top: 2px; font-size: .88rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk.off { cursor: default; }
.sk.off .slot { filter: grayscale(.85) brightness(.55); }
.sk.off .skn b { color: #a9a696; }
.sk.can { box-shadow: inset 0 0 0 1px rgba(114, 228, 255, .5), inset 0 0 0 2px rgba(0, 0, 0, .5), inset 0 0 14px rgba(114, 228, 255, .12); }
.sk.can .sks { color: var(--cyan); }
.sk.sig { grid-column: 1 / -1; padding: 8px 10px 8px 8px; background: linear-gradient(100deg, rgba(230, 200, 119, .20), rgba(230, 200, 119, .04) 55%, rgba(17, 19, 28, .9)), linear-gradient(#1a1d2a, #11131c);
  box-shadow: inset 0 0 0 1px var(--gold), inset 0 0 0 2px rgba(0, 0, 0, .6), inset 0 0 26px rgba(230, 200, 119, .12), 0 0 12px rgba(230, 200, 119, .15); }
.sk.sig .skn b { font: 600 1.15rem var(--title); color: var(--gold-hi); letter-spacing: .03em; }
.sk.sig .sks { white-space: normal; color: #d8d3bf; }
.sk.patron { grid-column: 1 / -1; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 70%, #000), inset 0 0 0 2px rgba(0, 0, 0, .6), inset 0 0 24px color-mix(in srgb, var(--c) 14%, transparent); }
.sk.patron .sks { white-space: normal; }
.tag { display: inline-flex; align-items: center; height: 1.45em; padding: 0 .55em; border-radius: 3px; font: 700 .74rem var(--body); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; color: #1b1404;
  background: linear-gradient(var(--gold-hi), var(--gold) 60%, #a98a40); box-shadow: 0 0 0 1px #000; }
.tag.cy { color: #04222b; background: linear-gradient(#d9f8ff, var(--cyan) 60%, #2b8fb5); }
.tag.dark { color: var(--dim); background: #0a0b11; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(255, 255, 255, .14); }
.splvl { display: inline-flex; gap: 2px; flex: none; }
.splvl i { width: .62rem; height: .36rem; border-radius: 1px; background: #1c1e28; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(255, 255, 255, .12); }
.splvl i.f { background: linear-gradient(var(--gold-hi), var(--gold)); box-shadow: 0 0 0 1px #000, 0 0 4px rgba(230, 200, 119, .7); }

/* ── Рядки крамниці, наставника, майстерні ── */
.line { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 5px 7px 5px 5px; margin-bottom: 4px; border-radius: 6px;
  background: linear-gradient(#191c28, #11131c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .9), inset 0 0 0 2px rgba(255, 255, 255, .03); transition: box-shadow .12s, filter .12s; }
.line:hover { filter: brightness(1.12); box-shadow: inset 0 0 0 1px rgba(230, 200, 119, .5), inset 0 0 0 2px rgba(0, 0, 0, .5); }
.line .slot { pointer-events: none; }
.line .t { flex: 1; min-width: 0; }
.line .t > b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.02rem; color: #fff; }
.line .t small { display: block; color: var(--dim); font-size: .88rem; line-height: 1.35; }
.line.off .slot { filter: grayscale(.8) brightness(.6); }
.line.off .t > b { color: #a9a696; }
.line .t small b { color: #fff; font-weight: 600; }
.line.click { cursor: pointer; }
.line .side-r { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.line .costs { display: flex; gap: 8px; font-size: .92rem; }
.npcTalk { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; margin-bottom: 10px; }
.npcTalk .face { width: calc(58px * var(--k)); height: calc(58px * var(--k)); border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--metal); box-shadow: 0 0 0 1px #000, 0 3px 8px rgba(0, 0, 0, .6); }
.npcTalk .face i { width: calc(100% - 6px); height: calc(100% - 6px); border-radius: 50%; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 35%, #33415f, #151a2a 60%, #090b12); box-shadow: inset 0 0 0 1px #000, inset 0 0 12px rgba(0, 0, 0, .8); }
.npcTalk .face .ic { width: 58%; height: 58%; fill: url(#gIvory); filter: drop-shadow(0 1px 1px #000); }
.npcText { position: relative; padding: 9px 13px; border-radius: 3px 8px 8px 8px; color: #e4dfcb; font: italic 1.02rem/1.5 var(--title); background: linear-gradient(rgba(230, 200, 119, .10), rgba(230, 200, 119, .04));
  box-shadow: inset 0 0 0 1px rgba(230, 200, 119, .3), inset 3px 0 0 0 var(--gold); }
.qbox { position: relative; padding: 9px 11px 10px 13px; margin-bottom: 7px; border-radius: 6px; background: linear-gradient(#191c28, #11131c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .9), inset 0 0 0 2px rgba(255, 255, 255, .03), inset 3px 0 0 0 var(--gold); }
.qbox.ready { box-shadow: inset 0 0 0 1px rgba(114, 228, 255, .6), inset 0 0 0 2px rgba(0, 0, 0, .5), inset 3px 0 0 0 var(--cyan), inset 0 0 22px rgba(114, 228, 255, .10); }
.qbox.wait { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .9), inset 3px 0 0 0 #5d5a4e; }
.qbox .qh { display: flex; align-items: center; gap: 8px; }
.qbox .qh b { flex: 1; font: 600 1.15rem var(--title); color: var(--gold-hi); letter-spacing: .02em; }
.qbox p { margin: 6px 0; color: #cfcab8; line-height: 1.5; }
.qbox .obj { display: grid; grid-template-columns: 1.15em 1fr auto; align-items: center; gap: 6px; margin: 2px 0; color: var(--text); }
.qbox .obj .dot { width: 7px; height: 7px; justify-self: center; transform: rotate(45deg); background: #2a2d3a; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(255, 255, 255, .2); }
.qbox .obj .ic { width: 1.1em; height: 1.1em; fill: url(#gGreen); }
.qbox .obj.ok { color: var(--good); }
.qbox .obj .pr { font-variant-numeric: tabular-nums; color: var(--cyan); font-weight: 600; } .qbox .obj.ok .pr { color: var(--good); }
.qbox .rew { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 7px 0 0; padding-top: 7px; border-top: 1px solid rgba(255, 255, 255, .07); color: var(--dim); font-size: .92rem; }
.qbox .rew .ri { display: inline-flex; align-items: center; gap: .3em; color: var(--text); }
.qbox .rew .ri .ic { width: 1.2em; height: 1.2em; }
.qbox .btn { margin-top: 9px; }
.qmark { width: 1.5em; height: 1.5em; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font: 700 1.05rem var(--title); color: #1b1404;
  background: radial-gradient(circle at 50% 30%, var(--gold-hi), var(--gold) 60%, #a98a40); box-shadow: 0 0 0 1px #000, 0 0 8px rgba(230, 200, 119, .5); }
.qmark.rdy { color: #04222b; background: radial-gradient(circle at 50% 30%, #e6fbff, var(--cyan) 60%, #2b8fb5); box-shadow: 0 0 0 1px #000, 0 0 8px rgba(114, 228, 255, .6); }
.qmark.wait { color: #cfcab8; background: #2a2d3a; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(255, 255, 255, .16); }
.qnext { display: grid; grid-template-columns: auto 1fr; gap: 2px 9px; align-items: center; margin: 0 0 5px; padding: 6px 9px; border-radius: 6px; color: #cfcab8; background: rgba(0, 0, 0, .24); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 255, 255, .04); }
.qnext .qmark { grid-row: span 2; }
.qnext b { color: var(--gold-hi); font: 600 1.08rem var(--title); }
.qnext .who { color: var(--good); }
.qnext small { font-size: .92rem; color: var(--dim); }
.qprog { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.qprog .bar { flex: 1; height: .7rem; }
.qdone { display: flex; flex-wrap: wrap; gap: 4px; }
.qdone span { display: inline-flex; align-items: center; gap: .3em; padding: .08em .6em; border-radius: 3px; font-size: .88rem; color: #a9a696; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); }
.qdone .ic { width: 1em; height: 1em; fill: url(#gGreen); }
.tprow { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tprow .btn { justify-content: space-between; padding: .55em .9em; }
.shophead { display: flex; align-items: center; gap: 10px; margin: 13px 0 8px; }
.shophead .sec { flex: 1; margin: 0; }

/* ── Карта світу ── */
.wmap { display: flex; gap: 12px; align-items: flex-start; }
.wmap > canvas { display: block; flex: none; border: 1px solid #000; border-radius: 5px; background: #0d1018; box-shadow: 0 0 0 1px var(--gold-lo), 0 0 0 2px #000, 0 2px 10px rgba(0, 0, 0, .5); cursor: crosshair; }
.win.w-map .body { padding: 10px; max-height: none; overflow: visible; }
.win.w-char .body { max-height: min(calc(100vh - 198px * var(--k)), calc(700px * var(--k))); }
.wleg { flex: 1; min-width: 0; font-size: 12px; }
.wleg .sec { font-size: 13px; margin: 9px 0 5px; } .wleg .sec:first-child { margin-top: 0; }
.wleg .li { display: flex; align-items: center; gap: 8px; height: 20px; color: #d8d3bf; white-space: nowrap; }
.wleg .li canvas { width: 22px; height: 22px; flex: none; }
.wleg .two { display: grid; grid-template-columns: 1fr 1fr; }
.wleg .sw { width: 22px; height: 10px; flex: none; border-radius: 2px; box-shadow: 0 0 0 1px #000; }
.wleg .note { margin-top: 9px; color: var(--dim); font-size: 11px; line-height: 1.4; }

/* ── Підказки ── */
#tooltip { position: fixed; z-index: 100; max-width: calc(318px * var(--k)); pointer-events: none; font-size: .95rem; border-radius: 7px; padding: 2px; background: var(--metal);
  box-shadow: 0 0 0 1px #000, 0 10px 30px rgba(0, 0, 0, .8); }
#tooltip > div { border-radius: 5px; overflow: hidden; background: var(--grain), linear-gradient(#171a27, #0b0c13); box-shadow: inset 0 0 0 1px #000; }
#tooltip b.n { font: 600 1.12rem var(--title); letter-spacing: .02em; }
.tt-p { padding: 8px 11px; line-height: 1.45; }
.tt-h { display: flex; align-items: center; gap: 10px; padding: 9px 11px; background: linear-gradient(100deg, color-mix(in srgb, var(--g, #6f6238) 30%, #151824), #151824 75%); border-bottom: 1px solid #000; box-shadow: inset 0 -1px 0 0 color-mix(in srgb, var(--g, #6f6238) 60%, transparent); }
.tt-h .tt-t { min-width: 0; }
.tt-h b.n { display: block; line-height: 1.2; text-shadow: 0 1px 2px #000; }
.tt-sub { display: block; margin-top: 1px; color: var(--dim); font-size: .88rem; }
.tt-b { padding: 8px 11px 9px; line-height: 1.45; }
.tt-r { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; }
.tt-r span { color: #b9b5a6; }
.tt-r b { color: #fff; font-variant-numeric: tabular-nums; }
.tt-r.good b, .tt-r.good span { color: var(--good); }
.tt-sep { height: 1px; margin: 7px -11px; background: linear-gradient(90deg, transparent, rgba(230, 200, 119, .4), transparent); }
.tt-d { color: #b9b5a6; font-style: italic; }
.tt-set b { color: var(--gold); }
.tt-set div { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; }
.tt-set .on { color: var(--good); } .tt-set .offb { color: #77745f; }
.tt-hint { margin-top: 6px; color: var(--cyan); font-size: .9rem; }
.tt-f { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }

/* ── Літаючі числа ── */
#floaters { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.fl { position: absolute; left: 0; top: 0; font: 700 1.5rem var(--title); white-space: nowrap; letter-spacing: .02em; will-change: transform, opacity;
  text-shadow: -1px 0 #000, 1px 0 #000, 0 -1px #000, 0 1px #000, 0 2px 3px rgba(0, 0, 0, .9), 0 0 8px rgba(0, 0, 0, .7); }
.fl.out { color: #fff; } .fl.crit { color: #ffd84a; font-size: 2.3rem; text-shadow: -1px 0 #3a2400, 1px 0 #3a2400, 0 -1px #3a2400, 0 2px #3a2400, 0 0 14px rgba(255, 170, 30, .8); }
.fl.in { color: #ff5d5d; } .fl.heal { color: #74ff95; }
.fl.miss { color: #b6bfd0; font-size: 1.15rem; font-style: italic; } .fl.eff { color: var(--cyan); font-size: 1.1rem; } .fl.dot { color: #cfa6ff; font-size: 1.2rem; }

/* ── Паті ── */
#party { margin-top: 10px; width: calc(214px * var(--k)); display: flex; flex-direction: column; gap: 5px; }
.pm { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: center; padding: 5px 8px 6px 5px; border-radius: 22px 6px 6px 22px; cursor: pointer; border: 1px solid #000;
  background: linear-gradient(90deg, #1b2236, #10131d); box-shadow: inset 0 0 0 1px rgba(143, 208, 255, .35), inset 0 0 0 2px rgba(0, 0, 0, .6), 0 4px 12px rgba(0, 0, 0, .5); }
.pm:hover { box-shadow: inset 0 0 0 1px var(--cyan), inset 0 0 0 2px rgba(0, 0, 0, .6), 0 0 10px rgba(114, 228, 255, .3); }
.pm.dead { filter: grayscale(.9) brightness(.6); }
.pm .pface { position: relative; width: calc(36px * var(--k)); height: calc(36px * var(--k)); border-radius: 50%; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 35%, #33415f, #151a2a 60%, #090b12); box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(143, 208, 255, .5); }
.pm .pface .ic { width: 60%; height: 60%; fill: url(#gIvory); }
.pm .crown { position: absolute; left: -3px; top: -6px; width: 1.25em; height: 1.25em; filter: drop-shadow(0 1px 1px #000) drop-shadow(0 0 4px rgba(230, 200, 119, .8)); }
.pm .crown .ic { width: 100%; height: 100%; fill: url(#gGold); }
.pm .pinfo { min-width: 0; }
.pm .row { gap: 6px; margin-bottom: 2px; }
.pm .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #dbeaff; font-weight: 600; }
.pm.pk1 .nm { color: var(--pvp); } .pm.pk2 .nm { color: var(--pk); }
.pm .lv { color: var(--gold-hi); font: 700 .92rem var(--title); font-variant-numeric: tabular-nums; }
.pm .kick { position: relative; width: 1.15em; height: 1.15em; flex: none; border-radius: 3px; background: rgba(0, 0, 0, .5); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.pm .kick::before, .pm .kick::after { content: ''; position: absolute; left: 50%; top: 50%; width: 60%; height: 1.5px; background: var(--dim); transform: translate(-50%, -50%) rotate(45deg); }
.pm .kick::after { transform: translate(-50%, -50%) rotate(-45deg); }
.pm .kick:hover { box-shadow: inset 0 0 0 1px var(--bad); } .pm .kick:hover::before, .pm .kick:hover::after { background: var(--bad); }
.pm .bar { height: .62rem; margin-top: 2px; border-radius: 3px; } .pm .bar.thin { height: .38rem; }
.pfoot { display: flex; gap: 5px; align-items: center; }
.ploot { display: inline-flex; align-items: center; gap: .45em; height: 1.9em; padding: 0 .8em 0 .5em; font-size: .92rem; color: var(--dim); border-radius: 5px; border: 1px solid #000; white-space: nowrap;
  background: linear-gradient(#1b2236, #10131d); box-shadow: inset 0 0 0 1px rgba(143, 208, 255, .3); }
.ploot .ic { width: 1.25em; height: 1.25em; fill: url(#gCyan); }
.ploot b { color: #dbeaff; }
.ploot.lead { cursor: pointer; } .ploot.lead:hover { box-shadow: inset 0 0 0 1px var(--cyan), 0 0 8px rgba(114, 228, 255, .3); }

/* ── Плашка-запит ── */
#popup { position: fixed; left: 50%; top: 24%; transform: translateX(-50%); padding: 18px 24px 16px; text-align: center; z-index: 60; min-width: calc(300px * var(--k)); max-width: min(92vw, calc(460px * var(--k)));
  box-shadow: inset 0 0 0 1px rgba(114, 228, 255, .55), inset 0 0 0 2px rgba(0, 0, 0, .7), 0 0 30px rgba(114, 228, 255, .15), 0 16px 40px rgba(0, 0, 0, .75); }
#popup .ptext { font-size: 1.05rem; line-height: 1.5; }
#popup .row { justify-content: center; margin-top: 14px; gap: 10px; }
#popup .cntrow { margin-top: 10px; color: var(--gold); }
#popup .cntrow input, .credrow input, .rcp .qty, .craftbar .find { background: linear-gradient(#06070b, #0d0f16); border: 1px solid #000; border-radius: 4px; color: var(--text); padding: .3em .5em; font: inherit; outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .8), 0 0 0 1px rgba(230, 200, 119, .3); }
#popup .cntrow input:focus, .credrow input:focus, .rcp .qty:focus, .craftbar .find:focus { box-shadow: inset 0 2px 4px rgba(0, 0, 0, .8), 0 0 0 1px var(--cyan), 0 0 8px rgba(114, 228, 255, .3); }
#popup .cntrow input { width: 96px; text-align: center; font-weight: 600; }

/* ── Трейд ── */
.tcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.tcol { position: relative; padding: 9px; border-radius: 6px; background: rgba(0, 0, 0, .26); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .85), inset 0 0 0 2px rgba(255, 255, 255, .03); }
.tcol.ok { box-shadow: inset 0 0 0 1px #4fbf6a, inset 0 0 0 2px rgba(0, 0, 0, .5), inset 0 0 24px rgba(79, 191, 106, .2); }
.tcol { min-width: 0; }
.tcol .sec { letter-spacing: .05em; gap: 6px; }
.tcol .sec > span:first-child, .sec > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tag.ok { gap: .3em; color: #062a10; background: linear-gradient(#d6ffdc, var(--good) 60%, #2f9a4c); }
.tag.ok .ic { width: 1em; height: 1em; fill: #062a10; }
.credrow { display: flex; align-items: center; gap: 6px; margin-top: 9px; color: var(--gold-hi); font-weight: 600; font-variant-numeric: tabular-nums; }
.credrow .ic { width: 1.35em; height: 1.35em; }
.credrow input { width: 96px; }
.credrow small { color: var(--dim); font-weight: 400; }
.trbtn { justify-content: flex-end; margin-top: 12px; gap: 8px; }
.tlock { margin-top: 8px; color: var(--warn); }

/* ── Майстерня ── */
.craftbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 6px; }
.craftbar .find { flex: 1; min-width: 150px; padding: .34em .7em; user-select: text; }
.rcp { margin-bottom: 6px; padding: 5px 8px 8px 5px; border-radius: 6px; background: linear-gradient(#181b27, #10121b); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .9), inset 0 0 0 2px rgba(255, 255, 255, .03), inset 3px 0 0 0 #3c3a30; }
.rcp.ok { background: linear-gradient(rgba(111, 217, 138, .09), rgba(111, 217, 138, .03)), linear-gradient(#181b27, #10121b); box-shadow: inset 0 0 0 1px rgba(111, 217, 138, .5), inset 0 0 0 2px rgba(0, 0, 0, .5), inset 3px 0 0 0 #6fd98a; }
.rcp .line { padding: 0 0 0 2px; margin: 0; background: none; box-shadow: none; }
.rcp .line:hover { filter: none; box-shadow: none; }
.rcp .line .t small span.bad, .chip.short b { color: var(--bad); }
.rcp .qty { width: 58px; text-align: center; }
.rcp .ing { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0 0 calc(var(--slot) * .78 + 11px); }
.chip { display: inline-flex; gap: .4em; align-items: center; height: 1.8em; padding: 0 .65em 0 .35em; border-radius: 4px; font-size: .9rem; color: #cfcab8; white-space: nowrap;
  background: rgba(0, 0, 0, .34); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09); }
.chip .ic { width: 1.25em; height: 1.25em; fill: url(#gIvory); }
.chip b { color: var(--good); font-variant-numeric: tabular-nums; }
.chip.short { background: rgba(255, 90, 70, .09); box-shadow: inset 0 0 0 1px rgba(255, 110, 90, .45); }
.chip.fee { color: var(--gold-hi); } .chip.fee .ic { fill: url(#gGold); }
.chip.fee.short { color: var(--bad); }
.rcp .src { margin: 5px 0 0 calc(var(--slot) * .78 + 11px); font-size: .9rem; line-height: 1.4; color: var(--dim); }
.rcp .src b { color: var(--warn); }

/* ── Екрани акаунта: герой по центру, колонки з боків ── */
.overlay.clear { background: linear-gradient(90deg, rgba(4, 5, 10, .8), rgba(4, 5, 10, 0) 36%, rgba(4, 5, 10, 0) 64%, rgba(4, 5, 10, .8)); justify-content: space-between; align-items: stretch; padding: 3vh 2vw; pointer-events: none; }
.side { width: calc(340px * var(--k)); max-width: 32vw; padding: 20px 20px 18px; overflow-y: auto; pointer-events: auto; display: flex; flex-direction: column; gap: 7px; }
.side.right { width: calc(390px * var(--k)); }
.side h2 { font-size: 1.6rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-hi); text-shadow: 0 2px 0 #000; }
.side h3 { position: relative; display: flex; align-items: center; gap: 8px; margin: 8px 0 3px; font-size: 1.05rem; letter-spacing: .12em; text-transform: uppercase; }
.side h3::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(230, 200, 119, .55), transparent); }
.choices.col { display: flex; flex-direction: column; gap: 5px; }
.choice { position: relative; display: flex; align-items: center; gap: 11px; padding: 7px 10px 7px 7px; border-radius: 6px; cursor: pointer;
  background: linear-gradient(#1a1d2a, #11131c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .9), inset 0 0 0 2px rgba(255, 255, 255, .035); transition: box-shadow .12s, filter .12s; }
.choice:hover { filter: brightness(1.15); box-shadow: inset 0 0 0 1px rgba(230, 200, 119, .55), inset 0 0 0 2px rgba(0, 0, 0, .5); }
.choice.sel { background: linear-gradient(100deg, rgba(114, 228, 255, .20), rgba(114, 228, 255, .04) 60%), linear-gradient(#1a1d2a, #11131c); box-shadow: inset 0 0 0 1px var(--cyan), inset 0 0 0 2px rgba(0, 0, 0, .5), inset 0 0 22px rgba(114, 228, 255, .14), 0 0 12px rgba(114, 228, 255, .18); }
.choice .ico { width: calc(40px * var(--k)); height: calc(40px * var(--k)); flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, #33415f, #151a2a 60%, #090b12); box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(230, 200, 119, .5); }
.choice .ico .ic { width: 60%; height: 60%; fill: url(#gIvory); filter: drop-shadow(0 1px 1px #000); }
.choice.sel .ico { box-shadow: 0 0 0 1px #000, inset 0 0 0 1px var(--cyan), 0 0 10px rgba(114, 228, 255, .4); }
.choice > div:nth-child(2) { flex: 1; min-width: 0; }
.choice b { display: block; color: var(--gold-hi); font: 600 1.15rem var(--title); letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choice .perk { color: #9fd9e8; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sigbox { display: flex; gap: 11px; align-items: center; margin: 10px 0; padding: 9px 11px; border-radius: 6px; text-align: left; background: linear-gradient(100deg, rgba(230, 200, 119, .18), rgba(230, 200, 119, .03) 70%);
  box-shadow: inset 0 0 0 1px rgba(230, 200, 119, .6), inset 0 0 0 2px rgba(0, 0, 0, .5); }
.sigbox b { color: var(--gold-hi); }
.sigbox small { display: block; font: 700 .74rem var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
#createInfo { margin: 8px 0 4px; color: #d8d3bf; flex: 1; text-align: center; }
#createInfo h3 { display: block; color: var(--gold-hi); font-size: 1.38rem; margin: 0 0 6px; letter-spacing: .04em; text-transform: none; } #createInfo h3::after { display: none; }
#createInfo p { margin: 5px 0; line-height: 1.45; }
#createMsg { min-height: 1.4em; margin: 2px 0 4px; text-align: center; font-size: .92rem; }
/* Мальовані іконки в дрібних місцях: бафи, фішки рецептів, нагороди квестів. */
.buff .bi .ic.art { width: 100%; height: 100%; border-radius: 4px; filter: none; }
.chip .ic.art, .qbox .rew .ri .ic.art { width: 1.55em; height: 1.55em; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .8); }
