/* Грани Тумана — оформление */
:root {
  --bg: #07080a;
  --panel: #15120e;
  --panel-2: #1d1812;
  --panel-3: #0f0d0a;
  --line: #4a3d28;
  --line-soft: #2d261b;
  --gold: #d9b061;
  --gold-2: #f0d79a;
  --gold-dark: #8a6a33;
  --text: #ddd5c5;
  --muted: #9b9282;
  --dim: #6e675b;
  --red: #b84a4a;
  --red-2: #e06666;
  --blue: #4f7fb8;
  --blue-2: #6fa1dc;
  --green: #5d9e5f;
  --green-2: #7fc581;
  --violet: #a774d4;
  --shadow: 0 14px 40px rgba(0, 0, 0, .55);
  --acc: #8c1d17;
  --line-light: #b5aea2;
  --ink: #23201b;
  --ink-strong: #1f1c17;
  --line-warm: #3a3021;
  --panel-deep: #201d18;
  --ink-soft: #4a443a;
  --metal: #a9a294;
  --gold-line: #5a482d;
  --ink-muted: #5c564b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Verdana, sans-serif;
  font-size: 13px;
  background: linear-gradient(180deg, rgba(7, 8, 10, .78), rgba(7, 8, 10, .95) 70%), url("../assets/bg-hero.jpg") center / cover fixed no-repeat;
}
body.is-start { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold-2); }
h1, h2, h3, h4 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: normal; }
p { margin: 0 0 10px; line-height: 1.55; }
::selection { background: rgba(217, 176, 97, .3); }

#app { max-width: 1520px; margin: 0 auto; padding: 10px 12px 24px; }

/* ---------- Верхняя панель ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 7px 12px;
  background: linear-gradient(180deg, #201b13, #120f0b 70%);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 226, 168, .07), 0 6px 18px rgba(0, 0, 0, .45);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  background: none;
  border: 0;
  text-align: left;
  color: var(--gold-2);
  flex: 0 0 auto;
}
.brand-mark {
  width: 36px;
  height: 36px;
  color: var(--gold);
  display: grid;
  place-items: center;
  border: 1px solid rgba(217, 176, 97, .35);
  background: radial-gradient(circle at 50% 30%, rgba(217, 176, 97, .16), transparent 70%);
  transform: rotate(0deg);
}
.brand-mark svg { width: 30px; height: 30px; }
.brand-title {
  font-size: 18px;
  letter-spacing: .07em;
  color: var(--gold-2);
  text-shadow: 0 1px 0 #000;
  white-space: nowrap;
}
.brand-sub {
  display: block;
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
}
.hero-strip { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; }
.mini-portrait {
  width: 40px;
  height: 46px;
  object-fit: cover;
  border: 1px solid var(--gold-line);
  box-shadow: 0 0 0 1px #0c0a07;
  flex: 0 0 auto;
}
.mini-info { min-width: 0; flex: 1 1 auto; }
.mini-name { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-name b { color: var(--gold-2); font-size: 13px; font-weight: 600; }
.mini-name span { color: var(--dim); font-size: 11px; }
.mini-bars { display: flex; gap: 5px; margin-top: 3px; }
.mini-bars .bar { width: 118px; height: 12px; }
.mini-xp { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: var(--dim); font-size: 10px; }
.mini-xp .bar { flex: 1 1 auto; height: 5px; max-width: 360px; }
.top-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.coin-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid #3a301f;
  background: #0d0b08;
  color: var(--gold-2);
  font-size: 12px;
  white-space: nowrap;
}
.coin-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f0d79a, #a57b32); box-shadow: 0 0 5px rgba(217, 176, 97, .4); }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 9px;
  background: linear-gradient(#211b13, #15110c);
  border: 1px solid #3d3221;
  color: var(--muted);
  font-size: 11px;
  border-radius: 2px;
}
.icon-btn:hover { color: var(--gold-2); border-color: var(--gold-dark); }
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn.off { opacity: .45; }

/* ---------- Полосы ---------- */
.bar {
  position: relative;
  height: 13px;
  background: #090806;
  border: 1px solid #332a1c;
  border-radius: 1px;
  overflow: hidden;
}
.bar > i { display: block; height: 100%; width: 0; transition: width .3s ease; }
.bar.hp > i { background: linear-gradient(180deg, #b24b4b, #6e2323); }
.bar.mp > i { background: linear-gradient(180deg, #4f7fb8, #27405f); }
.bar.en > i { background: linear-gradient(180deg, #5d9e5f, #315a33); }
.bar.xp > i { background: linear-gradient(180deg, #d9b061, #8a6a33); }
.bar > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: #f2ead9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9);
  text-shadow: 0 1px 2px #000;
  letter-spacing: .02em;
}

/* ---------- Каркас ---------- */
.shell {
  display: grid;
  grid-template-columns: 202px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 10px;
}
.center-col { min-width: 0; }
.footer-note { margin-top: 6px; text-align: center; color: #4f4a40; font-size: 10px; letter-spacing: .03em; }

/* ---------- Левое меню ---------- */
.left-menu {
  background: linear-gradient(180deg, #17130e, #100d09);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.menu-list { display: flex; flex-direction: column; }
.menu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-bottom: 1px solid #241e15;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 12px;
  letter-spacing: .02em;
}
.menu-item svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: .8; }
.menu-item:hover { background: rgba(217, 176, 97, .05); color: var(--text); }
.menu-item.active {
  background: linear-gradient(90deg, rgba(217, 176, 97, .16), rgba(217, 176, 97, .02));
  color: var(--gold-2);
  box-shadow: inset 2px 0 0 var(--gold);
}
.menu-item.active svg { opacity: 1; }
.menu-item .badge {
  margin-left: auto;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  background: #5a2222;
  border: 1px solid #8a3b3b;
  color: #f0d7d7;
  font-size: 9px;
  border-radius: 8px;
}
.menu-extra { padding: 10px; border-top: 1px solid var(--line-soft); }
.menu-label {
  margin: 0 0 7px;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.menu-note { color: var(--dim); font-size: 10px; line-height: 1.45; margin-top: 8px; }
.menu-extra .btn { width: 100%; margin-bottom: 5px; }
.menu-foot { padding: 8px 10px; border-top: 1px solid #241e15; color: #4d483f; font-size: 9px; line-height: 1.5; }

/* ---------- Игровое окно ---------- */
.game-window {
  background: linear-gradient(180deg, #18140f, #0f0d0a 70%);
  border: 1px solid var(--gold-line);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .55), var(--shadow);
  overflow: hidden;
}
.window-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 39px;
  padding: 6px 12px;
  background: linear-gradient(180deg, #262017, #17130e);
  border-bottom: 1px solid var(--line);
}
.window-head .wt {
  font-family: Georgia, serif;
  font-size: 14px;
  color: var(--gold-2);
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.window-head .wc { color: var(--dim); font-size: 10px; white-space: nowrap; }
.window-head .spacer { flex: 1 1 auto; }
.window-head .back {
  background: none;
  border: 1px solid #3d3221;
  color: var(--muted);
  padding: 3px 8px;
  font-size: 10px;
  border-radius: 2px;
}
.window-head .back:hover { color: var(--gold-2); border-color: var(--gold-dark); }
.window-body {
  position: relative;
  padding: 10px;
  height: calc(100vh - 172px);
  min-height: 520px;
  max-height: 820px;
  overflow-y: auto;
  scrollbar-color: var(--line) #0c0a07;
  scrollbar-width: thin;
}
.window-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-height: 42px;
  padding: 7px 10px;
  background: #100d0a;
  border-top: 1px solid var(--line-warm);
}
.window-actions .hint { margin-left: auto; color: var(--dim); font-size: 10px; }

/* ---------- Правая панель ---------- */
.right-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 172px);
  min-height: 520px;
  max-height: 820px;
  background: linear-gradient(180deg, #17130e, #100d09);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.right-tabs { display: flex; flex: 0 0 auto; border-bottom: 1px solid var(--line); background: #120f0b; }
.right-tabs button {
  flex: 1 1 0;
  padding: 8px 4px;
  background: transparent;
  border: 0;
  border-right: 1px solid #241e15;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: .03em;
}
.right-tabs button:last-child { border-right: 0; }
.right-tabs button.active { color: var(--gold-2); background: rgba(217, 176, 97, .08); box-shadow: inset 0 -2px 0 var(--gold); }
.right-tabs button:hover { color: var(--text); }
.right-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px; scrollbar-color: var(--line) #0c0a07; scrollbar-width: thin; }
.right-section { border: 1px solid var(--line-soft); background: rgba(0, 0, 0, .16); margin-bottom: 8px; }
.right-section-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(217, 176, 97, .06);
  border-bottom: 1px solid var(--line-soft);
  color: var(--gold-2);
  font-family: Georgia, serif;
  font-size: 12px;
  letter-spacing: .03em;
}
.right-section-head .small { margin-left: auto; color: var(--dim); font-family: "Segoe UI", sans-serif; font-size: 9px; }
.right-section-body { padding: 7px 8px; }
.kv { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; font-size: 11px; }
.kv span { color: var(--dim); }
.kv b { color: var(--text); font-weight: 500; }
.sector-title { font-family: Georgia, serif; color: var(--gold-2); font-size: 14px; }
.sector-sub { color: var(--dim); font-size: 10px; margin: 2px 0 6px; }
.monster-line {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  border-bottom: 1px dotted #2a2318;
}
.monster-line:last-child { border-bottom: 0; }
.monster-line .ml-name { flex: 1 1 auto; min-width: 0; }
.monster-line .ml-name b { display: block; font-weight: 500; color: var(--text); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.monster-line .ml-name span { color: var(--dim); font-size: 9px; }
.monster-line .kind { font-size: 8px; padding: 1px 4px; border: 1px solid; border-radius: 2px; }
.empty-note { color: var(--dim); font-size: 11px; padding: 8px 0; line-height: 1.45; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: linear-gradient(#241e15, #17130e);
  color: var(--text);
  font-size: 11px;
  letter-spacing: .02em;
  line-height: 1.2;
}
.btn:hover { border-color: var(--gold-dark); color: var(--gold-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(#e3c37c, #b08a3f);
  border-color: #f0d79a;
  color: #201708;
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary:hover { background: linear-gradient(#f0d79a, #c49a4a); color: #1a1206; }
.btn-ghost { background: transparent; }
.btn-danger { border-color: #6d2c2c; color: #e0a0a0; }
.btn-danger:hover { border-color: #a84b4b; color: #ffd0d0; }
.btn-sm { min-height: 23px; padding: 2px 7px; font-size: 10px; }
.btn-wide { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 5px; }

/* ---------- Общие блоки ---------- */
.panel-box { border: 1px solid var(--line-soft); background: rgba(0, 0, 0, .18); padding: 10px; }
.panel-title { font-family: Georgia, serif; color: var(--gold-2); font-size: 15px; margin-bottom: 3px; }
.panel-sub { color: var(--dim); font-size: 11px; margin-bottom: 10px; line-height: 1.45; }
.divider { height: 1px; background: var(--line-soft); margin: 9px 0; }
.tag { display: inline-block; padding: 1px 5px; border: 1px solid var(--line); color: var(--muted); font-size: 9px; border-radius: 2px; }
.tag.gold { color: var(--gold-2); border-color: var(--gold-dark); }
.tag.red { color: #e0a0a0; border-color: #6d2c2c; }
.tag.green { color: var(--green-2); border-color: #3f6b41; }
.tag.blue { color: var(--blue-2); border-color: #34516f; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.gold { color: var(--gold-2); }
.small { font-size: 10px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---------- Городская карта ---------- */
.map-stage {
  position: relative;
  width: 100%;
  min-height: 540px;
  height: calc(100vh - 240px);
  max-height: 700px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.map-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0) 35%, rgba(4, 4, 3, .55) 100%);
  pointer-events: none;
}
.city-map-stage { background-image: url("../assets/city-map.jpg"); }
.island-map-stage { background-image: url("../assets/island-map.jpg"); background-position: center; }
.sector-map-stage { background-image: none; background-color: #0b1118; }
.full-map-stage { display: flex; align-items: center; justify-content: center; padding-top: 34px; }
.full-map-canvas {
  width: auto; height: auto;
  max-width: calc(100% - 18px); max-height: calc(100% - 44px);
  image-rendering: pixelated;
  border: 1px solid var(--gold-line);
  background: #0b1118;
  cursor: crosshair;
}
@media (max-width: 760px) {
  .full-map-stage { padding-top: 30px; }
  .full-map-canvas { max-width: 100%; max-height: calc(100% - 34px); }
}

.map-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: 0;
  padding: 0;
  z-index: 3;
  color: var(--text);
}
.hotspot-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(240, 215, 154, .65);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, rgba(74, 61, 40, .95), rgba(12, 10, 7, .95));
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .35), 0 0 14px rgba(217, 176, 97, .18);
  color: var(--gold-2);
  transition: transform .15s ease, box-shadow .15s ease;
}
.hotspot-icon svg { width: 18px; height: 18px; }
.hotspot-label {
  padding: 1px 5px;
  background: rgba(8, 7, 5, .82);
  border: 1px solid rgba(90, 72, 45, .7);
  color: #e7dcc5;
  font-size: 9px;
  white-space: nowrap;
  border-radius: 1px;
  text-shadow: 0 1px 1px #000;
}
.map-hotspot:hover .hotspot-icon { transform: scale(1.12); box-shadow: 0 0 0 2px rgba(0, 0, 0, .35), 0 0 20px rgba(217, 176, 97, .42); }
.map-hotspot.current .hotspot-icon { border-color: #f0d79a; box-shadow: 0 0 0 2px rgba(217, 176, 97, .35), 0 0 24px rgba(217, 176, 97, .5); }
.map-hotspot.current .hotspot-label { color: var(--gold-2); border-color: var(--gold-dark); }
.map-caption {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 4;
  padding: 5px 9px;
  background: rgba(8, 7, 5, .78);
  border: 1px solid var(--line);
  color: var(--gold-2);
  font-family: Georgia, serif;
  font-size: 13px;
  letter-spacing: .04em;
}
.map-caption small { display: block; color: var(--dim); font-family: "Segoe UI", sans-serif; font-size: 9px; letter-spacing: .03em; }
.city-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 6px;
}
.city-legend button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  background: #13100c;
  border: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 9px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.city-legend button:hover { border-color: var(--gold-dark); color: var(--gold-2); }
.city-legend svg { width: 13px; height: 13px; flex: 0 0 auto; }

/* ---------- Экран здания ---------- */
.building-hero {
  position: relative;
  min-height: 150px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line-soft);
  margin-bottom: 10px;
  display: flex;
  align-items: flex-end;
  padding: 10px;
}
.building-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 4, 3, .1), rgba(4, 4, 3, .9));
}
.building-hero .bh-inner { position: relative; z-index: 2; }
.building-hero h3 { font-size: 20px; color: var(--gold-2); text-shadow: 0 2px 4px #000; }
.building-hero p { margin: 2px 0 0; color: #c7bca8; font-size: 11px; max-width: 560px; text-shadow: 0 1px 2px #000; }
.building-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.building-card { border: 1px solid var(--line-soft); background: rgba(0, 0, 0, .18); padding: 10px; }
.building-card h4 { color: var(--gold-2); font-size: 13px; margin-bottom: 6px; }
.building-card p { font-size: 11px; color: var(--muted); }
.npc-row { display: flex; gap: 10px; align-items: flex-start; }
.npc-portrait { width: 86px; height: 106px; object-fit: cover; border: 1px solid var(--gold-line); flex: 0 0 auto; }
.npc-text { font-size: 12px; line-height: 1.5; color: #d6ccb9; }
.npc-text b { color: var(--gold-2); }
.quest-preview { border: 1px solid var(--line-soft); background: rgba(0, 0, 0, .2); padding: 8px; margin-top: 8px; }
.quest-preview h4 { color: var(--gold-2); font-size: 12px; margin-bottom: 3px; }
.quest-preview p { margin: 0 0 6px; font-size: 11px; color: var(--muted); }
.quest-progress { height: 6px; background: #090806; border: 1px solid #332a1c; margin: 5px 0; }
.quest-progress i { display: block; height: 100%; background: linear-gradient(90deg, #8a6a33, #d9b061); }

/* ---------- Остров: сетка секторов ---------- */
.island-wrap { position: relative; }
.sector-terrain-canvas {
  position: absolute;
  left: 3.5%;
  right: 3.5%;
  top: 5%;
  bottom: 5%;
  width: calc(93% - 0px);
  height: 90%;
  z-index: 1;
  pointer-events: none;
  border: 1px solid rgba(20, 16, 10, .45);
  opacity: .96;
}
.sector-grid {
  position: absolute;
  inset: 5% 3.5%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 2px;
  z-index: 2;
}
.sector-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(20, 16, 10, .55);
  background: rgba(10, 11, 8, .18);
  color: #efe6d2;
  font-size: 9px;
  transition: background .15s ease, box-shadow .15s ease;
}
.sector-cell .sector-icon svg { width: 21px; height: 21px; display: block; filter: drop-shadow(0 1px 2px #000); }
.sector-cell .sector-coord { position: absolute; left: 2px; top: 1px; font-size: 7px; color: rgba(239, 230, 210, .62); }
.sector-cell.terrain-forest { background: rgba(33, 63, 33, .45); }
.sector-cell.terrain-meadow { background: rgba(96, 103, 52, .36); }
.sector-cell.terrain-hills { background: rgba(91, 80, 61, .46); }
.sector-cell.terrain-swamp { background: rgba(55, 61, 46, .55); }
.sector-cell.terrain-ruins { background: rgba(64, 68, 81, .5); }
.sector-cell.terrain-gate { background: rgba(138, 106, 51, .55); }
.sector-cell.water { background: rgba(13, 31, 44, .3); border-color: rgba(40, 70, 90, .2); cursor: default; }
.sector-cell.unvisited { background: rgba(5, 6, 7, .82); border-color: #1d1a14; color: transparent; }
.sector-cell.unvisited .sector-icon, .sector-cell.unvisited .sector-coord, .sector-cell.unvisited .marker { visibility: hidden; }
.sector-cell.reachable { cursor: pointer; box-shadow: inset 0 0 0 1px rgba(240, 215, 154, .18); }
.sector-cell.reachable:hover { background: rgba(217, 176, 97, .26); box-shadow: inset 0 0 0 1px rgba(240, 215, 154, .7); z-index: 2; }
.sector-cell.current { box-shadow: inset 0 0 0 2px #f0d79a, 0 0 16px rgba(217, 176, 97, .5); z-index: 3; }
.sector-cell .marker {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b84a4a;
  box-shadow: 0 0 6px rgba(224, 102, 102, .8);
  right: 3px;
  bottom: 3px;
}
.sector-cell .marker.fish { background: #5c9fe0; box-shadow: 0 0 6px rgba(92, 159, 224, .8); }
.sector-cell .marker.tree { background: #6fbf73; box-shadow: 0 0 6px rgba(111, 191, 115, .8); }
.sector-cell .marker.ore { background: #d9a441; box-shadow: 0 0 6px rgba(217, 164, 65, .8); }
.dungeon-list { display: grid; gap: 6px; }
.dungeon-list-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px; border: 1px solid #332a1c; background: rgba(0,0,0,.14); }
.dlr-main { display: grid; gap: 2px; min-width: 0; }
.dlr-main b { color: var(--gold-2); font-family: Georgia, serif; font-size: 14px; }
.dlr-main span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.dlr-main small { color: var(--dim); font-size: 9px; }
.dlr-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex: 0 0 auto; }
@media (max-width:760px) {
  .dungeon-list-row { flex-direction: column; align-items: stretch; }
  .dlr-actions { align-items: flex-start; }
}

.dungeon-screen { display: grid; gap: 10px; }
.dungeon-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); background: linear-gradient(135deg, rgba(40,28,18,.8), rgba(12,12,10,.7)); }
.dungeon-title { font-family: Georgia, serif; font-size: 22px; color: var(--gold-2); }
.dungeon-sub { font-size: 11px; color: var(--dim); margin-top: 3px; }
.dungeon-progress { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.dungeon-room-dot { width: 10px; height: 10px; border-radius: 50%; background: #2b251b; border: 1px solid var(--gold-line); display: block; }
.dungeon-room-dot.cleared { background: #6fbf73; border-color: #6fbf73; }
.dungeon-room-dot.active { background: #f0d79a; border-color: #f0d79a; box-shadow: 0 0 8px rgba(240,215,154,.7); }
.dungeon-room-desc { padding: 9px 11px; border-left: 2px solid #8a6a33; background: rgba(0,0,0,.18); color: #d6ccb9; font-size: 12px; line-height: 1.5; }
.dungeon-section { border: 1px solid #332a1c; background: rgba(0,0,0,.12); padding: 8px; }
.dungeon-section h4 { margin: 0 0 6px; font-size: 12px; color: var(--gold-2); }
.dungeon-exits { display: flex; flex-wrap: wrap; gap: 5px; }
.dungeon-exit-btn { min-height: 28px; font-size: 10px; }
.dungeon-complete { padding: 10px; text-align: center; border: 1px solid #6fbf73; color: #b9e6a8; background: rgba(38,86,40,.25); font-family: Georgia, serif; }
@media (max-width:760px) {
  .dungeon-head { flex-direction: column; }
  .dungeon-progress { justify-content: flex-start; }
  .dungeon-monster-line { grid-template-columns: 26px minmax(0,1fr); }
  .dungeon-monster-line .kind,
  .dungeon-monster-line .btn { grid-column: 2; }
}

.sector-monster {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 24px;
  height: 34px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.48);
  border: 1px solid rgba(240,215,154,.35);
  border-radius: 3px;
  cursor: pointer;
  z-index: 4;
}
.sector-monster img { width: 18px; height: 30px; object-fit: contain; filter: drop-shadow(0 1px 2px #000); }
.sector-monster i { position: absolute; right: -2px; bottom: -2px; font-size: 7px; font-style: normal; background: #b84a4a; color: #fff; border-radius: 50%; width: 10px; height: 10px; display: grid; place-items: center; box-shadow: 0 0 5px rgba(184,74,74,.8); }
.monster-line { display: grid; grid-template-columns: 30px minmax(0,1fr) auto auto auto; gap: 5px; align-items: center; padding: 3px 0; border-bottom: 1px dotted rgba(90,72,45,.22); }
.ml-icon { width: 24px; height: 32px; border: 1px solid rgba(240,215,154,.25); border-radius: 3px; background: rgba(0,0,0,.3); display: grid; place-items: center; overflow: hidden; }
.ml-icon img { width: 18px; height: 28px; object-fit: contain; filter: drop-shadow(0 1px 2px #000); }
.monster-modal .monster-encounter { display: grid; grid-template-columns: 72px minmax(0,1fr); gap: 10px; align-items: start; }
.monster-sheet { display: grid; gap: 10px; }
.monster-head { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: 10px; align-items: start; }
.monster-portrait { width: 78px; height: 108px; object-fit: contain; border: 1px solid var(--gold-line); background: rgba(0,0,0,.28); }
.monster-sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.monster-sheet-card { border: 1px solid #332a1c; background: rgba(0,0,0,.16); padding: 7px; }
.monster-sheet-card h4 { margin: 0 0 4px; font-size: 11px; color: var(--gold-2); }
.monster-sheet-section h4 { margin: 0 0 5px; font-size: 12px; color: var(--gold-2); }
.monster-sheet-section h4 small { font-weight: normal; color: var(--dim); font-size: 9px; }
.monster-gear, .monster-drops { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
.monster-gear-item, .monster-drop-item { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 5px; align-items: center; padding: 4px 5px; border: 1px solid #332a1c; background: rgba(0,0,0,.14); font-size: 10px; }
.monster-drop-item { grid-template-columns: 24px minmax(0,1fr) auto; }
.mg-icon, .md-icon { width: 22px; height: 22px; display: grid; place-items: center; }
.mg-slot { grid-column: 1 / -1; font-size: 8px; color: var(--dim); }
.mg-icon b, .md-icon b { font-size: 10px; }
.monster-drop-item small { color: var(--dim); font-size: 8px; }
@media (max-width:760px) {
  .monster-sheet-grid, .monster-gear, .monster-drops { grid-template-columns: 1fr; }
  .monster-line { grid-template-columns: 26px minmax(0,1fr); }
  .monster-line .kind, .monster-line .btn { grid-column: 2; }
}
.sector-player {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f0d79a;
  border: 1px solid #6b4d1d;
  box-shadow: 0 0 10px rgba(240, 215, 154, .9);
  z-index: 4;
  pointer-events: none;
}
.island-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; color: var(--dim); font-size: 9px; }
.island-legend span { display: inline-flex; align-items: center; gap: 3px; }
.island-legend i { width: 8px; height: 8px; display: block; border-radius: 1px; }

/* ---------- Бой ---------- */
.combat-screen { position: relative; }
.combat-scene {
  position: relative;
  height: 190px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line-warm);
  margin-bottom: 8px;
}
.combat-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 4, 3, .15), rgba(4, 4, 3, .86));
}
.combat-round {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  padding: 3px 8px;
  background: rgba(8, 7, 5, .78);
  border: 1px solid var(--line);
  color: var(--gold-2);
  font-family: Georgia, serif;
  font-size: 12px;
}
.combat-scene-name {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  color: #d8cdb8;
  font-size: 10px;
  text-shadow: 0 1px 2px #000;
}
.enemy-card {
  position: absolute;
  left: 8px;
  bottom: 8px;
  right: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: rgba(10, 8, 6, .82);
  border: 1px solid var(--gold-line);
  backdrop-filter: blur(2px);
}
.enemy-card .ec-name { min-width: 0; flex: 0 0 auto; }
.enemy-card .ec-name b { display: block; font-family: Georgia, serif; font-size: 15px; color: var(--gold-2); white-space: nowrap; }
.enemy-card .ec-name span { color: var(--dim); font-size: 9px; }
.enemy-card .ec-bar { flex: 1 1 auto; }
.enemy-card .ec-bar .bar { height: 14px; }
.enemy-card .ec-meta { color: var(--dim); font-size: 9px; white-space: nowrap; }
.enemy-card .ec-meta b { color: var(--text); }

.battle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}
.fighter {
  position: relative;
  border: 1px solid var(--line-soft);
  background: radial-gradient(ellipse at 50% 30%, rgba(217, 176, 97, .07), rgba(0, 0, 0, .22));
  padding: 6px 4px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 248px;
}
.fighter.enemy { border-color: #4b2b2b; background: radial-gradient(ellipse at 50% 30%, rgba(184, 74, 74, .1), rgba(0, 0, 0, .24)); }
.fighter.player { border-color: #2b3c4b; background: radial-gradient(ellipse at 50% 30%, rgba(79, 127, 184, .1), rgba(0, 0, 0, .24)); }
.fighter-label { font-size: 9px; letter-spacing: .11em; text-transform: uppercase; color: var(--dim); margin-bottom: 2px; }
.fighter-name { font-family: Georgia, serif; font-size: 13px; color: var(--gold-2); margin-bottom: 1px; text-align: center; }
.body-svg { width: 100%; max-width: 178px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.body-svg .silhouette { fill: #262622; stroke: #59544a; stroke-width: 1.2; }
.fighter.enemy .silhouette { fill: #2b2421; stroke: #6b5148; }
.fighter.player .silhouette { fill: #20262b; stroke: #4b5b68; }
.zone { cursor: pointer; }
.zone circle {
  fill: rgba(12, 10, 8, .75);
  stroke-width: 1.6;
  transition: fill .12s ease, r .12s ease;
}
.zone.enemy circle { stroke: #c25050; }
.zone.player circle { stroke: #5b8fc9; }
.zone:hover circle { fill: rgba(217, 176, 97, .28); }
.zone text { fill: #f2ead9; font-size: 11px; font-weight: 600; text-anchor: middle; dominant-baseline: central; font-family: "Segoe UI", sans-serif; pointer-events: none; }
.zone.has-count.enemy circle { fill: rgba(184, 74, 74, .55); }
.zone.has-count.player circle { fill: rgba(79, 127, 184, .55); }
.zone-hint { font-size: 8px; color: var(--dim); text-align: center; margin-top: 2px; }
.fighter-portrait { position: relative; width: 100%; max-width: 190px; aspect-ratio: 1 / 1; margin: 4px auto 2px; overflow: hidden; border: 1px solid #332b1f; background: #0c0a08; }
.fighter-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; display: block; }
.zone-mark {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 1.6px solid #c25050;
  background: rgba(12, 10, 8, .72);
  color: #f2ead9;
  font-family: "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background .12s ease, box-shadow .12s ease;
}
.zone-mark.player { border-color: #5b8fc9; }
.zone-mark:hover { background: rgba(217, 176, 97, .32); box-shadow: 0 0 0 2px rgba(217,176,97,.35); }
.zone-mark.enemy.has-count { background: rgba(184, 74, 74, .72); }
.zone-mark.player.has-count { background: rgba(79, 127, 184, .72); }
.battle-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, .2);
  padding: 8px 4px;
  text-align: center;
}
.battle-center .vs { font-family: Georgia, serif; color: var(--gold-dark); font-size: 18px; }
.ap-big { font-family: Georgia, serif; font-size: 20px; color: var(--gold-2); line-height: 1; }
.ap-label { color: var(--dim); font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.plan-line { font-size: 9px; color: var(--muted); line-height: 1.4; }
.plan-line b { color: var(--text); }
.ap-warning { color: #e0a0a0; font-size: 9px; line-height: 1.35; }

.combat-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  margin-bottom: 8px;
}
.ct-side {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #2b3c4b;
  background: linear-gradient(135deg, rgba(24, 37, 46, .75), rgba(10, 10, 9, .72));
}
.ct-side.enemy { border-color: #4b2b2b; background: linear-gradient(135deg, rgba(46, 25, 24, .75), rgba(10, 10, 9, .72)); }
.ct-head { display: flex; align-items: baseline; gap: 7px; margin-bottom: 4px; }
.ct-head b { font-family: Georgia, serif; font-size: 13px; color: var(--gold-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-head span { color: var(--dim); font-size: 9px; white-space: nowrap; }
.ct-side.enemy .ct-head { justify-content: flex-end; text-align: right; }
.ct-bars { display: grid; gap: 3px; }
.ct-bars .bar { height: 12px; }
.ct-bars .bar span { font-size: 8px; }
.ct-note { margin-top: 3px; color: var(--dim); font-size: 8px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 74px; padding: 4px 6px; border: 1px solid var(--line-warm); background: rgba(0,0,0,.28); text-align: center; }
.ct-mid b { font-family: Georgia, serif; color: var(--gold-2); font-size: 11px; white-space: nowrap; }
.ct-mid span { color: var(--dim); font-size: 8px; }
.ct-timer { font-family: Georgia, serif; color: #e8dcc4; font-size: 20px; line-height: 1.05; margin: 2px 0; }
.ct-timer.warn { color: #e06666; animation: timerPulse .8s ease-in-out infinite; }
@keyframes timerPulse { 50% { opacity: .45; } }

.combat-arena {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr);
  gap: 7px;
  align-items: stretch;
}
.combat-board-wrap { display: flex; justify-content: center; gap: 5px; margin-bottom: 8px; }
.board-labels { display: grid; grid-auto-rows: 54px; gap: 4px; width: 14px; color: var(--dim); font-size: 9px; text-align: center; align-items: center; }
.combat-board { display: grid; grid-template-columns: repeat(4, 54px); gap: 4px; }
.board-cell {
  position: relative;
  width: 54px;
  height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 1px solid var(--line-soft);
  background: rgba(0,0,0,.18);
  color: var(--text);
  padding: 2px;
  overflow: hidden;
  font-family: inherit;
}
.board-cell:nth-child(4n+1), .board-cell:nth-child(4n+2) { background: rgba(40, 62, 82, .23); }
.board-cell:nth-child(4n+3), .board-cell:nth-child(4n+4) { background: rgba(82, 40, 40, .2); }
.board-cell.occupied { cursor: default; }
.board-cell img { width: 30px; height: 40px; object-fit: contain; }
.board-cell span { max-width: 50px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 7px; color: #d8cdb8; }
.board-cell b { font-size: 7px; color: #d9a5a5; font-weight: 500; }
.board-cell.player-cell { border-color: #4f7fb8; }
.board-cell.enemy-cell { border-color: #7d3b3b; cursor: pointer; }
.board-cell.enemy-cell.active { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.board-cell.enemy-cell.far { opacity: .55; }
.board-cell.enemy-cell.dead { opacity: .35; }
.board-cell.reachable { border-style: dashed; border-color: var(--gold-line); cursor: pointer; }
.board-cell.reachable:hover { background: rgba(217,176,97,.22); border-color: var(--gold); }
.board-hp { display: block; width: 42px; height: 4px; background: #3a2020; border: 1px solid #241414; }
.board-hp em { display: block; height: 100%; background: #b24b4b; }
.combat-fighters { display: grid; grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr); gap: 7px; align-items: stretch; }
.fighter-panel { display: flex; flex-direction: column; min-width: 0; }
.fighter-panel .fighter { width: 100%; flex: 1 1 auto; min-height: 0; }
.fighter-pos { text-align: center; color: var(--dim); font-size: 8px; padding: 2px 0; }
.arena-side { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.enemy-roster { display: grid; gap: 3px; margin-bottom: 2px; }
.enemy-roster-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 3px 5px;
  border: 1px solid #3a2b28;
  background: rgba(18, 12, 11, .8);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.enemy-roster-row img { width: 26px; height: 34px; object-fit: contain; }
.enemy-roster-row .er-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.enemy-roster-row .er-name small { display: block; color: var(--dim); font-size: 8px; }
.enemy-roster-row .er-hp { color: #d9a5a5; font-size: 9px; white-space: nowrap; }
.enemy-roster-row.active { border-color: var(--gold); background: rgba(217, 176, 97, .12); }
.enemy-roster-row.dead { opacity: .42; cursor: default; }
.enemy-roster-row.dead .er-hp { color: var(--dim); }
.arena-row-label { color: var(--dim); font-size: 8px; letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.arena-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border: 1px solid var(--line-soft);
  background: radial-gradient(ellipse at 50% 40%, rgba(217, 176, 97, .05), rgba(0, 0, 0, .22));
}
.arena-row.occupied { min-height: 236px; }
.arena-row.empty { min-height: 58px; border-style: dashed; background: rgba(0,0,0,.16); }
.arena-row .fighter { border: 0; background: transparent; min-height: 0; padding: 0 2px; width: 100%; }
.arena-row .body-svg { max-width: 176px; }
.arena-empty { color: #5c5344; font-family: Georgia, serif; font-size: 22px; }
.arena-move, .arena-move-note {
  position: absolute;
  right: 5px;
  bottom: 4px;
  z-index: 4;
  font-size: 9px;
}
.arena-move {
  border: 1px solid var(--gold-line);
  background: rgba(12, 10, 7, .9);
  color: var(--gold-2);
  padding: 2px 6px;
  cursor: pointer;
  font-family: inherit;
}
.arena-move:hover { background: rgba(217, 176, 97, .16); }
.arena-move-note { color: var(--dim); pointer-events: none; }
.arena-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 5px;
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, .24);
  text-align: center;
}
.arena-center .plan-line { font-size: 9px; }
.arena-go { width: 100%; max-width: 120px; min-height: 36px; font-size: 12px; }
.arena-row-hint { color: var(--dim); font-size: 8px; line-height: 1.35; max-width: 132px; }

.combat-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 7px;
  border: 1px solid var(--line-soft);
  background: #100d0a;
}
.combat-controls .ap-meter { min-width: 128px; flex: 0 0 auto; }
.combat-controls .ap-meter .bar { height: 8px; }
.combat-controls .ap-meter small { display: block; color: var(--dim); font-size: 8px; margin-top: 1px; }
.combat-controls .btn-primary { min-width: 108px; }
.potion-row { display: flex; gap: 5px; flex-wrap: wrap; width: 100%; border-top: 1px solid #241e15; padding-top: 6px; margin-top: 2px; }
.potion-row .btn { font-size: 9px; min-height: 23px; }

.combat-log {
  margin-top: 8px;
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid var(--line-soft);
  background: #0a0806;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.5;
  scrollbar-color: var(--line) #0c0a07;
  scrollbar-width: thin;
}
.combat-log div { padding: 1px 0; border-bottom: 1px dotted rgba(45, 38, 27, .5); }
.combat-log div:last-child { border-bottom: 0; }
.combat-log .system { color: var(--dim); }
.combat-log .hit { color: #d9a5a5; }
.combat-log .crit { color: var(--gold-2); }
.combat-log .block { color: var(--blue-2); }
.combat-log .dodge { color: #9aa3ad; }
.combat-log .heal { color: var(--green-2); }
.combat-log .victory { color: var(--gold-2); font-weight: 600; }
.combat-log .defeat { color: #e06666; font-weight: 600; }
.combat-log .round { color: var(--gold-dark); }

.combat-result { position: relative; margin-top: 8px; border: 1px solid var(--gold-line); background: linear-gradient(180deg, #211b12, #120f0b); padding: 12px; }
.combat-result h3 { font-size: 22px; color: var(--gold-2); margin-bottom: 4px; }
.combat-result.lost h3 { color: #e06666; }
.combat-result p { color: var(--muted); font-size: 11px; }
.reward-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 7px 0; }
.reward-list span { padding: 3px 7px; border: 1px solid #3d3221; background: #0d0b08; font-size: 11px; }
.reward-list span.gold { color: var(--gold-2); }
.reward-list span.green { color: var(--green-2); }
.reward-list span.blue { color: var(--blue-2); }

/* ---------- Персонаж ---------- */
.char-layout { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 10px; }
.char-paper { border: 1px solid var(--line-soft); background: rgba(0, 0, 0, .2); padding: 10px; }
.char-portrait { width: 100%; aspect-ratio: 1 / 1.15; object-fit: cover; border: 1px solid var(--gold-line); display: block; }
.char-name { font-family: Georgia, serif; text-align: center; color: var(--gold-2); font-size: 18px; margin-top: 8px; }
.char-sub { text-align: center; color: var(--dim); font-size: 10px; margin-bottom: 8px; }
.char-vitals .bar { margin-bottom: 5px; height: 15px; }
.equip-list { display: flex; flex-direction: column; gap: 2px; }
.equip-slot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 5px;
  border: 1px solid #241e15;
  background: rgba(0, 0, 0, .14);
  min-height: 24px;
}
.equip-slot .slot-short { width: 28px; color: var(--dim); font-size: 8px; letter-spacing: .06em; flex: 0 0 auto; }
.equip-slot .slot-name { flex: 1 1 auto; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.equip-slot .slot-name.empty { color: #4f4a40; }
.equip-slot button { background: none; border: 0; color: var(--dim); font-size: 11px; padding: 0 3px; }
.equip-slot button:hover { color: var(--red-2); }

.stat-list { display: flex; flex-direction: column; gap: 3px; }
.attr-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border: 1px solid #241e15;
  background: rgba(0, 0, 0, .15);
}
.attr-row .attr-name { flex: 1 1 auto; }
.attr-row .attr-name b { display: block; font-weight: 500; font-size: 12px; }
.attr-row .attr-name span { color: var(--dim); font-size: 9px; }
.attr-row .attr-value { font-family: Georgia, serif; font-size: 17px; color: var(--gold-2); min-width: 26px; text-align: right; }
.attr-row.locked { opacity: .45; }
.attr-add {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold-line);
  background: #211b12;
  color: var(--gold-2);
  font-size: 13px;
  line-height: 1;
  padding: 0;
}
.attr-add:hover { background: var(--line-warm); }
.derived-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.derived-box { border: 1px solid #241e15; padding: 4px 7px; background: rgba(0, 0, 0, .14); }
.derived-box span { display: block; color: var(--dim); font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
.derived-box b { font-family: Georgia, serif; font-size: 14px; color: var(--text); font-weight: normal; }
.armor-mini { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 4px; }
.armor-mini span { font-size: 9px; color: var(--muted); border: 1px solid #241e15; padding: 1px 4px; }
.armor-mini b { color: var(--text); font-weight: 500; }

/* ---------- Инвентарь и магазин ---------- */
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.item-card {
  position: relative;
  border: 1px solid var(--line-soft);
  border-left-width: 3px;
  background: rgba(0, 0, 0, .18);
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.item-card h4 { font-family: Georgia, serif; font-size: 12px; color: var(--text); line-height: 1.25; }
.item-card .item-sub { color: var(--dim); font-size: 9px; }
.item-card .item-stats { color: var(--muted); font-size: 10px; line-height: 1.4; }
.item-card .item-foot { display: flex; align-items: center; gap: 5px; margin-top: auto; padding-top: 5px; }
.item-card .item-price { color: var(--gold-2); font-size: 10px; margin-left: auto; white-space: nowrap; }
.item-card .item-desc { color: var(--dim); font-size: 9px; line-height: 1.4; font-style: italic; }
.item-card .btn { min-height: 22px; font-size: 9px; padding: 2px 6px; }
.item-card.rare { border-left-color: #5c9fe0; }
.item-card.epic { border-left-color: #b47ce0; }
.item-card.uncommon { border-left-color: #6fbf73; }
.item-card.common { border-left-color: #7a7468; }
.req-warn { color: #d08a8a; font-size: 9px; }
.shop-tabs { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.shop-tabs button { padding: 4px 9px; background: #13100c; border: 1px solid #3d3221; color: var(--muted); font-size: 10px; }
.shop-tabs button.active { color: var(--gold-2); border-color: var(--gold-dark); background: rgba(217, 176, 97, .1); }
.shop-section { margin-bottom: 12px; }
.shop-section h4 { font-family: Georgia, serif; color: var(--gold-2); font-size: 13px; margin-bottom: 5px; border-bottom: 1px solid var(--line-soft); padding-bottom: 3px; }
.shop-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-bottom: 1px dotted var(--line-soft);
}
.shop-row:last-child { border-bottom: 0; }
.shop-row .sr-name { flex: 1 1 auto; min-width: 0; }
.shop-row .sr-name b { display: block; font-weight: 500; font-size: 11px; }
.shop-row .sr-name span { color: var(--dim); font-size: 9px; }
.shop-row .sr-price { color: var(--gold-2); font-size: 10px; white-space: nowrap; }
.shop-row .btn { min-height: 22px; font-size: 9px; padding: 2px 6px; }
.res-row { display: flex; align-items: center; gap: 7px; padding: 4px 0; border-bottom: 1px dotted var(--line-soft); }
.res-row:last-child { border-bottom: 0; }
.res-row .res-name { flex: 1 1 auto; font-size: 11px; }
.res-row .res-count { color: var(--gold-2); font-size: 11px; min-width: 30px; text-align: right; }
.res-row .res-price { color: var(--dim); font-size: 9px; min-width: 50px; text-align: right; }

/* ---------- Задания ---------- */
.quest-list { display: flex; flex-direction: column; gap: 7px; }
.quest-card { border: 1px solid var(--line-soft); background: rgba(0, 0, 0, .18); padding: 9px; }
.quest-card.ready { border-color: #6b5531; background: rgba(217, 176, 97, .06); }
.quest-card h4 { font-family: Georgia, serif; font-size: 14px; color: var(--gold-2); margin-bottom: 2px; }
.quest-card .q-giver { color: var(--dim); font-size: 9px; margin-bottom: 4px; }
.quest-card p { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.quest-card .q-foot { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.quest-card .q-reward { color: var(--gold-2); font-size: 10px; }
.quest-card .q-progress-text { color: var(--dim); font-size: 10px; margin-left: auto; }

/* ---------- Профессии ---------- */
.prof-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.prof-card { border: 1px solid var(--line-soft); background: rgba(0, 0, 0, .18); padding: 9px; }
.prof-card.locked { opacity: .55; }
.prof-card h4 { font-family: Georgia, serif; color: var(--gold-2); font-size: 14px; }
.prof-card .prof-sub { color: var(--dim); font-size: 9px; margin: 1px 0 5px; }
.prof-card p { font-size: 10px; color: var(--muted); margin-bottom: 5px; }
.prof-bar { height: 6px; background: #090806; border: 1px solid #332a1c; margin: 4px 0; }
.prof-bar i { display: block; height: 100%; background: linear-gradient(90deg, #5d7f3f, #9bbf6a); }
.prof-foot { display: flex; align-items: center; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.prof-foot .small { margin-left: auto; }

/* ---------- Правая панель: сектор, чат, лог ---------- */
.sector-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.sector-actions .btn { flex: 1 1 auto; font-size: 9px; min-height: 24px; padding: 2px 5px; }
.move-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; width: 100%; margin-top: 6px; }
.move-pad button { min-height: 26px; font-size: 10px; }
.move-pad .move-up { grid-column: 2; }
.move-pad .move-left { grid-column: 1; grid-row: 2; }
.move-pad .move-city { grid-column: 2; grid-row: 2; font-size: 8px; }
.move-pad .move-right { grid-column: 3; grid-row: 2; }
.move-pad .move-down { grid-column: 2; grid-row: 3; }
.chat-feed { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; }
.chat-msg { font-size: 11px; line-height: 1.45; word-wrap: break-word; padding-bottom: 3px; border-bottom: 1px dotted rgba(45, 38, 27, .55); }
.chat-msg .chat-time { color: #504a40; font-size: 8px; margin-right: 4px; }
.chat-msg .chat-name { font-weight: 600; }
.chat-msg.self { color: #e8dfcd; }
.chat-box { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-box .chat-feed { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.chat-channels { display: flex; gap: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line-soft); }
.chat-channels button { flex: 0 0 auto; padding: 3px 10px; font-size: 11px; background: rgba(0,0,0,.25); border: 1px solid #332a1c; border-radius: 3px; color: var(--dim); cursor: pointer; font-family: inherit; }
.chat-channels button.active { color: var(--gold-2); border-color: var(--gold-dark); background: rgba(169,139,78,.14); }
.challenge-pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border: 1px solid #7a4038; border-radius: 13px; background: linear-gradient(180deg, #5a2620, #3a1712); color: #ffd9c8; font-size: 11px; font-family: inherit; cursor: pointer; animation: challengePulse 1.8s ease-in-out infinite; }
.challenge-pill b { color: #fff; font-weight: 700; }
@keyframes challengePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(185, 90, 74, 0); } 50% { box-shadow: 0 0 8px 1px rgba(185, 90, 74, .55); } }
.chat-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 15px; height: 15px; margin-left: 5px; padding: 0 4px; border-radius: 8px; background: #b95a4a; color: #fff3e6; font-size: 9.5px; font-weight: 600; line-height: 1; vertical-align: middle; }
.dock-tabs .chat-badge { margin-left: 4px; }
.chat-input { display: flex; gap: 4px; padding-top: 6px; border-top: 1px solid var(--line-soft); margin-top: 5px; }
.chat-input input { flex: 1 1 auto; min-width: 0; height: 26px; background: #090806; border: 1px solid #332a1c; color: var(--text); padding: 0 6px; font-size: 11px; }
.chat-input input:focus { outline: 1px solid var(--gold-2); box-shadow: 0 0 0 1px rgba(217,176,97,.35); }
.chat-input button { height: 26px; padding: 0 8px; }
.log-list { display: flex; flex-direction: column; gap: 3px; }
.log-line { font-size: 10px; line-height: 1.45; color: var(--muted); padding-bottom: 3px; border-bottom: 1px dotted rgba(45, 38, 27, .5); }
.log-line time { color: #504a40; font-size: 8px; margin-right: 4px; }
.log-line.level, .log-line.quest { color: var(--gold-2); }
.log-line.combat { color: #d9a5a5; }
.log-line.heal, .log-line.gather, .log-line.craft { color: var(--green-2); }
.log-line.trade { color: var(--blue-2); }


/* ---------- Стартовый экран ---------- */
.start-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(4, 5, 6, .45), rgba(4, 5, 6, .94)),
    url("../assets/bg-hero.jpg") center / cover no-repeat;
}
.start-card {
  position: relative;
  width: min(1060px, 100%);
  padding: 28px 34px 26px;
  background: rgba(14, 12, 9, .88);
  border: 1px solid #6b5531;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .75), inset 0 0 0 1px rgba(240, 215, 154, .08);
  backdrop-filter: blur(5px);
}
.start-card::before, .start-card::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: var(--gold);
  border-style: solid;
  pointer-events: none;
}
.start-card::before { left: 6px; top: 6px; border-width: 1px 0 0 1px; }
.start-card::after { right: 6px; bottom: 6px; border-width: 0 1px 1px 0; }
.start-kicker { text-align: center; color: var(--gold); font-size: 10px; letter-spacing: .32em; text-transform: uppercase; }
.start-title {
  margin: 6px 0 2px;
  text-align: center;
  font-family: Georgia, serif;
  font-size: clamp(38px, 6.5vw, 64px);
  letter-spacing: .12em;
  line-height: 1.05;
  background: linear-gradient(180deg, #f7e9c3, #c69a4a 70%, #8a6a33);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .65));
}
.start-sub { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .06em; margin-bottom: 20px; }
.start-grid { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 28px; align-items: start; }
.start-copy h3 { color: var(--gold-2); font-size: 17px; margin-bottom: 6px; }
.start-copy p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.start-features { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 7px; }
.start-features li { display: flex; gap: 8px; color: #cfc5b1; font-size: 12px; line-height: 1.45; }
.start-features li::before { content: "◆"; color: var(--gold); font-size: 9px; line-height: 1.8; }
.start-form { border: 1px solid #3d3221; background: rgba(0, 0, 0, .22); padding: 14px; }
.start-form label { display: block; color: var(--dim); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px; }
.start-form input {
  width: 100%;
  height: 36px;
  background: #090806;
  border: 1px solid var(--line);
  color: var(--gold-2);
  padding: 0 9px;
  font-size: 15px;
  font-family: Georgia, serif;
  letter-spacing: .04em;
}
.start-form input:focus { outline: 1px solid var(--gold-dark); }
.portrait-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.portrait-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  background: #100d0a;
  border: 1px solid #332a1c;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}
.portrait-card img { width: 100%; height: auto; aspect-ratio: 1 / 1.1; object-fit: cover; display: block; filter: saturate(.85) brightness(.85); }
.portrait-card:hover { border-color: var(--gold-dark); color: var(--gold-2); }
.portrait-card.selected { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(217, 176, 97, .4); color: var(--gold-2); }
.portrait-card.selected img { filter: saturate(1) brightness(1); }
.start-actions { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.start-actions .btn { height: 40px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.start-note { color: var(--dim); font-size: 9px; text-align: center; line-height: 1.5; margin-top: 8px; }

/* ---------- Модальные окна ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 4, 5, .8);
  backdrop-filter: blur(3px);
}
.modal {
  width: min(780px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #1b1610, #100d09);
  border: 1px solid #6b5531;
  box-shadow: var(--shadow);
}
.modal.small { width: min(430px, 100%); }
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-bottom: 1px solid #3d3221;
  background: rgba(217, 176, 97, .06);
}
.modal-head h3 { font-family: Georgia, serif; color: var(--gold-2); font-size: 16px; letter-spacing: .04em; flex: 1 1 auto; }
.modal-close { background: none; border: 0; color: var(--dim); font-size: 18px; line-height: 1; padding: 2px 5px; }
.modal-close:hover { color: var(--red-2); }
.modal-body { padding: 13px; }
.modal-foot { padding: 10px 13px; border-top: 1px solid #3d3221; display: flex; gap: 6px; flex-wrap: wrap; }
.modal p { font-size: 12px; color: var(--muted); }
.modal h4 { color: var(--gold-2); font-size: 13px; margin: 10px 0 5px; }
.menu-buttons { display: flex; flex-direction: column; gap: 6px; }
.menu-buttons .btn { justify-content: flex-start; min-height: 34px; }

/* ---------- Работа (прогресс) ---------- */
.work-overlay { z-index: 120; }
.work-modal {
  width: min(390px, 100%);
  padding: 18px;
  background: linear-gradient(180deg, #1d1811, #100d09);
  border: 1px solid #6b5531;
  box-shadow: var(--shadow);
  text-align: center;
}
.work-modal h3 { color: var(--gold-2); font-size: 18px; margin-bottom: 4px; }
.work-modal p { color: var(--muted); font-size: 11px; margin-bottom: 10px; }
.work-bar { height: 12px; background: #090806; border: 1px solid var(--line); overflow: hidden; }
.work-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8a6a33, #e3c37c); transition: width .12s linear; }
.work-hint { color: var(--dim); font-size: 10px; margin-top: 6px; }
.work-modal .btn { margin-top: 10px; }

/* ---------- Тосты и цифры урона ---------- */
#toastRoot {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 140;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: min(440px, calc(100vw - 24px));
  pointer-events: none;
}
.toast {
  padding: 7px 11px;
  background: rgba(16, 13, 10, .96);
  border: 1px solid #6b5531;
  color: var(--text);
  font-size: 11px;
  line-height: 1.4;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5);
  animation: toastIn .18s ease-out;
}
.toast.error { border-color: #7a3232; color: #f0c0c0; }
.toast.success { border-color: #4f7d51; color: #c8ecc9; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fx-num {
  position: fixed;
  z-index: 150;
  transform: translate(-50%, 0);
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: #f08a8a;
  text-shadow: 0 2px 4px #000, 0 0 12px rgba(0, 0, 0, .8);
  pointer-events: none;
  animation: fxFloat .9s ease-out forwards;
}
.fx-num.crit { color: var(--gold-2); font-size: 30px; }
.fx-num.heal { color: var(--green-2); }
.fx-num.block { color: var(--blue-2); font-size: 18px; }
.fx-num.dodge { color: #aab3bd; font-size: 16px; }
@keyframes fxFloat {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(.8); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -68px) scale(1); }
}

/* ---------- Адаптив ---------- */
@media (max-width: 1240px) {
  .shell { grid-template-columns: 184px minmax(0, 1fr); }
  .right-panel { grid-column: 1 / -1; height: auto; min-height: 0; max-height: none; }
  .right-body { max-height: 420px; }
}
@media (max-width: 980px) {
  .brand-sub { display: none; }
  .mini-bars .bar { width: 86px; }
  .topbar { flex-wrap: wrap; }
  .hero-strip { order: 3; flex-basis: 100%; }
  .top-actions { margin-left: auto; }
  .window-body { height: auto; min-height: 480px; max-height: none; }
  .map-stage { height: 460px; min-height: 0; }
  .city-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  #app { padding: 6px 6px 18px; }
  .topbar { padding: 6px 8px; gap: 8px; }
  .brand-title { font-size: 15px; }
  .brand-mark { width: 30px; height: 30px; }
  .mini-portrait { width: 34px; height: 40px; }
  .mini-bars { flex-wrap: wrap; }
  .mini-bars .bar { width: 78px; height: 10px; }
  .coin-pill { padding: 3px 5px; font-size: 10px; }
  .icon-btn span { display: none; }
  .icon-btn { width: 30px; padding: 0; }
  .shell { grid-template-columns: 1fr; gap: 7px; }
  .left-menu { display: flex; overflow-x: auto; border-radius: 3px; }
  .menu-list { flex-direction: row; }
  .menu-item { flex: 0 0 auto; border-bottom: 0; border-right: 1px solid #241e15; padding: 8px 9px; font-size: 10px; }
  .menu-item .badge { display: none; }
  .menu-item span.menu-text { white-space: nowrap; }
  .menu-extra, .menu-foot { display: none; }
  .window-body { padding: 7px; }
  .window-head { padding: 5px 8px; }
  .window-head .wt { font-size: 12px; }
  .map-stage { height: 360px; }
  .hotspot-icon { width: 28px; height: 28px; }
  .hotspot-icon svg { width: 14px; height: 14px; }
  .hotspot-label { font-size: 8px; padding: 0 3px; }
  .city-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .building-grid { grid-template-columns: 1fr; }
  .char-layout { grid-template-columns: 1fr; }
  .char-paper { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; align-items: start; }
  .char-portrait { width: 120px; }
  .char-name { text-align: left; margin-top: 0; font-size: 16px; }
  .char-sub { text-align: left; }
  .char-vitals { grid-column: 1 / -1; }
  .equip-list { grid-column: 1 / -1; }
  .battle-row { grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); gap: 4px; }
  .battle-center { padding: 4px 2px; }
  .ap-big { font-size: 16px; }
  .plan-line { font-size: 8px; }
  .body-svg { max-width: 132px; }
  .fighter { min-height: 210px; padding: 4px 2px; }
  .combat-scene { height: 150px; }
  .enemy-card { gap: 5px; padding: 4px 5px; }
  .enemy-card .ec-name b { font-size: 12px; }
  .enemy-card .ec-meta { display: none; }
  .combat-controls { gap: 4px; }
  .combat-controls .btn-primary { min-width: 84px; }
  .prof-grid { grid-template-columns: 1fr; }
  .inv-grid { grid-template-columns: 1fr 1fr; }
  .item-card { padding: 5px; }
  .item-card h4 { font-size: 10px; }
  .item-card .item-desc { display: none; }
  .derived-grid { grid-template-columns: 1fr 1fr; }
  
  
  .sector-grid { inset: 3% 2%; gap: 1px; }
  .start-card { padding: 18px 14px; }
  .start-grid { grid-template-columns: 1fr; gap: 16px; }
  .start-sub { margin-bottom: 12px; }
  .start-title { letter-spacing: .08em; }
  .start-features { display: none; }
  .start-copy p { font-size: 11px; }
  .modal-body { padding: 9px; }
  .modal { max-height: 94vh; }
  .right-panel { border-radius: 3px; }
  .right-body { max-height: 480px; }
}
@media (max-width: 520px) {
  .mini-bars .bar { width: 62px; }
  .hero-strip { gap: 6px; }
  .mini-name b { font-size: 12px; }
  .mini-xp { display: none; }
  .start-card { border: 0; background: rgba(10, 9, 7, .9); }
  
  .start-actions .btn { height: 36px; font-size: 12px; }
  .inv-grid { grid-template-columns: 1fr; }
  .battle-row { grid-template-columns: 1fr 1fr; }
  .battle-center { grid-column: 1 / -1; grid-row: 2; flex-direction: row; justify-content: space-around; padding: 5px; }
  .fighter.enemy { grid-column: 1; grid-row: 1; }
  .fighter.player { grid-column: 2; grid-row: 1; }
  .body-svg { max-width: 140px; }
}

/* ---------- Вход и регистрация ---------- */
.auth-tabs { display: flex; gap: 4px; margin-bottom: 10px; border-bottom: 1px solid #3d3221; padding-bottom: 5px; }
.auth-tabs button {
  flex: 1 1 0;
  padding: 6px 8px;
  background: #100d0a;
  border: 1px solid #332a1c;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: .04em;
}
.auth-tabs button:hover { color: var(--gold-2); border-color: var(--gold-dark); }
.auth-tabs button.active { color: var(--gold-2); border-color: var(--gold-dark); background: rgba(217, 176, 97, .1); }
.auth-error { min-height: 14px; color: #e06666; font-size: 10px; line-height: 1.4; margin: 5px 0; }
.start-form form .btn-wide { width: 100%; margin-top: 2px; height: 34px; }
.start-form .portrait-grid { margin-bottom: 8px; }

/* ---------- Читаемость и боевые фигуры ---------- */
body { font-size: 14px; }
.menu-item { font-size: 13px; padding: 11px; }
.menu-label { font-size: 10px; }
.menu-note, .menu-foot { font-size: 10px; }
.right-section-body, .right-panel { font-size: 12px; }
.quest-card p, .panel-sub, .building-card p { font-size: 12px; }
.hotspot-label { font-size: 10px; padding: 1px 6px; }
.start-sub { font-size: 13px; }
.start-form input { height: 38px; font-size: 16px; background: #080706; border-color: var(--gold-line); }
.start-form input:focus { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(217, 176, 97, .25); }
.start-note a { font-size: 11px; color: var(--gold-2); }
.battle-row { grid-template-columns: minmax(0, 1fr) 148px minmax(0, 1fr); }
.fighter { min-height: 276px; }
.body-svg { max-width: 204px; }
.battle-center { gap: 8px; padding: 10px 5px; }
.plan-line { font-size: 10px; }

.btn { font-size: 12px; min-height: 30px; }
.btn-sm { font-size: 10px; }

.item-card .item-stats { font-size: 11px; }

/* ---------- Главное меню в шапке ---------- */
.main-menu { display: flex; align-items: center; gap: 1px; margin-left: auto; flex: 0 0 auto; }
.main-menu button {
  position: relative;
  width: 47px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: linear-gradient(180deg, #211b13, #14100b);
  border: 1px solid #332a1c;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: .01em;
  padding: 2px;
}
.main-menu button svg { width: 18px; height: 18px; }
.main-menu button:hover { color: var(--gold-2); border-color: var(--gold-dark); }
.main-menu button.active { color: var(--gold-2); border-color: var(--gold); background: linear-gradient(180deg, var(--line-warm), #1d1811); box-shadow: inset 0 -2px 0 var(--gold); }
.main-menu .mm-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  display: grid;
  place-items: center;
  background: #5a2222;
  border: 1px solid #8a3b3b;
  color: #f0d7d7;
  font-size: 8px;
  font-style: normal;
  border-radius: 8px;
}
.menu-sector { margin: 8px 10px; padding: 8px; border: 1px solid var(--line-soft); background: rgba(0, 0, 0, .18); }
.menu-sector .ms-title { font-family: Georgia, serif; font-size: 14px; color: var(--gold-2); }
.menu-sector .ms-terrain { color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.menu-sector .ms-line { font-size: 10px; color: var(--dim); }
.menu-sector .ms-line b { color: var(--text); font-weight: 500; }

@media (max-width: 1280px) {
  .main-menu button { width: 42px; height: 44px; font-size: 7px; }
  .main-menu button svg { width: 16px; height: 16px; }
}
@media (max-width: 980px) {
  .main-menu { order: 4; width: 100%; justify-content: center; margin: 2px 0 0; }
  .main-menu button { height: 36px; width: 52px; flex-direction: row; gap: 4px; font-size: 9px; }
  .main-menu button svg { width: 15px; height: 15px; }
}
@media (max-width: 760px) {
  .left-menu { display: none; }
  
  .main-menu { overflow-x: auto; justify-content: flex-start; }
  .main-menu button { flex: 0 0 auto; width: auto; min-width: 46px; padding: 0 6px; }
  .main-menu button span { font-size: 8px; }
}

/* ---------- Мобильные правки ---------- */
@media (max-width: 760px) {
  .map-stage { height: 330px; }
  .hotspot-icon { width: 30px; height: 30px; }
  .hotspot-icon svg { width: 15px; height: 15px; }
  .hotspot-label { font-size: 9px; padding: 1px 4px; }
  .city-legend { grid-template-columns: 1fr 1fr; gap: 4px; }
  .city-legend button { font-size: 11px; padding: 6px; min-height: 34px; }
  .window-actions .btn { min-height: 34px; font-size: 11px; }
  .combat-controls .btn { min-height: 34px; padding: 4px 8px; }
  .potion-row .btn { min-height: 30px; }
  .combat-log { font-size: 12px; max-height: 180px; }
  .right-tabs button { padding: 10px 3px; font-size: 12px; }
  .right-section-body 
  .monster-line .ml-name b { font-size: 12px; }
  .monster-line .ml-name span 
  .sector-actions .btn { min-height: 32px; font-size: 10px; }
  .move-pad button { min-height: 34px; font-size: 12px; }
  .start-form label 
  .start-note 
  .start-form input { height: 40px; font-size: 16px; }
  .start-actions .btn { height: 42px; }
  .auth-tabs button { padding: 8px 6px; font-size: 12px; }
  .prof-card p 
  .prof-card .prof-sub 
  .prof-foot .small { font-size: 9px; }
  .quest-card p { font-size: 11px; }
  .item-card .item-stats 
  .building-hero { min-height: 120px; }
  .building-hero h3 { font-size: 17px; }
}
@media (max-width: 520px) {
  .topbar { padding: 5px 6px; }
  .brand-title { font-size: 14px; }
  .brand-mark { width: 26px; height: 26px; }
  .brand-mark svg { width: 22px; height: 22px; }
  .mini-portrait { width: 30px; height: 36px; }
  .mini-bars .bar { width: 56px; height: 10px; }
  .mini-bars .bar span { font-size: 8px; }
  .coin-pill { font-size: 9px; padding: 2px 4px; }
  .main-menu button { min-width: 42px; }
  .main-menu button span { display: none; }
  .main-menu button svg { width: 17px; height: 17px; }
  .main-menu button { height: 34px; }
  .window-body { padding: 6px; }
  .map-stage { height: 300px; }
  .hotspot-label { font-size: 8px; max-width: 76px; white-space: normal; text-align: center; line-height: 1.15; }
  .battle-row { gap: 3px; }
  .body-svg { max-width: 128px; }
  .fighter { min-height: 205px; }
  .fighter-name { font-size: 11px; }
  .zone-hint { font-size: 7px; }
  .battle-center { padding: 4px 2px; }
  .ap-big { font-size: 15px; }
  .combat-controls .btn { font-size: 10px; }
  .combat-controls .btn-primary { min-width: 76px; }
  .start-card { padding: 16px 10px; }
  .start-title { font-size: 34px; letter-spacing: .06em; }
  .start-grid { gap: 10px; }
  .start-copy h3 { font-size: 15px; }
  .portrait-grid { gap: 4px; }
  .portrait-card span { font-size: 8px; }
}

/* ---------- Владение оружием ---------- */
.skill-list { display: flex; flex-direction: column; gap: 3px; }
.skill-row { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); }
.skill-row > span { width: 58px; flex: 0 0 auto; }
.skill-row > b { width: 24px; text-align: right; color: var(--text); font-weight: 500; }
.skill-bar { flex: 1 1 auto; height: 5px; background: #090806; border: 1px solid #332a1c; }
.skill-bar i { display: block; height: 100%; background: linear-gradient(90deg, #5f4a28, #c9a961); }

/* ---------- Расширенная карта ---------- */
.sector-cell.terrain-sand { background: rgba(165, 145, 91, .45); }
.sector-cell.terrain-dense { background: rgba(28, 52, 28, .62); }
.sector-cell.terrain-mountains { background: rgba(70, 66, 58, .65); }
.sector-cell.terrain-road { background: rgba(128, 104, 62, .5); }
.sector-cell.terrain-village { background: rgba(138, 106, 51, .55); }
.sector-cell.terrain-deep { background: rgba(10, 24, 37, .55); }
.sector-map-stage { background-blend-mode: multiply; }
.sector-map-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(17, 22, 15, .25), rgba(4, 6, 5, .7));
  pointer-events: none;
}
.sector-grid { gap: 1px; }
.sector-cell { border-color: rgba(14, 12, 8, .7); }
.sector-cell.reachable:hover { box-shadow: inset 0 0 0 1px #f0d79a, 0 0 12px rgba(217, 176, 97, .35); }
.sector-cell.current { animation: currentPulse 2.4s ease-in-out infinite; }
@keyframes currentPulse {
  0%, 100% { box-shadow: inset 0 0 0 2px #f0d79a, 0 0 10px rgba(217, 176, 97, .35); }
  50% { box-shadow: inset 0 0 0 2px #f0d79a, 0 0 20px rgba(217, 176, 97, .7); }
}
.world-map-wrap { text-align: center; }
#worldCanvas {
  width: 100%;
  max-width: 680px;
  height: auto;
  image-rendering: pixelated;
  border: 1px solid var(--gold-line);
  background: #0b1118;
  cursor: crosshair;
}
.world-legend { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0; color: var(--dim); font-size: 10px; }
.world-legend span { display: inline-flex; align-items: center; gap: 3px; }
.world-legend i { width: 10px; height: 10px; display: block; }
.landmark-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 6px; }
.landmark-row { display: flex; align-items: center; gap: 5px; padding: 4px 6px; border: 1px solid var(--line-soft); background: rgba(0,0,0,.16); font-size: 11px; }
.landmark-row .lr-name { flex: 1 1 auto; }
.landmark-row .lr-coord { color: var(--gold-2); font-size: 10px; white-space: nowrap; }
.landmark-row .btn { min-height: 22px; font-size: 9px; padding: 2px 5px; }
.landmark-row.unknown { opacity: .45; }
@media (max-width: 760px) {
  .landmark-list { grid-template-columns: 1fr; }
  .sector-grid { inset: 3% 2%; }
  .sector-terrain-canvas { left: 2%; right: 2%; top: 3%; bottom: 3%; width: 96%; height: 94%; }
  .sector-cell .sector-icon svg { width: 14px; height: 14px; }
  .sector-cell .sector-coord { font-size: 5px; }
}

/* ---------- Карта: читаемость ---------- */
.sector-cell { border-color: rgba(240, 215, 154, .14); }
.sector-cell .sector-icon svg { width: 20px; height: 20px; }
.sector-cell .sector-coord { font-size: 8px; color: rgba(239, 230, 210, .72); }
.sector-cell.current .sector-coord { color: #f0d79a; }
.world-modal { width: min(940px, 100%); }
.world-modal .modal-body { max-height: 76vh; overflow-y: auto; }
#worldCanvas { max-width: 600px; }
@media (max-width: 760px) {
  .sector-cell .sector-icon svg { width: 15px; height: 15px; }
  .sector-cell .sector-coord { font-size: 6px; }
  #worldCanvas { max-width: 100%; }
}
.sector-cell.terrain-sand,
.sector-cell.terrain-meadow,
.sector-cell.terrain-forest,
.sector-cell.terrain-dense,
.sector-cell.terrain-hills,
.sector-cell.terrain-mountains,
.sector-cell.terrain-swamp,
.sector-cell.terrain-ruins,
.sector-cell.terrain-road,
.sector-cell.terrain-village,
.sector-cell.terrain-gate,
.sector-cell.water,
.sector-cell.terrain-deep { background: rgba(0, 0, 0, .08) !important; }
.sector-grid .sector-cell { background: transparent !important; }\n.sector-cell.unexplored { opacity: .58; filter: saturate(.75); }
.sector-cell.unexplored:hover { opacity: 1; filter: none; }
.island-legend { font-size: 10px; gap: 10px; }
.island-legend i { width: 11px; height: 11px; border-radius: 2px; }
.modal-close { font-size: 22px; padding: 0 6px; }
.right-section .sector-sub { font-size: 11px; }
.world-modal .modal-head h3 { font-size: 18px; }

/* ---------- Персонаж: экран как в Гранях ---------- */
.shell.wide-mode { grid-template-columns: 1fr; }
.shell.wide-mode .left-menu,
.shell.wide-mode .right-panel,\n.shell.wide-mode .city-nav-panel { display: none; }
.shell.wide-mode .center-col { grid-column: 1 / -1; }
.shell.wide-mode .window-body { height: calc(100vh - 172px); min-height: 620px; }

.hero-screen {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}
.hero-doll {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px;
  background: linear-gradient(180deg, #1c1811, #100d09);
  border: 1px solid var(--gold-line);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5);
}
.hero-doll-name {
  font-family: Georgia, serif;
  font-size: 19px;
  color: var(--gold-2);
  text-align: center;
  line-height: 1.1;
}
.hero-doll-sub { text-align: center; color: var(--dim); font-size: 10px; margin-top: -4px; }
.hero-doll-body { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 3px; }
.doll-col { display: flex; flex-direction: column; gap: 5px; width: 58px; flex: 0 0 auto; }
.doll-center { flex: 1 1 auto; position: relative; min-width: 0; text-align: center; }
.doll-avatar {
  width: 100%;
  max-width: 158px;
  aspect-ratio: 1 / 1.22;
  object-fit: cover;
  border: 1px solid var(--gold-line);
  box-shadow: 0 0 0 1px #0b0906, 0 0 22px rgba(0, 0, 0, .6);
  display: block;
  margin: 0 auto;
}
.doll-lvl {
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  padding: 1px 6px;
  background: rgba(8, 7, 5, .86);
  border: 1px solid var(--gold-dark);
  color: var(--gold-2);
  font-size: 9px;
  white-space: nowrap;
}
.doll-slot {
  width: 58px;
  height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px;
  background: linear-gradient(#15120d, #0d0b08);
  border: 1px solid #332a1c;
  color: var(--muted);
  overflow: hidden;
}
.doll-slot.filled { background: linear-gradient(#211b12, #14100b); }
.doll-slot.empty { opacity: .5; }
.doll-slot:hover { border-color: var(--gold-dark); }
.doll-slot .ds-short { font-size: 8px; color: var(--dim); letter-spacing: .06em; }
.doll-slot .ds-name { font-size: 7.5px; line-height: 1.1; text-align: center; max-height: 20px; overflow: hidden; }
.belt-slot-row { display: flex; justify-content: center; }
.belt-slot-row .doll-slot { width: 100%; height: 38px; flex-direction: row; gap: 7px; }
.belt-slot-row .doll-slot .ds-name { max-height: none; }
.doll-xp { margin-top: 2px; }
.doll-xp .bar { height: 12px; }
.mentor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 7px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 10px;
}
.mentor-row b { color: var(--gold-2); }

.hero-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.char-stat-tabs { display: flex; gap: 3px; border-bottom: 1px solid #8a6a33; }
.char-stat-tabs button { padding: 6px 10px; border: 1px solid #8a6a33; border-bottom: 0; background: #1a1510; color: #b9a883; font-size: 11px; font-family: 'Segoe UI', sans-serif; }
.char-stat-tabs button:hover { color: #f0d79a; }
.char-stat-tabs button.active { background: linear-gradient(#efe7d6, #ddd2bc); color: #2a2419; }
.char-stat-panel { display: grid; grid-template-columns: 1fr; }
.char-stat-panel.stat-params .mods-block, .char-stat-panel.stat-params .info-block, .char-stat-panel.stat-params .defense-block,
.char-stat-panel.stat-mods .params-block, .char-stat-panel.stat-mods .info-block, .char-stat-panel.stat-mods .defense-block,
.char-stat-panel.stat-info .params-block, .char-stat-panel.stat-info .mods-block, .char-stat-panel.stat-info .defense-block,
.char-stat-panel.stat-defense .params-block, .char-stat-panel.stat-defense .mods-block, .char-stat-panel.stat-defense .info-block { display: none; }
.char-stat-panel .hero-block { min-height: 0; }
.char-skill-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.char-skill-box { padding: 8px 10px; background: linear-gradient(180deg, #efe7d6, #ddd2bc); border: 1px solid #b09a6e; color: #2a2419; }
.char-skill-box h4 { margin: 0 0 4px; font-family: Georgia, serif; font-size: 12px; color: #2b2113; border-bottom: 1px solid #b9a883; padding-bottom: 3px; }
.char-skill-box .char-skill-line { padding: 2px 0; border-bottom: 1px dotted rgba(90,72,45,.22); }
.char-skill-box .csl-name { color: #4a3b26; width: 62px; }
.char-skill-box .csl-bar { background: #c6b99f; border: 1px solid #9e8b66; }
.char-skill-box .char-skill-line b { color: #211a0e; }
.hero-bottom.char-extra { min-height: 0; grid-template-columns: minmax(0,1fr) 82px; }
.char-extra.empty { display: block; }
.char-extra.empty .char-extra-tabs { justify-content: flex-start; }
.char-extra-tabs { flex-direction: row; flex-wrap: wrap; }
.char-extra-tabs button { min-height: 34px; width: auto; padding: 4px 9px; }
.char-extra-tabs button span { font-size: 9px; }

.hero-top { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.hero-block {
  min-height: 158px;
  padding: 8px 9px;
  background: linear-gradient(180deg, #efe7d6, #ddd2bc);
  border: 1px solid #b09a6e;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), 0 2px 6px rgba(0, 0, 0, .25);
  color: #2a2419;
}
.hero-block h4 {
  font-family: Georgia, serif;
  font-size: 12px;
  color: #2b2113;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid #b9a883;
  padding-bottom: 3px;
  margin-bottom: 5px;
}
.hero-points { font-size: 10px; color: #5d4c31; margin-bottom: 4px; }
.hero-points b { color: #201708; font-size: 12px; }
.hstat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.hstat-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  border-bottom: 1px dotted rgba(90, 72, 45, .25);
  font-size: 10.5px;
}
.hstat-row span { flex: 1 1 auto; color: #5b4a30; }
.hstat-row b { font-size: 12px; color: #211a0e; }
.hero-block .attr-add {
  width: 17px;
  height: 17px;
  font-size: 11px;
  border: 1px solid #8a6a33;
  background: #c9a961;
  color: #201708;
}
.hero-block .attr-add:hover { background: #e3c37c; }
.hmod-row {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  padding: 2px 0;
  border-bottom: 1px dotted rgba(90, 72, 45, .22);
  font-size: 10.5px;
  color: #5b4a30;
}
.hmod-row:last-child { border-bottom: 0; }
.hmod-row b { color: #211a0e; text-align: right; white-space: nowrap; }

.hero-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 8px;
  min-height: 330px;
  flex: 1 1 auto;
}
.hero-tab-content {
  padding: 10px 12px;
  background: linear-gradient(180deg, #efe7d6, #ddd2bc);
  border: 1px solid #b09a6e;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), 0 2px 6px rgba(0, 0, 0, .25);
  color: #2a2419;
  overflow-y: auto;
  height: 100%;
  max-height: 380px;
  scrollbar-color: #9e8b66 #d8ccb5;
  scrollbar-width: thin;
}
.hero-tabs { display: flex; flex-direction: column; gap: 4px; }
.hero-tabs button {
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 3px 2px;
  background: linear-gradient(#1a1510, #100d09);
  border: 1px solid #332a1c;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.1;
}
.hero-tabs button svg { width: 17px; height: 17px; }
.hero-tabs button:hover { color: var(--gold-2); border-color: var(--gold-dark); }
.hero-tabs button.active { background: linear-gradient(#efe7d6, #ddd2bc); color: #2a2419; border-color: #b09a6e; }
.hero-tabs button span { font-size: 8px; text-align: center; }

.char-sheet-title {
  font-family: Georgia, serif;
  font-size: 17px;
  color: #241b0e;
  border-bottom: 1px solid #b9a883;
  padding-bottom: 3px;
  margin-bottom: 5px;
}
.char-subtitle {
  font-family: Georgia, serif;
  font-size: 13px;
  color: #3a2c16;
  margin: 9px 0 4px;
}
.char-desc { font-size: 11px; color: #4b3e2b; line-height: 1.45; margin: 4px 0 8px; }
.char-info-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px dotted rgba(90, 72, 45, .25);
  font-size: 11px;
  color: #5b4a30;
}
.char-info-line b { color: #211a0e; font-weight: 600; }
.char-skill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 14px; }
.char-skill-list { display: flex; flex-direction: column; gap: 2px; }
.char-skill-line {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  border-bottom: 1px dotted rgba(90, 72, 45, .22);
  font-size: 10.5px;
  color: #4b3e2b;
}
.csl-name { width: 54px; flex: 0 0 auto; }
.csl-bar { flex: 1 1 auto; height: 6px; background: #c6b99f; border: 1px solid #9e8b66; }
.csl-bar i { display: block; height: 100%; background: linear-gradient(90deg, #5d7f3f, #8fbf5e); }
.char-skill-line.active .csl-name { color: #7a5418; font-weight: 700; }
.char-skill-line.active .csl-bar i { background: linear-gradient(90deg, #8a6a33, #d5b46a); }
.char-skill-line b { width: 25px; text-align: right; color: #211a0e; }
.char-style-list { display: flex; flex-wrap: wrap; gap: 3px; }
.style-chip {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid #9e8b66;
  color: #4a3b26;
  font-size: 10px;
}
.style-chip.active { background: #c9a961; border-color: #8a6a33; color: #201708; }
.char-prof-list { display: flex; flex-direction: column; gap: 1px; }
.char-prof-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dotted rgba(90, 72, 45, .25);
  font-size: 10.5px;
}
.char-prof-line.locked { opacity: .5; }
.cpl-name { width: 115px; flex: 0 0 auto; color: #3a2c16; }
.cpl-name small { display: block; color: #6b5c44; font-size: 8px; }
.cpl-bar { flex: 1 1 auto; height: 7px; background: #c6b99f; border: 1px solid #9e8b66; }
.cpl-bar i { display: block; height: 100%; background: linear-gradient(90deg, #5d7f3f, #8fbf5e); }
.char-prof-line b { width: 55px; text-align: right; color: #211a0e; font-size: 9px; }
.char-card-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 8px 0; }
.char-card { border: 1px solid #b09a6e; background: rgba(255, 255, 255, .22); padding: 7px; }
.char-card h5 { font-family: Georgia, serif; font-size: 12px; color: #2b2113; margin-bottom: 3px; }
.char-card p { font-size: 10px; color: #4b3e2b; line-height: 1.4; }
.char-empty-card { border: 1px dashed #9e8b66; padding: 16px; text-align: center; color: #4b3e2b; }
.char-empty-card b { display: block; font-family: Georgia, serif; font-size: 15px; margin-bottom: 4px; color: #2b2113; }
.char-empty-card p { font-size: 11px; line-height: 1.45; }

@media (max-width: 1180px) {
  .hero-screen { grid-template-columns: 290px minmax(0, 1fr); }
  .hero-top { grid-template-columns: 1fr 1fr; }
  .hero-block { min-height: 145px; }
  .hero-bottom { min-height: 300px; }
}
@media (max-width: 900px) {
  .hero-screen { grid-template-columns: 1fr; }
  .char-skill-columns { grid-template-columns: 1fr; }
  .hero-doll { max-width: 360px; width: 100%; margin: 0 auto; }
  .hero-top { grid-template-columns: 1fr 1fr; }
  .hero-bottom { grid-template-columns: 1fr; }
  .hero-tabs { flex-direction: row; overflow-x: auto; }
  .hero-tabs button { flex: 0 0 auto; width: 64px; min-height: 50px; }
  .hero-tab-content { max-height: none; }
}
@media (max-width: 560px) {
  .hero-top { grid-template-columns: 1fr; }
  .char-skill-grid { grid-template-columns: 1fr; }
  .char-card-row { grid-template-columns: 1fr; }
  .hero-block { min-height: 0; }
  .hero-doll-body { gap: 2px; }
  .doll-col { width: 54px; }
  .doll-slot { width: 54px; height: 54px; }
  .doll-avatar { max-width: 140px; }
  .hero-tabs button span { font-size: 7px; }
}

/* ---------- Персонаж: читаемость ---------- */
.doll-lvl { font-size: 10px; padding: 2px 7px; }
.doll-slot .ds-short { font-size: 8.5px; }
.doll-slot .ds-name { font-size: 8px; }
.hero-tabs button svg { width: 19px; height: 19px; }
.hero-tabs button span { font-size: 8.5px; }
.hero-tabs button { min-height: 60px; }
.hstat-row { font-size: 11px; }
.hmod-row { font-size: 11px; }
.cpl-name small { font-size: 9px; }
.char-prof-line b { font-size: 10px; width: 60px; }
.char-prof-line { padding: 5px 0; }
.style-chip { font-size: 10.5px; padding: 3px 7px; }
.hero-bottom { gap: 10px; }
.hero-block h4 { font-size: 12.5px; }

/* ---------- Приёмы, питомцы, наставник, слоты ---------- */
.doll-slot .ds-icon { height: 18px; display: grid; place-items: center; }
.doll-slot .ds-icon svg { width: 17px; height: 17px; }
.mentor-select {
  height: 25px;
  background: #0d0b08;
  color: var(--gold-2);
  border: 1px solid var(--line);
  font-size: 10px;
  max-width: 100px;
}
.mentor-desc { color: var(--dim); font-size: 9px; line-height: 1.4; margin-top: -2px; }
.doll-pet { color: var(--muted); font-size: 10px; padding-top: 5px; border-top: 1px solid var(--line-soft); }
.doll-pet b { color: var(--gold-2); }

.tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.tech-card { border: 1px solid #b09a6e; background: rgba(255, 255, 255, .22); padding: 7px 8px; display: flex; gap: 7px; align-items: flex-start; }
.tech-card.locked { opacity: .5; }
.tech-card .tech-ic { flex: 0 0 auto; width: 42px; height: 42px; border: 1px solid #b09a6e; background: #1b160f; overflow: hidden; }
.tech-card .tech-ic .tech-art,
.tech-card .tech-ic .raster-icon { width: 40px; height: 40px; object-fit: cover; border-radius: 0; }
.tech-card .tech-body { flex: 1 1 auto; min-width: 0; }
.tech-head { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.tech-head b { font-family: Georgia, serif; font-size: 12px; color: #2b2113; }
.tech-head span { font-size: 9px; color: #6b5c44; white-space: nowrap; }
.tech-unlock { font-size: 9px; color: #5d7c46; margin: 1px 0 3px; }
.tech-card p { font-size: 10px; line-height: 1.4; color: #4b3e2b; }
.tech-req { font-size: 9px; color: #6b5c44; margin-top: 3px; font-style: italic; }
.tech-btn .tech-art { width: 30px; height: 30px; object-fit: cover; margin-bottom: 2px; border-radius: 2px; }

.pet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.pet-card { border: 1px solid #b09a6e; background: rgba(255, 255, 255, .22); padding: 8px; display: flex; flex-direction: column; gap: 3px; }
.pet-card.active { border-color: #8a6a33; box-shadow: inset 0 0 0 1px #c9a961; background: rgba(255, 244, 218, .5); }
.pet-card-head { display: flex; align-items: center; gap: 5px; }
.pet-card-head svg { width: 18px; height: 18px; color: #5d4c31; }
.pet-card-head b { font-family: Georgia, serif; font-size: 12px; color: #2b2113; }
.pet-req { font-size: 9px; color: #6b5c44; }
.pet-card p { font-size: 10px; line-height: 1.35; color: #4b3e2b; }
.pet-bonus { font-size: 9px; color: #4f6f3f; font-weight: 600; }
.pet-card .btn { margin-top: auto; }
.pet-active { border: 1px solid #b09a6e; background: rgba(255, 255, 255, .25); padding: 7px 9px; font-size: 11px; color: #4b3e2b; margin-bottom: 6px; }
.pet-active b { color: #2b2113; }

/* Приёмы в бою */
.technique-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 4px;
  border-top: 1px solid #241e15;
  padding-top: 6px;
  margin-top: 2px;
}
.tr-label { color: var(--dim); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; align-self: center; margin-right: 2px; }
.tech-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  min-height: 32px;
  padding: 3px 7px;
  background: #13100c;
  border: 1px solid #3d3221;
  color: var(--muted);
  font-size: 8px;
  text-align: left;
}
.tech-btn svg { width: 13px; height: 13px; float: left; margin-right: 3px; }
.tech-btn b { font-weight: 500; color: var(--text); font-size: 10px; }
.tech-btn span { color: var(--dim); font-size: 8px; }
.tech-btn:hover { border-color: var(--gold-dark); color: var(--gold-2); }
.tech-btn.active { border-color: var(--gold); background: rgba(217, 176, 97, .14); }
.tech-btn.active b { color: var(--gold-2); }
.tech-btn:disabled { opacity: .35; cursor: not-allowed; }

.ability-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  border-top: 1px solid #241e15;
  padding-top: 6px;
  margin-top: 2px;
}
.ability-grid .tech-btn {
  min-height: 54px;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4px 3px;
}
.ability-grid .tech-btn svg { width: 18px; height: 18px; float: none; margin: 0 auto 2px; display: block; }
.ability-grid .tech-btn b { display: block; font-size: 8px; line-height: 1.15; }
.ability-grid .tech-btn span { display: block; font-size: 7px; line-height: 1.15; }
.ability-grid .ability-potion img { width: 18px; height: 18px; object-fit: contain; display: block; margin: 0 auto 2px; }
.ability-grid .tech-empty { min-height: 54px; opacity: .18; background: rgba(0,0,0,.12); border-style: dashed; pointer-events: none; }
.combat-log .poison { color: var(--green-2); }
.combat-log .skill { color: var(--gold-2); }

@media (max-width: 760px) {
  .tech-grid, .pet-grid { grid-template-columns: 1fr; }
  .tech-btn { min-height: 34px; }
  .mentor-select { max-width: 85px; }
}
.tech-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pet-bonus { font-weight: 700; }
.pet-card .btn:disabled { opacity: .55; }
.mentor-row { flex-wrap: wrap; }
.mentor-row .btn { margin-left: auto; }
@media (max-width: 1180px) { .tech-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .tech-grid { grid-template-columns: 1fr; } }

/* ---------- Сумка 2.0: снаряжение, сравнение, фильтры ---------- */
.inv-screen {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.inv-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.inv-content { min-width: 0; }
.inv-style { color: var(--dim); font-size: 10px; margin: 1px 0 5px; }
.inv-style b { color: var(--gold-2); font-weight: 500; }
.equip-list { display: flex; flex-direction: column; }
.equip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px dotted var(--line-soft);
  min-width: 0;
}
.equip-row:last-child { border-bottom: 0; }
.equip-row[data-act] { cursor: pointer; }
.equip-row[data-act]:hover { background: rgba(217, 176, 97, .05); }
.equip-row.empty { opacity: .62; }
.equip-row.empty:hover { opacity: 1; }
.equip-row.current { background: rgba(217, 176, 97, .06); border: 1px solid #3d3221; padding: 5px; margin-bottom: 4px; }
.equip-row .ei {
  width: 28px; height: 28px; flex: 0 0 auto;
  display: grid; place-items: center;
  border: 1px solid #332a1c; background: #0d0b08; color: var(--muted);
}
.equip-row .ei svg { width: 16px; height: 16px; }
.equip-row .en { flex: 1 1 auto; min-width: 0; line-height: 1.25; }
.equip-row .en b { display: block; font-size: 10px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.equip-row .en > span { display: block; color: var(--dim); font-size: 8.5px; }
.equip-row .btn { flex: 0 0 auto; }
.cap-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.cap-bar { height: 6px; background: #0d0b08; border: 1px solid var(--line-soft); margin: 3px 0 5px; }
.cap-bar i { display: block; height: 100%; background: linear-gradient(90deg, #6b5531, #d9b061); }
.inv-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.inv-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.inv-filters button {
  padding: 4px 9px; background: #13100c; border: 1px solid #3d3221;
  color: var(--muted); font-size: 10px;
}
.inv-filters button:hover { border-color: var(--gold-dark); color: var(--gold-2); }
.inv-filters button.active { color: var(--gold-2); border-color: var(--gold-dark); background: rgba(217, 176, 97, .1); }
.inv-sort { margin-left: auto; color: var(--dim); font-size: 9px; display: flex; align-items: center; gap: 4px; }
.inv-sort select {
  height: 24px; background: #0d0b08; color: var(--gold-2);
  border: 1px solid var(--line); font-size: 9px; max-width: 130px;
}
.item-card[data-act] { cursor: pointer; transition: border-color .15s, background .15s; }
.item-card[data-act]:hover { background: rgba(217, 176, 97, .06); border-color: var(--line); }
.item-head { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.item-icon {
  width: 52px; height: 52px; flex: 0 0 auto;
  display: grid; place-items: center;
  border: 1px solid #3d3221; background: linear-gradient(#17130e, #0d0b08);
}
.item-icon svg { width: 20px; height: 20px; }
.item-title { flex: 1 1 auto; min-width: 0; }
.item-title h4 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-level { flex: 0 0 auto; font-size: 8px; color: var(--dim); border: 1px solid var(--line-soft); padding: 1px 4px; white-space: nowrap; }
.item-compare { display: flex; flex-wrap: wrap; gap: 3px; margin: 1px 0; }
.cmp { font-size: 8.5px; line-height: 1.35; padding: 1px 4px; border: 1px solid var(--line-soft); white-space: nowrap; }
.cmp-good { color: #8fd394; border-color: #3f6b41; background: rgba(111, 191, 115, .08); }
.cmp-bad { color: #e0a0a0; border-color: #6d2c2c; background: rgba(224, 160, 160, .06); }
.cmp-note { color: var(--dim); border-style: dashed; }
.item-modal { max-width: 620px; }
.item-detail { display: flex; gap: 10px; align-items: flex-start; }
.item-detail-icon {
  width: 76px; height: 76px; flex: 0 0 auto;
  display: grid; place-items: center;
  border: 1px solid #3d3221; background: linear-gradient(#17130e, #0d0b08);
}
.item-detail-icon svg { width: 34px; height: 34px; }
.item-detail-meta { flex: 1 1 auto; min-width: 0; }
.item-detail-meta .item-stats { font-size: 12px; color: var(--text); margin: 4px 0; }
.item-detail-meta .item-desc { margin: 3px 0 5px; }
.inv-toolbar + .panel-title { margin-top: 0; }
@media (max-width: 980px) {
  .inv-screen { grid-template-columns: 1fr; }
  .inv-side { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .inv-side { grid-template-columns: 1fr; }
  .inv-filters button { padding: 3px 6px; font-size: 9px; }
  .inv-sort { margin-left: 0; }
  .item-icon { width: 44px; height: 44px; }
  .item-icon .item-art { width: 42px; height: 42px; }
  .item-icon svg { width: 17px; height: 17px; }
  .item-detail-icon { width: 60px; height: 60px; }
  .equip-row .en b { font-size: 9.5px; }
}

/* ---------- Кузница и высокоуровневый бой ---------- */
.recipe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.recipe-card { border: 1px solid var(--line-soft); background: rgba(0, 0, 0, .18); padding: 7px; display: flex; flex-direction: column; gap: 4px; }
.recipe-head { display: flex; gap: 6px; align-items: flex-start; }
.recipe-head h4 { font-family: Georgia, serif; font-size: 12px; line-height: 1.2; }
.recipe-head .item-icon { width: 30px; height: 30px; flex: 0 0 auto; }
.recipe-head .item-icon svg { width: 17px; height: 17px; }
.recipe-cost { color: var(--dim); font-size: 8.5px; line-height: 1.45; }
.recipe-card .btn { margin-top: auto; align-self: flex-start; }
.combat-status { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0 0; }
.status-chip { font-size: 9px; padding: 2px 6px; border: 1px solid #3d3221; color: var(--muted); background: rgba(0, 0, 0, .25); }
.status-chip.poison { color: #9ad39a; border-color: #3f6b41; }
.status-chip.stun { color: #e0c27a; border-color: #6b5531; }
.status-chip.break { color: #e0a0a0; border-color: #6d2c2c; }
.status-chip.rage { color: #e0a06a; border-color: #7a4a2c; }
.ec-ability { margin-top: 3px; font-size: 8.5px; color: var(--dim); line-height: 1.35; }
@media (max-width: 760px) {
  .recipe-grid { grid-template-columns: 1fr; }
}

/* ---------- Карта сектора: физическое положение ---------- */
.sector-cell.adjacent { box-shadow: inset 0 0 0 2px rgba(217, 176, 97, .55); }
.sector-cell.adjacent:hover { box-shadow: inset 0 0 0 2px var(--gold), 0 0 12px rgba(217, 176, 97, .35); }
.sector-cell.current { box-shadow: inset 0 0 0 2px #f0d79a, 0 0 18px rgba(240, 215, 154, .35); }
.sector-player {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #17130e;
  background: #f0d79a;
  box-shadow: 0 0 0 3px rgba(240, 215, 154, .25), 0 0 16px rgba(240, 215, 154, .7);
  animation: herePulse 1.8s ease-in-out infinite;
}
.sector-player svg { width: 15px; height: 15px; }
@keyframes herePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.island-map-stage.moving .sector-grid { animation: sectorStep .42s ease-out; }
@keyframes sectorStep {
  from { opacity: .55; transform: scale(.985); }
  to { opacity: 1; transform: scale(1); }
}
@media (max-width: 760px) {
  .sector-player { width: 20px; height: 20px; margin: -10px 0 0 -10px; }
  .sector-player svg { width: 13px; height: 13px; }
}

/* ---------- Классы предметов и комплекты ---------- */
.item-set { font-size: 8.5px; line-height: 1.35; color: #c9a96a; border-left: 2px solid #6b5531; padding-left: 5px; margin: 2px 0; }
.item-detail-meta .item-set { font-size: 10px; margin: 5px 0; }

/* ---------- Сгенерированные иконки предметов ---------- */
.item-art { display: block; width: 100%; height: 100%; object-fit: contain; }
.item-art-fallback { display: grid; place-items: center; width: 100%; height: 100%; }
.item-icon, .item-detail-icon, .equip-row .ei { overflow: hidden; }
.item-icon .item-art { width: 50px; height: 50px; object-fit: contain; margin: auto; }
.item-detail-icon .item-art { width: 74px; height: 74px; object-fit: contain; margin: auto; }
.equip-row .ei .item-art { max-width: 24px; max-height: 24px; margin: auto; }
.doll-slot .ds-icon { height: 38px; }
.doll-slot .ds-icon .item-art { width: 46px; height: 36px; object-fit: contain; margin: auto; }
.doll-slot .ds-icon .item-art-fallback svg { width: 17px; height: 17px; }
@media (max-width: 760px) {
  .doll-slot .ds-icon { height: 30px; }
  .doll-slot .ds-icon .item-art { max-width: 34px; max-height: 30px; }
}
/* ---------- Арт монстров ---------- */
.combat-monster-art {
  position: absolute;
  right: 16px;
  bottom: 44px;
  z-index: 2;
  height: 150px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.75));
}
.monster-right-art {
  display: block;
  width: 115px;
  height: 150px;
  object-fit: contain;
  margin: 4px auto 6px;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.6));
}
@media (max-width: 760px) {
  .combat-monster-art { height: 110px; right: 8px; bottom: 38px; }
  .monster-right-art { width: 90px; height: 120px; }
}

/* ---------- Образ игрока ---------- */
.player-art-card { float: right; width: 92px; margin: 0 0 8px 10px; text-align: center; }
.player-art { display: block; width: 92px; height: 192px; object-fit: contain; margin: 0 auto; filter: drop-shadow(0 4px 8px rgba(0,0,0,.6)); }
.player-art-name { color: var(--gold-2); font-size: 9px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .player-art-card { width: 75px; }
  .player-art { width: 75px; height: 156px; }
}
.shop-icon { width: 32px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; }
.shop-icon .item-art { max-width: 30px; max-height: 34px; margin: auto; }
.shop-icon .item-art-fallback svg { width: 18px; height: 18px; }

.doll-avatar.doll-full { width: 115px; height: 240px; max-width: 115px; aspect-ratio: auto; object-fit: contain; padding: 4px; background: radial-gradient(ellipse at 50% 55%, rgba(217,176,97,.12), rgba(0,0,0,.25)); border: 1px solid var(--gold-line); }
@media (max-width: 760px) { .doll-avatar.doll-full { width: 95px; height: 198px; max-width: 95px; } }

.potion-icon { width: 28px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; }
.potion-icon img { max-width: 26px; max-height: 22px; object-fit: contain; }

/* ---------- Режимы боёв ---------- */
.battle-hub { display: grid; gap: 12px; }
.battle-hub-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); background: linear-gradient(135deg, rgba(40,28,18,.85), rgba(12,12,10,.7)); }
.battle-hub-title { font-family: var(--font-title); color: var(--gold-2); font-size: 16px; letter-spacing: .04em; }
.battle-hub-sub { color: var(--text-dim); font-size: 10px; margin-top: 3px; max-width: 430px; }
.battle-hub-vitals { display: grid; gap: 3px; min-width: 135px; }
.battle-hub-vitals .kv { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; border-bottom: 1px dotted #3a3020; padding-bottom: 2px; }
.battle-hub-vitals .kv span { color: var(--text-dim); }
.battle-hub-vitals .kv b { color: var(--gold-2); white-space: nowrap; }
.battle-mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 8px; }
.battle-mode-card { display: grid; gap: 7px; padding: 10px; border: 1px solid #3d3222; background: linear-gradient(160deg, rgba(30,24,17,.9), rgba(10,10,9,.8)); }
.battle-mode-card.locked { opacity: .6; }
.bm-head { display: flex; align-items: center; gap: 6px; }
.bm-head svg { width: 17px; height: 17px; color: var(--gold-2); flex: 0 0 auto; }
.bm-head b { color: var(--gold-2); font-size: 12px; }
.bm-head span { margin-left: auto; color: var(--text-dim); font-size: 9px; }
.battle-mode-card p { margin: 0; color: var(--text); font-size: 10px; line-height: 1.45; min-height: 42px; }
.bm-meta { color: var(--text-dim); font-size: 9px; border-top: 1px dotted #3a3020; padding-top: 5px; }
.battle-mode-card .btn { justify-self: start; }
@media (max-width: 760px) {
  .battle-hub-head { flex-direction: column; }
  .battle-hub-vitals { width: 100%; }
  .battle-mode-grid { grid-template-columns: 1fr; }
  .battle-mode-card p { min-height: 0; }
  .combat-topline { grid-template-columns: 1fr; gap: 5px; }
  .ct-side.enemy .ct-head { justify-content: flex-start; text-align: left; }
  .ct-note { text-align: left; }
  .ct-mid { flex-direction: row; gap: 8px; justify-content: space-between; min-width: 0; }
  .combat-arena { grid-template-columns: 1fr; }
  .combat-board { grid-template-columns: repeat(4, 44px); }
  .board-cell { width: 44px; height: 48px; }
  .board-labels { grid-auto-rows: 48px; }
  .combat-fighters { grid-template-columns: 1fr; }
  .arena-center { order: -1; flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
  .fighter-panel { min-height: 160px; }
  .arena-center .plan-line { text-align: left; }
  .arena-go { width: auto; min-width: 96px; }
  .arena-row-hint { max-width: none; text-align: left; }
  .arena-row.occupied { min-height: 210px; }
  .ability-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Онлайн ---------- */
.online-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 18px; background: rgba(4,3,2,.78); backdrop-filter: blur(3px); }
.online-window { width: min(900px, 100%); max-height: min(760px, 94vh); display: flex; flex-direction: column; border: 1px solid var(--gold-line); background: linear-gradient(160deg, #19130d, #0b0a08); box-shadow: 0 22px 70px rgba(0,0,0,.65); }
.online-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-warm); background: rgba(0,0,0,.3); }
.online-head > div { display: flex; align-items: baseline; gap: 8px; }
.online-head b { font-family: Georgia, serif; color: var(--gold-2); font-size: 18px; }
.online-head span { color: var(--dim); font-size: 10px; }
.online-close { border: 1px solid var(--line); background: transparent; color: var(--text); width: 30px; height: 30px; font-size: 20px; cursor: pointer; }
.online-body { padding: 12px; overflow-y: auto; min-height: 280px; }
.online-auth { max-width: 360px; margin: 20px auto; display: grid; gap: 10px; }
.online-auth label { display: grid; gap: 4px; color: var(--dim); font-size: 10px; }
.online-auth input, .online-chat-form input, .online-plan-foot select { background: #0d0b08; border: 1px solid var(--line); color: var(--text); padding: 7px 8px; font-family: inherit; font-size: 12px; }
.online-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.online-muted { color: var(--dim); font-size: 10px; line-height: 1.5; }
.online-error { color: #e06666; font-size: 11px; }
.online-lobby-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line-warm); background: rgba(0,0,0,.2); margin-bottom: 9px; font-size: 11px; }
.online-challenges { display: grid; gap: 5px; margin-bottom: 9px; }
.online-challenge { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding: 7px 9px; border: 1px solid #6b4a2a; background: rgba(217,176,97,.1); font-size: 11px; }
.online-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.online-card { border: 1px solid var(--line-warm); background: rgba(0,0,0,.16); padding: 9px; min-width: 0; }
.online-card h1 { margin: 0 0 7px; font-family: Georgia, serif; color: var(--gold-2); font-size: 14px; font-weight: 400; }
.online-players { display: grid; gap: 4px; }
.online-player { display: flex; align-items: center; gap: 7px; padding: 5px 6px; border: 1px solid var(--line-soft); background: rgba(0,0,0,.16); }
.online-player img { width: 26px; height: 42px; object-fit: contain; }
.online-player > div { display: grid; gap: 1px; min-width: 0; flex: 1 1 auto; }
.online-player b { color: var(--gold-2); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-player span { color: var(--dim); font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-chat { height: 230px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 4px; border: 1px solid var(--line-soft); background: #0b0907; font-size: 10px; }
.online-chat-line { line-height: 1.45; }
.online-chat-line time { color: var(--dim); font-size: 8px; margin-right: 4px; }
.online-chat-line b { color: var(--gold-2); }
.online-chat-form { display: flex; gap: 5px; margin-top: 6px; }
.online-chat-form input { flex: 1 1 auto; min-width: 0; }
.online-duel { display: grid; gap: 9px; }
.online-duel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-warm); background: rgba(0,0,0,.22); }
.online-duel-head > div { display: grid; gap: 2px; }
.online-duel-head b { color: var(--gold-2); font-family: Georgia, serif; font-size: 13px; }
.online-duel-head span { color: var(--dim); font-size: 9px; }
.online-timer { font-family: Georgia, serif; color: #e8dcc4; font-size: 22px; }
.online-timer.warn { color: #e06666; }
.online-duel-bars { display: grid; grid-template-columns: 1fr 44px 1fr; gap: 6px; align-items: stretch; }
.online-side { border: 1px solid #2b3c4b; background: rgba(24,37,46,.45); padding: 8px; display: grid; gap: 5px; }
.online-side.enemy { border-color: #4b2b2b; background: rgba(46,25,24,.42); }
.online-side h1 { margin: 0; font-family: Georgia, serif; color: var(--gold-2); font-size: 13px; font-weight: 400; }
.online-side h1 small { color: var(--dim); font-size: 9px; }
.online-stat { display: grid; grid-template-columns: 52px 1fr; gap: 3px 5px; align-items: center; font-size: 9px; }
.online-stat span { color: var(--dim); }
.online-stat b { text-align: right; color: var(--text); font-weight: 500; }
.online-stat i { grid-column: 1 / -1; height: 6px; background: #2a1a1a; display: block; }
.online-stat i em { display: block; height: 100%; background: #b24b4b; }
.online-stat i.mp em { background: #4f7fb8; }
.online-stat i.en em { background: #5d9e5f; }
.online-sector { color: var(--dim); font-size: 8px; text-align: right; }
.online-vs { display: grid; place-items: center; color: var(--dim); font-family: Georgia, serif; font-size: 10px; text-align: center; }
.online-plan { border: 1px solid var(--line-warm); background: rgba(0,0,0,.16); padding: 9px; }
.online-plan-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; font-size: 10px; }
.online-plan-head b { color: var(--gold-2); }
.online-plan-head span { color: var(--dim); }
.online-zones { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 4px; }
.online-zone { border: 1px solid var(--line-soft); padding: 5px; display: grid; gap: 4px; text-align: center; }
.online-zone > b { color: var(--gold-2); font-size: 9px; font-weight: 500; }
.online-zone-row { display: flex; align-items: center; justify-content: center; gap: 3px; font-size: 8px; }
.online-zone-row span { color: var(--dim); }
.online-zone-row button { width: 18px; height: 18px; border: 1px solid var(--line); background: #0d0b08; color: var(--text); cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.online-zone-row b { min-width: 12px; color: var(--text); }
.online-plan-foot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.online-plan-foot select { flex: 1 1 180px; }
.online-log { max-height: 160px; overflow-y: auto; border: 1px solid var(--line-soft); background: #0a0806; padding: 6px 8px; font-size: 10px; line-height: 1.45; }
.online-log .hit { color: #d9a5a5; }
.online-log .crit { color: var(--gold-2); }
.online-log .block { color: #7fa8d8; }
.online-log .heal { color: #6fbf73; }
.online-log .victory { color: var(--gold-2); font-weight: 600; }
.online-log .miss { color: #9aa3ad; }
.online-result { text-align: center; display: grid; gap: 8px; padding: 20px 10px; border: 1px solid var(--gold-line); background: rgba(217,176,97,.06); }
.online-result h1 { margin: 0; font-family: Georgia, serif; color: var(--gold-2); font-size: 24px; font-weight: 400; }
.online-wait { text-align: center; padding: 30px 10px; }
.online-wait h1 { color: var(--gold-2); font-family: Georgia, serif; font-weight: 400; }
@media (max-width: 760px) {
  .online-overlay { padding: 0; }
  .online-window { width: 100%; max-height: 100vh; height: 100vh; border: 0; }
  .online-grid { grid-template-columns: 1fr; }
  .online-duel-bars { grid-template-columns: 1fr; }
  .online-vs { display: none; }
  .online-zones { grid-template-columns: 1fr 1fr; }
  .online-lobby-head { flex-direction: column; align-items: flex-start; }
}
.sector-player-row { display: flex; align-items: center; gap: 6px; width: 100%; padding: 4px 5px; border: 1px solid var(--line-soft); background: rgba(0,0,0,.14); color: var(--text); text-align: left; font-family: inherit; margin-bottom: 3px; cursor: pointer; }
.sector-player-row.self { cursor: default; }
.sector-player-row > div { display: grid; gap: 1px; min-width: 0; }
.sector-player-row b { color: var(--gold-2); font-size: 11px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sector-player-row small { color: var(--dim); font-size: 9.5px; }
.sector-player-row .sp-main { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; background: none; border: 0; padding: 0; color: var(--text); font-family: inherit; text-align: left; cursor: pointer; }
.sector-player-row .btn { margin-left: auto; flex: 0 0 auto; }
.sp-dot { width: 7px; height: 7px; border-radius: 50%; background: #5d9e5f; flex: 0 0 auto; }
.sp-dot.online { background: #6fbf73; box-shadow: 0 0 5px rgba(111,191,115,.45); }
#footerOnline { display: inline-block; min-width: 64px; text-align: left; }
.online-count { display: inline-block; min-width: 40px; text-align: right; }
.battle-history { margin-top: 10px; border: 1px solid var(--line-warm); background: rgba(0,0,0,.18); }
.battle-history-head { display: flex; justify-content: space-between; padding: 6px 8px; color: var(--gold-2); font-family: Georgia, serif; font-size: 12px; border-bottom: 1px solid var(--line-soft); }
.battle-history-head span { color: var(--dim); font-family: "Segoe UI", sans-serif; font-size: 9px; }
.battle-history-row { display: grid; grid-template-columns: 82px minmax(0,1fr) auto; gap: 8px; align-items: center; width: 100%; padding: 6px 8px; border: 0; border-bottom: 1px dotted var(--line-soft); background: transparent; color: var(--text); text-align: left; cursor: pointer; font-family: inherit; }
.battle-history-row:hover { background: rgba(217,176,97,.07); }
.bh-result { font-size: 9px; color: var(--dim); }
.bh-result.victory { color: #6fbf73; }
.bh-result.defeat { color: #e06666; }
.bh-main { display: grid; gap: 1px; min-width: 0; }
.bh-main b { font-size: 10px; color: var(--gold-2); font-weight: 500; }
.bh-main small { color: var(--dim); font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bh-meta { color: var(--dim); font-size: 8px; text-align: right; line-height: 1.35; }
.battle-log-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 5px; margin-bottom: 8px; }
.battle-log-summary > div { border: 1px solid var(--line-soft); background: rgba(0,0,0,.15); padding: 5px 6px; display: grid; gap: 2px; }
.battle-log-summary span { color: var(--dim); font-size: 8px; }
.battle-log-summary b { color: var(--gold-2); font-size: 11px; font-weight: 500; }
.battle-log-enemies { color: var(--dim); font-size: 9px; margin-bottom: 6px; }
.battle-log-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--line-soft); background: #0a0806; padding: 6px 8px; font-size: 10px; line-height: 1.45; }
.battle-log-list .hit, .battle-log-list .crit { color: #d9a5a5; }
.battle-log-list .block { color: #7fa8d8; }
.battle-log-list .heal, .battle-log-list .poison { color: #6fbf73; }
.battle-log-list .victory { color: var(--gold-2); font-weight: 600; }
.battle-log-list .defeat { color: #e06666; font-weight: 600; }
.battle-log-list .system, .battle-log-list .skill { color: var(--dim); }
@media (max-width: 760px) { .battle-log-summary { grid-template-columns: 1fr 1fr; } .battle-history-row { grid-template-columns: 64px minmax(0,1fr); } .bh-meta { display: none; } }
.ach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ach-card { border: 1px solid var(--line-warm); background: rgba(0,0,0,.15); padding: 8px; display: grid; gap: 5px; }
.ach-card.maxed { opacity: .7; }
.ach-head { display: flex; justify-content: space-between; gap: 6px; }
.ach-head b { color: var(--gold-2); font-family: Georgia, serif; font-size: 12px; font-weight: 400; }
.ach-head span { color: var(--dim); font-size: 8px; }
.ach-card p { margin: 0; color: var(--text); font-size: 9px; line-height: 1.4; }
.ach-progress { height: 6px; background: #2a1a1a; border: 1px solid #241414; }
.ach-progress i { display: block; height: 100%; background: linear-gradient(90deg, #8a6a33, #e3c37c); }
.ach-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: var(--dim); font-size: 9px; }
.ach-foot .btn { font-size: 8px; min-height: 23px; }
@media (max-width: 760px) { .ach-grid { grid-template-columns: 1fr; } }
.item-sockets { margin-top: 6px; border-top: 1px dotted var(--line-warm); padding-top: 5px; display: grid; gap: 4px; }
.socket-rune { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-soft); padding: 4px 6px; }
.socket-rune span { font-size: 10px; }
.socket-rune small { color: var(--dim); font-size: 8px; flex: 1 1 auto; }
.socket-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.socket-actions .btn { font-size: 8px; min-height: 22px; }
.recipe-head .item-icon .item-art { width: 28px; height: 28px; }
.online-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; max-width: 330px; margin: 8px auto 4px; }
.online-board-cell { min-height: 34px; border: 1px solid var(--line-warm); background: rgba(0,0,0,.24); color: #7d6f59; font-size: 8px; display: grid; place-items: center; padding: 0; cursor: default; }
.online-board-cell span { opacity: .55; }
.online-board-cell.is-step { cursor: pointer; border-color: #a98b4e; background: rgba(169,139,78,.12); }
.online-board-cell.is-step:hover { background: rgba(169,139,78,.24); }
.online-board-cell.is-you { border-color: #d8b96a; background: rgba(216,185,106,.18); color: var(--gold-2); }
.online-board-cell.is-foe { border-color: #a24a3c; background: rgba(162,74,60,.2); color: #e7a08f; }
.online-board-cell.is-foe b { font-size: 8px; }
.online-board-cell.is-move { box-shadow: inset 0 0 0 1px #d8b96a; }
.online-board-hint { text-align: center; color: var(--dim); font-size: 8px; margin: 0 0 6px; }

.board-cell .board-name { max-width: 100%; padding: 0 1px; font-size: 8px; line-height: 1.05; text-align: center; white-space: normal; word-break: break-word; color: #e2d7c2; }
@media (max-width: 760px) {
  .fighter-portrait { max-width: 132px; }
  .zone-mark { width: 24px; height: 24px; font-size: 9px; }
}
@media (max-width: 520px) {
  .fighter-portrait { max-width: 112px; }
}

.battle-request-form { display: grid; gap: 10px; padding: 12px; border: 1px solid #6b5631; background: linear-gradient(150deg, rgba(48,35,20,.92), rgba(12,12,10,.85)); }
.brf-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.brf-head b { font-family: var(--font-title); color: var(--gold-2); font-size: 15px; }
.brf-head span { color: var(--dim); font-size: 9px; }
.brf-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.brf-fields label { display: grid; gap: 3px; color: var(--dim); font-size: 9px; letter-spacing: .04em; text-transform: uppercase; }
.brf-fields input { width: 92px; padding: 6px 8px; border: 1px solid var(--line); background: rgba(0,0,0,.45); color: var(--text); font: inherit; font-size: 13px; }
.brf-fields input:focus { outline: none; border-color: var(--gold); }
.brf-dash { color: var(--dim); padding-bottom: 7px; }
.brf-note { margin: 0; color: var(--dim); font-size: 9px; line-height: 1.45; }
.brf-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.battle-request-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #6b5631; background: linear-gradient(150deg, rgba(48,35,20,.9), rgba(12,12,10,.8)); }
.brc-main { display: grid; gap: 3px; flex: 1 1 auto; min-width: 0; }
.brc-main b { font-family: var(--font-title); color: var(--gold-2); font-size: 13px; }
.brc-main span { color: var(--text-dim); font-size: 9px; }
.brc-timer { display: grid; justify-items: center; min-width: 46px; }
.brc-timer b { font-family: var(--font-title); color: var(--gold-2); font-size: 22px; line-height: 1; }
.brc-timer span { color: var(--dim); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
@media (max-width: 760px) {
  .battle-request-card { flex-wrap: wrap; }
  .brc-main { flex-basis: 100%; }
  .brf-fields input { width: 78px; }
}

.brf-fields select { padding: 6px 8px; border: 1px solid var(--line); background: rgba(0,0,0,.45); color: var(--text); font: inherit; font-size: 11px; }
.battle-apps { display: grid; gap: 6px; }
.battle-apps-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-title); color: var(--gold-2); font-size: 13px; padding-bottom: 3px; border-bottom: 1px solid var(--line-warm); }
.battle-apps-head span { color: var(--dim); font-size: 10px; }
.battle-app-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #3d3222; background: rgba(0,0,0,.2); }
.ba-main { display: grid; gap: 3px; flex: 1 1 240px; min-width: 0; }
.ba-main > b { font-family: var(--font-title); color: var(--gold-2); font-size: 12px; }
.ba-main > span { color: var(--dim); font-size: 9px; }
.ba-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 2px; }
.ba-team { display: grid; gap: 1px; font-size: 9px; }
.ba-team b { color: var(--text-dim); font-weight: 500; }
.ba-team span { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.ba-join { display: flex; flex-wrap: wrap; gap: 5px; }
.ba-badge { color: var(--dim); font-size: 9px; border: 1px solid var(--line-warm); padding: 3px 6px; }
.online-app .ba-teams { width: 100%; }
.ba-countdown { color: var(--gold-2); }
.battle-result-card { display: grid; gap: 8px; padding: 12px; border: 1px solid #6b5631; background: linear-gradient(150deg, rgba(48,35,20,.92), rgba(12,12,10,.85)); }
.ba-result-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 9px; }
.ba-result-teams b { display: block; color: var(--gold-2); font-size: 10px; margin-bottom: 2px; }
.ba-result-teams span { color: var(--text-dim); }
.ba-result-log { max-height: 210px; overflow: auto; display: grid; gap: 2px; font-size: 9px; border-top: 1px solid var(--line-warm); padding-top: 6px; }
.ba-result-log .hit { color: var(--text); }
.ba-result-log .crit { color: #e0b060; }
.ba-result-log .death { color: #d08080; }
.ba-result-log .victory { color: var(--gold-2); }
.ba-result-log .miss { color: var(--dim); }
@media (max-width: 760px) {
  .brf-fields select { max-width: 100%; }
  .ba-teams { grid-template-columns: 1fr; }
  .ba-result-teams { grid-template-columns: 1fr; }
}

.clan-page { display: grid; gap: 10px; }
.clan-empty { display: grid; gap: 8px; justify-items: start; padding: 16px; border: 1px solid #3d3222; background: rgba(0,0,0,.2); }
.clan-empty b { font-family: var(--font-title); color: var(--gold-2); font-size: 16px; }
.clan-empty p { margin: 0; color: var(--dim); font-size: 10px; }
.clan-head { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid #6b5631; background: linear-gradient(140deg, rgba(48,35,20,.9), rgba(12,12,10,.8)); }
.clan-emblem { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid #a98b4e; background: rgba(0,0,0,.35); font-family: var(--font-title); font-size: 18px; color: var(--gold-2); }
.clan-title { font-family: var(--font-title); color: var(--gold-2); font-size: 18px; }
.clan-title span { color: var(--dim); font-size: 11px; }
.clan-sub { color: var(--dim); font-size: 9px; margin-top: 2px; }
.clan-level { margin-left: auto; display: grid; justify-items: center; }
.clan-level b { font-family: var(--font-title); color: var(--gold-2); font-size: 24px; line-height: 1; }
.clan-level span { color: var(--dim); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.clan-bonus { padding: 7px 10px; border: 1px solid var(--line-warm); background: rgba(0,0,0,.2); color: var(--text-dim); font-size: 10px; }
.clan-bonus b { color: var(--gold-2); }
.clan-members-head, .clan-members-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-title); color: var(--gold-2); font-size: 13px; padding-bottom: 3px; border-bottom: 1px solid var(--line-warm); }
.clan-members-head span { color: var(--dim); font-size: 10px; }
.clan-members { display: grid; gap: 3px; }
.clan-member { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line-soft); background: rgba(0,0,0,.16); }
.clan-member b { font-size: 11px; color: var(--text); }
.clan-member b small { color: var(--dim); font-weight: 400; }
.cm-rank { font-size: 8px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); border: 1px solid var(--line-warm); padding: 2px 5px; }
.cm-rank.leader { color: var(--gold-2); border-color: #6b5631; }
.cm-rank.officer { color: #b9cfe0; border-color: #3e5668; }
.cm-lvl { color: var(--dim); font-size: 9px; }
.cm-actions { display: flex; gap: 4px; margin-left: auto; }
.clan-actions { display: flex; gap: 6px; }
.clan-create { display: grid; gap: 8px; padding: 10px; border: 1px solid #3d3222; background: rgba(0,0,0,.2); }
.clan-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.clan-form label { display: grid; gap: 3px; color: var(--dim); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.clan-form input, .clan-form select { padding: 6px 8px; border: 1px solid var(--line); background: rgba(0,0,0,.45); color: var(--text); font: inherit; font-size: 12px; min-width: 120px; }
.clan-create-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--dim); font-size: 9px; }
.clan-row { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line-soft); background: rgba(0,0,0,.16); }
.cr-main { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.cr-main b { color: var(--text); font-size: 11px; }
.cr-main span { color: var(--dim); font-size: 9px; }
@media (max-width: 760px) {
  .clan-head { flex-wrap: wrap; }
  .clan-level { margin-left: 0; }
  .clan-form input, .clan-form select { min-width: 0; width: 140px; }
  .clan-create-foot { flex-direction: column; align-items: flex-start; }
  .cm-actions { margin-left: 0; }
}

.tourney-result { display: grid; gap: 8px; padding: 10px; border: 1px solid #6b5631; background: linear-gradient(150deg, rgba(48,35,20,.9), rgba(12,12,10,.82)); }
.tourney-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tourney-head b { display: block; font-family: var(--font-title); color: var(--gold-2); font-size: 15px; }
.tourney-head span { display: block; color: var(--dim); font-size: 9px; margin-top: 2px; }
.tourney-place { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #a98b4e; border-radius: 50%; font-family: var(--font-title); color: var(--gold-2); font-size: 17px; }
.tourney-board { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; align-items: flex-start; }
.tourney-round { flex: 0 0 170px; display: grid; gap: 4px; }
.tourney-round-name { color: var(--dim); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line-warm); padding-bottom: 2px; }
.tourney-match { display: grid; grid-template-columns: 1fr 22px 8px 22px 1fr; align-items: center; gap: 2px; padding: 4px 5px; border: 1px solid var(--line-soft); background: rgba(0,0,0,.18); font-size: 9px; }
.tourney-match span { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tourney-match span:last-child { text-align: right; }
.tourney-match span.tw { color: var(--text); }
.tourney-match span.tme { color: var(--gold-2); }
.tourney-match b { color: var(--text-dim); font-size: 8px; text-align: center; font-weight: 500; }
.tourney-match i { color: var(--line); font-style: normal; text-align: center; }
.tourney-loot { color: var(--gold-2); font-size: 9px; }
@media (max-width: 760px) {
  .tourney-round { flex-basis: 150px; }
}

.clan-donate { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--dim); font-size: 9px; }
.clan-chat { display: grid; gap: 5px; padding: 8px; border: 1px solid var(--line-soft); background: rgba(0,0,0,.16); }
.clan-chat-log { display: grid; gap: 2px; max-height: 150px; overflow-y: auto; font-size: 9px; }
.clan-chat-line time { color: var(--dim); margin-right: 5px; }
.clan-chat-line b { color: var(--gold-2); font-weight: 600; }
.clan-chat-form { display: flex; gap: 5px; }
.clan-chat-form input { flex: 1 1 auto; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); background: rgba(0,0,0,.45); color: var(--text); font: inherit; font-size: 11px; }

.auction-page { display: grid; gap: 10px; }
.auction-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px; border: 1px solid #3d3222; background: rgba(0,0,0,.2); }
.auction-balance { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 9px; }
.auction-balance b { color: var(--gold-2); font-family: var(--font-title); font-size: 16px; }
.auction-balance .btn { margin-left: 4px; }
.auction-sell { display: grid; gap: 6px; padding: 10px; border: 1px solid #3d3222; background: rgba(0,0,0,.16); }
.auction-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.auction-form select, .auction-form input { padding: 6px 8px; border: 1px solid var(--line); background: rgba(0,0,0,.45); color: var(--text); font: inherit; font-size: 11px; }
.auction-form select { max-width: 260px; }
.auction-form input { width: 100px; }
.auction-list { display: grid; gap: 4px; }
.auction-row { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line-soft); background: rgba(0,0,0,.16); }
.auction-main { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.auction-main b { font-size: 11px; }
.auction-main span { color: var(--dim); font-size: 9px; }
.auction-price { color: var(--gold-2); font-size: 11px; white-space: nowrap; }
@media (max-width: 760px) {
  .auction-form select { max-width: 100%; width: 100%; }
  .auction-row { flex-wrap: wrap; }
  .auction-main { flex-basis: 100%; }
}

.mine-page { display: grid; gap: 10px; }
.mine-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px; border: 1px solid #6b5631; background: linear-gradient(150deg, rgba(48,35,20,.9), rgba(12,12,10,.8)); }
.mine-head > div:first-child { display: grid; gap: 3px; flex: 1 1 260px; }
.mine-head b { font-family: var(--font-title); color: var(--gold-2); font-size: 15px; }
.mine-head span { color: var(--dim); font-size: 9px; }
.mine-license { color: var(--dim); font-size: 9px; border: 1px solid var(--line-warm); padding: 4px 7px; }
.mine-license.ok { color: #7fbf73; border-color: #3d5b35; }
.mine-cart { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; padding: 8px 10px; border: 1px solid var(--line-warm); background: rgba(0,0,0,.2); font-size: 10px; }
.mine-cart b { color: var(--gold-2); }
.mine-cart span { color: var(--dim); }
.mine-floors { display: flex; flex-wrap: wrap; gap: 5px; }
.mine-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.mine-cell { display: grid; gap: 2px; justify-items: center; min-height: 58px; padding: 6px; border: 1px solid #3d3222; background: radial-gradient(ellipse at 50% 30%, rgba(169,139,78,.14), rgba(0,0,0,.24)); color: var(--text); font: inherit; cursor: pointer; }
.mine-cell:hover { border-color: var(--gold); background: rgba(217,176,97,.18); }
.mine-cell b { font-size: 10px; }
.mine-cell span { color: var(--dim); font-size: 8px; }
.mine-cell.empty { opacity: .4; cursor: default; filter: grayscale(.7); }
.mine-locked { display: grid; gap: 7px; padding: 14px; border: 1px dashed #6b5631; background: rgba(0,0,0,.18); justify-items: start; }
.mine-locked b { color: var(--gold-2); font-family: var(--font-title); font-size: 15px; }
.mine-locked p { margin: 0; color: var(--dim); font-size: 10px; }
@media (max-width: 520px) {
  .mine-grid { grid-template-columns: repeat(3, 1fr); }
}

.mine-upgrades { display: flex; flex-wrap: wrap; gap: 5px; padding: 7px 9px; border: 1px solid var(--line-warm); background: rgba(0,0,0,.16); }
.mine-upgrades .btn { font-size: 8px; }

.mine-owner-note { color: var(--dim); font-size: 9px; line-height: 1.4; align-self: center; }

.daily-task-list { display: grid; gap: 4px; }
.daily-task { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line-soft); background: rgba(0,0,0,.16); }
.daily-task > div { display: grid; gap: 2px; flex: 1 1 auto; }
.daily-task b { color: var(--text); font-size: 11px; }
.daily-task span { color: var(--dim); font-size: 9px; }

.auction-filter { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.auction-filter input { flex: 1 1 180px; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); background: rgba(0,0,0,.45); color: var(--text); font: inherit; font-size: 10px; }

.battle-filter { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }

.inv-search { padding: 4px 7px; border: 1px solid var(--line); background: rgba(0,0,0,.45); color: var(--text); font: inherit; font-size: 9px; min-width: 90px; max-width: 130px; }

.auction-filter select { padding: 5px 7px; border: 1px solid var(--line); background: rgba(0,0,0,.45); color: var(--text); font: inherit; font-size: 10px; }

.portrait-card span { display: grid; gap: 1px; }
.portrait-card span small { color: var(--dim); font-size: 8px; }

.portrait-block { margin-top: 8px; }
.portrait-select { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.portrait-select .portrait-card span { font-size: 10px; }
@media (max-width: 760px) {
  .portrait-select { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.doll-avatar.doll-full.doll-square { object-fit: cover; object-position: center 22%; }

.item-set-art { display: block; width: 100%; max-width: 260px; max-height: 340px; object-fit: cover; border: 1px solid var(--line); margin: 4px 0 6px; }
.set-gallery { margin-top: 8px; }
.set-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.set-card { display: grid; gap: 4px; border: 1px solid #3d3222; background: rgba(0,0,0,.2); padding: 4px; }
.set-card img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; }
.set-card b { display: block; color: var(--gold-2); font-family: var(--font-title); font-size: 11px; }
.set-card span { color: var(--dim); font-size: 8px; }
@media (max-width: 760px) {
  .set-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item-set-art { max-height: 260px; }
}

.set-shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.set-shop-card { display: grid; gap: 6px; padding: 6px; border: 1px solid #3d3222; background: rgba(0,0,0,.2); }
.set-shop-card > img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; }
.set-shop-info { display: grid; gap: 2px; }
.set-shop-info b { color: var(--gold-2); font-family: var(--font-title); font-size: 12px; }
.set-shop-info span { color: var(--text-dim); font-size: 9px; }
.set-shop-info small { color: var(--dim); font-size: 8px; line-height: 1.35; }
.set-shop-card .btn { justify-self: start; }
@media (max-width: 760px) {
  .set-shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.clan-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.pattern-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pattern-card { display: grid; gap: 5px; padding: 8px; border: 1px solid #3d3222; background: rgba(0,0,0,.18); }
.pattern-card.active { border-color: #6b5631; background: rgba(169,139,78,.12); }
.pattern-head { display: flex; align-items: center; gap: 6px; }
.pattern-head svg { width: 18px; height: 18px; color: var(--gold-2); }
.pattern-head b { font-family: var(--font-title); color: var(--gold-2); font-size: 11px; }
.pattern-card p { margin: 0; color: var(--text-dim); font-size: 9px; line-height: 1.4; min-height: 26px; }
.pattern-active { color: #7fbf73; font-size: 9px; }
.pattern-off { color: var(--dim); font-size: 8px; }
@media (max-width: 760px) {
  .pattern-grid { grid-template-columns: 1fr 1fr; }
}

.clan-battle-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px; border: 1px solid #3d3222; background: rgba(0,0,0,.18); }
.clan-battle-head > div { display: grid; gap: 2px; flex: 1 1 240px; }
.clan-battle-head b { font-family: var(--font-title); color: var(--gold-2); font-size: 13px; }
.clan-battle-head span { color: var(--dim); font-size: 9px; }
.clan-battle-list { display: grid; gap: 4px; }
.clan-battle-row { display: grid; gap: 2px; padding: 6px 8px; border: 1px solid var(--line-soft); background: rgba(0,0,0,.16); }
.clan-battle-row b { font-size: 10px; }
.clan-battle-row.won b { color: #7fbf73; }
.clan-battle-row.lost b { color: #d08080; }
.clan-battle-row span { color: var(--text-dim); font-size: 9px; }
.clan-battle-row small { color: var(--dim); font-size: 8px; }

.pattern-level-note { color: #b9cfe0; font-size: 8px; text-transform: uppercase; letter-spacing: .04em; }

.pattern-stock, .pattern-market { display: grid; gap: 4px; }
.pattern-stock-row, .pattern-market-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line-soft); background: rgba(0,0,0,.16); }
.pattern-stock-icon { width: 28px; height: 28px; display: grid; place-items: center; color: var(--gold-2); border: 1px solid var(--line); }
.pattern-stock-row > div, .pattern-market-row > div { display: grid; gap: 2px; flex: 1 1 220px; }
.pattern-stock-row b, .pattern-market-row b { color: var(--gold-2); font-size: 10px; }
.pattern-stock-row span, .pattern-market-row span { color: var(--dim); font-size: 9px; }

.city-street-stage { position: relative; min-height: 520px; padding: 14px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(8,8,10,.55), rgba(8,8,10,.9)), url("../assets/city-map.jpg") center/cover; overflow: hidden; }
.city-street-top { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; background: rgba(10,9,7,.82); border: 1px solid var(--line); backdrop-filter: blur(3px); }
.city-street-top b { display: block; font-family: var(--font-title); color: var(--gold-2); font-size: 18px; }
.city-street-top span { display: block; color: var(--text-dim); font-size: 10px; margin-top: 2px; }
.city-street-nav { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--dim); font-size: 10px; }
.street-arrow { width: 34px; height: 34px; border: 1px solid #6b5631; background: rgba(0,0,0,.45); color: var(--gold-2); font-size: 20px; cursor: pointer; }
.street-arrow:hover { background: rgba(169,139,78,.28); }
.street-grid { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.street-building { display: grid; gap: 5px; justify-items: start; text-align: left; padding: 12px; min-height: 170px; border: 1px solid var(--line); background: linear-gradient(160deg, rgba(28,23,17,.94), rgba(8,8,8,.86)); color: var(--text); cursor: pointer; box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.street-building:hover { border-color: var(--gold); transform: translateY(-2px); background: linear-gradient(160deg, rgba(44,35,22,.96), rgba(10,10,8,.9)); }
.street-building.current { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(217,176,97,.35), 0 10px 24px rgba(0,0,0,.4); }
.street-building-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #6b5631; background: rgba(0,0,0,.35); color: var(--gold-2); }
.street-building-icon svg { width: 22px; height: 22px; }
.street-building b { font-family: var(--font-title); color: var(--gold-2); font-size: 13px; }
.street-building > span { color: var(--text-dim); font-size: 9px; line-height: 1.4; }
.street-building em { margin-top: auto; color: var(--gold-2); font-size: 9px; font-style: normal; }
.street-bottom { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding: 8px 10px; background: rgba(10,9,7,.82); border: 1px solid var(--line); }
.street-prev, .street-next { color: var(--gold-2); font-size: 9px; cursor: pointer; }
.street-prev:hover, .street-next:hover { text-decoration: underline; }
.street-dots { display: flex; gap: 5px; }
.street-dot { width: 22px; height: 22px; border: 1px solid var(--line); background: rgba(0,0,0,.4); color: var(--dim); font-size: 9px; cursor: pointer; }
.street-dot.active { border-color: var(--gold); color: var(--gold-2); background: rgba(169,139,78,.25); }
@media (max-width: 980px) {
  .street-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .city-street-stage { padding: 8px; min-height: auto; }
  .street-grid { grid-template-columns: 1fr; }
  .street-building { min-height: 130px; }
}

.item-art.set-art { object-fit: cover; object-position: center 18%; }
.board-cell .item-art.set-art { width: 100%; height: 100%; }

.emoji-wrap { position: relative; display: inline-flex; }
.emoji-toggle { min-width: 30px; height: 28px; border: 1px solid var(--line); background: rgba(0,0,0,.35); color: var(--text); font-size: 15px; cursor: pointer; border-radius: 3px; padding: 0 4px; }
.emoji-toggle:hover { border-color: var(--gold); }
.emoji-picker { display: none; position: absolute; bottom: 34px; right: 0; z-index: 20; width: 210px; padding: 6px; grid-template-columns: repeat(5, 1fr); gap: 3px; background: #12100c; border: 1px solid #6b5631; box-shadow: 0 8px 22px rgba(0,0,0,.5); }
.emoji-picker.open { display: grid; }
.emoji-picker button { border: 1px solid transparent; background: none; font-size: 19px; line-height: 1.2; padding: 4px 0; cursor: pointer; border-radius: 3px; }
.emoji-picker button:hover { background: rgba(169,139,78,.22); border-color: var(--gold-line); }

.street-building { padding: 0; overflow: hidden; align-content: start; min-height: 0; }
.street-building-art { display: block; width: 100%; aspect-ratio: 4 / 3; background: #0a0907; overflow: hidden; border-bottom: 1px solid var(--line-warm); }
.street-building-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.street-building-fallback { display: none; width: 100%; height: 100%; place-items: center; color: var(--gold-2); }
.street-building-fallback svg { width: 54px; height: 54px; }
.street-building-text { display: grid; gap: 4px; padding: 10px 12px 0; }
.street-building-text b { font-family: var(--font-title); color: var(--gold-2); font-size: 15px; }
.street-building-text span { color: var(--text-dim); font-size: 10px; line-height: 1.45; }
.street-building em { padding: 0 12px 12px; margin-top: 0; }
.city-street-stage { min-height: 680px; padding: 18px; }
.street-grid { gap: 16px; margin-top: 18px; }
@media (max-width: 980px) { .city-street-stage { min-height: 0; } }

.raster-icon { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; border-radius: 3px; }
.main-menu button .raster-icon { width: 22px; height: 22px; }
.tech-btn .raster-icon { width: 30px; height: 30px; margin-bottom: 2px; }
.prof-card h4 { display: flex; align-items: center; gap: 7px; }
.prof-card h4 .prof-icon { width: 32px; height: 32px; flex: 0 0 32px; }

.char-skill-line .csl-name { display: inline-flex; align-items: center; gap: 5px; }
.skill-icon { width: 17px; height: 17px; flex: 0 0 17px; }

.city-exit-top { white-space: nowrap; }

/* ---------- Нижняя панель: сектор, чат, лог ---------- */
.bottom-dock { display: grid; grid-template-columns: 132px minmax(0, 1fr); margin-top: 10px; height: 190px; min-height: 150px; border: 1px solid var(--line); border-radius: 4px; background: linear-gradient(180deg,#17130e,#100d09); overflow: hidden; }
.dock-tabs { display: flex; flex-direction: column; border-right: 1px solid var(--line); border-bottom: 0; overflow-y: auto; }
.dock-tabs button { flex: 0 0 auto; text-align: left; padding: 10px 12px; border-right: 0; border-bottom: 1px solid #241e15; }
.dock-tabs button.active { box-shadow: inset 3px 0 0 var(--gold); }
.dock-tabs .dock-toggle { flex: 0 0 auto; text-align: center; padding: 8px 0; font-size: 13px; color: var(--dim); }
.dock-tabs .dock-toggle.active { color: var(--gold-2); box-shadow: inset 3px 0 0 var(--gold); }
.dock-body { height: 100%; padding: 8px 10px; }
.dock-body .chat-box { height: 100%; }

@media (max-width: 760px) {
  .bottom-dock { grid-template-columns: 1fr; height: 230px; }
  .dock-tabs { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); }
  .dock-tabs button { flex: 1 1 0; text-align: center; border-bottom: 0; border-right: 1px solid #241e15; }
  .dock-tabs button.active { box-shadow: inset 0 -2px 0 var(--gold); }
}
/* ---------- Комфортное чтение чата в нижней панели ---------- */
.bottom-dock { height: 268px; grid-template-columns: 116px minmax(0, 1fr); }
.dock-body { padding: 8px 12px 10px; }
.dock-body .chat-box { gap: 0; }
.dock-body .chat-feed { gap: 3px; padding-right: 4px; }
.dock-body .chat-msg { font-size: 13px; line-height: 1.55; padding: 5px 8px; border-bottom: 0; border-radius: 4px; background: rgba(0,0,0,.18); color: #f2ecdd; }
.dock-body .chat-msg:nth-child(even) { background: rgba(255,255,255,.025); }
.dock-body .chat-msg.self { background: rgba(169,139,78,.12); }
.dock-body .chat-msg .chat-time { font-size: 9.5px; color: #a79a8a; margin-right: 6px; }
.dock-body .chat-msg .chat-name { color: var(--gold-2); margin-right: 2px; }
.dock-body .chat-input { padding-top: 7px; margin-top: 6px; gap: 6px; }
.dock-body .chat-input input { height: 34px; font-size: 12.5px; padding: 0 9px; border-color: var(--line); }
.dock-body .chat-input .btn { min-width: 38px; height: 34px; font-size: 15px; }
.dock-body .emoji-toggle { height: 34px; min-width: 36px; font-size: 17px; }
.dock-body .right-section { margin-bottom: 6px; }
.dock-body .right-section-head { font-size: 11px; }
@media (max-width: 760px) {
  .bottom-dock { height: 300px; grid-template-columns: 1fr; }
  .dock-body { padding: 8px 9px 10px; }
  .dock-body .chat-msg { font-size: 12px; padding: 5px 6px; }
}

/* ---------- Навигация по городу справа ---------- */
.city-nav-panel { display: none; background: linear-gradient(180deg,#17130e,#100d09); border: 1px solid var(--line); border-radius: 4px; padding: 8px; height: fit-content; }
.shell.city-nav-on { grid-template-columns: minmax(0, 1fr) 238px; }\n.shell.city-nav-on .left-menu { display: none; }
.shell.city-nav-on .city-nav-panel { display: block; }
.city-nav-title { font-family: var(--font-title); color: var(--gold-2); font-size: 13px; margin-bottom: 6px; }
.city-nav-list { display: grid; gap: 3px; }
.city-nav-item { display: flex; align-items: center; gap: 7px; width: 100%; padding: 7px 8px; border: 1px solid var(--line-soft); background: rgba(0,0,0,.16); color: var(--text); text-align: left; cursor: pointer; border-radius: 3px; }
.city-nav-item:hover { border-color: var(--gold-line); color: var(--gold-2); }
.city-nav-item.active { border-color: var(--gold); color: var(--gold-2); background: rgba(169,139,78,.12); }
.city-nav-icon { width: 20px; height: 20px; display: grid; place-items: center; color: var(--gold-2); flex: 0 0 20px; }
.city-nav-icon svg { width: 18px; height: 18px; }
.city-nav-item b { font-size: 10px; font-weight: 500; }
.city-nav-street { margin: 8px 0 4px; color: var(--dim); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.city-nav-exit { margin-top: 8px; width: 100%; }

/* ---------- Нижняя панель: чат слева, сектор справа ---------- */
.bottom-dock { grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); height: 268px; }
.dock-left { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; border-right: 1px solid var(--line); }
.dock-left .dock-tabs { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); }
.dock-left .dock-tabs button { flex: 0 0 auto; padding: 7px 16px; border-bottom: 0; border-right: 1px solid #241e15; }
.dock-left .dock-tabs button.active { box-shadow: inset 0 -2px 0 var(--gold); }
.dock-sector { min-width: 0; overflow-y: auto; padding: 8px 10px; }
.dock-sector .right-section { margin-bottom: 6px; }
@media (max-width: 980px) {
  .shell.city-nav-on { grid-template-columns: 1fr; }
  .shell.city-nav-on .city-nav-panel { display: none; }
  .bottom-dock { grid-template-columns: 1fr; height: 360px; }
  .dock-left { border-right: 0; border-bottom: 1px solid var(--line); }
  .dock-sector { max-height: 150px; }
}

.city-street-hero { position: relative; z-index: 2; margin-top: 16px; border: 1px solid var(--line); overflow: hidden; background: #080706; box-shadow: 0 16px 44px rgba(0,0,0,.45); }
.city-street-hero > img { display: block; width: 100%; height: min(56vh, 560px); object-fit: cover; }
.city-hero-overlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 24px 20px; background: linear-gradient(0deg, rgba(5,4,3,.96), rgba(5,4,3,.6) 55%, transparent); }
.city-hero-overlay > span { color: var(--dim); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.city-hero-overlay h3 { margin: 3px 0 5px; font-family: var(--font-title); color: var(--gold-2); font-size: 26px; }
.city-hero-overlay p { margin: 0 0 10px; max-width: 620px; color: var(--text-dim); font-size: 11px; line-height: 1.5; }
@media (max-width: 760px) {
  .city-street-hero > img { height: 44vh; min-height: 260px; }
  .city-hero-overlay { padding: 30px 14px 14px; }
  .city-hero-overlay h3 { font-size: 21px; }
}

/* ---------- Компактная левая колонка и чат у основного окна ---------- */
#app { max-width: none; margin: 0; padding: 8px 8px 18px 4px; }
.shell { grid-template-columns: 168px minmax(0, 1fr); gap: 8px; }
.left-menu .menu-item { padding: 9px 8px; font-size: 12px; }
.left-menu .menu-label { padding-left: 8px; }
.bottom-dock { margin-top: 6px; }
@media (max-width: 1240px) {
  .shell { grid-template-columns: 158px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  #app { padding: 6px; }
  .shell { grid-template-columns: 1fr; }
}

.bottom-dock { grid-template-columns: minmax(0, 1.65fr) minmax(220px, .65fr); }

/* Чат должен быть виден без прокрутки страницы */
.window-body, .shell.wide-mode .window-body { height: calc(100vh - 410px); min-height: 380px; }
@media (max-width: 760px) {
  .window-body, .shell.wide-mode .window-body { height: auto; min-height: 420px; }
}

/* Нижняя панель всегда видна в окне */
.center-col { padding-bottom: 222px; }
.bottom-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  height: 212px;
  margin: 0;
  padding-left: 176px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  box-shadow: 0 -10px 30px rgba(0,0,0,.42);
  grid-template-columns: minmax(0, 1.7fr) minmax(220px, .7fr);
}
body.no-left-panel .bottom-dock { padding-left: 0; }
@media (max-width: 980px) {
  .center-col { padding-bottom: 232px; }
  .bottom-dock { padding-left: 0; height: 222px; }
}
@media (max-width: 760px) {
  .center-col { padding-bottom: 292px; }
  .bottom-dock { height: 280px; grid-template-columns: 1fr; }
}

.window-body, .shell.wide-mode .window-body { height: clamp(250px, calc(100vh - 415px), 900px); min-height: 0; }
@media (max-width: 760px) {
  .window-body, .shell.wide-mode .window-body { height: auto; min-height: 380px; }
}

/* Стартовый экран в стиле баннера */
.start-screen {
  background:
    radial-gradient(ellipse at 68% 55%, rgba(0,0,0,.12), rgba(4,3,2,.9) 72%),
    linear-gradient(90deg, rgba(4,3,2,.94) 0%, rgba(4,3,2,.72) 45%, rgba(4,3,2,.38) 100%),
    url("../assets/buildings/square.jpg") center / cover no-repeat;
}
.start-screen::before {
  content: "";
  position: fixed;
  width: 1200px; height: 420px;
  left: -260px; bottom: -160px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(190,205,210,.13), transparent 68%);
  filter: blur(20px);
  pointer-events: none;
  animation: startFog 16s ease-in-out infinite alternate;
}
@keyframes startFog { from { transform: translateX(-40px); opacity: .35; } to { transform: translateX(90px); opacity: .7; } }
.start-card {
  background: linear-gradient(145deg, rgba(10,8,6,.9), rgba(8,7,6,.76));
  border-color: #8a6c3a;
  box-shadow: 0 34px 100px rgba(0,0,0,.78), inset 0 0 0 1px rgba(240,215,154,.1);
}
.start-title {
  color: #f5e7c8;
  text-shadow: 0 0 34px rgba(217,176,97,.2);
  letter-spacing: .055em;
}
.start-kicker { color: #d9b061; }
.start-sub { color: #cfc3af; letter-spacing: .1em; }
.start-copy h3 { font-family: Georgia, serif; font-size: 19px; }

/* Компактный режим под окно 1800×700 */
.city-street-stage { min-height: 0; padding: 10px; }
.street-grid { gap: 10px; margin-top: 10px; }
.street-building-art { aspect-ratio: 16 / 9; }
@media (max-height: 760px) {
  .city-street-stage { min-height: 0; padding: 8px; }
  .city-street-top { padding: 7px 10px; }
  .city-street-top b { font-size: 15px; }
  .street-grid { gap: 8px; margin-top: 8px; }
  .street-building-text { padding: 7px 9px 0; }
  .street-building-text b { font-size: 13px; }
  .street-building-text span { display: none; }
  .street-building em { padding: 0 9px 9px; }
  .street-bottom { display: none; }
  .bottom-dock { height: 200px; }
  .center-col { padding-bottom: 208px; }
}

/* Авто-подстройка: высота окна и чата считается из JS (fitGameLayout) */
.window-body, .shell.wide-mode .window-body {
  height: var(--game-body-height, clamp(250px, calc(100vh - 415px), 900px)) !important;
  min-height: 0 !important;
}
.center-col { padding-bottom: calc(var(--dock-height, 212px) + 10px); }
.bottom-dock { height: var(--dock-height, 212px) !important; }
@media (max-width: 760px) {
  .bottom-dock { height: var(--dock-height, 240px) !important; }
}

/* Чат в нижней панели: ввод закреплён, лента прокручивается */
.dock-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.dock-body .chat-box {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow: hidden;
}
.dock-body .chat-feed {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--line) #0c0a07;
  scrollbar-width: thin;
}
.dock-body .chat-input {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-bottom: 2px;
  background: linear-gradient(180deg, rgba(16,13,9,.96), #100d09 35%);
}
.dock-body .log-list {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

/* Нижняя панель не растягивается от длинного чата */
.bottom-dock { min-height: 0; }
.dock-left { height: 100%; min-height: 0; overflow: hidden; }
.dock-left > .dock-body { height: auto; min-height: 0; }
.dock-sector { height: 100%; min-height: 0; }

/* Детали комплектов в галерее и на бирже */
.set-card .set-pieces { display: flex; flex-wrap: wrap; gap: 3px; }
.set-card .set-pieces img {
  width: 26px;
  height: 26px;
  aspect-ratio: auto;
  object-fit: cover;
  border: 1px solid #3d3222;
  border-radius: 2px;
  opacity: .42;
  filter: grayscale(.6);
}
.set-card .set-pieces img.owned {
  opacity: 1;
  filter: none;
  border-color: #a98b4e;
  box-shadow: 0 0 6px rgba(217,176,97,.25);
}
.auction-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #3d3221;
  background: linear-gradient(#17130e, #0d0b08);
}
.auction-icon .item-art { width: 36px; height: 36px; object-fit: cover; }
@media (max-width: 760px) {
  .auction-icon { width: 32px; height: 32px; }
  .auction-icon .item-art { width: 30px; height: 30px; }
}

/* Компактная галерея комплектов: 6 карточек в ряд на широком экране */
@media (min-width: 1200px) {
  .set-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .set-card > img:first-child { height: 150px; aspect-ratio: auto; object-fit: contain; background: radial-gradient(ellipse at 50% 40%, rgba(217,176,97,.09), rgba(0,0,0,.28)); }
}
@media (min-width: 761px) and (max-width: 1199px) {
  .set-card > img:first-child { height: 190px; aspect-ratio: auto; object-fit: contain; background: radial-gradient(ellipse at 50% 40%, rgba(217,176,97,.09), rgba(0,0,0,.28)); }
}

/* Состав комплекта в подробной карточке предмета */
.item-set-pieces { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.item-set-pieces img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border: 1px solid #3d3222;
  border-radius: 2px;
  opacity: .35;
  filter: grayscale(.7);
}
.item-set-pieces img.owned {
  opacity: 1;
  filter: none;
  border-color: #a98b4e;
  box-shadow: 0 0 7px rgba(217,176,97,.3);
}

/* ================= Главный экран входа и регистрация ================= */
.landing-screen {
  align-items: stretch;
  justify-content: center;
  padding: 16px;
  background:
    radial-gradient(ellipse at 18% 18%, rgba(217,176,97,.10), transparent 46%),
    radial-gradient(ellipse at 82% 80%, rgba(120,40,30,.14), transparent 52%),
    linear-gradient(90deg, rgba(4,3,2,.96) 0%, rgba(6,5,4,.82) 48%, rgba(8,6,4,.68) 100%),
    url("../assets/buildings/square.jpg") center / cover no-repeat;
}
.landing-screen::before { opacity: .5; }
.landing-frame {
  width: min(1540px, 100%);
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: calc(100vh - 32px);
}
.landing-head {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 4px 10px;
  border-bottom: 1px solid rgba(169,139,78,.38);
}
.landing-brand { display: flex; align-items: center; gap: 10px; min-width: 250px; }
.landing-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid #8a6c3a; color: var(--gold-2); font-size: 14px;
  transform: rotate(45deg); background: rgba(217,176,97,.05);
}
.landing-mark + div { display: grid; gap: 1px; }
.landing-brand b { font-family: Georgia, serif; font-size: 19px; letter-spacing: .14em; color: #f0dfbb; }
.landing-brand span { color: var(--dim); font-size: 8px; letter-spacing: .22em; text-transform: uppercase; }
.landing-nav { display: flex; align-items: center; gap: 4px; }
.landing-nav button, .landing-nav a {
  padding: 7px 12px; color: #9b907e; background: transparent; border: 1px solid transparent;
  font-size: 11px; text-decoration: none; letter-spacing: .04em;
}
.landing-nav button:hover, .landing-nav a:hover { color: var(--gold-2); border-color: var(--line); }
.landing-nav button.active { color: var(--gold-2); border-color: #6b5531; background: rgba(217,176,97,.08); }
.landing-status { margin-left: auto; color: #9b907e; font-size: 10px; display: flex; align-items: center; gap: 7px; }
.landing-status i { width: 6px; height: 6px; border-radius: 50%; background: #7fb56e; box-shadow: 0 0 8px rgba(127,181,110,.7); }
.landing-main { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 14px; flex: 1; min-height: 0; }
.landing-world { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.landing-hero {
  position: relative; padding: 17px 22px 14px; border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(6,5,4,.95) 0%, rgba(6,5,4,.82) 48%, rgba(6,5,4,.34) 100%),
    url("../assets/buildings/square.jpg") center 36% / cover no-repeat;
  box-shadow: 0 18px 40px rgba(0,0,0,.35), inset 0 0 0 1px rgba(240,215,154,.05);
}
.landing-hero::after {
  content: ""; position: absolute; right: 12px; top: 12px; width: 26px; height: 26px;
  border-top: 1px solid var(--gold); border-right: 1px solid var(--gold); opacity: .65;
}
.landing-hero .start-kicker { text-align: left; font-size: 9px; letter-spacing: .28em; }
.landing-hero .start-title { text-align: left; font-size: clamp(40px, 5vw, 58px); margin: 4px 0 5px; letter-spacing: .09em; }
.landing-lead { max-width: 780px; margin: 0; color: #c9bda9; font-size: 12.5px; line-height: 1.55; }
.landing-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.landing-tags span { font-size: 8.5px; letter-spacing: .05em; color: #d5c4a2; border: 1px solid var(--line); background: rgba(0,0,0,.24); padding: 3px 7px; }
.landing-info { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 12px; flex: 1; min-height: 0; }
.landing-panel {
  border: 1px solid #3d3221; background: linear-gradient(160deg, rgba(15,12,9,.9), rgba(9,8,6,.78));
  padding: 9px 12px 8px; min-height: 0; overflow: hidden;
}
.landing-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid #332a1c; }
.landing-panel-head b { font-family: Georgia, serif; color: var(--gold-2); font-size: 15px; letter-spacing: .04em; }
.landing-panel-head span { color: #6e6557; font-size: 8px; text-transform: uppercase; letter-spacing: .12em; }
.news-list { display: flex; flex-direction: column; }
.news-item { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 9px; padding: 7px 0 6px; border-bottom: 1px dotted rgba(74,61,40,.65); }
.news-item:last-child { border-bottom: 0; }
.news-date { display: grid; gap: 2px; align-content: start; padding-top: 1px; }
.news-date b { color: var(--gold-2); font-size: 10px; font-weight: normal; }
.news-date span { color: #746a5a; font-size: 7.5px; text-transform: uppercase; letter-spacing: .08em; }
.news-item h4 { margin: 0 0 2px; color: #e1d4bc; font-size: 12px; line-height: 1.25; }
.news-item p { margin: 0; color: #9c917e; font-size: 10px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rating-subhead { margin: 6px 0 2px; color: #8e826e; font-size: 8px; text-transform: uppercase; letter-spacing: .14em; }
.rating-subhead:first-of-type { margin-top: 5px; }
.rating-list { display: grid; gap: 1px; }
.rating-row { display: grid; grid-template-columns: 16px 25px minmax(0, 1fr) auto; align-items: center; gap: 5px; padding: 2px 0; border-bottom: 1px dotted rgba(61,50,33,.6); min-height: 24px; }
.rating-row:last-child { border-bottom: 0; }
.rating-rank { color: #6f6554; font-size: 9px; text-align: center; }
.rating-portrait { width: 24px; height: 24px; object-fit: cover; border: 1px solid var(--line); background: #0d0b08; }
.rating-row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d8cbb4; font-size: 10.5px; font-weight: normal; }
.rating-row b small { color: #7f9c72; font-size: 7px; }
.rating-row em { color: #8b7f6b; font-size: 8.5px; font-style: normal; white-space: nowrap; }
.clan-row { grid-template-columns: 16px 42px minmax(0, 1fr) auto; }
.clan-tag { color: var(--gold); font-size: 9px; }
.rating-empty { margin: 4px 0 3px; color: #796f60; font-size: 9.5px; line-height: 1.4; }
.auth-panel {
  border: 1px solid #6b5531; background: linear-gradient(155deg, rgba(18,14,10,.96), rgba(8,7,6,.92));
  box-shadow: 0 24px 60px rgba(0,0,0,.55), inset 0 0 0 1px rgba(240,215,154,.06);
  display: flex; flex-direction: column; align-self: start; min-height: 0;
  position: relative;
}
.auth-panel::before { content: ""; position: absolute; left: 7px; top: 7px; width: 20px; height: 20px; border-left: 1px solid var(--gold); border-top: 1px solid var(--gold); opacity: .7; pointer-events: none; }
.auth-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 16px 10px; border-bottom: 1px solid #3d3221; background: rgba(217,176,97,.035); }
.auth-panel-head span { font-family: Georgia, serif; color: #f0dfbb; font-size: 19px; letter-spacing: .05em; }
.auth-panel-head small { color: #8d806b; font-size: 8px; text-transform: uppercase; letter-spacing: .12em; }
.auth-panel-body { padding: 14px 16px 15px; display: flex; flex-direction: column; gap: 0; }
.auth-panel label { display: block; color: #9c8f79; font-size: 8.5px; letter-spacing: .13em; text-transform: uppercase; margin: 0 0 4px; }
.auth-panel input[type=text], .auth-panel input[type=password], .auth-panel input[type=email], .auth-panel input:not([type]) {
  width: 100%; height: 40px; background: #070605; border: 1px solid var(--gold-line); color: #f1dfbb;
  padding: 0 10px; font-size: 15px; font-family: Georgia, serif; margin-bottom: 10px;
}
.auth-panel input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 1px rgba(217,176,97,.25); }
.auth-panel .btn-wide { width: 100%; min-height: 36px; }
.auth-sep { display: flex; align-items: center; gap: 8px; margin: 12px 0 10px; color: #736857; font-size: 8px; text-transform: uppercase; letter-spacing: .14em; }
.auth-sep::before, .auth-sep::after { content: ""; height: 1px; flex: 1; background: #332a1c; }
.auth-hint { margin: 10px 0 0; color: #786e5f; font-size: 9px; line-height: 1.45; }
.link-btn { display: inline; padding: 0; border: 0; background: none; color: var(--gold-2); font-size: inherit; text-decoration: underline; }
.landing-foot { display: flex; justify-content: space-between; gap: 10px; padding: 1px 4px 0; color: #655b4c; font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }

/* Регистрация */
.register-main { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 16px; flex: 1; min-height: 0; }
.register-story {
  border: 1px solid var(--line); background:
    linear-gradient(90deg, rgba(6,5,4,.94), rgba(6,5,4,.68)),
    url("../assets/buildings/square.jpg") center / cover no-repeat;
  padding: 20px 20px 16px; display: grid; grid-template-columns: minmax(0, 1fr) 190px; grid-template-rows: auto auto; gap: 12px 14px; align-content: start;
}
.register-story > div:first-child { grid-column: 1; }
.register-story .start-title { text-align: left; font-size: clamp(34px, 4vw, 50px); margin: 4px 0 6px; }
.register-story .landing-lead { font-size: 11.5px; }
.register-story .start-features { grid-column: 1; margin-top: 0; }
.register-preview { grid-column: 2; grid-row: 1 / span 2; align-self: start; border: 1px solid var(--gold-line); background: radial-gradient(ellipse at 50% 42%, rgba(217,176,97,.13), rgba(0,0,0,.35)); padding: 5px; }
.register-preview img { width: 100%; height: 250px; object-fit: contain; display: block; }
.register-preview span { display: block; text-align: center; color: #8d806b; font-size: 8px; text-transform: uppercase; letter-spacing: .14em; padding: 4px 0 1px; }
.register-panel { align-self: stretch; }
.register-panel .auth-panel-body { padding-top: 12px; }
.reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.reg-grid .reg-wide { grid-column: 1 / -1; }
.reg-label { margin-top: 1px !important; }
.portrait-mini-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin: 0 0 9px; }
.portrait-mini { position: relative; padding: 2px; background: #0c0a07; border: 1px solid #332a1c; overflow: hidden; }
.portrait-mini img { width: 100%; height: 46px; object-fit: cover; object-position: center 22%; display: block; }
.portrait-mini span { display: block; padding: 2px 1px 1px; color: #7e7362; font-size: 7px; line-height: 1.2; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portrait-mini.selected { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(217,176,97,.25); }
.portrait-mini.selected span { color: var(--gold-2); }
.reg-agree { display: flex !important; align-items: flex-start; gap: 6px; margin: 0 0 3px !important; color: #9c8f79 !important; font-size: 9px !important; letter-spacing: 0 !important; text-transform: none !important; line-height: 1.35; cursor: pointer; }
.reg-agree input { width: 13px; height: 13px; margin: 1px 0 0; accent-color: #a98b4e; flex: 0 0 auto; }
.reg-agree span { display: inline; }

@media (max-width: 1180px) {
  .landing-main { grid-template-columns: minmax(0, 1fr) 350px; }
  .landing-info { grid-template-columns: 1fr; }
  .rating-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
  .rating-panel .landing-panel-head { grid-column: 1 / -1; }
  .register-main { grid-template-columns: 1fr; }
  .register-story { grid-template-columns: minmax(0, 1fr) 150px; }
  .register-preview img { height: 190px; }
}
@media (max-width: 820px) {
  .landing-screen { padding: 10px; }
  .landing-frame { min-height: calc(100vh - 20px); }
  .landing-head { flex-wrap: wrap; gap: 8px; }
  .landing-brand { min-width: 0; flex: 1 1 100%; }
  .landing-status { display: none; }
  .landing-main { grid-template-columns: 1fr; }
  .landing-hero .start-title { font-size: 40px; }
  .landing-info { grid-template-columns: 1fr; }
  .rating-panel { display: block; }
  .register-story { grid-template-columns: 1fr; }
  .register-preview { grid-column: 1; grid-row: auto; display: none; }
  .reg-grid { grid-template-columns: 1fr; }
  .reg-grid .reg-wide { grid-column: auto; }
  .portrait-mini-grid { grid-template-columns: repeat(3, 1fr); }
  .landing-foot { display: none; }
}

/* ================= Читаемость: минимальные размеры и контраст ================= */
:root {
  --muted: #b2a898;
  --dim: #948a78;
  --text: #e4dccd;
}
body { font-size: 14px; line-height: 1.45; }
.small, .small.muted, .small.dim { font-size: 11px; line-height: 1.45; }
.brand-sub { font-size: 10px; }
.mm-badge { font-size: 9px; }
.wc, .hint { font-size: 11px; }

.menu-note, .menu-foot { font-size: 10.5px; }

.btn-sm { font-size: 11px; min-height: 26px; }
.bar span { font-size: 10px; }
.kv { font-size: 11.5px; }
.right-section-head { font-size: 11px; }
.right-section-head .small { font-size: 10px; }
.chat-time { font-size: 10px !important; }
.street-prev, .street-next { font-size: 10.5px; }
.street-dot { font-size: 10px; }
.city-nav-street { font-size: 9.5px; }
.street-building em { font-size: 10.5px; }

/* Сумка и предметы */
.item-sub, .item-level, .kind, .tag, .req-warn { font-size: 10px; }
.item-stats { font-size: 11.5px; }
.item-desc { font-size: 10.5px; line-height: 1.45; }
.item-price { font-size: 11px; }
.item-card .item-sub { font-size: 10px; }
.item-card h4 { font-size: 13.5px; }
.inv-sort, .inv-search, .inv-tabs button { font-size: 10.5px; }
.set-card b { font-size: 12px; }
.set-card span { font-size: 10px; }
.set-card small { font-size: 10px; }
.set-card .set-pieces img { width: 28px; height: 28px; }
.auction-main b { font-size: 12px; }
.auction-main span { font-size: 10.5px; }
.auction-price { font-size: 12px; }

/* Персонаж */
.ds-name { font-size: 9.5px; line-height: 1.2; }
.ds-short { font-size: 9px; }
.csl-name { font-size: 11px; }
.hero-doll-sub, .doll-lvl, .hero-points { font-size: 11px; }
.hstat-row, .hmod-row { font-size: 11.5px; }
.hero-block h4 { font-size: 15px; }

/* Мини-карта, перемещение, бой */
.ms-terrain, .ms-line { font-size: 11px; }
.move-city { font-size: 9.5px; }
.move-up, .move-down, .move-left, .move-right { font-size: 12px; }
.ct-note, .board-name, .zone-hint, .fighter-pos, .ap-label, .arena-row-hint { font-size: 9.5px; line-height: 1.3; }


.combat-log { font-size: 12px; }



/* Стартовый экран и регистрация */
.landing-brand span { font-size: 9.5px; }
.landing-nav button, .landing-nav a { font-size: 11.5px; }
.landing-status { font-size: 11px; }
.landing-tags span { font-size: 10px; }
.landing-panel-head b { font-size: 16px; }
.landing-panel-head span { font-size: 9px; }
.news-date b { font-size: 11px; }
.news-date span { font-size: 9px; }
.news-item h4 { font-size: 13px; }
.news-item p { font-size: 11px; line-height: 1.45; color: #b8ac96; }
.rating-row b { font-size: 11.5px; }
.rating-row em { font-size: 10px; }
.rating-rank { font-size: 10px; }
.rating-subhead { font-size: 9.5px; }
.rating-empty { font-size: 10.5px; }
.auth-panel label { font-size: 10px; }
.auth-hint { font-size: 10.5px; color: #9f917c; }
.auth-panel-head small { font-size: 9.5px; }
.reg-agree { font-size: 10.5px !important; line-height: 1.4; }
.portrait-mini span { font-size: 9px; }
.register-story .landing-lead { font-size: 12px; }
.start-features li { font-size: 12px; }

/* Читаемость: не обрезать названия и боевые подписи */
.item-title h4 {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.25;
}
.bar > span { line-height: 1; font-size: 10px; }
.ct-bars .bar span { font-size: 9.5px; }
.ct-mid b { font-size: 12px; }
.ct-mid span { font-size: 10px; }
.ct-note { font-size: 10px; white-space: normal; overflow: visible; text-overflow: clip; }
.board-name { font-size: 9.5px; }
.zone-hint { font-size: 10px; }
.fighter-pos { font-size: 10px; }
.ap-label { font-size: 9.5px; }
.arena-row-hint { font-size: 9.5px; line-height: 1.35; }
.fighter-label { font-size: 10px; }
.combat-scene-name { font-size: 11px; }
.combat-round { font-size: 10px; }
.ability-grid .tech-btn b { font-size: 11px; }
.ability-grid .tech-btn span { font-size: 9.5px; line-height: 1.25; }

/* Читаемость: магазин, комплекты, верхнее меню */
.shop-row .sr-name b { font-size: 12.5px; }
.shop-row .sr-name span { font-size: 10.5px; }
.shop-row .sr-price { font-size: 11.5px; }
.shop-row .btn { font-size: 10.5px; min-height: 26px; }
.shop-section h4 { font-size: 15px; }
.set-shop-info b { font-size: 13px; }
.set-shop-info span { font-size: 10px; }
.set-shop-info small { font-size: 9.5px; }
@media (min-width: 1200px) {
  .main-menu button { width: 52px; height: 50px; font-size: 9.5px; }
  .main-menu button span { font-size: 9.5px; }
  .main-menu button svg { width: 19px; height: 19px; }
}

/* ================= Магазин: карточки товаров ================= */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.building-card .shop-grid { grid-template-columns: 1fr; }
.shop-card {
  position: relative;
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 5px 10px;
  padding: 10px;
  border: 1px solid #3d3221;
  border-left: 3px solid #5d5547;
  background: linear-gradient(140deg, rgba(24,19,13,.96), rgba(10,9,7,.92));
  box-shadow: inset 0 1px 0 rgba(255,226,168,.04);
  transition: border-color .15s, background .15s, transform .15s;
}
.shop-card:hover { background: linear-gradient(140deg, rgba(31,25,17,.98), rgba(12,10,8,.94)); border-color: #6b5531; }
.shop-card::after {
  content: ""; position: absolute; right: 5px; top: 5px; width: 14px; height: 14px;
  border-top: 1px solid rgba(217,176,97,.45); border-right: 1px solid rgba(217,176,97,.45);
  pointer-events: none;
}
.shop-card.rarity-uncommon { border-left-color: #6fbf73; }
.shop-card.rarity-rare { border-left-color: #5c9fe0; }
.shop-card.rarity-epic { border-left-color: #b47ce0; }
.shop-card.rarity-artifact { border-left-color: #e0b04a; }
.shop-card-art {
  grid-row: 1 / 3;
  width: 120px; height: 120px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 42%, rgba(217,176,97,.12), rgba(0,0,0,.3) 70%);
  overflow: hidden;
}
.shop-card-art .item-art { width: 116px; height: 116px; object-fit: contain; filter: drop-shadow(0 5px 8px rgba(0,0,0,.45)); }
.shop-card-art .potion-icon { width: 98px; height: 98px; }
.shop-card-art .potion-icon img { max-width: 96px; max-height: 96px; }
.shop-card-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.shop-card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.shop-card-title b { font-family: Georgia, serif; font-size: 15px; line-height: 1.2; font-weight: normal; }
.shop-card-title span { color: #948a78; font-size: 10px; white-space: nowrap; }
.shop-card-meta { color: #8f8472; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.shop-card-stats { color: #d8c9ae; font-size: 12px; line-height: 1.4; }
.shop-card-desc { color: #ab9f8b; font-size: 11.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shop-card-foot { grid-column: 2; display: flex; align-items: center; gap: 8px; padding-top: 3px; border-top: 1px dotted rgba(74,61,40,.55); }
.shop-card-price { margin-right: auto; color: var(--gold-2); font-size: 14.5px; white-space: nowrap; }
.shop-card-price small { color: #8d816e; font-size: 9.5px; }
.shop-card .btn { min-height: 28px; padding: 3px 13px; }
.shop-card .btn:disabled { opacity: .45; }
@media (max-width: 900px) {
  .shop-grid { grid-template-columns: 1fr; }
  .shop-card { grid-template-columns: 96px minmax(0, 1fr); }
  .shop-card-art { width: 92px; height: 92px; }
  .shop-card-art .item-art { width: 88px; height: 88px; }
}

/* ================= Туманная монета и донат-лавка ================= */
.coin-pill.mist-pill {
  display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer; color: #d9fff6;
  border-color: #3f6f68;
  background: linear-gradient(180deg, rgba(24,60,56,.85), rgba(8,24,23,.9));
  box-shadow: inset 0 0 0 1px rgba(143,230,216,.08);
}
.coin-pill.mist-pill:hover { border-color: #8fe6d8; color: #f1fffb; }
.mist-coin-sm { width: 19px; height: 19px; display: block; filter: drop-shadow(0 0 4px rgba(143,230,216,.45)); }
.mist-modal { width: min(920px, 100%); }
.mist-modal-head { align-items: flex-start; background: linear-gradient(90deg, rgba(20,48,45,.55), transparent); }
.mist-modal-head h3 { color: #d9fff6; }
.mist-kicker { display: block; color: #7fc9bd; font-size: 8px; text-transform: uppercase; letter-spacing: .24em; margin-bottom: 2px; }
.mist-hero {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 14px; border: 1px solid #3f6f68;
  background: radial-gradient(ellipse at 10% 30%, rgba(143,230,216,.12), transparent 45%), linear-gradient(120deg, rgba(9,28,27,.95), rgba(13,12,9,.9));
  margin-bottom: 12px;
}
.mist-hero-coin { width: 84px; height: 84px; filter: drop-shadow(0 0 14px rgba(143,230,216,.35)); }
.mist-hero-text { display: grid; gap: 2px; }
.mist-hero-text span { color: #7fc9bd; font-size: 8px; text-transform: uppercase; letter-spacing: .18em; }
.mist-hero-text b { font-family: Georgia, serif; color: #f0dfbb; font-size: 20px; font-weight: normal; }
.mist-hero-text p { margin: 2px 0 0; color: #a9b8ad; font-size: 10.5px; line-height: 1.4; }
.mist-wallet { text-align: right; display: grid; gap: 3px; }
.mist-wallet span { color: #7fc9bd; font-size: 8px; text-transform: uppercase; letter-spacing: .12em; }
.mist-wallet strong { color: #d9fff6; font-size: 24px; font-weight: normal; display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.mist-wallet strong img { width: 28px; height: 28px; }
.mist-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mist-card {
  display: grid; grid-template-columns: 74px minmax(0, 1fr);
  grid-template-rows: 1fr auto; gap: 4px 8px;
  padding: 8px; border: 1px solid #3d514b; background: linear-gradient(140deg, rgba(16,29,26,.92), rgba(8,10,9,.92));
}
.mist-card-art { grid-row: 1 / 3; width: 70px; height: 70px; display: grid; place-items: center; border: 1px solid #3f5b55; background: radial-gradient(ellipse at 50% 40%, rgba(143,230,216,.13), rgba(0,0,0,.28)); overflow: hidden; }
.mist-card-art img { max-width: 66px; max-height: 66px; object-fit: contain; }
.mist-card-info { min-width: 0; }
.mist-card-info b { display: block; color: #d9fff6; font-family: Georgia, serif; font-size: 13px; font-weight: normal; line-height: 1.2; }
.mist-card-info p { margin: 2px 0 0; color: #9fb0a5; font-size: 9.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mist-card-foot { grid-column: 2; display: flex; align-items: center; justify-content: space-between; gap: 6px; border-top: 1px dotted rgba(63,111,104,.45); padding-top: 4px; }
.mist-price { display: inline-flex; align-items: center; gap: 4px; color: #d9fff6; font-size: 12px; }
.mist-price img { width: 17px; height: 17px; }
.mist-card .btn { min-height: 26px; font-size: 10.5px; padding: 2px 9px; }
.mist-note { margin: 10px 0 0; color: #7e8e84; font-size: 9.5px; line-height: 1.4; }
@media (max-width: 760px) {
  .mist-hero { grid-template-columns: 64px 1fr; }
  .mist-hero-coin { width: 58px; height: 58px; }
  .mist-wallet { grid-column: 1 / -1; text-align: left; }
  .mist-wallet strong { justify-content: flex-start; }
  .mist-grid { grid-template-columns: 1fr; }
}

/* Расчёт боя — калькулятор урона по зонам */
.forecast-modal { width: min(880px, 100%); }
.forecast-head { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.forecast-head > div { border: 1px solid #3d3221; background: rgba(0,0,0,.2); padding: 9px 11px; display: grid; gap: 2px; }
.forecast-head > div.enemy { border-color: #5b3535; background: rgba(80,25,25,.14); }
.forecast-head span { color: #8d806b; font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.forecast-head b { color: var(--gold-2); font-family: Georgia, serif; font-size: 17px; font-weight: normal; }
.forecast-head .enemy b { color: #e0a0a0; }
.forecast-head small { color: #a99d89; font-size: 10.5px; }
.forecast-table-wrap { border: 1px solid #3d3221; overflow: auto; }
.forecast-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.forecast-table th, .forecast-table td { padding: 6px 7px; border-bottom: 1px solid var(--line-soft); text-align: center; white-space: nowrap; }
.forecast-table thead th { color: #a99d89; background: #120f0b; font-weight: normal; font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; }
.forecast-table .forecast-side th { color: #d9b061; font-size: 9px; padding: 3px 7px; }
.forecast-table .forecast-side th:nth-child(2) { background: rgba(217,176,97,.06); }
.forecast-table .forecast-side th:nth-child(5) { color: #d98b8b; background: rgba(160,60,60,.08); }
.forecast-table tbody tr:hover { background: rgba(217,176,97,.045); }
.forecast-table td:first-child { text-align: left; color: #d8cbb4; }
.forecast-table .dmg-cell { color: #d9b061; font-weight: 600; }
.forecast-table .dmg-cell.danger { color: #e0a0a0; }
.forecast-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.forecast-summary span { border: 1px solid #3d3221; background: rgba(0,0,0,.18); padding: 4px 8px; color: #9d917d; font-size: 10.5px; }
.forecast-summary b { color: #e2d3b8; font-weight: normal; }
.forecast-note { margin: 8px 0 0; color: #7d7363; font-size: 10px; line-height: 1.4; }
@media (max-width: 600px) {
  .forecast-head { grid-template-columns: 1fr; }
  .forecast-table { font-size: 10.5px; }
  .forecast-table th, .forecast-table td { padding: 4px 4px; }
}

/* Парирование, контратаки и эффекты комплектов */
.combat-log .parry, .combat-log .proc { color: #8fd3c5; }
.combat-log .counter { color: #e0a06a; }

/* Итоги боя */
.combat-stats { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 2px; }
.combat-stats span { border: 1px solid #3d3221; background: rgba(0,0,0,.18); padding: 3px 7px; color: #9d917d; font-size: 10.5px; }
.combat-stats b { color: #e2d3b8; font-weight: normal; }

/* Профиль чужого игрока в онлайн-окне */
.online-profile { position: relative; border: 1px solid var(--gold-line); background: linear-gradient(145deg, rgba(23,18,13,.98), rgba(9,8,6,.97)); padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.online-profile-close { position: absolute; right: 7px; top: 5px; width: 24px; height: 24px; background: transparent; border: 0; color: #9d917d; font-size: 20px; cursor: pointer; }
.online-profile-close:hover { color: var(--gold-2); }
.online-profile-head { display: grid; grid-template-columns: 74px minmax(0,1fr); gap: 10px; align-items: center; padding-right: 22px; }
.online-profile-head > img { width: 70px; height: 82px; object-fit: contain; object-position: center top; border: 1px solid var(--line); background: radial-gradient(ellipse at 50% 35%, rgba(217,176,97,.12), #0a0806); }
.online-profile-kicker { display: block; color: #8fd3c5; font-size: 8px; text-transform: uppercase; letter-spacing: .16em; }
.online-profile-head h1 { margin: 1px 0 2px; color: #f0dfbb; font-family: Georgia, serif; font-size: 21px; font-weight: normal; }
.online-profile-head p { margin: 0; color: #b0a28d; font-size: 11px; line-height: 1.35; }
.online-profile-clan { color: #d9b061 !important; }
.online-profile-stats { display: flex; flex-wrap: wrap; gap: 5px; margin: 9px 0; }
.online-profile-stats span { border: 1px solid #3d3221; background: rgba(0,0,0,.18); padding: 4px 7px; color: #9d917d; font-size: 10.5px; }
.online-profile-stats b { color: #e2d3b8; font-weight: normal; }
.online-profile h2 { margin: 5px 0 5px; color: #d9b061; font-family: Georgia, serif; font-size: 14px; font-weight: normal; }
.online-profile-gear { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 5px; }
.online-profile-item { display: flex; align-items: center; gap: 6px; border: 1px solid #332a1c; background: rgba(0,0,0,.15); padding: 4px; min-width: 0; }
.online-profile-item > span { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #3d3221; background: #0b0907; overflow: hidden; }
.online-profile-item img { max-width: 32px; max-height: 32px; object-fit: contain; }
.online-profile-item b { display: block; color: #d8cbb4; font-size: 10.5px; font-weight: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.online-profile-item small { display: block; color: #8f8472; font-size: 9px; }
.online-profile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; padding-top: 7px; border-top: 1px solid #332a1c; color: #9d917d; font-size: 10.5px; }
.online-profile-foot b { color: #d8cbb4; font-weight: normal; }
@media (max-width: 640px) {
  .online-profile-head { grid-template-columns: 58px 1fr; }
  .online-profile-head > img { width: 54px; height: 66px; }
  .online-profile-gear { grid-template-columns: 1fr 1fr; }
}

.online-player { flex-wrap: wrap; }
.online-player b { font-size: 12px; }
.online-player span { font-size: 10px; }
.online-player .btn { min-height: 24px; font-size: 10px; padding: 2px 7px; }
.online-chat { font-size: 11px; }
.online-chat-line time { font-size: 9px; }

/* Компактный город: карточки зданий целиком над чатом */
@media (max-height: 760px) {
  .street-building-art { aspect-ratio: 2.2 / 1 !important; }
  .city-street-stage { padding-bottom: 6px; }
}

/* Арена: рейтинг PvP */
.arena-row em { color: #d9b061; letter-spacing: .02em; }
.online-rating { color: #d9b061; }
.online-lobby-head small { color: #8b7f6b; font-size: 9px; }
.online-profile-arena { color: #d9b061 !important; }
.online-rating-line { margin: 6px 0 0; color: #d9b061; font-size: 12px; letter-spacing: .02em; }
@media (max-height: 780px) {
  .rating-subhead { margin: 4px 0 1px; font-size: 9px; }
  .rating-row { min-height: 21px; padding: 1px 0; }
  .rating-portrait { width: 22px; height: 22px; }
}
/* Общий мир: метка другого игрока в секторе */
.map-player {
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #23564a;
  border: 1px solid #7fd6b0;
  color: #eaf6ef;
  font-size: 9px;
  line-height: 15px;
  text-align: center;
  box-shadow: 0 0 7px rgba(127, 214, 176, .65);
  z-index: 4;
  pointer-events: none;
}
/* Живой командный бой */
.online-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.online-team-col { border: 1px solid var(--line-warm); background: rgba(0, 0, 0, .18); padding: 8px; }
.online-team-col h1 { margin: 0 0 6px; font-size: 12px; color: var(--gold-2); font-weight: normal; letter-spacing: .04em; }
.online-team-row { padding: 6px 0; border-bottom: 1px dotted rgba(61, 50, 33, .6); }
.online-team-row:last-child { border-bottom: 0; }
.online-team-row.is-dead { opacity: .45; }
.online-team-row.is-self .online-team-name b { color: #d9b061; }
.online-team-name { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.online-team-name b { font-size: 12px; }
.online-team-name small { color: #8b7f6b; font-size: 9px; }
@media (max-width: 640px) {
  .online-teams { grid-template-columns: 1fr; }
}
/* ------------------------------------------------------------------ */
/* Боевой экран в стиле референса: светлая страница, две плашки, портреты */
/* ------------------------------------------------------------------ */
body.in-combat { background: #e9e7e2; }
body.in-combat .topbar {
  background: #f2f0eb;
  border-bottom: 1px solid #b8b1a3;
  box-shadow: none;
  color: var(--panel-deep);
}
body.in-combat .brand-title, body.in-combat .brand-sub { color: var(--panel-deep); }
body.in-combat .brand-sub { color: #6b6459; }
body.in-combat .main-menu button { color: #3a352c; }
body.in-combat .main-menu button.active { color: var(--acc); }
body.in-combat .coin-pill { background: #e2ded5; border-color: #b8b1a3; color: var(--panel-deep); }
body.in-combat #heroStrip { display: none; }
body.in-combat .shell { grid-template-columns: minmax(0, 1fr); }
body.in-combat .left-menu, body.in-combat .city-nav-panel { display: none; }
body.in-combat .game-window,
body.in-combat .window-body {
  background: #efede7;
  color: var(--panel-deep);
  border-color: #b8b1a3;
}
body.in-combat .window-head {
  background: #e6e3da;
  border-color: #b8b1a3;
  color: var(--panel-deep);
}
body.in-combat .window-head h2, body.in-combat .window-head b { color: var(--panel-deep); }
body.in-combat .window-head .muted, body.in-combat .window-head span { color: #6b6459; }
body.in-combat .footer-note { color: #6b6459; }

body.in-combat .combat-screen {
  background: #efede7;
  color: var(--panel-deep);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.in-combat .combat-scene { display: none; }
body.in-combat .combat-topline { order: 1; background: #f5f3ee; border: 1px solid #b8b1a3; border-radius: 4px; padding: 8px 12px; }
body.in-combat .combat-fighters { order: 2; }
body.in-combat .combat-controls { order: 3; }
body.in-combat .combat-board-wrap { order: 4; }
body.in-combat .combat-status { order: 5; }
body.in-combat .combat-result { order: 6; }

body.in-combat .ct-head b { color: var(--panel-deep); font-size: 14px; }
body.in-combat .ct-head span { color: #6b6459; }
body.in-combat .ct-mid { color: var(--panel-deep); }
body.in-combat .ct-mid b { color: var(--acc); font-size: 15px; }
body.in-combat .ct-timer { color: var(--panel-deep); font-weight: 700; }
body.in-combat .ct-note { color: #6b6459; }
body.in-combat .ct-bars .bar { background: #d8d3c8; border-color: #a79f8f; }
body.in-combat .ct-bars .bar > span { color: #1b1b1b; text-shadow: none; font-size: 10px; }
body.in-combat .bar.hp > i { background: #c62828; }
body.in-combat .bar.mp > i { background: #1565c0; }
body.in-combat .bar.en > i { background: #2e7d32; }

body.in-combat .fighter-panel,
body.in-combat .arena-center {
  background: #f5f3ee;
  border: 1px solid #b8b1a3;
  border-radius: 4px;
  color: var(--panel-deep);
}
body.in-combat .fighter-label { color: var(--acc); }
body.in-combat .fighter-name { color: var(--panel-deep); }
body.in-combat .fighter-portrait { background: #ddd8cd; border-color: #a79f8f; }
body.in-combat .fighter-pos, body.in-combat .zone-hint { color: #6b6459; }
body.in-combat .ap-label { color: #6b6459; }
body.in-combat .ap-big { color: var(--panel-deep); }
body.in-combat .plan-line { color: #3a352c; }
body.in-combat .plan-line b { color: var(--panel-deep); }
body.in-combat .arena-row-hint { color: #6b6459; }
body.in-combat .arena-go {
  background: #b3261e !important;
  border: 1px solid var(--acc) !important;
  color: #fff !important;
  text-shadow: none;
  font-weight: 700;
}
body.in-combat .arena-go:hover:not(:disabled) { background: #c9302a !important; }

body.in-combat .combat-controls .btn {
  background: #efede7;
  border: 1px solid #a79f8f;
  color: var(--panel-deep);
}
body.in-combat .combat-controls .btn-danger {
  background: #f3dcd9;
  border-color: #b3261e;
  color: var(--acc);
}
body.in-combat .ability-grid .tech-btn {
  background: #efede7;
  border: 1px solid #a79f8f;
  color: var(--panel-deep);
  border-radius: 3px;
}
body.in-combat .ability-grid .tech-btn b { color: var(--panel-deep); }
body.in-combat .ability-grid .tech-btn span { color: #6b6459; }
body.in-combat .ability-grid .tech-btn.active {
  border-color: #b3261e;
  box-shadow: inset 0 0 0 1px #b3261e;
  background: #fbeceb;
}
body.in-combat .ability-grid .tech-btn:disabled { opacity: .55; }
body.in-combat .tech-empty { background: #e3dfd6; border: 1px solid #c6bfb0; }

body.in-combat .combat-board .board-cell {
  background: #f5f3ee;
  border: 1px solid #b8b1a3;
  color: var(--panel-deep);
}
body.in-combat .combat-board .board-cell.reachable { background: #eef1e6; border-color: #7f9464; }
body.in-combat .combat-board .enemy-cell { background: #fbe9e7; border-color: #c07a72; }
body.in-combat .combat-board .enemy-cell.active { border-color: #b3261e; box-shadow: inset 0 0 0 1px #b3261e; }
body.in-combat .combat-board .player-cell { background: #e7eef7; border-color: #7a93b0; }
body.in-combat .board-name { color: var(--panel-deep); }
body.in-combat .board-labels { color: #6b6459; }

body.in-combat .combat-status .status-chip {
  background: #f5f3ee;
  border: 1px solid #b8b1a3;
  color: #3a352c;
}
body.in-combat .combat-result {
  background: #f5f3ee;
  border: 1px solid #b8b1a3;
  color: var(--panel-deep);
}
body.in-combat .combat-result h3 { color: var(--acc); }
body.in-combat .reward-list .gold { color: #8a6a1f; }
body.in-combat .reward-list .green { color: #2e7d32; }

/* нижняя панель и чат в бою — светлые, как в референсе */
body.in-combat .bottom-dock {
  background: #f2f0eb;
  border: 1px solid #b8b1a3;
}
body.in-combat .dock-tabs { border-color: #b8b1a3; }
body.in-combat .dock-tabs button { color: #3a352c; border-color: #cfc8ba; background: transparent; }
body.in-combat .dock-tabs button.active { color: var(--acc); box-shadow: inset 0 -2px 0 #b3261e; }
body.in-combat .chat-box, body.in-combat .dock-body { background: #f2f0eb; }
body.in-combat .chat-msg { color: var(--panel-deep); background: #f7f5f1; }
body.in-combat .chat-msg .chat-time { color: #6b6459; }
body.in-combat .chat-msg .chat-name { color: var(--acc); }
body.in-combat .chat-input { border-top-color: #cfc8ba; }
body.in-combat .chat-input input {
  background: #fffdf8;
  border: 1px solid #a79f8f;
  color: var(--panel-deep);
}
body.in-combat .chat-channels button {
  background: #e6e3da;
  border: 1px solid #b8b1a3;
  color: #3a352c;
}
body.in-combat .chat-channels button.active {
  background: #fbeceb;
  border-color: #b3261e;
  color: var(--acc);
}
body.in-combat .dock-sector, body.in-combat .right-section { color: var(--panel-deep); }
body.in-combat .right-section { background: #f2f0eb; border-color: #b8b1a3; }
body.in-combat .right-section-head { color: var(--panel-deep); }
body.in-combat .sector-player-row { background: #f7f5f1; border-color: #cfc8ba; }
body.in-combat .sector-player-row b { color: var(--panel-deep); }
body.in-combat .sector-player-row small { color: #6b6459; }


body.in-combat .combat-controls { background: transparent; border-color: #b8b1a3; }
body.in-combat .combat-board-wrap { background: transparent; }
body.in-combat .combat-controls .ap-meter { color: var(--panel-deep); }
/* компактная раскладка боя под референс */
body.in-combat .window-body,
body.in-combat .shell.wide-mode .window-body {
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow: visible !important;
}
body.in-combat .game-window { height: auto !important; }
body.in-combat .combat-topline { padding: 5px 10px; }
body.in-combat .ct-bars .bar { height: 11px; }
body.in-combat .combat-fighters { grid-template-columns: minmax(0, 1fr) 160px minmax(0, 1fr); }
body.in-combat .fighter-portrait { max-width: 150px; }
body.in-combat .fighter-name { font-size: 12px; }
body.in-combat .ability-grid { grid-template-columns: repeat(auto-fill, 52px); gap: 4px; }
body.in-combat .ability-grid .tech-btn { width: 52px; height: 52px; min-height: 52px; padding: 2px; }
body.in-combat .ability-grid .tech-btn b { font-size: 7.5px; line-height: 1.05; max-height: 16px; overflow: hidden; }
body.in-combat .ability-grid .tech-btn span { display: none; }
body.in-combat .tech-empty { width: 52px; height: 52px; }
body.in-combat .combat-board { grid-template-columns: repeat(4, 42px); }
body.in-combat .combat-board .board-cell { width: 42px; height: 34px; }
body.in-combat .combat-board .board-name { font-size: 8px; }
body.in-combat .combat-board-wrap { margin-top: 4px; }
body.in-combat .bottom-dock { margin-top: 8px; }
body.in-combat .combat-fighters { grid-template-columns: minmax(0, 1fr) 210px minmax(0, 1fr); }
body.in-combat .fighter-portrait { max-width: 240px; aspect-ratio: 4 / 3; }
body.in-combat .fighter-portrait img { width: 100%; height: 100%; object-fit: contain; }
body.in-combat .combat-fighters { min-height: 250px; }
body.in-combat .ability-grid .tech-btn { border-radius: 2px; width: 56px; height: 56px; min-height: 56px; }
body.in-combat .tech-empty { width: 56px; height: 56px; border-radius: 2px; }
body.in-combat .ability-grid { grid-template-columns: repeat(auto-fill, 56px); }
body.in-combat .combat-screen::before,
body.in-combat .combat-screen::after {
  content: '';
  position: absolute;
  top: 90px; bottom: 140px; width: 120px;
  pointer-events: none;
  opacity: .5;
  background:
    radial-gradient(circle at 20% 20%, rgba(179, 38, 30, .18), transparent 45%),
    radial-gradient(circle at 70% 60%, rgba(140, 29, 23, .14), transparent 50%);
}
body.in-combat .combat-screen::before { left: 0; }
body.in-combat .combat-screen::after { right: 0; }
/* док в бою — в потоке, не поверх арены, и светлый */
body.in-combat .bottom-dock {
  position: static;
  height: var(--dock-height, 212px);
  padding-left: 176px;
  box-shadow: none;
  z-index: auto;
}
body.in-combat .center-col { padding-bottom: 0; }
body.in-combat .right-tabs, body.in-combat .right-body { background: #f2f0eb; }
body.in-combat .dock-left .right-tabs { border-right-color: #cfc8ba; }
@media (max-width: 980px) {
  body.in-combat .bottom-dock { padding-left: 0; }
}
body.in-combat .ability-grid { grid-template-columns: repeat(4, 56px); max-width: 240px; }
body.in-combat .main-menu button,
body.in-combat .top-actions button {
  background: #f4f2ed;
  color: var(--ink);
  border-color: #c9c2b4;
}
body.in-combat .main-menu button.active { background: #e6e0d4; color: var(--acc); }
body.in-combat .main-menu button:hover, body.in-combat .top-actions button:hover { background: #ebe6dc; }
body.in-combat .top-actions { color: var(--ink); }
body.in-combat .hero-strip { color: var(--ink); }
body.in-combat .ability-grid { grid-template-columns: repeat(6, 48px); max-width: none; }

body.in-combat .tech-empty { width: 48px; height: 48px; }
body.in-combat .fighter-label, body.in-combat .zone-hint { font-size: 10px; }
body.in-combat .fighter-name { margin: 0 0 2px; }
body.in-combat .combat-fighters { min-height: 0; }
body.in-combat .combat-board { grid-template-columns: repeat(5, 38px); }
body.in-combat .combat-board .board-cell { width: 38px; height: 30px; }
body.in-combat .fighter-portrait {
  width: auto;
  max-width: none;
  height: 210px;
  aspect-ratio: 115 / 240;
  margin: 0 auto;
}
body.in-combat .fighter-portrait img { object-fit: contain; }
/* бой: сетка экрана, тактическая доска справа от портретов */
body.in-combat .combat-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  grid-template-areas:
    "top top"
    "fight board"
    "status status"
    "controls controls"
    "result result";
  gap: 8px;
  align-items: start;
}
body.in-combat .combat-topline { grid-area: top; }
body.in-combat .combat-fighters { grid-area: fight; }
body.in-combat .combat-board-wrap { grid-area: board; margin: 0; align-self: start; }
body.in-combat .combat-status { grid-area: status; }
body.in-combat .combat-controls { grid-area: controls; }
body.in-combat .combat-result { grid-area: result; }
body.in-combat .combat-board { grid-template-columns: repeat(5, 34px); }
body.in-combat .combat-board .board-cell { width: 34px; height: 26px; }
body.in-combat .fighter-portrait { height: 240px; }
/* в бою шапка тонкая, как в референсе */
body.in-combat .topbar {
  min-height: 0;
  height: 54px;
  padding: 6px 12px;
  align-items: center;
}
body.in-combat .brand-sub { display: none; }
body.in-combat .brand-title { font-size: 15px; line-height: 1.1; }
body.in-combat .brand-mark { width: 26px; height: 26px; }
body.in-combat .hero-strip { display: none; }
body.in-combat .shell { margin-top: 6px; }
body.in-combat .fighter-portrait { height: 210px; }
body.in-combat .ability-grid { grid-template-columns: repeat(6, 44px); }
body.in-combat .ability-grid .tech-btn { width: 44px; height: 44px; min-height: 44px; }
body.in-combat .tech-empty { width: 44px; height: 44px; }
body.in-combat .combat-topline { padding: 3px 10px; }
body.in-combat .ct-bars .bar { height: 10px; }
body.in-combat .ability-grid { grid-template-columns: repeat(8, 44px); }
/* бой: рамки плашек и портретов как в референсе */
body.in-combat .fighter-panel {
  background: #f7f5f1;
  border: 1px solid #3a352c;
  border-radius: 6px;
  padding: 8px 10px 6px;
  box-shadow: inset 0 0 0 3px #efece4, 0 2px 6px rgba(60, 50, 35, .10);
}
body.in-combat .fighter-portrait {
  border: 2px solid #2f2b23;
  border-radius: 2px;
  background: #fffdf9;
  box-shadow: inset 0 0 0 2px #e7e2d7;
  padding: 2px;
  box-sizing: content-box;
}
body.in-combat .fighter-portrait img { border-radius: 1px; }
body.in-combat .ct-side {
  background: #f7f5f1;
  border: 1px solid #3a352c;
  border-radius: 6px;
  padding: 5px 9px;
  box-shadow: inset 0 0 0 3px #efece4;
}
body.in-combat .ct-mid {
  background: #fbf9f5;
  border: 1px solid #3a352c;
  border-radius: 6px;
  box-shadow: inset 0 0 0 3px #efece4;
}
body.in-combat .ct-bars .bar { border-radius: 2px; }
body.in-combat .fighter-pos { color: #6b6459; }
/* бой: декор по краям (сгенерированные орнаменты, белый фон убирается multiply) */
body.in-combat .combat-screen::before,
body.in-combat .combat-screen::after {
  content: '';
  position: absolute;
  top: 150px;
  bottom: 60px;
  width: 190px;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: .9;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}
body.in-combat .combat-screen::before {
  left: -40px;
  background-image: url('../assets/decor/emblem-left.png');
}
body.in-combat .combat-screen::after {
  right: -40px;
  background-image: url('../assets/decor/claw-right.png');
}
@media (max-width: 1100px) {
  body.in-combat .combat-screen::before,
  body.in-combat .combat-screen::after { display: none; }
}
body.in-combat .combat-screen::after {
  background-image: url('../assets/decor/emblem-left.png');
  transform: scaleX(-1);
}
body.in-combat .ct-bars { gap: 4px; }
body.in-combat .ct-bars .bar { height: 15px; border-radius: 3px; }
body.in-combat .ct-bars .bar > span { font-size: 10.5px; font-weight: 700; letter-spacing: .2px; }
@media (max-width: 900px) {
  body.in-combat .combat-screen {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "top"
      "fight"
      "board"
      "status"
      "controls"
      "result";
  }
  body.in-combat .combat-fighters { grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr); }
  body.in-combat .fighter-portrait { height: 150px; }
  body.in-combat .fighter-panel { padding: 5px 6px; }
  body.in-combat .fighter-name { font-size: 11px; }
  body.in-combat .ct-head b { font-size: 12px; }
  body.in-combat .ability-grid { grid-template-columns: repeat(4, 44px); }
  body.in-combat .combat-board { justify-content: start; }
}
/* экран персонажа: размеры слотов под референс */
.hero-doll { max-width: 460px; }
.hero-doll-body { gap: 8px; align-items: center; }
.doll-col { width: auto; gap: 6px; }
.doll-slot { width: 68px; height: 68px; padding: 2px; justify-content: center; }
.doll-slot[data-slot="helmet"] { width: 68px; height: 68px; }

.doll-slot[data-slot="gloves"] { width: 68px; height: 45px; }
.doll-slot[data-slot="bracers"] { width: 68px; height: 38px; }
.doll-slot[data-slot="amulet"] { width: 68px; height: 45px; }
.doll-slot[data-slot="artifact"] { width: 68px; height: 45px; }
.doll-slot[data-slot="armor"] { width: 68px; height: 85px; }


.doll-slot[data-slot="ring"],
.doll-slot[data-slot="ring2"],
.doll-slot[data-slot="ring3"],
.doll-slot[data-slot="ring4"] { width: 62px; height: 42px; }
.doll-slot .ds-short, .doll-slot .ds-name { display: none; }
.doll-slot .ds-icon { width: 100%; height: 100%; display: grid; place-items: center; }
.doll-slot .ds-icon .item-art { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; }
.doll-slot .ds-icon svg { width: 22px; height: 22px; }
.belt-slot-row .doll-slot { width: 68px; height: 38px; padding: 2px; }
/* экран персонажа: светлая металлическая рама и слоты как в референсе */
.hero-doll {
  background:
    radial-gradient(ellipse at 18% 12%, rgba(150, 30, 24, .18), transparent 42%),
    radial-gradient(ellipse at 82% 88%, rgba(150, 30, 24, .14), transparent 45%),
    linear-gradient(180deg, #eae7e0, #d3cec4);
  border: 2px solid #6d675c;
  box-shadow: inset 0 0 0 3px #efece4, inset 0 0 0 4px var(--metal), 0 6px 18px rgba(0, 0, 0, .35);
}
.hero-doll-name { color: var(--ink-strong); }
.hero-doll-sub { color: #6b6459; }
.doll-slot {
  background: linear-gradient(180deg, #b9b3a7, #8e887c);
  border: 1px solid #574f44;
  box-shadow: inset 0 0 0 1px #e6e1d6, inset 0 2px 6px rgba(255, 255, 255, .35);
  color: #2a2620;
}
.doll-slot.filled { background: linear-gradient(180deg, #efece3, #d8d3c8); }
.doll-slot.empty { opacity: .8; }
.doll-slot:hover { border-color: var(--acc); box-shadow: inset 0 0 0 1px #efece4, 0 0 0 1px var(--acc); }
.doll-slot .ds-icon { color: #3a352c; }
.doll-slot.filled .ds-icon { color: inherit; }
.doll-avatar {
  border: 1px solid #6d675c;
  box-shadow: 0 0 0 2px #efece4, 0 0 0 3px var(--metal);
  background: #f4f2ec;
}
.doll-lvl { background: rgba(245, 243, 238, .92); border-color: var(--acc); color: var(--acc); }
.belt-slot-row { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.doll-xp .bar { border-color: #8e887c; background: #bdb7ab; }
.mentor-row { border-top-color: #b3ab9d; color: var(--ink-soft); }
.mentor-select { background: #f6f4ef; color: var(--ink-strong); border-color: #8e887c; }
.mentor-desc, .doll-pet { color: var(--ink-soft); }
/* экран персонажа: шире колонка куклы, крупнее фигура */
.hero-screen { grid-template-columns: 400px minmax(0, 1fr); }
.hero-doll { max-width: none; }
.doll-avatar.doll-full { width: 150px; height: 300px; max-width: 150px; padding: 5px; }
.doll-col { gap: 8px; }
.doll-center { padding: 0 4px; }
@media (max-width: 1100px) {
  
  .hero-doll { max-width: 420px; margin: 0 auto; }
}
.doll-slot[data-slot="belt"] { width: 68px; height: 38px; }
.doll-extra-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.doll-extra-row .doll-slot { flex: 0 0 auto; }
/* атака/защита в бою */
body.in-combat .ad-line { font-size: 10px; color: var(--ink-soft); margin: 2px 0 1px; letter-spacing: .01em; }
body.in-combat .ad-line b { color: var(--acc); font-size: 11px; }
body.in-combat .tech-btn.on-cooldown { opacity: .45; filter: grayscale(1); }
body.in-combat .tech-btn span { display: none; }
body.in-combat .tech-btn:disabled span { display: none; }
/* гильдейские приёмы: свой акцент, чтобы отличались от любых чужих иконок */
body.in-combat .ability-grid .tech-btn[data-id^="guild_"] { box-shadow: inset 0 0 0 2px var(--acc); }
body.in-combat .ability-grid .tech-btn[data-id^="guild_"]::after {
  content: '';
  position: absolute;
  top: 3px; right: 3px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #b3261e;
}
body.in-combat .ability-grid .tech-btn { position: relative; }
body.in-combat .ability-grid .tech-btn[data-id^="guild_"] .item-art,
body.in-combat .ability-grid .tech-btn[data-id^="guild_"] img { filter: saturate(1.15) contrast(1.05); }
/* экран персонажа: раскладка как в референсе — 3 слева, 3+кольца справа, 4 снизу */
.doll-slot[data-slot="armor"] { width: 68px; height: 85px; }
.doll-slot[data-slot="artifact"] { width: 68px; height: 85px; }
.doll-slot[data-slot="offhand"] { width: 68px; height: 68px; }
.doll-slot[data-slot="weapon"] { width: 68px; height: 97px; }
.doll-slot[data-slot="boots"] { width: 68px; height: 75px; }
.doll-col-right { align-items: center; }
.doll-rings { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.doll-rings .doll-slot { width: 62px; height: 42px; }
.doll-bottom-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.doll-bottom-row .doll-slot[data-slot="gloves"],
.doll-bottom-row .doll-slot[data-slot="amulet"] { width: 68px; height: 45px; }
.doll-bottom-row .doll-slot[data-slot="belt"],
.doll-bottom-row .doll-slot[data-slot="bracers"] { width: 68px; height: 38px; }
/* рамка куклы: заклёпки и внутренний кант как в референсе */
.hero-doll { position: relative; border-width: 3px; }
.hero-doll::before { content: ''; position: absolute; inset: 7px; border: 1px solid #8f887b; pointer-events: none; }
.hero-doll::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 13px 13px, #6d675c 0 3px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 13px) 13px, #6d675c 0 3px, transparent 3.5px),
    radial-gradient(circle at 13px calc(100% - 13px), #6d675c 0 3px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 13px) calc(100% - 13px), #6d675c 0 3px, transparent 3.5px);
}
.hero-doll > * { position: relative; z-index: 1; }
.doll-col { justify-content: flex-start; align-self: stretch; }
.doll-col-right { justify-content: flex-start; }
.doll-rings { margin-top: 6px; }
.hero-doll-body { align-items: flex-start; }
/* на экране персонажа нижняя панель не перекрывает лист */
body.char-tab .bottom-dock { position: static; height: var(--dock-height, 212px); padding-left: 176px; box-shadow: none; }
body.char-tab .center-col { padding-bottom: 0; }
@media (max-width: 980px) {
  body.char-tab .bottom-dock { padding-left: 0; }
}
/* кукла: точные координаты слотов как в эталоне (крупный вариант 453×450) */
.hero-doll { max-width: none; }
.hero-doll-body.doll-grid { position: relative; display: block; width: 453px; height: 450px; margin: 0 auto; }
.hero-doll-body.doll-grid::before { content: ''; position: absolute; top: 13px; left: 75px; right: 75px; bottom: 18px; background: #b9b9b9; }
.hero-doll-body.doll-grid::after { content: ''; position: absolute; top: 68px; left: 14px; right: 14px; bottom: 73px; background: #b9b9b9; }
.hero-doll-body.doll-grid > * { position: absolute; }
.doll-grid .doll-avatar.doll-full {
  top: 97px; left: 169px; width: 115px; height: 240px; max-width: 115px;
  padding: 0; border: 0; box-shadow: none; background: transparent; z-index: 2;
}
.doll-grid .doll-lvl { top: 40px; left: 50%; transform: translateX(-50%); z-index: 4; }
.doll-grid .doll-xp { top: 341px; left: 169px; width: 115px; z-index: 4; }
.doll-grid .doll-xp .bar { height: 8px; }
.doll-grid .doll-slot { z-index: 3; padding: 2px; }
.doll-grid .doll-slot[data-slot="weapon"] { top: 70px; left: 14px; width: 76px; height: 108px; }
.doll-grid .doll-slot[data-slot="offhand"] { top: 70px; left: 363px; width: 76px; height: 108px; }
.doll-grid .doll-slot[data-slot="helmet"] { top: 69px; left: 90px; width: 76px; height: 76px; }
.doll-grid .doll-slot[data-slot="armor"] { top: 145px; left: 90px; width: 76px; height: 94px; }
.doll-grid .doll-slot[data-slot="artifact"] { top: 146px; left: 287px; width: 76px; height: 92px; }
.doll-grid .doll-slot[data-slot="gloves"] { top: 239px; left: 90px; width: 76px; height: 53px; }
.doll-grid .doll-slot[data-slot="bracers"] { top: 239px; left: 287px; width: 76px; height: 53px; }
.doll-grid .doll-slot[data-slot="belt"] { top: 292px; left: 90px; width: 76px; height: 84px; }
.doll-grid .doll-slot[data-slot="boots"] { top: 292px; left: 287px; width: 76px; height: 84px; }
.doll-grid .doll-slot[data-slot="amulet"] { top: 69px; left: 287px; width: 76px; height: 76px; }
.doll-grid .doll-slot[data-slot="ring"] { top: 180px; left: 363px; width: 76px; height: 50px; }
.doll-grid .doll-slot[data-slot="ring2"] { top: 228px; left: 363px; width: 76px; height: 48px; }
.doll-grid .doll-slot[data-slot="ring3"] { top: 275px; left: 363px; width: 76px; height: 48px; }
.doll-grid .doll-slot[data-slot="ring4"] { top: 322px; left: 363px; width: 76px; height: 50px; }
/* размеры иконок внутри слотов — как задано */
.doll-grid .doll-slot .ds-icon { width: 100%; height: 100%; display: grid; place-items: center; }
.doll-grid .doll-slot .ds-icon .item-art { object-fit: contain; }
.doll-grid .doll-slot[data-slot="weapon"] .item-art { width: 68px; height: 97px; max-width: none; max-height: none; }
.doll-grid .doll-slot[data-slot="offhand"] .item-art { width: 68px; height: 97px; max-width: none; max-height: none; }
.doll-grid .doll-slot[data-slot="helmet"] .item-art { width: 68px; height: 68px; max-width: none; max-height: none; }
.doll-grid .doll-slot[data-slot="armor"] .item-art { width: 68px; height: 85px; max-width: none; max-height: none; }
.doll-grid .doll-slot[data-slot="artifact"] .item-art { width: 68px; height: 85px; max-width: none; max-height: none; }
.doll-grid .doll-slot[data-slot="gloves"] .item-art { width: 68px; height: 45px; max-width: none; max-height: none; }
.doll-grid .doll-slot[data-slot="bracers"] .item-art { width: 68px; height: 38px; max-width: none; max-height: none; }
.doll-grid .doll-slot[data-slot="belt"] .item-art { width: 68px; height: 38px; max-width: none; max-height: none; }
.doll-grid .doll-slot[data-slot="boots"] .item-art { width: 68px; height: 75px; max-width: none; max-height: none; }
.doll-grid .doll-slot[data-slot="amulet"] .item-art { width: 68px; height: 45px; max-width: none; max-height: none; }
.doll-grid .doll-slot[data-slot="ring"] .item-art,
.doll-grid .doll-slot[data-slot="ring2"] .item-art,
.doll-grid .doll-slot[data-slot="ring3"] .item-art,
.doll-grid .doll-slot[data-slot="ring4"] .item-art { width: 62px; height: 42px; max-width: none; max-height: none; }
@media (max-width: 560px) {
  .hero-doll-body.doll-grid { position: static; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: 100%; height: auto; }
  .hero-doll-body.doll-grid::before, .hero-doll-body.doll-grid::after { display: none; }
  .hero-doll-body.doll-grid > * { position: static !important; width: auto !important; height: auto !important; left: auto !important; top: auto !important; transform: none !important; }
  .doll-grid .doll-avatar.doll-full { grid-column: 1 / -1; justify-self: center; width: auto !important; height: auto !important; max-width: 100%; max-height: 220px; object-fit: contain; }
  .doll-grid .doll-slot { position: relative !important; }
  .doll-grid .doll-lvl, .doll-grid .doll-xp { grid-column: 1 / -1; }
  .doll-grid .doll-slot { min-height: 56px; height: 56px !important; }
  .doll-grid .doll-slot .item-art { width: 46px !important; height: 46px !important; max-width: 46px; max-height: 46px; object-fit: contain; }
  .hero-doll { overflow: visible; }
}
/* свои металлические гнёзда слотов (в стиле эталона, без чужих картинок) */
.doll-grid .doll-slot {
  background: linear-gradient(180deg, #a9a397 0%, #8d877b 46%, #7c766b 54%, #989184 100%);
  border: 1px solid #46413a;
  border-radius: 0;
  padding: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    inset 0 -2px 0 rgba(0, 0, 0, .35),
    inset 0 0 0 2px #bdb7ab,
    0 1px 0 rgba(0, 0, 0, .35);
}
.doll-grid .doll-slot::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid #5a544a;
  background:
    radial-gradient(ellipse at 50% 28%, #efece4 0%, #d8d3c8 55%, #b8b2a6 100%);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, .35), inset 0 -1px 0 rgba(255, 255, 255, .6);
  pointer-events: none;
  z-index: 0;
}
.doll-grid .doll-slot.filled::before {
  background:
    radial-gradient(ellipse at 50% 28%, #f6f3ec 0%, #e2ddd2 55%, #c3bdb1 100%);
}
.doll-grid .doll-slot .ds-icon { position: relative; z-index: 1; }
.doll-grid .doll-slot:hover {
  border-color: var(--acc);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    inset 0 -2px 0 rgba(0, 0, 0, .35),
    inset 0 0 0 2px #bdb7ab,
    0 0 0 2px rgba(140, 29, 23, .55);
}
.doll-grid .doll-slot:hover::before { border-color: var(--acc); }
/* заклёпки по углам гнёзд */
.doll-grid .doll-slot::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 5px 5px, #e6e1d6 0 1.5px, #575146 1.6px 2.4px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 5px) 5px, #e6e1d6 0 1.5px, #575146 1.6px 2.4px, transparent 2.5px),
    radial-gradient(circle at 5px calc(100% - 5px), #e6e1d6 0 1.5px, #575146 1.6px 2.4px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 5px) calc(100% - 5px), #e6e1d6 0 1.5px, #575146 1.6px 2.4px, transparent 2.5px);
}
/* сама панель куклы — металлическая пластина */
.hero-doll {
  background:
    radial-gradient(ellipse at 18% 10%, rgba(150, 30, 24, .16), transparent 42%),
    radial-gradient(ellipse at 84% 90%, rgba(150, 30, 24, .12), transparent 45%),
    linear-gradient(180deg, #ddd8cd, #c4beb2);
  border: 2px solid #5f594e;
  box-shadow:
    inset 0 0 0 2px #f0ece3,
    inset 0 0 0 4px var(--metal),
    0 8px 20px rgba(0, 0, 0, .35);
}
.hero-screen { grid-template-columns: 500px minmax(0, 1fr); }
.hero-doll { padding: 12px 14px; }
.doll-grid .doll-slot { padding: 5px; }
.doll-grid .doll-slot::before {
  inset: 5px;
  background: radial-gradient(ellipse at 50% 25%, #ded8cc 0%, #c5bfb2 55%, #a8a295 100%);
  box-shadow: inset 0 3px 7px rgba(0, 0, 0, .42), inset 0 -1px 0 rgba(255, 255, 255, .5);
}
.doll-grid .doll-slot.filled::before {
  background: radial-gradient(ellipse at 50% 25%, #efece3 0%, #d9d3c6 55%, #b9b3a6 100%);
}
@media (max-width: 1100px) { .hero-screen { grid-template-columns: 1fr; } }
/* уровень уже подписан в шапке куклы — убираем нашивку поверх аватара */
.doll-grid .doll-lvl { display: none; }
/* экран персонажа: 4 блока параметров в ряд, как в эталоне */
body.char-tab .char-stat-tabs { display: none; }
body.char-tab .char-stat-panel { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; align-items: start; }
body.char-tab .char-stat-panel .hero-block { display: block !important; min-height: 0; }
body.char-tab .char-stat-panel .params-block { grid-column: span 1; }
body.char-tab .hero-screen { background: #d7d7d7; padding: 8px; border: 1px solid #b9b3a7; }
body.char-tab .hero-main { gap: 8px; }
@media (max-width: 1100px) {
  body.char-tab .char-stat-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  body.char-tab .char-stat-panel { grid-template-columns: 1fr; }
}
/* вкладка «Персонаж»: светлая тема как в эталоне */
body.char-tab .game-window { background: #d7d7d7; border-color: var(--line-light); }
body.char-tab .window-body { background: #d7d7d7; }
body.char-tab .window-head { background: linear-gradient(#ece9e2, #ddd9d0); border-color: var(--line-light); }
body.char-tab .window-head .wt { color: var(--ink-strong); }
body.char-tab .window-head .wc { color: var(--ink-muted); }
body.char-tab .window-head .back { color: #2a2620; border-color: var(--metal); }
body.char-tab .window-actions { background: #cfcbc2; border-color: var(--line-light); }
body.char-tab .window-actions .btn { background: linear-gradient(#f4f2ec, #ddd8cd); color: var(--ink-strong); border-color: var(--metal); }
body.char-tab .window-actions .hint { color: var(--ink-muted); }
body.char-tab .char-skill-box { background: linear-gradient(#efece5, #dfdbd1); border-color: var(--line-light); }
body.char-tab .char-skill-box h4 { color: var(--ink-strong); border-bottom-color: var(--line-light); }
body.char-tab .char-skill-box .csl-name { color: var(--ink-soft); }
body.char-tab .char-skill-box .char-skill-line b { color: var(--ink-strong); }
body.char-tab .char-skill-box .csl-bar { background: #c3bdb1; border-color: #9c958a; }
body.char-tab .hero-bottom { background: #e3e0d9; border-color: var(--line-light); }
body.char-tab .hero-tabs button { background: #cfcbc2; color: #2a2620; border-color: var(--metal); }
body.char-tab .hero-tabs button:hover { background: #e7e4dd; }
body.char-tab .hero-tabs button.active { background: linear-gradient(#f6f4ef, #e2ded5); color: var(--acc); }
body.char-tab .hero-block.set-gallery,
body.char-tab .hero-block.portrait-block { background: linear-gradient(#efece5, #dfdbd1); border-color: var(--line-light); }
body.char-tab .hero-block.set-gallery h4,
body.char-tab .hero-block.portrait-block h4 { color: var(--ink-strong); border-bottom-color: var(--line-light); }
body.char-tab .hero-block.set-gallery .small,
body.char-tab .hero-block.portrait-block .small { color: var(--ink-soft); }
body.char-tab .hero-block.set-gallery .set-card,
body.char-tab .portrait-card { background: #f2f0ea; border-color: var(--line-light); color: #2a2620; }
body.char-tab .portrait-card.selected { border-color: var(--acc); color: var(--acc); box-shadow: 0 0 0 1px rgba(140,29,23,.35); }
body.char-tab .hero-tab-content { color: #2a2620; }
body.char-tab .hero-bottom.char-extra { display: flex; flex-direction: column-reverse; }
body.char-tab .hero-tabs.char-extra-tabs { flex-direction: row; flex-wrap: wrap; border-top: 1px solid var(--line-light); padding-top: 6px; }
body.char-tab .hero-tabs.char-extra-tabs button { flex: 0 0 auto; }
/* вкладка «Сумка»: светлая тема и плитки как в эталоне */
body.inv-tab .game-window { background: #d7d7d7; border-color: var(--line-light); }
body.inv-tab .window-body { background: #d7d7d7; }
body.inv-tab .window-head { background: linear-gradient(#ece9e2, #ddd9d0); border-color: var(--line-light); }
body.inv-tab .window-head .wt { color: var(--ink-strong); }
body.inv-tab .window-head .wc { color: var(--ink-muted); }
body.inv-tab .window-actions { background: #cfcbc2; border-color: var(--line-light); }
body.inv-tab .window-actions .btn { background: linear-gradient(#f4f2ec, #ddd8cd); color: var(--ink-strong); border-color: var(--metal); }
body.inv-tab .panel-box { background: #e6e4df; border-color: var(--line-light); color: #2a2620; }
body.inv-tab .panel-title { color: var(--ink-strong); }
body.inv-tab .inv-style { color: var(--ink-soft); }
body.inv-tab .inv-style b { color: var(--acc); }
body.inv-tab .equip-row { border-color: #c6c0b3; color: #2a2620; background: #efede7; }
body.inv-tab .equip-row[data-act]:hover { background: #e4e1da; }
body.inv-tab .equip-row .en b { color: var(--ink-strong); }
body.inv-tab .equip-row .en span { color: var(--ink-muted); }
body.inv-tab .cap-row { color: #2a2620; }
body.inv-tab .cap-bar { background: #c3bdb1; border-color: #9c958a; }
body.inv-tab .res-row { color: #2a2620; border-color: #cfc8ba; }
body.inv-tab .res-price { color: #6b6459; }
body.inv-tab .inv-toolbar { background: #e3e0d9; border-color: var(--line-light); }
body.inv-tab .inv-filters button { background: #cfcbc2; color: var(--ink); border-color: var(--metal); }
body.inv-tab .inv-filters button:hover { background: #e7e4dd; }
body.inv-tab .inv-filters button.active { background: #f6f4ef; color: var(--acc); }
body.inv-tab .inv-search, body.inv-tab .inv-sort select { background: #fbfaf7; color: var(--ink-strong); border-color: var(--metal); }
body.inv-tab .inv-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
body.inv-tab .item-card { background: #f2f0ea; border-color: var(--line-light); color: #2a2620; }
body.inv-tab .item-card h4 { color: var(--ink-strong); }
body.inv-tab .item-card .item-sub { color: var(--ink-muted); }

body.inv-tab .item-card .item-desc { color: var(--ink-muted); }
body.inv-tab .item-card .item-price { color: #8a6a1f; }
body.inv-tab .item-card .btn { background: linear-gradient(#f4f2ec, #ddd8cd); color: var(--ink-strong); border-color: var(--metal); }
body.inv-tab .item-card .btn-primary { background: linear-gradient(#c0392b, var(--acc)); color: #fff; border-color: #7a1a15; }
/* общая светлая тема: верхняя панель и нижний док */
.topbar { background: linear-gradient(#eceae4, #d9d5cc); border-bottom: 1px solid var(--line-light); }
.brand-title { color: var(--ink-strong); }
.brand-sub { color: var(--ink-muted); }
.brand-mark { color: var(--acc); }
.main-menu button { background: #cfcbc2; color: var(--ink); border-color: var(--metal); }
.main-menu button:hover { background: #e7e4dd; }
.main-menu button.active { background: #f6f4ef; color: var(--acc); }
.mini-name b { color: var(--ink-strong); }
.mini-name span { color: var(--ink-muted); }
.mini-bars .bar { background: #c3bdb1; border-color: #9c958a; }
.mini-bars .bar > span { color: #1b1b1b; text-shadow: none; font-size: 10px; font-weight: 700; }
.mini-xp span { color: var(--ink-soft); }
.coin-pill { background: #f2f0ea; color: var(--ink); border-color: var(--metal); }
.icon-btn { background: #f2f0ea; color: var(--ink); border-color: var(--metal); }
.icon-btn:hover { background: #e2ddd4; }
.bottom-dock { background: #e3e0d9; border-color: var(--line-light); box-shadow: 0 -6px 18px rgba(0, 0, 0, .15); }
.dock-tabs { background: #d9d5cc; border-color: var(--line-light); }
.dock-tabs button { color: var(--ink); border-color: #c6c0b3; background: transparent; }
.dock-tabs button:hover { background: #e7e4dd; }
.dock-tabs button.active { color: var(--acc); box-shadow: inset 3px 0 0 var(--acc); }
.dock-body, .dock-body .chat-box { background: #e9e6df; }
.dock-body .chat-msg { background: #f4f2ec; color: var(--panel-deep); }
.dock-body .chat-msg:nth-child(even) { background: #eeece5; }
.dock-body .chat-msg .chat-time { color: #6b6459; }
.dock-body .chat-msg .chat-name { color: var(--acc); }
.dock-body .chat-input input { background: #fbfaf7; color: var(--ink-strong); border-color: var(--metal); }
.dock-body .chat-input .btn { background: #cfcbc2; color: var(--ink); border-color: var(--metal); }
.chat-channels button { background: #d9d5cc; color: var(--ink); border-color: var(--line-light); }
.chat-channels button.active { background: #f6f4ef; color: var(--acc); }
.dock-sector { background: #e3e0d9; border-color: var(--line-light); color: #2a2620; }
.dock-sector .res-row, .dock-sector .sector-row { border-color: #cfc8ba; color: #2a2620; }
/* город и мир: светлая тема */
body.world-tab .game-window { background: #d7d7d7; border-color: var(--line-light); }
body.world-tab .window-body { background: #d7d7d7; }
body.world-tab .window-head { background: linear-gradient(#ece9e2, #ddd9d0); border-color: var(--line-light); }
body.world-tab .window-head .wt { color: var(--ink-strong); }
body.world-tab .window-head .wc { color: var(--ink-muted); }
body.world-tab .window-actions { background: #cfcbc2; border-color: var(--line-light); }
body.world-tab .window-actions .btn { background: linear-gradient(#f4f2ec, #ddd8cd); color: var(--ink-strong); border-color: var(--metal); }
body.world-tab .city-street-stage { background: #d7d7d7; color: var(--ink); }


body.world-tab .street-building { background: linear-gradient(#efece5, #dfdbd1); border-color: var(--line-light); color: var(--ink); }
body.world-tab .street-building:hover { background: linear-gradient(#f6f4ee, #e7e3da); border-color: var(--acc); }
body.world-tab .street-building.current { border-color: var(--acc); }


body.world-tab .street-arrow, body.world-tab .city-exit-top { background: #e6e4df; color: var(--ink); border-color: var(--metal); }
body.world-tab .street-dot { background: #cfcbc2; color: var(--ink); border-color: var(--metal); }
body.world-tab .street-dot.active { background: #f6f4ef; color: var(--acc); border-color: var(--acc); }
body.world-tab .street-bottom { color: #2a2620; border-color: #c6c0b3; }
body.world-tab .building-hero h3 { color: var(--ink-strong); }
body.world-tab .building-hero p { color: var(--ink-soft); }
body.world-tab .building-card, body.world-tab .panel-box { background: #e6e4df; border-color: var(--line-light); color: var(--ink); }
body.world-tab .building-card h4, body.world-tab .panel-title { color: var(--ink-strong); }
body.world-tab .building-card p, body.world-tab .small, body.world-tab .dim { color: var(--ink-muted); }
body.world-tab .kv span { color: var(--ink-muted); }
body.world-tab .kv b { color: var(--ink-strong); }
body.world-tab .btn { background: linear-gradient(#f4f2ec, #ddd8cd); color: var(--ink-strong); border-color: var(--metal); }
body.world-tab .btn-primary { background: linear-gradient(#c0392b, var(--acc)); color: #fff; border-color: #7a1a15; }


/* светлая тема для остальных окон */
body.light-ui .game-window { background: #d7d7d7; border-color: var(--line-light); }
body.light-ui .window-body {
  background: #d7d7d7; color: var(--ink);
  --text: var(--ink); --muted: var(--ink-soft); --dim: #6b6459;
  --panel: #e6e4df; --panel-2: #efede7; --panel-3: #ddd9d0;
  --line: var(--line-light);
}
body.light-ui .window-head { background: linear-gradient(#ece9e2, #ddd9d0); border-color: var(--line-light); }
body.light-ui .window-head .wt { color: var(--ink-strong); }
body.light-ui .window-head .wc { color: var(--ink-muted); }
body.light-ui .window-head .back { color: #2a2620; border-color: var(--metal); }
body.light-ui .window-actions { background: #cfcbc2; border-color: var(--line-light); }
body.light-ui .window-actions .btn { background: linear-gradient(#f4f2ec, #ddd8cd); color: var(--ink-strong); border-color: var(--metal); }
body.light-ui .window-actions .hint { color: var(--ink-muted); }
body.light-ui .panel-box,
body.light-ui .hero-block,
body.light-ui .building-card,
body.light-ui .item-card,
body.light-ui .quest-card,
body.light-ui .shop-card,
body.light-ui .set-shop-card,
body.light-ui .tech-card,
body.light-ui .ach-card,
body.light-ui .pet-card,
body.light-ui .recipe-card { background: #e6e4df; border-color: var(--line-light); color: var(--ink); }
body.light-ui .panel-title,
body.light-ui .hero-block h4,
body.light-ui .building-card h4 { color: var(--ink-strong); }
body.light-ui .btn { background: linear-gradient(#f4f2ec, #ddd8cd); color: var(--ink-strong); border-color: var(--metal); }
body.light-ui .btn-primary { background: linear-gradient(#c0392b, var(--acc)); color: #fff; border-color: #7a1a15; }
body.light-ui input, body.light-ui select, body.light-ui textarea { background: #fbfaf7; color: var(--ink-strong); border-color: var(--metal); }
body.light-ui .empty-note, body.light-ui .small, body.light-ui .dim { color: var(--ink-muted); }
body.light-ui .left-menu { background: linear-gradient(#eceae4, #ddd9d0); border-color: var(--line-light); }
body.light-ui .menu-item { color: #3a352c; border-bottom-color: #cfc8ba; }
body.light-ui .menu-item:hover { background: #e7e4dd; color: #14110c; }
body.light-ui .menu-item.active { background: #f6f4ef; color: var(--acc); box-shadow: inset 3px 0 0 var(--acc); }
body.light-ui .menu-label { color: #6b6459; }
body.light-ui .menu-extra .btn { background: linear-gradient(#f4f2ec, #ddd8cd); color: var(--ink-strong); border-color: var(--metal); }
body.light-ui .daily-task { background: #efede7; border-color: #cfc8ba; color: var(--ink); }
body.light-ui .daily-task-list { background: transparent; }
body.light-ui .quest-preview, body.light-ui .quest-progress { color: var(--ink-soft); }
body.light-ui .quest-progress { background: #c3bdb1; border-color: #9c958a; }
body.light-ui .quest-card.ready { border-color: var(--acc); }
/* карточки магазина — светлые */
.shop-card, .set-shop-card, .recipe-card { background: #e6e4df; border-color: var(--line-light); color: var(--ink); }
.shop-card-title { color: var(--ink-strong); }
.shop-card-desc, .shop-card-meta, .shop-card-stats { color: var(--ink-soft); }
.shop-card-price { color: #8a6a1f; }
.shop-card-art { background: #ddd9d0; border-color: var(--line-light); }
.shop-card .btn { background: linear-gradient(#f4f2ec, #ddd8cd); color: var(--ink-strong); border-color: var(--metal); }
.shop-card .btn-primary { background: linear-gradient(#c0392b, var(--acc)); color: #fff; border-color: #7a1a15; }
/* бой: сцена как в эталоне — два аватара, зоны под ними, сетка приёмов 6×2 */
body.in-combat .combat-screen {
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  grid-template-areas:
    "top top"
    "fight fight"
    "controls controls"
    "result result";
  justify-items: center;
}
body.in-combat .combat-board-wrap { display: none; }
body.in-combat .combat-fighters {
  grid-area: fight;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 30px;
  width: 100%;
}
body.in-combat .fighter-panel { flex: 0 0 auto; }
body.in-combat .fighter-portrait {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  width: 115px;
  height: auto;
  aspect-ratio: auto;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  gap: 3px;
}
body.in-combat .fighter-portrait img { width: 115px; height: 240px; object-fit: contain; }
body.in-combat .fighter-portrait .zone-mark {
  position: static !important;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid #6d675c;
  border-radius: 2px;
  background: #e6e4df;
  color: var(--ink);
  font-size: 10px;
  line-height: 1;
}
body.in-combat .fighter-portrait .zone-mark.has-count { background: #f1d6cf; border-color: var(--acc); color: var(--acc); }
body.in-combat .arena-center {
  order: 3;
  flex: 0 0 auto;
  align-self: center;
  width: 150px;
  min-width: 0;
  padding: 4px 6px;
}
body.in-combat .ability-grid { grid-template-columns: repeat(6, 48px); gap: 4px; }
body.in-combat .ability-grid .tech-btn { width: 48px; height: 48px; min-height: 48px; }
body.in-combat .combat-controls { grid-area: controls; justify-content: center; }
/* компактный переключатель цели */
body.in-combat .target-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}
body.in-combat .target-switch button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #6d675c;
  border-radius: 2px;
  background: #e6e4df;
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
body.in-combat .target-switch button:hover { border-color: var(--acc); color: var(--acc); }
body.in-combat .target-switch span { font-size: 10px; color: var(--ink-soft); white-space: nowrap; }
@media (max-width: 760px) {
  body.in-combat .target-switch span { font-size: 9px; }
}
body.in-combat .ct-mid { gap: 2px; }
body.in-combat .ct-mid b { font-size: 13px; }
body.in-combat .ct-timer { display: inline; font-size: 13px; font-weight: 700; color: var(--acc); }
body.in-combat .ct-od { font-size: 9.5px; color: var(--ink-soft); white-space: nowrap; }
/* бой: панели союзников/противников и кнопки над сценой */
body.in-combat .combat-bar { display: flex; gap: 6px; justify-content: center; margin: 4px 0 2px; }
body.in-combat .combat-bar .btn { min-height: 24px; font-size: 10px; padding: 3px 10px; }
body.in-combat .combat-versus { display: flex; justify-content: space-between; gap: 12px; width: 100%; max-width: 1000px; margin: 0 auto 2px; }
body.in-combat .vs-side { flex: 1 1 0; min-width: 0; background: #e6e4df; border: 1px solid var(--line-light); padding: 3px 6px; font-size: 10px; color: var(--ink); }
body.in-combat .vs-side.enemy { text-align: right; }
body.in-combat .vs-title { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: #6b6459; margin-bottom: 2px; }
body.in-combat .vs-row { display: block; width: 100%; text-align: inherit; background: transparent; border: 0; padding: 1px 0; font-size: 10px; color: var(--ink); cursor: default; }
body.in-combat button.vs-row { cursor: pointer; }
body.in-combat button.vs-row:hover { color: var(--acc); }
body.in-combat .vs-row.active { color: var(--acc); font-weight: 700; }
body.in-combat .combat-screen {
  grid-template-areas:
    "top top"
    "bar bar"
    "vs vs"
    "fight fight"
    "controls controls"
    "result result";
}
body.in-combat .combat-bar { grid-area: bar; align-self: center; }
body.in-combat .combat-versus { grid-area: vs; }
/* итоги боя и окно лога */
body.in-combat .combat-result-table { width: 100%; border-collapse: collapse; margin: 6px 0 8px; font-size: 11px; color: var(--ink); }
body.in-combat .combat-result-table th { background: #cfcbc2; border: 1px solid var(--line-light); padding: 3px 6px; text-align: left; font-weight: 700; }
body.in-combat .combat-result-table td { border: 1px solid #cfc8ba; padding: 3px 6px; background: #f4f2ec; }
body.in-combat .combat-log { display: none; }
body.in-combat.combat-log-open .combat-log {
  display: block;
  position: fixed;
  top: 80px; right: 24px;
  width: 440px; max-height: 62vh; overflow: auto;
  padding: 10px 12px;
  background: #f4f2ec;
  border: 2px solid #6d675c;
  box-shadow: inset 0 0 0 2px #efece4, 0 12px 30px rgba(0, 0, 0, .35);
  color: var(--ink);
  font-size: 11px;
  line-height: 1.5;
  z-index: 90;
  text-align: left;
}
body.in-combat.combat-log-open .combat-log div { border-bottom: 1px dotted #cfc8ba; padding: 2px 0; }
/* бой на весь экран, как в эталонном iframe: без шапки приложения */
body.in-combat .topbar { display: none; }
body.in-combat .window-head,
body.in-combat .window-actions { display: none; }
body.in-combat .game-window { border: 0; background: transparent; }
body.in-combat .window-body { padding-top: 0; }
body.in-combat .shell { margin-top: 0; }
body.in-combat .combat-screen { border: 0; }
/* блок ожидания раунда */
body.in-combat .combat-wait {
  width: 100%; max-width: 520px; margin: 4px auto;
  padding: 6px 10px; text-align: center;
  background: #e6e4df; border: 1px solid var(--line-light); color: var(--ink);
}
body.in-combat .combat-wait b { color: var(--ink-strong); }
body.in-combat .cw-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; margin-top: 3px; font-size: 10px; color: var(--ink-soft); }
body.in-combat .cw-stats b { color: var(--acc); }
/* панели сторон по краям сцены, как в эталоне */
body.in-combat .combat-versus {
  position: absolute;
  left: 16px; right: 16px;
  top: 150px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 2;
}
body.in-combat .vs-side {
  width: 210px;
  min-height: 150px;
  pointer-events: auto;
  background: #e6e4df;
  border: 1px solid var(--line-light);
  padding: 6px 8px;
}
body.in-combat .combat-fighters { position: relative; z-index: 1; }
/* иконки автохода в центре боя */
body.in-combat .ct-auto { display: flex; gap: 4px; justify-content: center; margin-top: 2px; }
body.in-combat .ct-auto button {
  width: 22px; height: 22px; padding: 0;
  border: 1px solid #6d675c; border-radius: 2px;
  background: #e6e4df; color: var(--ink); font-size: 11px; line-height: 1; cursor: pointer;
}
body.in-combat .ct-auto button:hover { border-color: var(--acc); color: var(--acc); }
/* блоки — синие, удары — красные */
body.in-combat .fighter .zone-mark.player.has-count { background: #d7e5f7; border-color: #1565c0; color: #1565c0; }
body.in-combat .fighter .zone-mark.enemy.has-count { background: #f7d9d4; border-color: var(--acc); color: var(--acc); }
body.in-combat .combat-result-table tr.total td { background: #e6e4df; font-weight: 700; border-top: 2px solid var(--line-light); }
body.in-combat .combat-log-head { margin-bottom: 6px; padding-bottom: 5px; border-bottom: 1px solid var(--line-light); font-size: 10px; color: var(--ink-soft); }
/* кнопка «Назад» в бою */
body.in-combat .combat-screen { position: relative; }
body.in-combat .combat-back {
  position: absolute;
  top: 6px; right: 8px;
  z-index: 20;
  padding: 4px 10px;
  font-size: 10px;
  border: 1px solid #6d675c;
  border-radius: 2px;
  background: #e6e4df;
  color: var(--ink);
  cursor: pointer;
}
body.in-combat .combat-back:hover { border-color: var(--acc); color: var(--acc); }
body.in-combat .combat-result-table tr.enemy-row td { color: var(--ink-muted); }
body.in-combat .combat-result-table tr.enemy-row.dead td { color: var(--acc); text-decoration: line-through; }
/* кнопка «Назад» в интерфейсе, справа сверху */
.icon-btn.nav-back { font-size: 16px; font-weight: 700; line-height: 1; padding: 0 8px; }
body.in-combat .icon-btn.nav-back { display: none; }
/* кнопка «Назад» внутри зданий */
.building-topline { display: flex; justify-content: flex-end; padding: 2px 4px 6px; }
.building-back {
  padding: 4px 10px; font-size: 10px;
  border: 1px solid #6d675c; border-radius: 2px;
  background: #e6e4df; color: var(--ink); cursor: pointer;
}
.building-back:hover { border-color: var(--acc); color: var(--acc); }
body.has-combat .icon-btn.nav-back { display: none; }
body.in-combat .icon-btn.nav-back { display: inline-flex; }
/* верхняя панель как в эталоне: слева ник+полосы, центр — меню, справа — деньги */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 0;
  height: 58px;
  padding: 5px 10px;
}
.brand { display: none; }
.hero-strip { flex: 0 0 auto; gap: 0; }
.mini-portrait { display: none; }
.mini-xp { display: none; }
.mini-name { display: block; text-align: left; }
.mini-name b { font-size: 11px; color: var(--ink-strong); }
.mini-name span { font-size: 10px; color: var(--ink-muted); }
.mini-bars { width: 190px; margin-top: 2px; }
.mini-bars .bar { width: 190px; height: 11px; }
.main-menu { margin-left: auto; margin-right: auto; flex: 0 1 auto; }
.main-menu button { padding: 6px 8px; }
.main-menu button span { display: none; }
.top-actions { margin-left: auto; }
.icon-btn span { display: none; }
/* контраст на светлой теме: золотые акценты -> тёмные */
body.light-ui .window-body,
body.char-tab .window-body,
body.inv-tab .window-body,
body.world-tab .window-body,
body.light-ui .window-actions {
  --gold: #8a6a1f;
  --gold-2: var(--acc);
  --gold-dark: #6d5418;
  --muted: var(--ink-soft);
  --dim: var(--ink-muted);
  --text: var(--ink);
}
.bottom-dock {
  --gold: #8a6a1f;
  --gold-2: var(--acc);
  --gold-dark: #6d5418;
  --text: var(--ink);
  --muted: var(--ink-soft);
  --dim: var(--ink-muted);
}
body.light-ui .gold, body.char-tab .gold, body.inv-tab .gold, body.world-tab .gold { color: #8a6a1f; }
body.light-ui .dim, body.char-tab .dim, body.inv-tab .dim, body.world-tab .dim { color: var(--ink-muted); }
.bottom-dock .gold, .bottom-dock .sector-title { color: var(--acc); }
.bottom-dock .sector-sub, .bottom-dock .dock-toggle { color: var(--ink-muted); }
.bottom-dock .emoji-toggle { color: var(--ink-soft); }
/* город: светлые панели поверх тёмной сцены */
body.world-tab .city-street-stage { background: #d7d7d7; }
body.world-tab .city-street-top,
body.world-tab .street-bottom {
  background: #e6e4df;
  border-color: var(--line-light);
}
body.world-tab .city-street-top b { color: var(--ink-strong); }
body.world-tab .city-street-top span { color: var(--ink-muted); }
body.world-tab .street-building { background: linear-gradient(#f4f2ec, #e2ded5); color: var(--ink); border-color: var(--line-light); }
body.world-tab .street-building-text b { color: var(--ink-strong); }
body.world-tab .street-building-text span { color: var(--ink-muted); }
body.world-tab .city-nav-item { background: #e6e4df; color: var(--ink); border-color: var(--line-light); }
body.world-tab .city-nav-item.active { background: #f6f4ef; color: var(--acc); }
body.world-tab .city-exit-top, body.world-tab .street-arrow { background: #e6e4df; color: var(--ink); border-color: var(--metal); }
body.char-tab .doll-xp .bar { background: #c3bdb1; border-color: #9c958a; }
body.char-tab .doll-xp .bar > span { color: #1b1b1b; text-shadow: none; font-size: 9px; font-weight: 700; }
body.inv-tab .item-card h4 { color: var(--ink-strong) !important; }
body.inv-tab .item-card .item-stats { color: #3a352c; }
body.light-ui .btn-primary { color: #ffffff; background: linear-gradient(#b3261e, var(--acc)); border-color: #7a1a15; }
body.inv-tab .item-card h4,
body.inv-tab .item-card .item-sub,
body.inv-tab .item-card .item-stats,
body.inv-tab .item-card .item-desc { color: var(--ink) !important; }
body.inv-tab .item-card .item-price { color: #8a6a1f !important; }
body.light-ui .battle-history .defeat, body.light-ui .battle-history .lost { color: var(--acc); }
/* жирные надписи во всём интерфейсе */
body { font-weight: 600; }
.window-body, .window-body *,
.topbar, .topbar *,
.bottom-dock, .bottom-dock *,
.hero-screen, .hero-screen *,
.inv-screen, .inv-screen *,
.battle-hub, .battle-hub *,
.combat-screen, .combat-screen * { font-weight: 600; }
.window-body b, .window-body strong,
.window-body h1, .window-body h2, .window-body h3, .window-body h4,
.topbar b, .bottom-dock b, .bottom-dock strong,
button, .btn, .menu-item, .tech-btn, .doll-slot,
.hero-screen b, .hero-screen h3, .hero-screen h4,
.inv-screen b, .inv-screen h4,
.battle-hub b, .battle-hub h3, .battle-hub h4,
.combat-screen b { font-weight: 700; }
/* крупнее надписи + читаемость */
body { font-size: 14px; }
.window-body { font-size: 13px; }
.menu-item { font-size: 13px; }
.menu-label { font-size: 11px; }
.window-head .wt { font-size: 15px; }
.window-head .wc { font-size: 11px; }
.btn { font-size: 12px; }
.btn-sm { font-size: 11px; }
.hint, .small, .empty-note { font-size: 11.5px; }
.hstat-row, .hmod-row { font-size: 12px; }
.hstat-row b, .hmod-row b { font-size: 13px; }
.kv { font-size: 12px; }
.chat-msg { font-size: 13px; }
.chat-input input { font-size: 12.5px; }
.bar > span { font-size: 10.5px; }
.item-card h4 { font-size: 13px; }
.item-card .item-stats { font-size: 11.5px; }
.item-card .item-desc { font-size: 11px; }
.shop-card-title { font-size: 13px; }
.battle-hub-title { font-size: 18px; }
body.inv-tab .equip-row .en b { color: var(--ink-strong) !important; font-size: 12.5px; }
body.inv-tab .equip-row .en span { color: var(--ink-soft); font-size: 10.5px; }
body.inv-tab .equip-row .tag { font-size: 10px; color: var(--acc); }
/* «Бои»: светлые карточки режимов и история */
body.light-ui .battle-hub-head,
body.light-ui .battle-history,
body.light-ui .battle-apps > *,
body.light-ui .battle-mode-card {
  background: linear-gradient(#f4f2ec, #e2ded5);
  border-color: var(--line-light);
  color: var(--ink);
}
body.light-ui .battle-mode-card p,
body.light-ui .bm-meta { color: #3a352c; }
body.light-ui .bm-head b { color: var(--ink-strong); }
body.light-ui .bm-head span { color: var(--ink-muted); }
body.light-ui .battle-history-head { color: var(--acc); }
body.light-ui .battle-history-row { color: var(--ink); }
body.light-ui .battle-history-row:hover { background: #efede7; }
body.light-ui .battle-mode-card.locked { opacity: .75; }
/* верхняя панель в 3 раза крупнее */
.topbar { height: 150px; padding: 12px 18px; gap: 16px; }
.mini-name b { font-size: 30px; }
.mini-name span { font-size: 21px; }
.mini-bars { width: 540px; margin-top: 6px; }
.mini-bars .bar { width: 540px; height: 30px; }
.mini-bars .bar > span { font-size: 19px; }
.main-menu { gap: 6px; }
.main-menu button { padding: 14px 18px; border-radius: 4px; }
.main-menu button svg { width: 40px; height: 40px; }
.top-actions { gap: 12px; }
.coin-pill { font-size: 24px; padding: 8px 14px; }
.icon-btn svg { width: 34px; height: 34px; }
.icon-btn.nav-back { font-size: 40px; padding: 0 14px; }
.coin-pill .dot { width: 16px; height: 16px; }
.mist-coin-sm { width: 26px; height: 26px; }
@media (max-width: 1400px) {
  .topbar { height: 120px; }
  .mini-name b { font-size: 22px; }
  .mini-bars, .mini-bars .bar { width: 380px; }
  .main-menu button { padding: 10px 12px; }
  .main-menu button svg { width: 30px; height: 30px; }
}
/* доводка до ~3x */
.topbar { height: 168px; }
.mini-name b { font-size: 33px; }
.mini-name span { font-size: 23px; }
.mini-bars, .mini-bars .bar { width: 585px; }
.mini-bars .bar { height: 33px; }
.mini-bars .bar > span { font-size: 21px; }
.main-menu button { padding: 16px 20px; }
.main-menu button svg { width: 46px; height: 46px; }
.coin-pill { font-size: 27px; }
.icon-btn svg { width: 38px; height: 38px; }
/* шапка 116px, иконки меню 80px */
.topbar { height: 116px; padding: 8px 14px; gap: 12px; }
.mini-name b { font-size: 24px; }
.mini-name span { font-size: 17px; }
.mini-bars { width: 430px; margin-top: 4px; }
.mini-bars, .mini-bars .bar { width: 430px; }
.mini-bars .bar { height: 24px; }
.mini-bars .bar > span { font-size: 15px; }
.main-menu { gap: 4px; }
.main-menu button { width: 80px; height: 80px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.main-menu button svg { width: 58px; height: 58px; }
.coin-pill { font-size: 20px; padding: 6px 12px; }
.coin-pill .dot { width: 14px; height: 14px; }
.mist-coin-sm { width: 22px; height: 22px; }
.icon-btn svg { width: 30px; height: 30px; }
.icon-btn.nav-back { font-size: 32px; padding: 0 12px; }
/* иконки меню: картинка 80×80 внутри кнопки 80×80 */
.main-menu { gap: 6px; }
.main-menu button {
  width: 80px; height: 80px; padding: 0;
  border: 0; background: transparent; box-shadow: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.main-menu button svg { width: 80px; height: 80px; }
.main-menu button:hover { background: rgba(0,0,0,.06); }
.main-menu button.active { background: rgba(140,29,23,.10); }
.main-menu button.active svg { color: var(--acc); }
/* изображения иконок меню ровно 80×80 */
.main-menu button { width: 84px; height: 84px; }
.main-menu button .raster-icon { width: 80px; height: 80px; object-fit: contain; }
/* описания — крупнее и с подсветкой */
.prof-card p,
.quest-card p,
.tech-card p,
.pet-card p,
.shop-card-desc,
.char-desc,
.panel-sub {
  font-size: 13.5px;
  line-height: 1.5;
  color: #2a2620;
  background: #f7f3e6;
  border-left: 3px solid #8a6a1f;
  padding: 6px 8px;
  margin: 6px 0;
}
.prof-card h4 { font-size: 15px; }
.prof-sub { font-size: 11.5px; }
body.inv-tab .item-card .item-desc {
  font-size: 12.5px;
  background: #f7f3e6;
  border-left: 3px solid #8a6a1f;
  padding: 5px 7px;
}
/* описания ещё крупнее */
.prof-card p, .quest-card p, .tech-card p, .pet-card p,
.shop-card-desc, .char-desc, .panel-sub { font-size: 15px; }
.prof-card h4 { font-size: 16px; }
body.inv-tab .item-card .item-desc { font-size: 13.5px; }
/* подписи, подзаголовки и описания зданий — крупнее */
.prof-sub { font-size: 14px; }
.prof-card .small, .prof-foot .small { font-size: 12.5px; }
.building-hero p, .bh-inner p { font-size: 15px; line-height: 1.45; }
.building-card p { font-size: 14.5px; line-height: 1.45; }
.building-card .small { font-size: 12.5px; }
.street-building-text span { font-size: 13px; line-height: 1.35; }
.street-building-text b { font-size: 15px; }
.kv { font-size: 13px; }
.panel-sub { font-size: 15px; }
.prof-card .prof-sub { font-size: 14px; }
/* «Образы» — свёрнутый блок */
.portrait-block summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; user-select: none; }
.portrait-block summary::-webkit-details-marker { display: none; }
.portrait-block summary h4 { margin: 0; border: 0; padding: 0; flex: 1 1 auto; }
.portrait-block summary::after { content: '▸'; font-size: 14px; color: var(--acc); }
.portrait-block[open] summary::after { content: '▾'; }
.portrait-block .collapse-hint { font-size: 11px; color: #6b6459; }
.portrait-block[open] .collapse-hint { display: none; }
.portrait-block .portrait-grid { margin-top: 8px; }

/* ---------- Обучение новых героев ---------- */
.onboard-bar {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) auto;
  grid-template-areas: "head task actions";
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #fbf7ea, #efe6cf);
  border: 1px solid #b99a52;
  border-left: 4px solid #8a6a1f;
  border-radius: 4px;
  color: #2a241a;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
.onboard-bar[hidden] { display: none; }
.onboard-bar .ob-head { grid-area: head; display: flex; flex-direction: column; gap: 4px; }
.onboard-bar .ob-kicker { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #8a6a1f; font-weight: 700; }
.onboard-bar .ob-head b { font-size: 13px; }
.ob-track { height: 6px; background: #ddd0b0; border-radius: 3px; overflow: hidden; }
.ob-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c8a44d, #8a6a1f); transition: width .3s ease; }
.ob-track.big { height: 10px; margin: 8px 0; }
.onboard-bar .ob-task { grid-area: task; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.onboard-bar .ob-task b { font-size: 14px; }
.onboard-bar .ob-task span {
  font-size: 12.5px; color: #5d5445; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.onboard-bar .ob-actions { grid-area: actions; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.onboard-bar .ob-skip { opacity: .72; }
.onboard-bar .ob-skip:hover { opacity: 1; }
.ob-welcome-list { margin: 10px 0 12px 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.4; }
.ob-welcome-list li b { color: #8a6a1f; }
.ob-panel .ob-steps {
  list-style: none; margin: 10px 0 12px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 16px;
}
.ob-steps li {
  display: grid; grid-template-columns: 14px minmax(0, 1fr); column-gap: 8px;
  align-items: start; font-size: 13px; color: #5d5445; min-width: 0;
}
.ob-steps li b { grid-column: 2; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.ob-steps li small { grid-column: 2; color: #8a8272; font-size: 11.5px; line-height: 1.3; }
.ob-steps .ob-dot { width: 14px; height: 14px; margin-top: 2px; border-radius: 50%; border: 1.5px solid #b99a52; background: #fbf7ea; flex: 0 0 auto; }
.ob-steps li.done .ob-dot { background: #5f7d4a; border-color: #4d683c; }
.ob-steps li.done b { color: #4d683c; text-decoration: line-through; text-decoration-color: rgba(77, 104, 60, .45); }
.ob-steps li.current .ob-dot { background: #c8a44d; border-color: #8a6a1f; box-shadow: 0 0 0 3px rgba(200, 164, 77, .25); }
.ob-steps li.current b { color: #2a241a; }
@media (max-width: 760px) {
  .onboard-bar { grid-template-columns: 1fr; grid-template-areas: "head" "task" "actions"; gap: 6px; padding: 7px 9px; }
  .onboard-bar .ob-actions { justify-content: flex-start; }
  .ob-steps { grid-template-columns: 1fr; }
  /* Шапка не должна вылезать за экран: крупные полосы сжимаются по ширине */
  .topbar { height: auto; min-height: 88px; padding: 6px 8px; gap: 8px; flex-wrap: wrap; }
  .mini-name b { font-size: 16px; }
  .mini-name span { font-size: 12px; }
  .mini-bars, .mini-bars .bar { width: auto; }
  .mini-bars { width: 100%; max-width: 100%; gap: 4px; margin-top: 2px; }
  .mini-bars .bar { flex: 1 1 30%; min-width: 0; height: 16px; }
  .mini-bars .bar > span { font-size: 10px; }
  .mini-xp .bar { max-width: 100%; }
  .main-menu { order: 4; width: 100%; flex-wrap: wrap; justify-content: center; margin: 2px 0 0; }
  .main-menu button { width: 44px; height: 44px; padding: 0; }
  .main-menu button svg, .main-menu button .raster-icon { width: 30px; height: 30px; }
  .main-menu button span { display: none; }
  .top-actions { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 100%; }
  .coin-pill { font-size: 14px; padding: 4px 8px; }
}
/* ---------- Выбор пола на регистрации ---------- */
.gender-switch { display: flex; gap: 6px; margin: 0 0 9px; }
.gender-switch button {
  flex: 1 1 0; padding: 8px 10px; border: 1px solid #332a1c; border-radius: 3px;
  background: #0c0a07; color: #9c8f79; font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; cursor: pointer; font-weight: 600;
}
.gender-switch button:hover { color: var(--gold-2); border-color: var(--gold-line); }
.gender-switch button.active {
  color: var(--gold-2); border-color: var(--gold);
  background: linear-gradient(180deg, var(--line-warm), #1d1811);
  box-shadow: inset 0 -2px 0 var(--gold);
}
.portrait-mini-grid.gender-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1180px) { .portrait-mini-grid.gender-grid { grid-template-columns: repeat(3, 1fr); } }
/* ---------- Пол героя во вкладке «Персонаж» ---------- */
.hero-sex-switch { display: flex; gap: 6px; margin: 6px 0 8px; }
.hero-sex-switch button {
  flex: 1 1 0; padding: 7px 10px; border: 1px solid #b3a789; border-radius: 3px;
  background: #f4f0e4; color: #5d5445; font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; font-weight: 600; cursor: pointer;
}
.hero-sex-switch button:hover { border-color: #8a6a1f; color: #5a430f; }
.hero-sex-switch button.active {
  border-color: #8a6a1f; color: #4a3608;
  background: linear-gradient(180deg, #f9efd4, #e8dbb8);
  box-shadow: inset 0 -2px 0 #8a6a1f;
}
.portrait-sex-note { margin: 8px 0 0; font-size: 11.5px; line-height: 1.35; color: #5d5445; }
/* Картинки из панели разработчика */
.quest-art { display: block; width: 100%; max-height: 170px; object-fit: cover; border: 1px solid #b09a6e; margin: 2px 0 6px; background: #1b160f; }
.shop-art { display: block; width: 100%; max-height: 200px; object-fit: cover; border: 1px solid var(--line-soft); margin-bottom: 6px; }
.pet-art { width: 26px; height: 26px; object-fit: cover; border-radius: 3px; border: 1px solid #b09a6e; }
.prof-card h4 img.prof-icon { object-fit: cover; border-radius: 4px; }
.monster-portrait, .monster-right-art, .combat-monster-art { image-rendering: auto; }

/* ---------- Шапка на средних экранах: без горизонтальной прокрутки ---------- */
@media (min-width: 761px) and (max-width: 1700px) {
  .brand-sub { display: none; }
  .brand-title 
  .mini-name b { font-size: 20px; }
  .mini-name span { font-size: 14px; }
  .mini-bars, .mini-bars .bar { width: 300px; }
  .mini-bars .bar { height: 22px; }
  .mini-bars .bar > span { font-size: 13px; }
  .main-menu button { width: 56px; height: 56px; }
  .main-menu button svg, .main-menu button .raster-icon { width: 40px; height: 40px; }
  .coin-pill { font-size: 16px; padding: 4px 8px; }
  .coin-pill .dot { width: 11px; height: 11px; }
  .icon-btn svg { width: 26px; height: 26px; }
  .icon-btn.nav-back { font-size: 28px; padding: 0 8px; }
  .icon-btn span { font-size: 10px; }
}
@media (min-width: 761px) and (max-width: 1450px) {
  .mini-bars, .mini-bars .bar { width: 250px; }
  .main-menu button { width: 48px; height: 48px; }
  .main-menu button svg, .main-menu button .raster-icon { width: 34px; height: 34px; }
  .coin-pill { font-size: 14px; padding: 3px 7px; }
  .icon-btn svg { width: 22px; height: 22px; }
}
/* ================= Читаемость: сплошной проход по вкладкам (09.11.2026) ================= */

/* Диалоги и подсказки на светлых экранах */
body.world-tab .npc-text, body.light-ui .npc-text { color: #3a332a; }
body.world-tab .npc-text b, body.light-ui .npc-text b { color: #7a5a12; }
#windowActions .hint, #windowActions .hint b { color: #4f483c; }

/* Вкладки магазина: светлый текст на тёмных чипах */
.shop-tabs button { color: #cdc2ab; font-size: 11px; }
.shop-tabs button.active { color: #f0d9a0; }

/* Карточки товаров: уровни, цены, редкости */
.shop-card-title span { color: #5d5445; font-size: 10.5px; }
.shop-card-price small { color: #5d5445; font-size: 10.5px; }
.shop-card-price { color: #6b5416; }
.shop-card.rarity-common .shop-card-title b { color: #3f392f; }
.shop-card.rarity-uncommon .shop-card-title b { color: #2f6b34; }
.shop-card.rarity-rare .shop-card-title b { color: #2a4d8f; }
.shop-card.rarity-epic .shop-card-title b { color: #6a2f8f; }
.set-shop-info small { color: var(--ink-soft); font-size: 10.5px; }

/* Правая панель «Сектор» и игроки */
#dockSector .right-section-body { color: #2a241a; }
#dockSector .sector-sub,
#dockSector .small.muted,
#dockSector .small.dim,
#dockSector .empty-note,
#dockSector .kv span { color: #3f392f !important; }
#dockSector .right-section-head .small,
#dockSector .online-count { color: #3f392f !important; font-size: 10.5px; }
#dockSector .sector-player-row { background: #f7f5f1; border-color: #cfc8ba; }
#dockSector .sector-player-row b { color: var(--panel-deep); }
#dockSector .sector-player-row small { color: var(--ink-soft); font-size: 10.5px; }
#dockSector .monster-line .ml-name span { color: var(--ink-soft); }

/* Чат: имена собеседников в светлой панели */
#rightBody .chat-msg .chat-name { filter: brightness(.55) saturate(1.35); }
#rightBody .chat-msg, #rightBody .chat-msg .chat-text { color: #2a241a; }
#rightBody .chat-msg .chat-time { color: #5d5445 !important; font-size: 10px; }

/* Техники, питомцы, достижения, ежедневки — мелкие подписи крупнее и темнее */
.tech-head span, .tech-unlock, .tech-req { font-size: 10.5px; }
.tech-head span, .tech-req { color: #4a4034; }
.tech-unlock { color: #3f6330; }
.pet-card .pet-req, .pet-card .pet-bonus { font-size: 10.5px; }
.pet-card .pet-bonus { color: #2f6b34; }
.ach-card .ach-head span, .ach-card .ach-foot, .ach-card .ach-foot span, .ach-card p { font-size: 10.5px; }
.ach-card .ach-head span, .ach-card .ach-foot span.dim { color: var(--ink-soft); }
.daily-task span { font-size: 10.5px; color: #4f483c; }
.quest-card .q-giver { font-size: 10.5px; color: #4f483c; }
.hero-tabs button span { font-size: 10.5px; }
.hero-doll-body .doll-xp .bar > span { font-size: 10px; }
.inv-filters button { font-size: 10.5px; }
.clan-create .clan-form label, .auction-balance span { font-size: 10.5px; }
.equip-row .en span { font-size: 10.5px; }
.log-list time, .online-chat-line time { font-size: 10px; }
.portrait-card span small { font-size: 10px; }
.map-caption small { font-size: 10px; }
.sector-grid .sector-coord { font-size: 9.5px; }
/* ================= Читаемость: точечные исправления (09.11.2026, проход 2) ================= */

/* Активная вкладка магазина: тёмный чип, светлый текст */
.shop-tabs button.active { background: #4a3512; border-color: #8a6a1f; color: #ffe6a8; }

/* Редкости: цвет названия читаем на светлой карточке */
.shop-card.rarity-common .shop-card-title b { color: #3f392f !important; }
.shop-card.rarity-uncommon .shop-card-title b { color: #2f6b34 !important; }
.shop-card.rarity-rare .shop-card-title b { color: #2a4d8f !important; }
.shop-card.rarity-epic .shop-card-title b { color: #5f2a86 !important; }
.recipe-card h4 { color: #2f6b34 !important; }
.recipe-cost .req-warn { color: #9b2c2c !important; font-size: 10.5px; }
.recipe-cost { font-size: 10.5px; color: var(--ink-soft); }

/* Карточки заданий */
body.world-tab .quest-card, body.light-ui .quest-card { background: #f7f5ef; }
.quest-card .q-progress-text { color: var(--ink-soft); font-size: 10.5px; }
.quest-card .q-reward { color: #7a5a12; font-size: 10.5px; }
.quest-preview p { color: #3a332a; }
.quest-preview h4 { color: #7a1712; }
#windowBody .npc-text b { color: #6b4f10; }

/* Имена в чате заметно темнее */
#rightBody .chat-msg .chat-name { filter: brightness(.42) saturate(1.4); }

/* Бой: кнопки приёмов тёмные — текст светлый */
.combat-controls .tech-btn b { color: #f2e8d2; font-size: 10px; line-height: 1.15; }
.combat-controls .tech-btn span { color: #c9bda6; font-size: 9px; line-height: 1.15; }
.combat-controls .tech-btn.active b { color: #ffd98a; }
.combat-controls .tech-btn.active span { color: #e8d9b4; }
.combat-controls .tech-btn:hover b { color: #ffe2a6; }
.ct-od, #combatTimer { color: #2f2a22 !important; }
.combat-round, .combat-scene-name { color: #2f2a22 !important; }

/* Цветные заголовки школ и гильдий — темнее, но с сохранением оттенка */
.building-card > .recipe-grid h4, .guild-card h4 { filter: brightness(.55) saturate(1.25); }
/* ================= Читаемость: проход 3 ================= */

/* Чат: имена — тёмные, различия по оттенку сохраняем фильтром */
#rightBody .chat-msg .chat-name { color: #6b4f10 !important; filter: brightness(.75) saturate(1.6); }

/* Бой: панели «Союзники/Противники», арена и лог */
.combat-versus .vs-title { color: #2f2a22 !important; }
.combat-versus .vs-row { color: #2f2a22 !important; }
.combat-versus .vs-row.active { color: #7a1712 !important; }
.combat-fighters .ad-line, .combat-fighters .ad-line b { color: #2f2a22 !important; }
.combat-fighters .ap-label, .combat-fighters .arena-row-hint { color: #3f392f !important; }
.combat-board .board-name { color: var(--ink) !important; font-size: 9.5px; }
#combatLog, #combatLog div { color: #eadfca; }
#combatLog .system { color: #d8cdb5; }
.combat-topline .ct-mid b { color: #7a1712; }

/* Карта острова: подпись на тёмном фоне */
.map-caption { color: #f4e3b6 !important; }
.map-caption small { color: #d8cdb5 !important; }

/* Клан, биржа, профессии: подписи темнее */
.clan-create .clan-form label, .clan-create .clan-members-head span, .clan-create .clan-create-foot span { color: #3f392f !important; }
.auction-balance span { color: #3f392f !important; }
.prof-card .prof-sub, .prof-card .small.dim { color: #3f392f !important; }
/* ================= Читаемость: проход 4 ================= */

.building-card .small.gold { color: #6b4a0a !important; }
#dockSector .right-section-head { color: #3f392f; }
#dockSector .sector-sub span { color: #3f392f !important; }
.sector-grid .sector-coord { font-size: 10px !important; }

.doll-xp .bar > span { font-size: 10px; }

.prof-card .small.req-warn, .prof-foot .req-warn { color: #8a1f1a !important; }

.clan-members-head { color: #6b1410; }
.clan-members-head > span { color: #3f392f !important; font-size: 10.5px; }
.clan-create-foot span { font-size: 10.5px; }
.auction-sell .small.dim, .auction-page .small.dim { color: #3f392f !important; }

.combat-topline .ct-mid b { color: #5f120f; }
.combat-fighters .plan-line { color: #2f2a22 !important; font-size: 10px; }
.ct-bars .bar > span { font-size: 10px; }
.combat-board .board-name { font-size: 10px !important; }
.ap-label, .arena-row-hint { font-size: 10px !important; }
.ability-grid .tech-btn b { font-size: 10px; }
.ability-grid .tech-btn span { font-size: 10px; }

/* Мобильное имя героя не обрезается */
.hero-doll-name { white-space: normal; overflow-wrap: anywhere; }
/* ================= Читаемость: проход 5 ================= */

/* Раунд и название локации на сцене боя — светлый текст с тенью */
.combat-round, .combat-scene-name { color: #f7ecd2 !important; text-shadow: 0 1px 3px rgba(0,0,0,.85), 0 0 8px rgba(0,0,0,.6); }
.combat-round { background: rgba(20, 16, 12, .55); }

/* Опыт в кукле героя */
.hero-doll-body .doll-xp .bar > span { font-size: 10px !important; }

/* Подпись локации на сцене боя — на тёмной плашке */
.combat-scene-name { background: rgba(20, 16, 12, .55); padding: 3px 8px; border-radius: 3px; }
/* ================= Значки кланов ================= */
.clan-mark { display: inline-block; margin-right: 4px; font-size: 1.02em; line-height: 1; vertical-align: -1px; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .25)); }
.mini-name .clan-mark { font-size: 22px; vertical-align: -3px; }
.chat-name .clan-mark { font-size: 13px; margin-right: 3px; }
.online-player .clan-mark { font-size: 15px; }
.sector-player-row .clan-mark { font-size: 12px; }
.clan-row .clan-mark { font-size: 18px; }

/* Бейдж клана в шапке клана: теперь может быть эмодзи */
.clan-head .clan-emblem { font-size: 24px; line-height: 1; font-family: "Segoe UI Emoji", "Segoe UI", sans-serif; }

.clan-emblem-pick { margin: 8px 0 4px; }
.clan-emblem-label { font-size: 10.5px; color: #3f392f; margin-bottom: 5px; letter-spacing: .05em; text-transform: uppercase; }
.clan-emblem-label span { color: #7a5a12; text-transform: none; letter-spacing: 0; font-weight: 600; margin-left: 4px; }
.clan-emblem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 4px; }
.clan-emblem-btn {
  width: 100%; height: 40px; display: flex; align-items: center; justify-content: center; padding: 0;
  font-size: 20px; line-height: 1; cursor: pointer;
  background: #f7f5ef; border: 1px solid var(--line-light); border-radius: 4px;
}
.clan-emblem-btn:hover { border-color: #8a6a1f; background: #fffaf0; }
.clan-emblem-btn.selected { border-color: #8a6a1f; background: #fff3d6; box-shadow: 0 0 0 2px rgba(138, 106, 31, .35); }
/* ================= Почта и друзья ================= */
.mail-btn { position: relative; }
.mail-badge {
  position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--acc); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; border: 1px solid #f0d7d7; font-style: normal;
}
.mail-badge[hidden] { display: none; }
.mail-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.mail-tabs button {
  padding: 7px 12px; border-radius: 4px; border: 1px solid var(--line); background: #17130e;
  color: #c9bda6; font-size: 12px; cursor: pointer;
}
.mail-tabs button.active { background: var(--line-warm); border-color: var(--gold); color: var(--gold-2); }
.mail-count { font-style: normal; background: var(--acc); color: #fff; border-radius: 8px; padding: 0 5px; font-size: 10px; margin-left: 4px; }
.mail-count.calm { background: var(--ink-soft); }
.mail-list { display: flex; flex-direction: column; gap: 6px; max-height: 48vh; overflow: auto; padding-right: 2px; }
.mail-item { border: 1px solid #3d3222; background: rgba(0, 0, 0, .22); padding: 8px 10px; border-radius: 4px; }
.mail-item.claimed { opacity: .72; }
.mail-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: #e8dfca; }
.mail-head b { color: var(--gold-2); }
.mail-head time { color: #9c8f79; font-size: 11px; }
.mail-text { margin: 6px 0 4px; color: #e8dfca; font-size: 13px; line-height: 1.4; white-space: pre-wrap; }
.mail-attach { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.mail-att-silver { color: #f0d9a0; font-size: 12px; font-weight: 600; }
.mail-att-item { color: #c9bda6; font-size: 12px; }
.mail-actions { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.mail-status { color: #9c8f79; font-size: 11px; }
.mail-compose label { display: block; margin-bottom: 8px; color: #c9bda6; font-size: 11px; }
.mail-compose input, .mail-compose textarea, .mail-compose select, .mail-friend-add input {
  width: 100%; margin-top: 3px; background: #0f0c08; border: 1px solid var(--line); color: #f0e6d2;
  padding: 7px 9px; border-radius: 3px; font: inherit;
}
.mail-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mail-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
.mail-friend-add { display: flex; gap: 6px; margin-bottom: 10px; }
.mail-friend-add input { flex: 1 1 auto; margin-top: 0; }
.mail-friend-list { display: flex; flex-direction: column; gap: 4px; }
.mail-friend { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid #3d3222; background: rgba(0, 0, 0, .2); border-radius: 4px; color: #e8dfca; font-size: 12px; }
.mail-friend b { flex: 0 0 auto; }
.mail-friend small { color: #9c8f79; flex: 1 1 auto; }
.mail-friend .btn { flex: 0 0 auto; }
.mf-dot { width: 8px; height: 8px; border-radius: 50%; background: #5a5245; flex: 0 0 auto; }
.mf-dot.online { background: #6fbf73; box-shadow: 0 0 6px rgba(111, 191, 115, .5); }
.mail-ignore { margin-top: 12px; }
.mail-sub { color: #9c8f79; font-size: 11px; margin-bottom: 6px; }
@media (max-width: 520px) { .mail-row { grid-template-columns: 1fr; } .mail-foot { flex-direction: column; align-items: stretch; } }
/* ================= Прямой обмен ================= */
.trade-modal .modal-body { max-height: 74vh; overflow: auto; }
.trade-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.trade-offer { border: 1px solid #3d3222; background: rgba(0, 0, 0, .22); padding: 8px 10px; border-radius: 4px; min-height: 74px; }
.trade-offer-head { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #c9bda6; margin-bottom: 4px; }
.trade-offer.mine .trade-offer-head { color: #f0d9a0; }
.trade-silver { color: #f0d9a0; font-weight: 600; font-size: 13px; }
.trade-item-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.trade-item-chip { background: #2a2318; border: 1px solid var(--line); border-radius: 3px; padding: 2px 6px; font-size: 11px; color: #e8dfca; }
.trade-empty { color: #9c8f79; font-size: 11px; }
.trade-editor { border-top: 1px solid #3d3222; padding-top: 8px; }
.trade-editor-head { font-size: 12px; color: #f0d9a0; margin-bottom: 6px; }
.trade-silver-row { display: flex; align-items: center; gap: 8px; color: #c9bda6; font-size: 11px; margin-bottom: 6px; }
.trade-silver-row input { width: 130px; background: #0f0c08; border: 1px solid var(--line); color: #f0e6d2; padding: 5px 8px; border-radius: 3px; }
.trade-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px; max-height: 32vh; overflow: auto; margin-bottom: 8px; }
.trade-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #e8dfca; background: rgba(0, 0, 0, .18); border: 1px solid #3d3222; border-radius: 3px; padding: 4px 6px; cursor: pointer; }
.trade-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.trade-invites { display: flex; flex-direction: column; gap: 6px; }
.trade-invite { display: flex; align-items: center; gap: 10px; justify-content: space-between; border: 1px solid #3d3222; background: rgba(0, 0, 0, .22); padding: 8px 10px; border-radius: 4px; color: #e8dfca; font-size: 13px; }
.trade-invite-actions { display: flex; gap: 6px; }
.trade-wait { border: 1px solid #3d3222; background: rgba(0, 0, 0, .22); padding: 12px; border-radius: 4px; color: #e8dfca; }
@media (max-width: 560px) { .trade-sides { grid-template-columns: 1fr; } }

/* ================= Клановые войны ================= */
.war-card { border: 1px solid #3d3222; background: rgba(0, 0, 0, .2); border-radius: 4px; padding: 8px 10px; margin-bottom: 8px; }
.war-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #f0d9a0; }
.war-score { font-weight: 700; font-size: 16px; }
.war-meta { color: #9c8f79; font-size: 11px; margin-top: 3px; }
.war-raid-list { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0; }
.war-log { border-top: 1px solid #3d3222; margin-top: 6px; padding-top: 5px; max-height: 120px; overflow: auto; }
.war-log-line { color: #c9bda6; font-size: 11.5px; line-height: 1.35; }
.war-declare { margin-top: 10px; }
.war-declare-row { display: flex; gap: 6px; align-items: center; }
.war-declare-row select { flex: 1 1 auto; background: #0f0c08; border: 1px solid var(--line); color: #f0e6d2; padding: 7px 9px; border-radius: 3px; }
/* ---------- боевой экран: клетки зон и сетка приёмов по геометрии референса ---------- */
.zone-cells { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin-top: 4px; }
.zone-cell {
  height: 35px; min-width: 0; padding: 0 2px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 3px; background: rgba(255,255,255,.04);
  font-size: 9px; line-height: 1; color: var(--dim); transition: border-color .15s, background .15s;
}
.zone-cell .zc-label { font-size: 9px; letter-spacing: .02em; }
.zone-cell b { font-size: 12px; color: var(--text); margin-top: 2px; }
.zone-cell:hover { border-color: var(--gold-dark); }
.zone-cell.has-count { border-color: var(--gold-dark); background: rgba(217,176,97,.16); }
.zone-cell.has-count b { color: var(--gold-2); }
.zone-cell.enemy.has-count { border-color: #c05050; background: rgba(192,80,80,.18); }
.zone-cell.enemy.has-count b { color: #e88; }
.tech-grid { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
.tech-btn .tech-art { width: 48px; height: 47px; object-fit: cover; }
@media (max-width: 900px) {
  .tech-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}
/* приёмы в бою: сетка 6×2, ячейка 48×47 (как в референсе) */
.ability-grid { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
.ability-grid .tech-btn .tech-art,
.ability-grid .tech-btn img { width: 48px; height: 47px; object-fit: cover; }
.ability-grid .ability-potion img { width: 40px; height: 40px; }
@media (max-width: 900px) {
  .ability-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .ability-grid .tech-btn .tech-art, .ability-grid .tech-btn img { width: 36px; height: 35px; }
}
/* ---------- вертикальная полоса HP и колонки сторон (референс) ---------- */
.fighter-panel { position: relative; }
.hp-tube {
  position: absolute; top: 34px; bottom: 34px; width: 26px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
}
.hp-tube.player { left: -30px; }
.hp-tube.enemy { right: -30px; }
.hp-tube-frame {
  position: absolute; inset: 0; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(0,0,0,.45); overflow: hidden;
}
.hp-tube-fill {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, #7fd0a0, #3d8a5f);
  border-radius: 0 0 12px 12px; transition: height .25s;
}
.hp-tube.enemy .hp-tube-fill { background: linear-gradient(180deg, #e08a8a, #9c3b3b); }
.hp-tube-val {
  position: relative; z-index: 2; font-size: 9px; color: #fff; text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,.85); padding-bottom: 3px; line-height: 1.1;
}
.hp-tube-val small { display: block; font-size: 8px; opacity: .8; }

.combat-versus { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sp-side { border: 1px solid var(--line); border-radius: 4px; padding: 6px; background: rgba(255,255,255,.02); }
.sp-title { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); margin-bottom: 4px; }
.sp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; font-size: 9px; color: var(--dim); margin-bottom: 3px; }
.sp-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 26px; gap: 4px; }
.sp-cell {
  display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 2px 4px;
  border: 1px solid var(--line); border-radius: 3px; background: rgba(255,255,255,.03);
  font-size: 9px; color: var(--text); text-align: left; overflow: hidden; cursor: default;
}
.sp-cell b { font-size: 10px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-cell span { font-size: 8px; color: var(--dim); }
.sp-cell.empty { color: var(--dim); align-items: center; opacity: .5; }
.sp-cell.active { border-color: var(--gold); background: rgba(217,176,97,.14); }
.sp-cell.dead { opacity: .45; text-decoration: line-through; }
button.sp-cell { cursor: pointer; width: 100%; }
.sp-side.enemy .sp-cell.active { border-color: #c05050; background: rgba(192,80,80,.16); }
.sp-move {
  margin-top: 5px; width: 100%; font-size: 10px; padding: 2px 0; border-radius: 3px;
  border: 1px dashed var(--line); background: transparent; color: var(--dim); cursor: pointer;
}
.sp-move:disabled { opacity: .45; cursor: default; }
/* =====================================================================
   Точная геометрия боевого экрана по референсу (css-geometry.txt)
   Полотно 1000px; колонки сторон 340px; портрет 115×240 при top:15;
   полоса HP 91×251 при top:70 (12px от края); зоны 37×35;
   приёмы 6×2 по 48×47 (малые 30×29); итоги 460 / 275-60-60-65.
   ===================================================================== */
.combat-screen { max-width: 1000px; margin: 0 auto; }
.combat-versus { grid-template-columns: 340px minmax(0, 1fr) 340px; gap: 10px; align-items: start; }
.sp-side { width: 340px; min-height: 400px; padding: 14px; box-sizing: border-box; position: relative; }
.sp-side .sp-grid { grid-auto-rows: 40px; gap: 5px; }
.sp-side .sp-title { font-size: 12px; letter-spacing: .08em; text-align: center; }
.sp-side .sp-move { position: absolute; left: 14px; right: 14px; bottom: 14px; }

/* портрет 115×240, рамка-«кукла» 148×270, смещение 15px сверху */
.fighter { position: relative; width: 148px; height: 270px; margin: 0 auto; }
.fighter-portrait { position: absolute; top: 15px; left: 0; width: 115px; height: 240px; }
.fighter-portrait img { position: absolute; top: 0; left: 0; width: 115px; height: 240px; object-fit: cover; z-index: -1; }
.fighter.enemy .fighter-portrait { left: 33px; }

/* полоса HP 91×251 при top:70, 12px от края, шкала top:48/bottom:16 */
.hp-tube { top: 70px; bottom: auto; width: 91px; height: 251px; }
.hp-tube.player { left: -12px; }
.hp-tube.enemy { right: -12px; }
.hp-tube-frame { top: 48px; bottom: 16px; left: 14px; right: 19px; border-radius: 6px; }
.hp-tube.enemy .hp-tube-frame { left: 19px; right: 14px; }
.hp-tube-fill { border-radius: 0 0 6px 6px; }
.hp-tube-val { position: absolute; top: 72px; left: 0; width: 100%; font-size: 11px; font-weight: 700; line-height: 32px; padding: 0; }
.hp-tube-val small { display: inline; font-size: 11px; opacity: .9; }

/* зоны: клетки 37×35, блоки слева (left:126), удары справа (left:-11) */
.zone-cells { position: absolute; top: -1px; display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; z-index: 4; }
.fighter.player .zone-cells { left: 126px; }
.fighter.enemy .zone-cells { left: -11px; top: -3px; }
.zone-cell {
  width: 37px; height: 35px; border-radius: 50%; padding: 0;
  border: 1px solid var(--line); background: rgba(10,14,20,.62);
  font-size: 8px; color: var(--dim);
}
.zone-cell .zc-label { font-size: 7px; line-height: 1; }
.zone-cell b { font-size: 11px; margin-top: 0; }
.zone-hint { display: none; }

/* приёмы: большая таблица 6×2 по 48×47, малые 30×29 */
.ability-grid { grid-template-columns: repeat(6, 48px) !important; justify-content: center; gap: 4px; }
.ability-grid .tech-btn { width: 48px; height: 47px; padding: 0; overflow: hidden; }
.ability-grid .tech-btn b, .ability-grid .tech-btn span { display: none; }
.ability-grid .tech-btn .tech-art, .ability-grid .tech-btn img { width: 48px; height: 47px; }

/* итоговая таблица 460 / 275-60-60-65 */
.combat-result-table { width: 460px; }
.combat-result-table th:nth-child(1), .combat-result-table td:nth-child(1) { width: 275px; }
.combat-result-table th:nth-child(2), .combat-result-table td:nth-child(2) { width: 60px; }
.combat-result-table th:nth-child(3), .combat-result-table td:nth-child(3) { width: 60px; }
.combat-result-table th:nth-child(4), .combat-result-table td:nth-child(4) { width: 65px; }

@media (max-width: 1100px) {
  .combat-versus { grid-template-columns: 1fr 1fr; }
  .sp-side { width: auto; min-height: 0; }
  .zone-cells { position: static; grid-template-columns: repeat(5, 1fr); margin-top: 4px; }
  .zone-cell { border-radius: 3px; width: auto; }
  .ability-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}
/* фикс: ячейка приёма ровно 48×47 с учётом рамок */
.ability-grid .tech-btn { box-sizing: border-box; width: 48px; height: 47px; min-height: 47px; padding: 0; line-height: 0; }
/* панель «Ожидаем окончания раунда» (референс: 312 px, компактные строки) */
.combat-wait {
  width: 312px; margin: 8px auto 0; padding: 8px 10px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 4px; background: rgba(255,255,255,.03);
  font-size: 10px; line-height: 1.55; color: var(--dim); text-align: center;
}
.combat-wait > b { display: block; font-size: 11px; color: var(--text); margin-bottom: 4px; }
.cw-line b { color: var(--text); font-weight: 600; }
/* строка кнопок боя: иконки 37×35 в линию со смещением 67 px (референс .fight .buttons) */
.combat-bar {
  display: flex; gap: 4px; justify-content: center; align-items: center;
  margin: 6px 0 2px 67px; flex-wrap: nowrap;
}
.combat-bar .btn {
  width: 37px; height: 35px; min-width: 37px; padding: 0; box-sizing: border-box;
  font-size: 9px; line-height: 1.05; text-align: center; border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center; white-space: normal;
}
@media (max-width: 900px) {
  .combat-bar { margin-left: 0; flex-wrap: wrap; }
}
/* компактные ячейки приёмов 30×29 (вторая таблица референса) */
.ability-grid.compact { grid-template-columns: repeat(6, 30px) !important; gap: 3px; }
.ability-grid.compact .tech-btn,
.ability-grid.compact .tech-btn .tech-art,
.ability-grid.compact .tech-btn img { width: 30px; height: 29px; min-height: 29px; }
/* экран персонажа: 7 вкладок и список инвентаря */
.hero-inv-list { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 10px; }
.hero-inv-row {
  display: grid; grid-template-columns: minmax(140px, 1fr) minmax(0, 2fr) auto;
  gap: 8px; align-items: center; padding: 5px 8px;
  border: 1px solid var(--line); border-radius: 3px; background: rgba(255,255,255,.03); font-size: 11px;
}
.hero-inv-row b { font-weight: 600; }
.hero-inv-row span { color: var(--dim); font-size: 10px; }
@media (max-width: 900px) { .hero-inv-row { grid-template-columns: 1fr auto; } .hero-inv-row span { grid-column: 1 / -1; } }
/* карта: статус перемещения и поиск сектора (референс map.html) */
.move-status {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding: 6px 8px; margin-bottom: 6px; border: 1px solid var(--gold-dark);
  border-radius: 3px; background: rgba(217,176,97,.10); font-size: 11px;
}
.move-status .ms-top b { color: var(--gold-2); }
.move-status .ms-sub { font-size: 10px; color: var(--dim); }
.move-status .btn { margin-top: 4px; }
.sector-find { display: flex; align-items: center; gap: 5px; margin: 8px 0 2px; font-size: 11px; color: var(--dim); }
.sector-find input { width: 42px; text-align: center; }
/* обследование сектора: список монстров и добычи */
.scan-row {
  display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr); gap: 8px;
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 3px;
  background: rgba(255,255,255,.03); font-size: 11px; margin-bottom: 4px;
}
.scan-row span { color: var(--dim); font-size: 10px; }
.sector-scan .modal-body h4 { margin: 10px 0 6px; font-size: 12px; color: var(--gold-2); }
@media (max-width: 900px) { .scan-row { grid-template-columns: 1fr; } }
/* биржа: чекбокс «на мой уровень» */
.auction-check { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--dim); cursor: pointer; white-space: nowrap; }
.auction-check input { width: auto; margin: 0; }
/* ювелир: витрина и список рун */
.jewel-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.jewel-row {
  display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 2fr) auto; gap: 8px; align-items: center;
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 3px; background: rgba(255,255,255,.03); font-size: 11px;
}
.jewel-row span { color: var(--dim); font-size: 10px; }
@media (max-width: 900px) { .jewel-row { grid-template-columns: 1fr auto; } .jewel-row span { grid-column: 1 / -1; } }
/* таланты: три ветки */
.talent-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.talent-row {
  display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 2fr) 44px auto; gap: 6px; align-items: center;
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 3px; background: rgba(255,255,255,.03); font-size: 11px;
}
.talent-row span { color: var(--dim); font-size: 10px; }
.talent-row .talent-rank { text-align: center; color: var(--gold-2); }
@media (max-width: 900px) { .talent-row { grid-template-columns: 1fr auto; } .talent-row span { grid-column: 1 / -1; } }
/* клан: испытательный срок */
.cm-prob { font-size: 9px; color: var(--gold-2); border: 1px solid var(--gold-dark); border-radius: 3px; padding: 0 4px; margin-left: 4px; }

/* турнир по заявкам: состав в карточке и сетка результата */
.ba-roster { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.ba-roster-name {
  font-size: 9px; padding: 1px 6px; border: 1px solid #3d3222; border-radius: 9px;
  background: rgba(217, 176, 97, .08); color: var(--text-dim); white-space: nowrap;
}
.ba-roster-name:first-child { border-color: var(--gold-dark); color: var(--gold-2); }
.ba-roster-empty { font-size: 9px; color: var(--dim); align-self: center; }
.tourney-app-result .tourney-board { margin: 8px 0; }
.tourney-app-result .brc-main b { color: var(--gold-2); }
.tourney-app-result .tourney-match { font-size: 10px; padding: 5px 6px; }
.tourney-app-result .tourney-match span { color: var(--text-dim); }
.tourney-app-result .tourney-match span.tw { color: #f2e7cf; font-weight: 600; }
.tourney-app-result .tourney-match span.tme { color: var(--gold-2); font-weight: 600; }
.tourney-app-result .tourney-round { flex: 1 1 0; min-width: 190px; }
.tourney-app-result .tourney-round-name { font-size: 10px; color: var(--gold-2); margin-bottom: 4px; }
.tourney-app-result .ba-result-teams { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* числа урона над портретами: всплывают и гаснут после раунда */
.fx-layer { position: absolute; left: 4px; width: 115px; top: 58px; height: 240px; pointer-events: none; z-index: 6; }
.fighter.enemy .fx-layer { left: auto; right: 4px; }
.fx-num {
  position: absolute; z-index: 6; pointer-events: none;
  font-family: var(--font-title, Georgia, serif); font-weight: 700; font-size: 15px;
  transform: translate(-50%, 0); text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, .8);
  animation: fx-rise 1.5s ease-out forwards;
}
.fx-num.hit { color: #ff8a78; }
.fx-num.crit { color: #ffd479; font-size: 18px; }
.fx-num.heal { color: #8ce09a; }
.fx-num.guard { color: #a9bccf; }
@keyframes fx-rise {
  0% { opacity: 0; margin-top: 10px; }
  15% { opacity: 1; margin-top: 0; }
  75% { opacity: 1; }
  100% { opacity: 0; margin-top: -26px; }
}

/* приёмы в бою: блок 288×94 (6×2) с прокруткой, как slots_battle_items в референсе */
.combat-controls { width: 288px; margin: 6px auto 0; padding: 0; gap: 0; border: 0; background: transparent; justify-content: center; }
.combat-controls .ability-grid {
  width: 288px; height: 94px; max-height: 94px;
  overflow-y: auto; overflow-x: hidden;
  align-content: start; grid-auto-rows: 47px; gap: 0;
  padding: 0; margin: 0; border-top: 0;
  scrollbar-width: none;
}
.combat-controls .ability-grid::-webkit-scrollbar { width: 0; height: 0; }
@media (max-width: 900px) {
  .combat-controls { width: 100%; }
  .combat-controls .ability-grid {
    width: 100%; height: auto; max-height: none; overflow: visible;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 4px;
  }
  .combat-controls .ability-grid .tech-btn { width: 100%; height: 47px; }
}

/* мобильный бой: полоса HP идёт сверху панели, а не сбоку от портрета */
@media (max-width: 760px) {
  .fighter-panel .hp-tube {
    position: relative; top: 0; left: 0 !important; right: auto !important; bottom: auto;
    width: 100%; height: 18px; margin: 0 0 6px; z-index: 3; order: -1;
  }
  .fighter-panel .hp-tube .hp-tube-frame { position: absolute; inset: 0; border-radius: 4px; }
  .fighter-panel .hp-tube .hp-tube-fill { border-radius: 0 0 4px 4px; }
  .fighter-panel .hp-tube .hp-tube-val {
    position: absolute; top: 0; left: 0; width: 100%; padding: 0;
    line-height: 16px; font-size: 10px; font-weight: 700; text-align: center;
  }
  .fighter-panel .hp-tube .hp-tube-val small { display: inline; font-size: 10px; opacity: .9; }
  .fighter-panel { justify-content: flex-start; }
}

/* Грани Тумана — боевой экран: предметы, прогресс раунда, отклик элементов. */

/* Ряд предметов в бою: шесть слотов 48×47 под сеткой приёмов (referenсe slots_battle_items) */
.combat-controls .combat-items {
  display: grid; grid-template-columns: repeat(6, 48px); gap: 0;
  width: 288px; height: 47px; margin: 0 0 2px;
}
.combat-items .ci-slot {
  width: 48px; height: 47px; box-sizing: border-box; padding: 0;
  display: grid; place-items: center; position: relative;
  border: 1px solid #3a3327; background: rgba(255, 255, 255, .03);
  color: var(--text); cursor: pointer; overflow: hidden;
}
.combat-items .ci-slot img { width: 40px; height: 40px; object-fit: contain; }
.combat-items .ci-slot.filled:hover { border-color: var(--gold-dark); background: rgba(217, 176, 97, .12); }
.combat-items .ci-slot.empty { cursor: default; opacity: .35; background: rgba(0, 0, 0, .18); border-style: dashed; }
.combat-items .ci-count {
  position: absolute; right: 1px; bottom: 0; font-size: 9px; line-height: 1;
  padding: 1px 2px; color: #f2e7cf; background: rgba(0, 0, 0, .55); border-radius: 2px;
}
@media (max-width: 900px) {
  .combat-controls .combat-items { width: 100%; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .combat-items .ci-slot { width: 100%; }
}

/* Полоса прогресса раунда */
.round-progress {
  height: 5px; margin: 5px auto 2px; width: 100%; max-width: 286px;
  background: #241f18; border: 1px solid #3a3327; border-radius: 3px; overflow: hidden;
}
.round-progress i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #d9b061, #8c6a2f); transition: width .25s linear; }
.round-progress.warn i { background: linear-gradient(90deg, #d0705e, #8c2f26); }

/* Отклик на нажатие и наведение: клетки зон и приёмы */
.zone-cell, .zone-mark { transition: transform .08s ease, border-color .12s ease, background-color .12s ease; }
.zone-cell:hover, .zone-mark:hover { border-color: var(--gold-2); }
.zone-cell:active, .zone-mark:active { transform: scale(.94); }
.ability-grid .tech-btn:active { transform: scale(.96); }

/* ================= Фон под предметами: единый #2A3038 (11.11.2026) ================= */
/* 1. Слоты, плитки и ячейки, внутри которых лежит предмет */
.doll-slot,
.doll-slot.empty,
.doll-slot.filled,
.doll-grid .doll-slot,
.doll-grid .doll-slot.empty,
.doll-grid .doll-slot.filled {
  background: #2A3038;
  border-color: #1c2128;
  box-shadow: inset 0 0 0 1px #39414b, 0 1px 0 rgba(0, 0, 0, .35);
}
.doll-grid .doll-slot::before,
.doll-grid .doll-slot.empty::before,
.doll-grid .doll-slot.filled::before {
  background: #2A3038;
  border-color: #141920;
  box-shadow: inset 0 3px 7px rgba(0, 0, 0, .5), inset 0 -1px 0 rgba(255, 255, 255, .05);
}
.doll-grid .doll-slot:hover,
.doll-grid .doll-slot:hover::before { border-color: var(--acc); }
.doll-slot .ds-icon,
.doll-grid .doll-slot .ds-icon { color: #7f8a97; }

.item-icon,
.item-detail-icon,
.equip-row .ei,
.equip-slot,
.combat-items .ci-slot,
.combat-items .ci-slot.empty,
.shop-card-art {
  background: #2A3038;
  border-color: #1c2128;
  color: #7f8a97;
}
.combat-items .ci-slot.empty { border-style: dashed; opacity: .6; }
.combat-items .ci-slot.filled:hover { background: #2A3038; border-color: var(--acc); }
.auction-icon,
.mist-card-art,
.mg-icon,
.md-icon {
  background: #2A3038;
  border-color: #1c2128;
  color: #7f8a97;
}
.auction-row { background: #2A3038; border-color: #1c2128; color: #dfe5ec; }
.auction-row .auction-main span { color: #9fabb8; }

/* 2. Карточки и строки, в которых перечислены предметы */
.item-card,
body.light-ui .item-card,
body.inv-tab .item-card,
.shop-card,
body.light-ui .shop-card,
.set-shop-card,
body.light-ui .set-shop-card,
.pattern-market-row,
.pattern-stock-row,
.trade-item {
  background: #2A3038;
  border-color: #1c2128;
  color: #dfe5ec;
}
.item-card[data-act]:hover,
body.inv-tab .item-card:hover,
.shop-card:hover { background: #2A3038; border-color: #4a5563; }
.item-card h4,
.item-card .item-stats,
.item-card .item-desc,
body.inv-tab .item-card h4,
body.inv-tab .item-card .item-stats,
body.inv-tab .item-card .item-desc { color: #dfe5ec !important; }
.item-card .item-sub,
body.inv-tab .item-card .item-sub { color: #9fabb8 !important; }
.item-card .item-price,
body.inv-tab .item-card .item-price { color: #e3b353 !important; }
.shop-card-desc, .shop-card-meta, .shop-card-stats { color: #b9c3cf !important; }
.shop-card-price { color: #e3b353 !important; }
.shop-card-price small, .shop-card-title span { color: #9fabb8 !important; }
.shop-card-title b,
.shop-card.rarity-common .shop-card-title b { color: #e8eef5 !important; }
.shop-card.rarity-uncommon .shop-card-title b { color: #8fe39a !important; }
.shop-card.rarity-rare .shop-card-title b { color: #8fbcff !important; }
.shop-card.rarity-epic .shop-card-title b { color: #cfa6ff !important; }
.shop-card.rarity-artifact .shop-card-title b { color: #f3d27a !important; }
.item-set { color: #d9c48f; }

/* ---------- Класс героя в окне персонажа (11.11.2026) ---------- */
.hero-doll-class {
  text-align: center;
  font-size: 11px;
  line-height: 1.35;
  color: var(--ink-soft);
  margin: 2px 0 4px;
}
.hero-doll-class b { color: var(--acc); font-weight: 600; }
.hero-doll-class .dim { color: #6b6459; }
.hero-doll-class .hint { color: #7a7468; font-size: 9px; }
@media (max-width: 560px) { .hero-doll-class { font-size: 12px; } }
/* ---------- Первые шаги новичка: чипы чек-листа (11.11.2026) ---------- */
.ob-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0 4px; }
.ob-chips .ob-step {
  font-size: 10px; line-height: 1.4; padding: 1px 7px; border-radius: 10px;
  border: 1px solid #b5aea2; color: #5c564b; background: #efede7;
}
.ob-chips .ob-step.done { border-color: #2f6b34; color: #2f6b34; background: rgba(47, 107, 52, .08); }
@media (max-width: 560px) { .ob-chips .ob-step { font-size: 10.5px; } }