:root { --ink: #fff; --glass: rgba(18, 16, 20, .62); --line: rgba(255, 255, 255, .14); --accent: #e0283c; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #8fc3e8; font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink);
  -webkit-user-select: none; user-select: none; touch-action: none; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#tags { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); white-space: nowrap; font-weight: 700; font-size: 12px;
  padding: 3px 9px 3px 20px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(4px); will-change: transform; }
.tag::before { content: ""; position: absolute; left: 8px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: #3ddc84; }
.tag.bot::before { background: #9aa0a6; }
.tag.me { background: rgba(224, 40, 60, .78); }

.hud-top { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 10px max(14px, env(safe-area-inset-left, 0px)); pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.who { display: flex; align-items: center; gap: 10px; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 7px 14px 7px 8px; }
.who .dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; background: #888; }
.who b { display: block; font-size: 15px; }
.who small { opacity: .75; }
.phase { background: var(--accent); font-weight: 700; font-size: 12px; padding: 5px 10px; border-radius: 8px; letter-spacing: .02em; }
.net { display: flex; gap: 12px; align-items: center; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; font-size: 13px; }
.net b { font-variant-numeric: tabular-nums; }
.back { color: #fff; text-decoration: none; font-weight: 700; padding: 4px 10px; border-radius: 8px; background: rgba(255, 255, 255, .14); }
.back:hover, .back:focus-visible { background: var(--accent); outline: none; }
#minimap { position: fixed; right: max(14px, env(safe-area-inset-right, 0px)); top: calc(68px + env(safe-area-inset-top, 0px)); width: 168px; height: 168px;
  border-radius: 50%; border: 3px solid rgba(255, 255, 255, .85); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); background: #2b4a2b; }

.help { position: fixed; left: max(14px, env(safe-area-inset-left, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 4px; max-width: 360px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 13px; }
.help button { justify-self: start; margin-top: 6px; font: inherit; font-weight: 700; color: #fff; background: var(--accent); border: 0; border-radius: 8px; padding: 6px 12px; cursor: pointer; }

.joy, .run-btn { display: none; }
@media (pointer: coarse) {
  .joy { display: block; position: fixed; left: calc(28px + env(safe-area-inset-left, 0px)); bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    width: 132px; height: 132px; border-radius: 50%; background: rgba(255, 255, 255, .16); border: 2px solid rgba(255, 255, 255, .45); }
  .knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(255, 255, 255, .85); }
  .run-btn { display: block; position: fixed; right: calc(28px + env(safe-area-inset-right, 0px)); bottom: calc(34px + env(safe-area-inset-bottom, 0px));
    width: 84px; height: 84px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .6); background: var(--glass); color: #fff; font: 700 15px system-ui; }
  .run-btn.on { background: var(--accent); }
  .help { display: none; }
  #minimap { width: 118px; height: 118px; }
  .phase { display: none; }
}
.rotate { display: none; position: fixed; inset: 0; z-index: 10; background: #121013; color: #fff; font: 700 20px system-ui; align-items: center; justify-content: center; text-align: center; padding: 24px; }
@media (orientation: portrait) and (pointer: coarse) { .rotate { display: flex; } }
.status { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--glass); padding: 12px 18px; border-radius: 12px; font-weight: 700; }
.status[hidden] { display: none; }
.hero-btn { margin-left: 6px; font: 700 12px system-ui; color: #fff; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.hero-btn:hover, .hero-btn:focus-visible { background: var(--accent); outline: none; }

/* Старт на телефоне: полный экран по нажатию, на iPhone — подсказка «На экран Домой» */
.start { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(ellipse at 50% 30%, rgba(18, 16, 19, .55), rgba(18, 16, 19, .92)); }
.start[hidden] { display: none; }
.start-card { display: grid; gap: 16px; justify-items: center; text-align: center; max-width: 460px; }
.start-title { font: 900 30px/1.1 system-ui; text-transform: uppercase; letter-spacing: .02em; text-shadow: 0 4px 18px rgba(0, 0, 0, .5); }
.start-btn { font: 800 18px system-ui; color: #fff; background: var(--accent); border: 0; border-radius: 14px; padding: 16px 28px; cursor: pointer;
  box-shadow: 0 10px 30px rgba(224, 40, 60, .4); }
.ios-hint { display: grid; gap: 8px; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 14px; }
.ios-hint[hidden] { display: none; }
.share { display: inline-block; padding: 0 6px; border-radius: 6px; background: rgba(255, 255, 255, .18); }
.start-link { justify-self: center; font: 700 14px system-ui; color: #fff; background: transparent; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; cursor: pointer; }
.fs-btn { position: fixed; right: calc(128px + env(safe-area-inset-right, 0px)); bottom: calc(52px + env(safe-area-inset-bottom, 0px)); width: 46px; height: 46px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--glass); color: #fff; font-size: 22px; }
.fs-btn[hidden] { display: none; }
@media (orientation: portrait) and (pointer: coarse) { .start { z-index: 5; } }

button.back { font: inherit; font-weight: 700; color: #fff; border: 0; cursor: pointer; }
.map-wrap { position: fixed; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; background: rgba(10, 9, 12, .72); padding: 16px; }
.map-wrap[hidden] { display: none; }
.map-box { position: relative; height: min(88vh, 88vw); aspect-ratio: 1; }
#worldMap { width: 100%; height: 100%; border-radius: 16px; border: 3px solid rgba(255, 255, 255, .85); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); cursor: crosshair; }
.map-close { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 10px; border: 0; background: var(--glass); color: #fff; font-size: 18px; cursor: pointer; }

/* Рамка цели и окно осмотра */
.target-frame { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 3;
  display: flex; align-items: center; gap: 10px; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; min-width: 300px; }
.target-frame[hidden] { display: none; }
.target-frame .dot { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; flex: none; }
.tf-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tf-main b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-main small { opacity: .8; font-size: 12px; }
.hp { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.hp i { display: block; height: 100%; background: linear-gradient(90deg, #3ddc84, #8cf0b4); }
.target-frame button, .inspect button { font: 700 12px system-ui; color: #fff; background: rgba(255, 255, 255, .14); border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.target-frame button:hover, .inspect button:hover { background: var(--accent); }
.inspect { position: fixed; z-index: 4; left: 50%; top: calc(74px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); width: min(340px, calc(100vw - 32px));
  background: rgba(18, 16, 20, .88); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 10px; }
.inspect[hidden] { display: none; }
.inspect header { display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.insp-rows { display: grid; gap: 6px; }
.insp-rows div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.insp-rows span { opacity: .7; }
.inspect small { opacity: .6; font-size: 12px; }
.phase { display: none; }

/* Создание персонажа */
.editor { --ed-bg: #16131a; position: fixed; z-index: 6; left: max(14px, env(safe-area-inset-left, 0px)); top: calc(70px + env(safe-area-inset-top, 0px));
  bottom: calc(14px + env(safe-area-inset-bottom, 0px)); width: min(440px, 46vw); display: grid; grid-template-columns: 64px minmax(0, 1fr);
  background: linear-gradient(180deg, rgba(28, 22, 32, .94), rgba(16, 13, 20, .94)); border: 1px solid rgba(255, 255, 255, .1); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45); overflow: hidden; backdrop-filter: blur(10px); }
.editor[hidden] { display: none; }
.ed-rail { display: grid; align-content: start; gap: 4px; padding: 10px 6px; background: rgba(0, 0, 0, .25); border-right: 1px solid rgba(255, 255, 255, .06); }
.ed-rail button { display: grid; justify-items: center; gap: 4px; padding: 10px 2px; border: 0; border-radius: 12px; background: none; color: rgba(255, 255, 255, .6); font: 700 10px system-ui; cursor: pointer; }
.ed-rail svg { width: 24px; height: 24px; fill: currentColor; }
.ed-rail svg .cut { fill: var(--ed-bg); } .ed-rail svg .cutline { fill: none; stroke: var(--ed-bg); stroke-width: 1.4; stroke-linecap: round; }
.ed-rail button.on { color: #fff; background: linear-gradient(180deg, rgba(224, 40, 60, .9), rgba(170, 25, 45, .9)); box-shadow: 0 6px 16px rgba(224, 40, 60, .35); }
.ed-rail button.on svg .cut { fill: #c21f35; } .ed-rail button.on svg .cutline { stroke: #c21f35; }
.ed-main { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; min-height: 0; }
.ed-main header { padding: 14px 16px 8px; display: grid; gap: 2px; }
.ed-main header small { font: 700 10px system-ui; letter-spacing: .14em; text-transform: uppercase; color: #ff7b89; }
.ed-main header b { font: 800 22px/1.1 system-ui; }
.ed-body { overflow-y: auto; padding: 4px 16px 12px; display: grid; align-content: start; gap: 14px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.ed-sec { display: grid; gap: 8px; }
.ed-sec h4 { margin: 0; font: 700 11px system-ui; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.ed-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.ed-tile { display: grid; gap: 5px; padding: 5px; border: 2px solid transparent; border-radius: 12px; background: rgba(255, 255, 255, .05); color: #fff; font: 600 11px system-ui; cursor: pointer; text-align: center; }
.ed-tile:hover { background: rgba(255, 255, 255, .1); }
.ed-tile.on { border-color: #ff4d5e; background: rgba(224, 40, 60, .14); }
.ed-thumb { aspect-ratio: 1; border-radius: 9px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, #3a3342, #221d27); }
.ed-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ed-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .2); border-top-color: #fff; animation: edspin .9s linear infinite; }
.ed-bodies { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ed-body-card { display: flex; align-items: center; gap: 10px; padding: 12px; border: 2px solid transparent; border-radius: 12px; background: rgba(255, 255, 255, .06); color: #fff; font: 700 14px system-ui; cursor: pointer; }
.ed-body-card span { font-size: 22px; opacity: .85; }
.ed-body-card.on { border-color: #ff4d5e; background: rgba(224, 40, 60, .16); }
.ed-slider { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-size: 13px; }
.ed-slider output { font: 700 12px ui-monospace, monospace; color: #ffb3bb; min-width: 3.5ch; text-align: right; }
.ed-slider input { grid-column: 1 / -1; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 4px; margin: 4px 0 2px;
  background: linear-gradient(90deg, #ff4d5e var(--p), rgba(255, 255, 255, .14) var(--p)); }
.ed-slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid #ff4d5e; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.ed-slider input::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #ff4d5e; }
.ed-sw { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.ed-sw .sw { position: relative; width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); background: var(--sw); color: #555; font: 800 12px system-ui; cursor: pointer; padding: 0; }
.ed-sw .sw.on { border-color: #fff; box-shadow: 0 0 0 2px #ff4d5e; }
.sw-pick { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red) !important; overflow: hidden; }
.sw-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ed-note { margin: 0; font-size: 12px; color: rgba(255, 255, 255, .5); }
.ed-slots { display: grid; gap: 6px; }
.ed-slot { display: grid; grid-template-columns: 1fr auto auto; gap: 2px 6px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .05); }
.ed-slot small { grid-column: 1; grid-row: 2; opacity: .55; font-size: 11px; }
.ed-slot button { grid-row: 1 / 3; }
.ed-code { display: flex; gap: 6px; } .ed-code input { flex: 1; min-width: 0; font: 13px ui-monospace, monospace; color: #fff; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .15); border-radius: 9px; padding: 8px 10px; }
.ed-wide { width: 100%; }
.ed-toast { margin: 0; font-size: 12px; color: #8cf0b4; overflow-wrap: anywhere; }
.editor button:not(.ed-tile):not(.sw):not(.ed-body-card):not(.ed-race):not(.ed-class):not(.ed-rail button), .ed-bar button { font: 700 12px system-ui; color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid transparent; border-radius: 9px; padding: 7px 11px; cursor: pointer; }
.editor footer { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 16px 14px; border-top: 1px solid rgba(255, 255, 255, .07); }
.editor footer span { flex: 1; }
.editor footer .ed-ok { background: linear-gradient(180deg, #ff4d5e, #c21f35) !important; padding: 9px 18px !important; font-size: 14px !important; box-shadow: 0 8px 20px rgba(224, 40, 60, .35); }
.ed-bar { position: fixed; z-index: 6; left: calc(min(440px, 46vw) + 28px); right: max(14px, env(safe-area-inset-right, 0px)); top: calc(70px + env(safe-area-inset-top, 0px));
  display: grid; gap: 6px; justify-items: end; pointer-events: none; }
.ed-bar[hidden] { display: none; }
.ed-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; padding: 5px 7px; border-radius: 12px; background: rgba(18, 16, 20, .72); backdrop-filter: blur(8px);
  pointer-events: auto; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ed-row::-webkit-scrollbar { display: none; }
.ed-row > * { flex: none; }
.ed-row small { font: 700 10px system-ui; letter-spacing: .08em; text-transform: uppercase; opacity: .6; margin: 0 3px 0 6px; }
.ed-bar button { padding: 6px 9px !important; }
.ed-bar button.on { background: #ff4d5e; }
.ed-toggle { display: inline-flex; align-items: center; gap: 7px; font: 700 12px system-ui; cursor: pointer; padding: 0 6px; }
.ed-toggle input { display: none; }
.ed-toggle span { width: 34px; height: 20px; border-radius: 10px; background: rgba(255, 255, 255, .2); position: relative; transition: background .2s; }
.ed-toggle span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
.ed-toggle input:checked + span { background: #ff4d5e; } .ed-toggle input:checked + span::after { transform: translateX(14px); }
body.editing #tags, body.editing .help, body.editing #minimap, body.editing .joy, body.editing .run-btn, body.editing .target-frame, body.editing .inspect, body.editing .net { display: none !important; }
body.photo .editor, body.photo .ed-bar, body.photo .hud-top { display: none !important; }
body.photo::after { content: "Нажмите, чтобы вернуть панели"; position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); font: 600 12px system-ui; opacity: .6; }
@media (pointer: coarse), (max-width: 900px) {
  .editor { width: min(380px, 50vw); top: calc(56px + env(safe-area-inset-top, 0px)); grid-template-columns: 52px minmax(0, 1fr); }
  .ed-bar { left: calc(min(380px, 50vw) + 16px); top: calc(56px + env(safe-area-inset-top, 0px)); }
  .ed-row { gap: 3px; padding: 4px 5px; } .ed-bar button { padding: 5px 7px !important; font-size: 11px !important; } .ed-row small { display: none; }
}
/* Фирменный курсор: золотая стрелка; над персонажем — прицел цели */
body { cursor: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><defs><linearGradient id='g' x1='0' y1='0' x2='1' y2='1'><stop offset='0' stop-color='%23fff6c8'/><stop offset='.45' stop-color='%23f5c542'/><stop offset='1' stop-color='%23b8741a'/></linearGradient></defs><path d='M3 2 L26 15 L16 17.5 L21.5 28 L17.5 30 L12 19.5 L5 26 Z' fill='url(%23g)' stroke='%23231a12' stroke-width='2' stroke-linejoin='round'/><path d='M6 6.5 L20 14.5 L13.5 16' fill='none' stroke='%23fffbe6' stroke-width='1.2' opacity='.8'/></svg>") 3 2, auto; }
body.over-char { cursor: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><circle cx='16' cy='16' r='10' fill='none' stroke='%23231a12' stroke-width='5'/><circle cx='16' cy='16' r='10' fill='none' stroke='%23ff5a6a' stroke-width='2.5'/><path d='M16 1v8M16 23v8M1 16h8M23 16h8' stroke='%23231a12' stroke-width='5' stroke-linecap='round'/><path d='M16 2v6M16 24v6M2 16h6M24 16h6' stroke='%23ffd0d5' stroke-width='2' stroke-linecap='round'/><circle cx='16' cy='16' r='2.4' fill='%23ff5a6a' stroke='%23231a12'/></svg>") 16 16, crosshair; }
button, a, input, label { cursor: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><defs><linearGradient id='g' x1='0' y1='0' x2='1' y2='1'><stop offset='0' stop-color='%23fff6c8'/><stop offset='.45' stop-color='%23f5c542'/><stop offset='1' stop-color='%23b8741a'/></linearGradient></defs><path d='M3 2 L26 15 L16 17.5 L21.5 28 L17.5 30 L12 19.5 L5 26 Z' fill='url(%23g)' stroke='%23231a12' stroke-width='2' stroke-linejoin='round'/><path d='M6 6.5 L20 14.5 L13.5 16' fill='none' stroke='%23fffbe6' stroke-width='1.2' opacity='.8'/></svg>") 3 2, pointer; }

.ed-undress { display: flex; gap: 8px; align-items: center; font-size: 13px; margin-top: 6px; opacity: .9; }
.ed-undress input { width: 16px; height: 16px; accent-color: var(--accent); }
.ed-loading { position: fixed; z-index: 7; left: 60%; top: 50%; transform: translate(-50%, -50%); display: flex; gap: 10px; align-items: center;
  background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-weight: 700; }
.ed-loading[hidden] { display: none; }
.ed-loading i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: edspin .8s linear infinite; }
@keyframes edspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ed-loading i { animation: none; } }

/* Экран загрузки: арт из брендбука, полоса и этап */
.loader { position: fixed; inset: 0; z-index: 30; display: grid; align-items: end; justify-items: center;
  background: linear-gradient(180deg, rgba(10, 8, 14, .1) 30%, rgba(10, 8, 14, .85)), url("/img/generated/previews/world-loading-screen.webp") center / cover no-repeat, #1a1720;
  padding: 0 max(20px, env(safe-area-inset-right, 0px)) calc(42px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); }
.loader[hidden] { display: none; }
.ld-box { width: min(560px, 100%); display: grid; gap: 10px; text-align: center; }
.ld-title { font: 900 clamp(26px, 4vw, 40px)/1 system-ui; text-transform: uppercase; letter-spacing: .03em; text-shadow: 0 4px 22px rgba(0, 0, 0, .6); }
.ld-bar { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .18); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.4); }
.ld-bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #ff4d5e, #ffd36e); transition: width .25s ease; box-shadow: 0 0 14px rgba(255, 120, 90, .7); }
.ld-stage { font-weight: 700; font-size: 14px; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); }
.ld-tip { font-size: 13px; opacity: .75; min-height: 1.4em; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); }
@media (prefers-reduced-motion: reduce) { .ld-bar i { transition: none; } }

/* ===================== Интерфейс MMORPG ===================== */
:root { --ui: 1; --gold: #d9b46c; --gold2: #f4dea6; --gline: rgba(217, 180, 108, .32); --pane: rgba(17, 14, 22, .9); --pane2: rgba(30, 25, 38, .92); }
.ico { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }
kbd { font: 700 10px ui-monospace, monospace; padding: 1px 5px; border-radius: 5px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-bottom-width: 2px; color: #f3e7cf; }
.hud-top { align-items: flex-start; }
/* Рамка героя */
.uf { display: flex; align-items: center; gap: 10px; zoom: var(--ui); pointer-events: auto; }
.uf-pic { position: relative; width: 66px; height: 66px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #3b3346, #19151e) center / cover;
  border: 2px solid var(--gold); box-shadow: 0 0 0 3px rgba(0, 0, 0, .45), 0 8px 22px rgba(0, 0, 0, .45), inset 0 0 12px rgba(0, 0, 0, .5); flex: none; }
.uf-lvl { position: absolute; right: -4px; bottom: -4px; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px; display: grid; place-items: center;
  font: 800 12px system-ui; background: linear-gradient(180deg, #ff4d5e, #b81c30); border: 2px solid var(--gold2); box-shadow: 0 3px 8px rgba(0, 0, 0, .5); }
.uf-main { display: grid; gap: 4px; min-width: 190px; padding: 6px 12px 7px 10px; border-radius: 12px; background: linear-gradient(180deg, rgba(20, 17, 26, .78), rgba(20, 17, 26, .6));
  border: 1px solid var(--gline); backdrop-filter: blur(6px); }
.uf-name { display: flex; align-items: center; gap: 7px; font-size: 14px; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.uf-name .dot { width: 9px; height: 9px; border-radius: 50%; border: 0; }
.bar { position: relative; height: 13px; border-radius: 4px; background: rgba(0, 0, 0, .55); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6); }
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; transition: width .3s; }
.bar.hp i { background: linear-gradient(180deg, #7fe36a, #2f9a3a); }
.bar.mp i { background: linear-gradient(180deg, #74b8ff, #2a5fc4); }
.bar span { position: relative; display: block; text-align: center; font: 700 10px/13px system-ui; text-shadow: 0 1px 2px #000; }
.net { gap: 10px; padding: 5px 10px; font-size: 12px; border-radius: 10px; opacity: .85; }
body.no-stats .net { display: none; }
body.no-names #tags { display: none; }
/* Мини-карта с регионом */
.mini { position: fixed; right: max(14px, env(safe-area-inset-right, 0px)); top: calc(14px + env(safe-area-inset-top, 0px)); width: 168px; zoom: var(--ui); }
.mini #minimap { position: static; display: block; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(0, 0, 0, .45), 0 8px 24px rgba(0, 0, 0, .4); }
.mini-region { margin-top: 8px; text-align: center; font: 700 13px system-ui; padding: 4px 10px; border-radius: 999px; background: rgba(17, 14, 22, .72); border: 1px solid var(--gline); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-btn { position: absolute; left: -6px; top: 118px; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--gold); background: var(--pane2); color: var(--gold2); display: grid; place-items: center; padding: 0; cursor: pointer; }
.mini-btn svg { width: 18px; height: 18px; fill: currentColor; }
.mini-btn:hover { background: #e0283c; color: #fff; }
.hud-top .net { margin-right: 190px; }
/* Трекер заданий */
.tracker { position: fixed; right: max(14px, env(safe-area-inset-right, 0px)); top: calc(240px + env(safe-area-inset-top, 0px)); width: 230px; display: grid; gap: 6px; zoom: var(--ui);
  padding: 8px 10px; border-radius: 10px; background: linear-gradient(90deg, transparent, rgba(12, 10, 16, .45) 30%);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .85); pointer-events: none; }
.tracker > b { font: 800 12px system-ui; letter-spacing: .08em; text-transform: uppercase; color: var(--gold2); display: flex; gap: 6px; align-items: center; }
.tq { display: grid; gap: 1px; padding-left: 10px; border-left: 2px solid rgba(255, 255, 255, .3); }
.tq.on { border-left-color: var(--gold); }
.tq span { font: 700 13px system-ui; color: #ffe9b0; } .tq small { font-size: 12px; opacity: .9; }
/* Журнал событий */
.log { position: fixed; left: max(14px, env(safe-area-inset-left, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); width: 380px; max-height: 170px; overflow-y: auto; zoom: var(--ui);
  padding: 8px 10px; border-radius: 12px; background: rgba(12, 10, 16, .0); transition: background .4s, opacity .4s; opacity: .55; scrollbar-width: none; pointer-events: none; }
.log.awake, .log:hover { background: rgba(12, 10, 16, .55); opacity: 1; pointer-events: auto; }
.log p { margin: 0 0 3px; font-size: 13px; text-shadow: 0 1px 3px #000; color: #efe7d8; }
.log p.good { color: #8cf0a8; } .log p.warn { color: #ffb36b; } .log p.xp { color: #c9a7ff; }
body.no-chat .log { display: none; }
/* Панель быстрого доступа и опыт */
.bottom { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; zoom: var(--ui); }
.hotbar { display: flex; gap: 5px; padding: 6px; border-radius: 14px; background: linear-gradient(180deg, rgba(30, 25, 38, .82), rgba(14, 12, 18, .88)); border: 1px solid var(--gline);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06); }
.hk { position: relative; width: 48px; height: 48px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .1); background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, .07), rgba(0, 0, 0, .35)); cursor: pointer; padding: 0; }
.hk kbd { position: absolute; left: 3px; top: 3px; font-size: 9px; padding: 0 3px; }
.hk:hover { border-color: var(--gold); }
.hk.flash { animation: hkflash .45s; }
@keyframes hkflash { 0% { box-shadow: 0 0 0 0 rgba(255, 210, 120, .9); } 100% { box-shadow: 0 0 0 10px rgba(255, 210, 120, 0); } }
.xp { width: 100%; height: 6px; border-radius: 4px; background: rgba(0, 0, 0, .55); overflow: hidden; border: 1px solid rgba(0, 0, 0, .4); }
.xp i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8a5cff, #d4a6ff); box-shadow: 0 0 10px rgba(180, 130, 255, .7); transition: width .6s; }
.cast { display: grid; gap: 4px; justify-items: center; width: 280px; margin-bottom: 10px; }
.cast[hidden] { display: none; }
.cast b { font: 700 13px system-ui; text-shadow: 0 1px 3px #000; }
.cast div { width: 100%; height: 12px; border-radius: 6px; background: rgba(0, 0, 0, .6); border: 1px solid var(--gold); overflow: hidden; }
.cast i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffcf6a, #fff3c4); }
/* Кнопки окон справа снизу */
.micro { position: fixed; right: max(14px, env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 4px; padding: 5px; zoom: var(--ui);
  border-radius: 12px; background: rgba(17, 14, 22, .78); border: 1px solid var(--gline); }
.micro button { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; border: 0; background: transparent; color: #d8cdb8; cursor: pointer; font-size: 19px; padding: 0; }
.micro button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.micro button.on { color: #fff; background: linear-gradient(180deg, #ff4d5e, #b81c30); }
/* Баннер региона / открытия места */
.banner { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: 5; display: grid; justify-items: center; gap: 2px; pointer-events: none; text-align: center; }
.banner[hidden] { display: none; }
.banner small { font: 800 12px system-ui; letter-spacing: .3em; text-transform: uppercase; color: var(--gold2); text-shadow: 0 2px 8px #000; }
.banner b { font: 900 clamp(26px, 4vw, 44px)/1.05 Georgia, "Times New Roman", serif; letter-spacing: .02em; text-shadow: 0 3px 18px rgba(0, 0, 0, .8), 0 0 2px #000; }
.banner::after { content: ""; width: min(420px, 70vw); height: 2px; margin-top: 8px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.banner.show { animation: banner 4.2s ease forwards; }
.banner.lvl b { color: #e6ccff; } .banner.poi b { color: #ffe9b0; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, 10px); } 12% { opacity: 1; transform: translate(-50%, 0); } 78% { opacity: 1; } 100% { opacity: 0; } }
/* Прицел экшен-камеры */
.crosshair { display: none; position: fixed; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; pointer-events: none; z-index: 2; }
body.locked .crosshair { display: block; }
.crosshair::before, .crosshair::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.crosshair::before { border: 2px solid rgba(255, 255, 255, .85); box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); transform: scale(.5); }
.crosshair::after { background: #fff; transform: scale(.14); }
body.locked.over-char .crosshair::before { border-color: #ff5a6a; transform: scale(.85); transition: transform .15s; }
body.hide-ui .hud-top, body.hide-ui .mini, body.hide-ui .tracker, body.hide-ui .log, body.hide-ui .bottom, body.hide-ui .micro, body.hide-ui #tags, body.hide-ui .target-frame { display: none !important; }

/* Окна */
#windows { position: fixed; inset: 0; pointer-events: none; z-index: 9; }
.win { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: auto; min-width: 280px; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px);
  display: grid; grid-template-rows: auto minmax(0, 1fr); zoom: var(--ui); color: #f1e8d8;
  background: linear-gradient(180deg, var(--pane2), var(--pane)); border: 1px solid var(--gline); border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 0 0 1px rgba(0, 0, 0, .4); backdrop-filter: blur(10px); animation: winin .16s ease-out; }
.win[hidden] { display: none; }
@keyframes winin { from { opacity: 0; } to { opacity: 1; } }
.win-h { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; cursor: grab; border-bottom: 1px solid var(--gline);
  background: linear-gradient(180deg, rgba(217, 180, 108, .14), transparent); border-radius: 14px 14px 0 0; }
.win-h .ico { color: var(--gold); font-size: 17px; }
.win-h b { flex: 1; font: 700 15px Georgia, "Times New Roman", serif; letter-spacing: .04em; color: var(--gold2); }
.win-x { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .06); color: #d8cdb8; cursor: pointer; padding: 0; font-size: 15px; }
.win-x:hover { background: #e0283c; color: #fff; }
.win-b { overflow-y: auto; padding: 12px 14px 14px; scrollbar-width: thin; scrollbar-color: rgba(217, 180, 108, .4) transparent; }
.win h4 { margin: 0 0 8px; font: 800 11px system-ui; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.hint { margin: 10px 0 0; font-size: 12px; color: rgba(241, 232, 216, .55); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: 700 13px system-ui; color: #fff; border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; padding: 8px 14px; cursor: pointer;
  background: linear-gradient(180deg, #ff4d5e, #b81c30); box-shadow: 0 6px 16px rgba(224, 40, 60, .25); }
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: rgba(255, 255, 255, .07); box-shadow: none; color: #efe4cf; }
.btn.ghost:hover, .btn.ghost.on { background: rgba(217, 180, 108, .18); border-color: var(--gline); }
.btn.big { font-size: 16px; padding: 12px; }
/* Ячейки вещей */
.slot { position: relative; width: 48px; height: 48px; border-radius: 9px; display: grid; place-items: center; font-size: 26px; color: var(--ic, #aaa);
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, .07), rgba(0, 0, 0, .4)); border: 1px solid rgba(255, 255, 255, .09); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5); }
.slot .ico { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); }
.slot i { position: absolute; right: 3px; bottom: 1px; font: 800 11px system-ui; color: #fff; text-shadow: 0 1px 2px #000, 0 0 2px #000; font-style: normal; }
.slot.r-fine { border-color: rgba(95, 208, 104, .7); } .slot.r-rare { border-color: rgba(79, 163, 255, .8); box-shadow: inset 0 0 12px rgba(79, 163, 255, .25); }
.slot.r-epic { border-color: rgba(192, 108, 255, .8); } .slot.r-quest { border-color: rgba(255, 207, 74, .8); }
.slot.empty { color: rgba(255, 255, 255, .14); font-size: 22px; }
.slot.locked { color: rgba(255, 255, 255, .2); font-size: 20px; } .slot.locked i { color: rgba(255, 255, 255, .5); }
.slot[data-i], .slot[data-eq] { cursor: pointer; } .slot[data-i]:hover, .slot[data-eq]:hover { border-color: var(--gold); }
.slot.ghost { position: fixed; z-index: 50; pointer-events: none; opacity: .9; transform: scale(1.08); }
.bag { display: grid; grid-template-columns: repeat(6, 48px); gap: 6px; }
.bag-f { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; }
.gold { display: inline-flex; align-items: center; gap: 5px; color: #e9edf5; } .gold .ico { color: #cfd6e4; }
.cap { flex: 1; opacity: .6; font-size: 12px; }
.tip { position: fixed; z-index: 60; max-width: 260px; padding: 10px 12px; border-radius: 10px; pointer-events: none; display: grid; gap: 4px;
  background: rgba(12, 10, 16, .96); border: 1px solid var(--gline); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.tip[hidden] { display: none; }
.tip b { font-size: 14px; } .tip small { font-size: 11px; opacity: .65; } .tip p { margin: 0; font-size: 12px; color: #d9cfbd; } .tip em { font-size: 11px; color: var(--gold2); font-style: normal; }
/* Персонаж */
.char { display: grid; grid-template-columns: auto 220px auto; gap: 12px; align-items: start; }
.eq-col { display: grid; gap: 6px; }
.eq { display: grid; justify-items: center; gap: 1px; } .eq small { font-size: 10px; opacity: .55; }
.char-mid { display: grid; gap: 6px; justify-items: center; text-align: center; }
.char-pic { width: 200px; height: 290px; border-radius: 12px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, rgba(217, 180, 108, .22), rgba(0, 0, 0, .35) 70%), #16121c; border: 1px solid var(--gline); }
.char-pic img { width: 100%; height: 100%; object-fit: cover; }
.char-name { font: 700 17px Georgia, serif; color: var(--gold2); } .char-mid small { opacity: .6; font-size: 12px; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .2); border-top-color: var(--gold); animation: edspin .8s linear infinite; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--gline); }
.stats div { display: flex; justify-content: space-between; font-size: 13px; } .stats span { opacity: .65; } .stats b { color: #fff; }
/* Умения */
.skills { display: grid; gap: 16px; width: min(520px, 80vw); }
.sk-grid { display: grid; grid-template-columns: repeat(6, 48px); gap: 6px; }
.forms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.form { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); }
.form .ico { font-size: 26px; color: var(--gold); } .form b { font-size: 13px; } .form small { font-size: 11px; opacity: .6; }
/* Журнал */
.quests { display: grid; gap: 10px; width: min(460px, 80vw); }
.q { padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); display: grid; gap: 6px; }
.q header { display: flex; justify-content: space-between; gap: 10px; } .q header b { color: #ffe9b0; } .q header span { font-size: 12px; opacity: .7; }
.q.done { opacity: .55; } .q.done header span { color: #8cf0a8; opacity: 1; }
.q p { margin: 0; font-size: 13px; color: #d9cfbd; }
.q ul { margin: 0; padding-left: 18px; font-size: 13px; } .q li.ok { color: #8cf0a8; text-decoration: line-through; }
.q footer { display: flex; justify-content: space-between; align-items: center; } .q footer small { opacity: .6; font-size: 12px; }
.q .btn { padding: 5px 10px; font-size: 12px; }
/* Настройки */
.set { display: grid; gap: 16px; width: min(480px, 82vw); }
.opts { display: grid; gap: 6px; } .opts.row { grid-template-columns: repeat(3, 1fr); }
.opt { display: block; cursor: pointer; } .opt input { position: absolute; opacity: 0; }
.opt span { display: grid; gap: 2px; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04); }
.opt span small { font-size: 12px; opacity: .65; }
.opt input:checked + span { border-color: var(--gold); background: rgba(217, 180, 108, .14); }
.opt input:focus-visible + span { outline: 2px solid var(--gold2); }
.range { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; margin-top: 10px; font-size: 13px; }
.range input { grid-column: 1 / -1; accent-color: #e0283c; } .range output { font: 700 12px ui-monospace, monospace; color: var(--gold2); }
.sw { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; cursor: pointer; }
.sw input { position: absolute; opacity: 0; }
.sw span { width: 36px; height: 20px; border-radius: 10px; background: rgba(255, 255, 255, .2); position: relative; transition: background .2s; flex: none; }
.sw span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
.sw input:checked + span { background: #e0283c; } .sw input:checked + span::after { transform: translateX(16px); }
/* Клавиши */
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; width: min(600px, 84vw); }
.keys div { display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 13px; padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.keys kbd { white-space: nowrap; }
.gmenu { display: grid; gap: 8px; width: 280px; }
.gmenu .btn { justify-content: flex-start; } .gmenu .btn.big { justify-content: center; }
/* Режим редактора и телефон */
body.editing .uf, body.editing .mini, body.editing .tracker, body.editing .log, body.editing .bottom, body.editing .micro, body.editing #windows { display: none !important; }
@media (pointer: coarse), (max-width: 900px) {
  .log, .tracker, .net { display: none; }
  .uf-pic { width: 52px; height: 52px; } .uf-main { min-width: 150px; }
  .hk { width: 40px; height: 40px; } .hotbar { gap: 4px; padding: 4px; }
  .micro { bottom: auto; top: calc(150px + env(safe-area-inset-top, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); flex-direction: column; }
  .micro button { width: 34px; height: 34px; }
  .mini { width: 118px; } .mini #minimap { width: 118px; height: 118px; } .mini-btn { top: 78px; } .mini-region { font-size: 11px; }
  .micro { top: calc(176px + env(safe-area-inset-top, 0px)); }
  .bag { grid-template-columns: repeat(6, 42px); } .slot { width: 42px; height: 42px; }
  .char { grid-template-columns: auto 150px auto; } .char-pic { width: 140px; height: 200px; }
}
@media (pointer: coarse) { .bottom { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); } .hotbar { display: none; } .xp { width: 280px; } }
@media (prefers-reduced-motion: reduce) { .banner.show, .win, .hk.flash { animation: none; } .banner.show { opacity: 1; } }

.tracker:empty { display: none; }

/* Иконки вещей из листа (art/items.png, 4×4) */
.ii { width: 88%; height: 88%; background: url("./art/items.png") 0 0 / 400% 400% no-repeat; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55)); }
.slot.ghost .ii { width: 100%; height: 100%; }
/* NPC: подпись и подсказка «F — поговорить» */
.tag.npc { background: rgba(40, 30, 12, .78); color: #ffe3a0; border: 1px solid rgba(217, 180, 108, .5); }
.tag.npc::before { background: #ffcf4a; }
.tag.npc.quest::after { content: "!"; position: absolute; left: 50%; top: -24px; transform: translateX(-50%); font: 900 20px Georgia, serif; color: #ffd34a; text-shadow: 0 2px 6px #000, 0 0 2px #000; animation: qbob 1.2s ease-in-out infinite; }
@keyframes qbob { 50% { transform: translate(-50%, -4px); } }
.talk-hint { position: fixed; left: 50%; bottom: calc(108px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 3; display: flex; gap: 8px; align-items: center;
  padding: 7px 14px; border-radius: 999px; background: rgba(17, 14, 22, .82); border: 1px solid var(--gline); font: 700 14px system-ui; zoom: var(--ui); cursor: pointer; }
.talk-hint[hidden] { display: none; }
/* Диалог (по макету: портрет слева, рамка с именем, ответы справа) */
.dialog { position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; height: min(46vh, 360px); pointer-events: none; zoom: var(--ui); }
.dialog[hidden] { display: none; }
.dl-pic { position: absolute; left: max(0px, env(safe-area-inset-left, 0px)); bottom: 0; width: min(34vw, 330px); height: min(56vh, 440px); background: no-repeat center bottom / contain;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .55)); pointer-events: none; z-index: 2; }
.dl-box { position: absolute; left: min(24vw, 250px); right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); min-height: 180px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 34%); grid-template-rows: auto 1fr; gap: 10px 18px; padding: 30px 22px 18px min(12vw, 120px); pointer-events: auto;
  background: linear-gradient(180deg, rgba(30, 24, 20, .95), rgba(16, 13, 12, .96)); border: 1px solid rgba(217, 180, 108, .6); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55), inset 0 0 0 3px rgba(0, 0, 0, .35), inset 0 0 0 4px rgba(217, 180, 108, .18); }
.dialog.in .dl-box { animation: dlin .22s ease-out; } .dialog.in .dl-pic { animation: dlpic .3s ease-out; }
@keyframes dlin { from { opacity: 0; transform: translateY(16px); } } @keyframes dlpic { from { opacity: 0; transform: translateX(-24px); } }
.dl-name { position: absolute; left: min(10vw, 100px); top: -18px; display: flex; align-items: baseline; gap: 10px; padding: 6px 18px; border-radius: 10px;
  background: linear-gradient(180deg, #3a2c1e, #21180f); border: 1px solid rgba(217, 180, 108, .7); box-shadow: 0 6px 16px rgba(0, 0, 0, .45); }
.dl-name b { font: 700 18px Georgia, "Times New Roman", serif; color: var(--gold2); }
.dl-name small { font-size: 12px; color: #cdbb98; letter-spacing: .06em; text-transform: uppercase; }
.dl-x { margin-left: 8px; border: 0; background: none; color: #cdbb98; font-size: 14px; cursor: pointer; padding: 0 2px; }
.dl-x:hover { color: #fff; }
.dl-text { grid-row: 1 / 3; margin: 0; font: 17px/1.55 Georgia, "Times New Roman", serif; color: #f3e9d6; min-height: 5em; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.dl-opts { grid-row: 1 / 3; grid-column: 2; display: grid; gap: 8px; align-content: center; }
.dl-opts button { display: flex; align-items: center; gap: 10px; text-align: left; font: 600 14px system-ui; color: #f3e9d6; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(217, 180, 108, .3); }
.dl-opts button:hover, .dl-opts button:focus-visible { background: rgba(217, 180, 108, .18); border-color: var(--gold); outline: none; }
@media (max-width: 900px), (pointer: coarse) {
  .dl-pic { width: 30vw; height: 52vh; } .dl-box { left: 22vw; grid-template-columns: 1fr; padding: 26px 14px 12px 8vw; min-height: 0; } .dl-text { grid-row: 1; font-size: 14px; min-height: 0; } .dl-opts { grid-row: 2; grid-column: 1; }
  .dl-opts button { padding: 7px 10px; font-size: 13px; }
}
body.editing .dialog, body.editing .talk-hint { display: none !important; }

/* Редактор: раса и класс */
.ed-races { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.ed-race { display: grid; gap: 2px; padding: 10px 8px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; text-align: left; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--rc) 30%, transparent), rgba(255, 255, 255, .04)); }
.ed-race b { font: 800 14px system-ui; } .ed-race small { font-size: 10px; opacity: .7; }
.ed-race.on { border-color: var(--rc); box-shadow: 0 0 0 1px var(--rc), 0 6px 18px color-mix(in srgb, var(--rc) 35%, transparent); }
.ed-lore { margin: 4px 0 0; font-size: 13px; color: rgba(255, 255, 255, .78); }
.ed-trait { margin: 0; font-size: 12px; color: #ffd98a; }
.ed-classes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ed-class { display: grid; gap: 3px; padding: 12px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; text-align: left; color: #fff; background: rgba(255, 255, 255, .05); }
.ed-class b { font: 800 16px system-ui; } .ed-class small { font-size: 11px; color: #ffb3bb; margin-bottom: 4px; } .ed-class span { font-size: 11px; opacity: .75; }
.ed-class.on { border-color: var(--rc); background: color-mix(in srgb, var(--rc) 16%, transparent); }
@media (max-width: 900px) { .ed-races { grid-template-columns: 1fr 1fr; } .ed-classes { grid-template-columns: 1fr; } }

/* Окно умений по классу */
.sk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--rc) 35%, transparent), rgba(255, 255, 255, .03)); border: 1px solid color-mix(in srgb, var(--rc) 60%, transparent); }
.sk-head small { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; } .sk-head b { display: block; font: 700 22px Georgia, serif; color: var(--gold2); }
.sk-head span { font-size: 12px; opacity: .8; }
.sk-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sk { display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: start; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .03); opacity: .6; }
.sk.open { opacity: 1; background: rgba(217, 180, 108, .08); }
.sk b { font-size: 13px; } .sk small { display: block; font-size: 11px; color: var(--gold2); } .sk p { margin: 2px 0 0; font-size: 12px; color: #d9cfbd; }
.sk-ic { color: var(--gold); }
.form.big { display: flex; gap: 12px; align-items: center; justify-items: start; text-align: left; } .form.big .ico { font-size: 40px; }
.form.big b { font-size: 16px; } .form.big small { display: block; }
.trait { margin: 0; font-size: 13px; color: #ffd98a; }
@media (max-width: 900px) { .sk-list { grid-template-columns: 1fr; } }

/* Бой: подписи монстров с полосой здоровья, цифры урона, экран гибели, ячейки панели */
.tag.mob { background: rgba(40, 14, 16, .72); padding-right: 10px; }
.tag.mob::before { background: #f5b301; } .tag.mob.aggr::before { background: #ff4040; }
.tag.mob small { opacity: .75; font-size: 10px; }
.tag .tb { display: none; position: absolute; left: 8px; right: 8px; bottom: -5px; height: 4px; border-radius: 2px; background: rgba(0, 0, 0, .7); overflow: hidden; }
.tag.hurt .tb { display: block; } .tag .tb b { display: block; height: 100%; background: linear-gradient(90deg, #ff4d4d, #ff9a6a); }
#fct { position: fixed; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.fct { position: absolute; transform: translate(-50%, -100%); font: 900 22px Georgia, serif; color: #fff; text-shadow: 0 2px 4px #000, 0 0 2px #000; animation: fct 1.1s ease-out forwards; white-space: nowrap; }
.fct.crit { font-size: 32px; color: #ffd34a; } .fct.hurt { color: #ff5a5a; font-size: 20px; } .fct.other { font-size: 14px; color: #d8d0c0; opacity: .8; }
@keyframes fct { 0% { opacity: 0; transform: translate(-50%, -60%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -100%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }
.death { position: fixed; inset: 0; z-index: 15; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center;
  background: radial-gradient(ellipse at center, rgba(60, 0, 8, .35), rgba(10, 0, 4, .82)); pointer-events: none; }
.death[hidden] { display: none; }
.death b { font: 900 clamp(36px, 7vw, 64px) Georgia, serif; color: #ff6a6a; text-shadow: 0 4px 24px #000; }
.death small { font-size: 15px; color: #f1d6d6; } .death span { font-size: 13px; opacity: .7; }
body.low-hp #scene { filter: saturate(.75); }
body.low-hp::before { content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none; box-shadow: inset 0 0 120px rgba(200, 0, 20, .45); animation: lowhp 1.2s ease-in-out infinite; }
@keyframes lowhp { 50% { opacity: .4; } }
.hk .hk-ic { position: absolute; inset: 8px; display: grid; place-items: center; color: var(--gold2); font-size: 22px; }
.hk.filled { border-color: rgba(217, 180, 108, .45); background: radial-gradient(circle at 50% 30%, rgba(217, 180, 108, .18), rgba(0, 0, 0, .35)); }
.hk .hk-cd { position: absolute; inset: 0; border-radius: 10px; pointer-events: none; background: conic-gradient(rgba(0, 0, 0, .65) var(--a, 0deg), transparent 0); opacity: 0; }
@property --a { syntax: "<angle>"; inherits: false; initial-value: 360deg; }
@keyframes hkcd { from { --a: 360deg; opacity: 1; } 99% { opacity: 1; } to { --a: 0deg; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fct { animation-duration: .01s; } body.low-hp::before { animation: none; } }

/* ===================== HUD по образцу PW: Ascend (03.11.2026) ===================== */
.hud-top { padding: calc(8px + env(safe-area-inset-top, 0px)) 0 0 max(10px, env(safe-area-inset-left, 0px)); justify-content: flex-start; }
/* Герой: квадратный портрет в золотой рамке, красное здоровье, синяя мана, сегменты опыта */
.uf { gap: 8px; align-items: flex-start; }
.uf-pic { width: 62px; height: 62px; border-radius: 12px; border: 2px solid var(--gold); box-shadow: 0 0 0 2px rgba(0, 0, 0, .55), 0 6px 18px rgba(0, 0, 0, .45); }
.uf-lvl { left: -6px; right: auto; bottom: -6px; min-width: 22px; height: 22px; font-size: 11px; border-radius: 6px; }
.uf-lvl { display: grid; } .uf-lvl::after { content: ""; }
.uf-main { min-width: 230px; padding: 0; background: none; border: 0; backdrop-filter: none; gap: 3px; }
.uf-name { font-size: 13px; gap: 6px; } .uf-name small { font-size: 11px; color: var(--gold2); opacity: .9; }
.bar { height: 15px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .7); background: rgba(10, 6, 8, .7); }
.bar.hp i { background: linear-gradient(180deg, #ff6b5e, #c81f2a 55%, #8e1018); }
.bar.mp i { background: linear-gradient(180deg, #6fb6ff, #2463d1 55%, #163f90); }
.bar span { line-height: 15px; font-size: 11px; }
.uf .xp { position: relative; width: 100%; height: 5px; border-radius: 2px; background: rgba(0, 0, 0, .6); border: 0; overflow: hidden; display: flex; }
.uf .xp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #e8b43a, #ffe08a); box-shadow: none; }
.uf .xp b { position: relative; flex: 1; border-right: 2px solid rgba(0, 0, 0, .7); } .uf .xp b:last-child { border: 0; }
/* Задания слева, с вкладками и сворачиванием */
.tracker { display: none; }
.qpanel { position: fixed; left: max(10px, env(safe-area-inset-left, 0px)); top: calc(92px + env(safe-area-inset-top, 0px)); width: 250px; z-index: 2; zoom: var(--ui);
  display: grid; gap: 0; transition: transform .25s; }
.qpanel.folded { transform: translateX(calc(-100% + 22px)); }
.qp-tabs { display: flex; gap: 2px; }
.qp-tabs button { flex: 1; font: 700 12px system-ui; color: #d8cdb8; padding: 6px 8px; border: 0; border-radius: 8px 8px 0 0; background: rgba(14, 12, 18, .55); cursor: pointer; }
.qp-tabs button.on { background: rgba(14, 12, 18, .82); color: var(--gold2); }
.qp-tabs .qp-fold { flex: 0 0 22px; padding: 0; font-size: 16px; background: rgba(14, 12, 18, .7); }
.qp-list { display: grid; gap: 2px; padding: 6px; border-radius: 0 0 10px 10px; background: rgba(14, 12, 18, .72); border: 1px solid rgba(217, 180, 108, .18); border-top: 0; }
.qp-list:empty { display: none; }
.qp-item { display: grid; gap: 1px; padding: 6px 8px; border-radius: 7px; text-align: left; border: 1px solid transparent; background: none; color: #fff; cursor: pointer; font: inherit; }
.qp-item:hover, .qp-item.on { background: rgba(217, 180, 108, .12); border-color: rgba(217, 180, 108, .35); }
.qp-item b { font: 700 13px system-ui; color: #ffe9b0; } .qp-item b em { font-style: normal; font-size: 11px; color: #ff9f5a; margin-right: 4px; }
.qp-item small { font-size: 12px; color: #8ff0a4; } .qp-item small.far { color: #cfc6b4; }
.qp-near { font-size: 12px; color: #cfc6b4; padding: 6px 8px; display: grid; gap: 4px; }
/* Меню с подписями слева от мини-карты */
.micro { display: none !important; }
.topmenu { position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); right: calc(max(10px, env(safe-area-inset-right, 0px)) + 170px); display: flex; gap: 2px; zoom: var(--ui); z-index: 2; }
.topmenu button { display: grid; justify-items: center; gap: 2px; min-width: 54px; padding: 4px 4px 3px; border: 0; border-radius: 10px; background: none; color: #f3e7cf; cursor: pointer;
  font: 700 11px system-ui; text-shadow: 0 1px 3px #000, 0 0 2px #000; }
.topmenu button .ico { font-size: 26px; color: var(--gold2); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .8)); }
.topmenu button:hover, .topmenu button.on { background: rgba(14, 12, 18, .55); }
.topmenu button.on .ico { color: #ff7b89; }
/* Мини-карта: название места и координаты */
.mini { top: calc(8px + env(safe-area-inset-top, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); width: 156px; display: grid; justify-items: center; gap: 4px; }
.mini #minimap { width: 150px; height: 150px; order: 1; }
.mini-head { order: 2; display: grid; justify-items: center; line-height: 1.2; text-shadow: 0 1px 3px #000, 0 0 2px #000; }
.mini-head b { font: 700 12px system-ui; max-width: 156px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .mini-head small { font: 600 10px ui-monospace, monospace; opacity: .85; }
.mini-region { display: none; }
.mini-btn { top: 108px; left: -4px; }
.net { position: fixed; right: max(10px, env(safe-area-inset-right, 0px)); bottom: calc(6px + env(safe-area-inset-bottom, 0px)); font-size: 11px; padding: 3px 8px; gap: 8px; background: rgba(14, 12, 18, .5); border: 0; }
.hud-top .net { margin-right: 0; }
/* Чат-журнал: тёмная панель снизу слева (ПК) */
.log { width: 400px; max-height: 128px; background: rgba(12, 10, 16, .5) !important; opacity: 1 !important; pointer-events: auto; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .06); }
.log p { font-size: 12.5px; }
/* Автопоиск пути */
.autopath { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 3; display: flex; gap: 8px; align-items: center;
  padding: 6px 14px; border-radius: 8px; background: rgba(14, 12, 18, .72); border: 1px solid rgba(217, 180, 108, .35); font: 700 13px system-ui; color: #ffe9b0; zoom: var(--ui); }
.autopath[hidden] { display: none; }
.autopath i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 233, 176, .3); border-top-color: #ffe9b0; animation: edspin .8s linear infinite; }
.talk-hint { bottom: calc(136px + env(safe-area-inset-bottom, 0px)); }
/* «Колесо» умений — только на телефоне */
.wheel { display: none; }
@media (pointer: coarse) {
  .run-btn { display: none !important; }
  .hotbar, .bottom .xp { display: none; }
  .joy { opacity: 0; transition: opacity .15s; width: 120px; height: 120px; }
  .joy.on { opacity: 1; }
  .wheel { display: block; position: fixed; right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); width: 250px; height: 230px; z-index: 3; pointer-events: none; }
  .wheel button { position: absolute; pointer-events: auto; border-radius: 50%; display: grid; place-items: center; padding: 0; cursor: pointer; color: #ffe9b0;
    border: 2px solid rgba(217, 180, 108, .75); background: radial-gradient(circle at 40% 30%, rgba(80, 60, 50, .85), rgba(20, 14, 16, .9)); box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
  .wheel button:active { transform: scale(.93); }
  .wheel .w-atk { right: 6px; bottom: 6px; width: 92px; height: 92px; border-width: 3px; background: radial-gradient(circle at 40% 30%, #a8452e, #4a1410); }
  .wheel .w-atk .hk-ic { font-size: 40px; }
  .wheel .w-sk { width: 60px; height: 60px; font-size: 20px; }
  .wheel .w-sk small { position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 700 10px system-ui; text-shadow: 0 1px 3px #000; color: #fff; }
  .wheel .s1 { right: 112px; bottom: 12px; } .wheel .s2 { right: 100px; bottom: 86px; } .wheel .s3 { right: 34px; bottom: 112px; }
  .wheel .locked { opacity: .55; font-size: 16px; }
  .wheel .w-sm { width: 42px; height: 42px; } .wheel .w-sm svg { width: 22px; height: 22px; fill: currentColor; }
  .wheel .w-tgt { right: 0; bottom: 176px; } .wheel .w-act { right: 172px; bottom: 96px; } .wheel .w-fly { right: 54px; bottom: 178px; } .wheel .w-jmp { right: 188px; bottom: 30px; width: 50px; height: 50px; }
  .wheel .hk-cd { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; background: conic-gradient(rgba(0, 0, 0, .65) var(--a, 0deg), transparent 0); opacity: 0; }
  .wheel .hk-ic { color: var(--gold2); font-size: 26px; display: grid; place-items: center; }
  .log { left: 50%; transform: translateX(-50%); bottom: calc(6px + env(safe-area-inset-bottom, 0px)); width: min(42vw, 360px); max-height: 74px; display: block !important; }
  .log p { font-size: 11px; }
  .qpanel { width: 190px; top: calc(76px + env(safe-area-inset-top, 0px)); }
  .qp-item b { font-size: 12px; } .qp-item small { font-size: 11px; }
  .topmenu { right: calc(max(10px, env(safe-area-inset-right, 0px)) + 118px); }
  .topmenu button { min-width: 40px; font-size: 9px; } .topmenu button .ico { font-size: 21px; }
  .mini { width: 112px; } .mini #minimap { width: 108px; height: 108px; } .mini-btn { top: 74px; }
  .uf-pic { width: 50px; height: 50px; } .uf-main { min-width: 170px; } .bar { height: 12px; } .bar span { line-height: 12px; font-size: 9px; }
  .net { display: none !important; } .autopath { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .talk-hint { left: auto; right: 270px; transform: none; bottom: calc(40px + env(safe-area-inset-bottom, 0px)); font-size: 15px; padding: 10px 16px; }
}
body.editing .qpanel, body.editing .topmenu, body.editing .wheel, body.editing .autopath { display: none !important; }
body.hide-ui .qpanel, body.hide-ui .topmenu, body.hide-ui .wheel { display: none !important; }

/* Админка и счётчик отрисовки */
.adm { display: grid; gap: 14px; width: min(460px, 84vw); }
.adm .sw div { display: grid; }
.adm-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.adm-row select { flex: 1; min-width: 0; font: 13px system-ui; color: #fff; background: rgba(0, 0, 0, .35); border: 1px solid var(--gline); border-radius: 9px; padding: 7px 8px; }
.adm-row .btn { padding: 7px 11px; font-size: 12px; }
.dbg { position: fixed; left: 50%; top: calc(4px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 20; font: 600 11px ui-monospace, monospace; color: #b8ffcb;
  background: rgba(0, 0, 0, .6); padding: 3px 10px; border-radius: 6px; pointer-events: none; white-space: nowrap; }
.dbg[hidden] { display: none; }

.sk[data-skill] { cursor: grab; } .sk-put { margin-top: 6px; padding: 4px 9px !important; font-size: 11px !important; }
.hk .hk-name { position: absolute; left: 1px; right: 1px; bottom: -1px; font: 700 8px system-ui; color: #fff; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hk .hk-ic { flex-direction: column; }

/* Админ-кнопки видит только владелец */
body:not(.is-admin) .topmenu [data-w="admin"], body:not(.is-admin) .wheel .w-fly { display: none !important; }
/* Ворота закрытой беты */
.beta { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px max(16px, env(safe-area-inset-right, 0px)) 20px max(16px, env(safe-area-inset-left, 0px));
  background: linear-gradient(180deg, rgba(10, 8, 14, .35), rgba(10, 8, 14, .9)), url("/img/generated/previews/world-loading-screen.webp") center / cover no-repeat, #1a1720; overflow-y: auto; }
.beta[hidden] { display: none; }
.bt-card { width: min(520px, 100%); display: grid; gap: 14px; padding: 26px 24px; border-radius: 18px; text-align: center;
  background: linear-gradient(180deg, rgba(30, 24, 36, .92), rgba(16, 13, 20, .95)); border: 1px solid rgba(217, 180, 108, .4); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.bt-card small.bt-eyebrow { font: 800 11px system-ui; letter-spacing: .24em; text-transform: uppercase; color: var(--gold2); }
.bt-card h1 { margin: 0; font: 900 clamp(28px, 5vw, 40px)/1.05 Georgia, serif; color: #fff; text-shadow: 0 3px 18px rgba(0, 0, 0, .6); }
.bt-card p { margin: 0; color: #e6dccb; font-size: 15px; line-height: 1.5; }
.bt-card form { display: grid; gap: 10px; }
.bt-card input { font: 700 20px ui-monospace, monospace; letter-spacing: .12em; text-align: center; text-transform: uppercase; color: #fff; background: rgba(0, 0, 0, .4);
  border: 1px solid rgba(217, 180, 108, .45); border-radius: 12px; padding: 12px; user-select: text; -webkit-user-select: text; }
.bt-card input:focus { outline: 2px solid var(--gold2); }
.bt-card .btn { justify-self: stretch; padding: 13px; font-size: 16px; }
.bt-msg { min-height: 1.3em; font-size: 14px; color: #cfc6b4; } .bt-msg.ok { color: #8cf0a8; } .bt-msg.bad { color: #ff9a8a; }
.bt-feat { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.bt-feat span { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(217, 180, 108, .12); border: 1px solid rgba(217, 180, 108, .3); color: #f3e3bc; }
.bt-login[hidden], .bt-code[hidden] { display: none; }
.inv-list { display: grid; gap: 4px; margin-top: 8px; max-height: 200px; overflow-y: auto; }
.inv { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 4px 8px; border-radius: 6px; background: rgba(255, 255, 255, .04); }
.inv code { font: 700 13px ui-monospace, monospace; color: #ffe9b0; user-select: all; -webkit-user-select: all; } .inv.used { opacity: .5; } .inv span { opacity: .8; }

/* Значок GM у ника администратора */
.gm { width: 20px; height: 23px; vertical-align: -6px; margin-right: 4px; image-rendering: pixelated; shape-rendering: crispEdges; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .7)); }
.tag.has-gm { padding-left: 8px; } .tag.has-gm::before { display: none; }
.tag .gm { position: absolute; left: 50%; top: 100%; width: 34px; height: 39px; margin: 2px 0 0 -17px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .8)); }
.tag.has-gm { overflow: visible; }
#tfName .gm, #inspName .gm { width: 16px; height: 18px; vertical-align: -4px; }
@media (max-width: 1150px) and (pointer: fine) { .topmenu button span { display: none; } .topmenu button { min-width: 38px; } }

/* Нарисованные значки */
.pic { display: block; width: 100%; height: 100%; background-repeat: no-repeat; border-radius: inherit; }
.hk .hk-ic .pic, .wheel .hk-ic .pic { position: absolute; inset: 0; border-radius: 9px; }
.wheel .hk-ic .pic { border-radius: 50%; }
.sk-ic .pic { border-radius: 8px; } .slot.ghost .pic { border-radius: 8px; }
.pic.emb { width: 34px; height: 34px; flex: none; }
.sk-head .pic.emb { width: 54px; height: 54px; } .sk-head { justify-content: flex-start; } .sk-head > div { flex: 1; }
.char-name .pic.emb { display: inline-block; width: 26px; height: 26px; vertical-align: -6px; margin-right: 6px; }
.form.big .pic.beast { width: 72px; height: 72px; flex: none; border-radius: 50%; }
.ed-race { grid-template-columns: 34px 1fr; column-gap: 8px; align-items: center; } .ed-race .pic.emb { grid-row: 1 / 3; }
.ed-race-art { width: 100%; border-radius: 12px; background: #2a2530; display: block; }

/* Чат */
.chat { position: fixed; left: max(10px, env(safe-area-inset-left, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); width: 420px; z-index: 3; zoom: var(--ui);
  display: grid; grid-template-rows: auto 1fr auto; border-radius: 10px; background: rgba(12, 10, 16, .58); border: 1px solid rgba(255, 255, 255, .07); overflow: hidden; }
.chat .log { position: static; width: auto; max-height: 132px; min-height: 96px; border: 0; border-radius: 0; background: none !important; padding: 4px 8px; transform: none; display: block !important; }
.ch-tabs { display: flex; gap: 1px; background: rgba(0, 0, 0, .35); }
.ch-tabs button { flex: 1; font: 700 11px system-ui; color: #cfc6b4; background: none; border: 0; padding: 5px 2px; cursor: pointer; white-space: nowrap; }
.ch-tabs button.on { color: #fff; background: rgba(217, 180, 108, .2); box-shadow: inset 0 -2px 0 var(--gold); }
.ch-tabs b { font: 800 10px system-ui; color: #ffd36e; padding: 0 4px; border-radius: 6px; background: rgba(0, 0, 0, .4); }
.ch-in { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-top: 1px solid rgba(255, 255, 255, .06); }
.ch-to { font: 700 11px system-ui; color: var(--gold2); white-space: nowrap; }
.ch-in input { flex: 1; min-width: 0; font: 13px system-ui; color: #fff; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .12); border-radius: 7px; padding: 5px 8px; user-select: text; -webkit-user-select: text; }
.ch-in input:focus { outline: 1px solid var(--gold); }
.ch-in button { border: 0; background: none; color: var(--gold2); font-size: 15px; cursor: pointer; padding: 2px 6px; }
.log p i { font-style: normal; opacity: .7; } .log p b { color: #ffe9b0; }
.log p.m-local { color: #fff; } .log p.m-world { color: #ffb36b; } .log p.m-world b { color: #ffd36e; }
.log p.m-party { color: #8fd8ff; } .log p.m-clan { color: #9cf0a8; }
.gm-mini { font: 900 9px system-ui; font-style: normal; color: #fff; background: #e0283c; border-radius: 3px; padding: 0 3px; margin-right: 3px; vertical-align: 1px; }
@media (pointer: coarse) {
  .chat { left: 50%; transform: translateX(-50%); width: min(44vw, 380px); bottom: calc(4px + env(safe-area-inset-bottom, 0px)); }
  .chat .log { max-height: 60px; min-height: 0; } .chat .log p { font-size: 11px; } .ch-tabs button { font-size: 9px; padding: 3px 1px; }
  .ch-in input { font-size: 16px; padding: 3px 6px; }
}
body.editing .chat, body.hide-ui .chat { display: none !important; }
@media (max-width: 1500px) { .bottom { left: calc(max(10px, env(safe-area-inset-left, 0px)) + 436px * var(--ui)); transform: none; } }
@media (max-width: 1000px) { .chat { width: 330px; } .bottom { left: auto; right: 10px; bottom: 34px; } }
@media (pointer: coarse) { .bottom { left: 50%; right: auto; transform: translateX(-50%); bottom: calc(8px + env(safe-area-inset-bottom, 0px)); } }
.hk .hk-ic .pic { inset: -7px; }
.ed-races { grid-template-columns: 1fr 1fr; } .ed-race { min-width: 0; } .ed-race b, .ed-race small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-body { overflow-x: hidden; }
.ed-steps { display: flex; gap: 4px; width: 100%; margin-bottom: 4px; } .ed-steps i { flex: 1; height: 22px; display: grid; place-items: center; border-radius: 6px; font: 700 11px system-ui; font-style: normal; background: rgba(255,255,255,.07); color: rgba(255,255,255,.5); }
.ed-steps i.on { background: #ff4d5e; color: #fff; } .ed-steps i.done { background: rgba(255, 77, 94, .3); color: #fff; }

.attr { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--gline); display: grid; gap: 6px; }
.attr header { display: flex; justify-content: space-between; font-size: 13px; } .attr header span { opacity: .7; } .attr header span.free { color: #8cf0a8; opacity: 1; font-weight: 700; }
.at { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; font-size: 13px; }
.at small { display: block; font-size: 10px; opacity: .55; } .at b { min-width: 3ch; text-align: right; font-size: 15px; } .at .btn { padding: 2px 10px; font-size: 15px; }
.at .btn:disabled { opacity: .3; cursor: default; }
.sk-key { font-style: normal; font-size: 10px; color: var(--gold2); opacity: .7; }
.hk.lockd { opacity: .5; } .hk .hk-lv { position: absolute; inset: auto 0 2px; text-align: center; font: 800 10px system-ui; color: #fff; text-shadow: 0 1px 2px #000; }
.fct.skillname { font: 900 18px Georgia, serif; letter-spacing: .04em; animation-duration: 1.3s; }
.pl-list { display: grid; gap: 6px; margin-top: 8px; max-height: 320px; overflow-y: auto; } .pl { padding: 8px; border-radius: 8px; background: rgba(255,255,255,.04); display: grid; gap: 2px; } .pl small { opacity: .7; font-size: 11px; } .pl input { width: 60px; font: 13px system-ui; color: #fff; background: rgba(0,0,0,.35); border: 1px solid var(--gline); border-radius: 7px; padding: 5px; user-select: text; }
.mini { width: 226px; } .mini #minimap { width: 220px; height: 220px; cursor: zoom-in; } .mini-btn { top: 162px; }
.topmenu { right: calc(max(10px, env(safe-area-inset-right, 0px)) + 240px); } .tracker, .qpanel { } 
@media (pointer: coarse) { .mini { width: 140px; } .mini #minimap { width: 136px; height: 136px; } .mini-btn { top: 96px; } .topmenu { right: calc(max(10px, env(safe-area-inset-right, 0px)) + 150px); } }
#worldMap { cursor: grab; touch-action: none; }
.style { width: min(460px, 84vw); } .st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.st-tile { display: grid; gap: 4px; padding: 5px; border-radius: 12px; border: 2px solid transparent; background: rgba(255,255,255,.05); color: #fff; font: 600 11px system-ui; cursor: pointer; }
.st-tile.on { border-color: var(--gold); background: rgba(217,180,108,.14); } .st-pic { aspect-ratio: 1; border-radius: 9px; overflow: hidden; display: grid; place-items: center; background: #221d27; } .st-pic img { width: 100%; height: 100%; object-fit: cover; }
