:root {
  --bg: #181a1e;
  --panel: #22252b;
  --line: #333840;
  --text: #e6e6e6;
  --muted: #9aa0a8;
  --accent: #6cb4ff;
  --green: #00ff00;
  --olive: #ffff00;
  --cyan: #00ffff;
  --magenta: #ff00ff;
  --red: #ff0000;
  --ward-obs: #2f8cff;
  --ward-sen: #ff8a00;
  --dot: clamp(11px, 1.15vw, 20px);
  --hdr: 52px;
  --flt: 58px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, "Segoe UI", Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { margin: 0 0 12px; font-size: clamp(22px, 2.4vw, 32px); }
h2 { margin: 28px 0 10px; font-size: 20px; }
h2 small { color: var(--muted); font-weight: 400; font-size: 14px; }
code { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.lead { max-width: 70ch; color: #cfd3d8; }

.top {
  position: sticky; top: 0; z-index: 1030;
  display: flex; align-items: center; gap: 8px 24px;
  height: var(--hdr); padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.top .brand { font-weight: 700; color: #fff; white-space: nowrap; }
.top nav { display: flex; gap: 4px 18px; flex: 1; }
.top nav a { padding: 4px 0; }
.top nav a.on, .langs a.on { color: #fff; border-bottom: 2px solid var(--accent); }
.langs { display: flex; gap: 10px; }
.nav-toggle { display: none; margin-left: auto; padding: 4px 12px; font-size: 22px; line-height: 1; color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }

main { max-width: 1500px; margin: 0 auto; padding: 16px; }
footer { padding: 24px 16px; color: var(--muted); font-size: 13px; text-align: center; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 18px; }
.card { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--panel); border-radius: 8px; color: var(--text); }
.card:hover { background: #2a2e35; text-decoration: none; }
.card b { font-size: 18px; color: #fff; }
.card span { color: #cfd3d8; font-size: 14px; }
.card em { color: var(--muted); font-style: normal; font-size: 13px; }

.filter {
  position: sticky; top: var(--hdr); z-index: 1020;
  display: flex; align-items: center; gap: 12px; height: var(--flt); margin: 0 -16px; padding: 0 16px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.filter input { flex: 1; min-width: 0; max-width: 480px; padding: 8px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; }
.filter span { white-space: nowrap; color: var(--muted); font-size: 14px; }
.group > h2 { position: sticky; top: calc(var(--hdr) + var(--flt)); z-index: 1010; margin: 0 -16px 10px; padding: 12px 16px 8px; background: var(--bg); border-bottom: 1px solid var(--line); }
.page-title { margin-top: 4px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.entry { display: flex; gap: 10px; padding: 8px; background: var(--panel); border-radius: 6px; color: var(--text); }
.entry:hover { background: #2a2e35; text-decoration: none; }
.entry[hidden], .group[hidden] { display: none; }
.entry .t { display: flex; flex-direction: column; min-width: 0; }
.entry .t b { font-size: 15px; }
.entry .t small { color: var(--muted); font-size: 12.5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.ico { flex: none; width: 48px; height: 48px; border-radius: 6px; background: #111; object-fit: cover; }
.ico.big { width: 80px; height: 80px; }
.ico.ph { display: grid; place-items: center; color: var(--muted); font-weight: 700; }

.entity { max-width: 900px; padding: 18px; background: var(--panel); border-radius: 8px; }
.entity header { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.entity h1, .entity h3 { margin: 0 0 4px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #2f3640; color: #cfd3d8; font-size: 12.5px; }
.desc { margin: 10px 0; }
.desc h1 { font-size: 17px; margin: 8px 0 4px; }
.warn { padding: 6px 10px; border-left: 3px solid var(--olive); background: #2c2a1c; font-size: 14px; }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 12px 0; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.params, .data { border-collapse: collapse; margin: 6px 0; }
.params th, .params td, .data th, .data td { padding: 5px 14px 5px 0; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.params th { color: #cfd3d8; font-weight: 500; }
.notes { margin: 6px 0; padding-left: 20px; }
.lore { color: var(--muted); font-style: italic; }
.crumbs { margin: 0 0 10px; font-size: 14px; }

/* карта */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.frame { padding: 1.5% 1.5% 3.5%; background: #0b0c0e; border-radius: 8px; }
.board { position: relative; }
.map { display: block; width: 100%; height: auto; }
aside { position: sticky; top: 16px; padding: 14px; background: var(--panel); border-radius: 8px; }
.legend { margin: 0; padding: 0; list-style: none; }
.legend li { position: relative; }
.legend input { position: absolute; opacity: 0; pointer-events: none; }
.legend label { display: flex; gap: 12px; padding: 10px; border-radius: 6px; cursor: pointer; }
.legend label:hover { background: rgb(255 255 255 / 6%); }
.legend input:focus-visible + label { outline: 2px solid var(--text); }
.legend input:not(:checked) + label { opacity: 0.4; }
.txt { display: flex; flex-direction: column; font-size: 14px; color: #d0d0d0; }
.txt b { margin-bottom: 2px; font-size: 16px; color: #fff; }
.note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.rules { max-width: 900px; }

.sw, .pt { --c: var(--green); background: var(--c); border: 2px solid #fff; border-radius: 50%; }
.sw { flex: none; width: 24px; height: 24px; margin-top: 2px; }
.g { --c: var(--green); }
.o { --c: var(--olive); }
.m { --c: var(--magenta); }
.r { --c: var(--red); }
.sw.p { background: transparent; border-color: var(--cyan); border-width: 4px; }
.sw.wo, .sw.ws { border-radius: 3px; transform: rotate(45deg); width: 20px; height: 20px; margin: 4px 2px 0; }
.sw.wo, .wd.wo { --c: var(--ward-obs); }
.sw.ws, .wd.ws { --c: var(--ward-sen); }

.pt, .wd { position: absolute; width: var(--dot); height: var(--dot); transform: translate(-50%, -50%); }
.wd { background: var(--c); border: 2px solid #fff; border-radius: 2px; width: calc(var(--dot) * 0.75); height: calc(var(--dot) * 0.75); transform: translate(-50%, -50%) rotate(45deg); z-index: 1; }
.pt.pool { box-shadow: 0 0 0 calc(var(--dot) * 0.3) var(--cyan); }
.pt.g { z-index: 3; }
.pt.r { z-index: 2; }
.pt:hover, .wd:hover { z-index: 10; }
.pt::after, .wd::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); display: none;
  padding: 4px 8px; border-radius: 4px; background: #000; color: #fff; font: 13px/1.3 system-ui, Arial, sans-serif;
  white-space: nowrap; transform: translateX(-50%); pointer-events: none;
}
.wd::after { transform: translateX(-50%) rotate(-45deg); bottom: calc(100% + 12px); }
.pt:hover::after, .wd:hover::after { display: block; }
.pt::after, .wd::after { white-space: normal; width: max-content; max-width: min(320px, 70vw); }
.pt.tl::after { left: 0; transform: none; }
.pt.tr::after { left: auto; right: 0; transform: none; }
.wd.tl::after { left: 0; transform: rotate(-45deg); transform-origin: left bottom; }
.wd.tr::after { left: auto; right: 0; transform: rotate(-45deg); transform-origin: right bottom; }

.page-map:has(#f-g:not(:checked)) .pt.g,
.page-map:has(#f-r:not(:checked)) .pt.r,
.page-map:has(#f-wo:not(:checked)) .wd.wo,
.page-map:has(#f-ws:not(:checked)) .wd.ws { display: none; }
.page-map:has(#f-o:not(:checked)) .pt.o,
.page-map:has(#f-m:not(:checked)) .pt.m { background: transparent; border-color: transparent; }
.page-map:has(#f-p:not(:checked)) .pt.pool { box-shadow: none; }
.page-map:has(#f-o:not(:checked)):has(#f-p:not(:checked)) .pt.o,
.page-map:has(#f-m:not(:checked)):has(#f-p:not(:checked)) .pt.m { display: none; }

@media (width <= 1000px) {
  .layout { grid-template-columns: 1fr; }
  aside { position: static; }
}

/* подсказка в стиле Dota 2 */
.dtip { width: 100%; max-width: 470px; background: #141c24; border: 1px solid #2b3a48; box-shadow: 0 6px 24px rgb(0 0 0 / 55%); color: #dde5ec; font-size: 15px; line-height: 1.35; }
.dtip-title { padding: 12px 14px 8px; font-size: 24px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.15; }
.dtip-head { padding: 0 14px 10px; color: #8fa0b0; font-size: 15px; }
.dtip-desc { padding: 0 14px 10px; }
.dtip-desc h1 { margin: 0 -14px 8px; padding: 5px 14px; background: #1f2d3b; font-size: 15px; font-weight: 700; line-height: 1.3; }
.dtip-notes { margin: 6px 12px 10px; padding: 10px 12px; background: #27404c; color: #e1e9ee; font-size: 14.5px; }
.dtip-params { padding: 4px 14px 10px; color: #7f90a0; font-size: 14.5px; }
.dtip-params b { color: #a9b6c2; font-weight: 600; }
.dtip-icons { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 2px 14px 12px; color: #cbd5de; font-size: 15px; }
.dtip-icons span { display: inline-flex; align-items: center; gap: 6px; }
.ic { width: 16px; height: 16px; }
.dtip-lore { margin: 0 8px 8px; padding: 8px 10px; background: #0f161c; color: #6f7f8d; font-style: italic; font-size: 14px; }

#tip { position: fixed; z-index: 2000; left: 0; top: 0; width: min(470px, calc(100vw - 16px)); pointer-events: none; }
#tip[hidden] { display: none; }
#tip .dtip { max-height: calc(100vh - 16px); overflow: hidden; }
#tip .tip-actions { display: none; }
body.tip-sheet #tip { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; pointer-events: auto; }
body.tip-sheet #tip .dtip { max-width: none; max-height: 72vh; overflow: auto; border-radius: 12px 12px 0 0; }
body.tip-sheet #tip .tip-actions { display: flex; gap: 12px; padding: 10px 14px; background: #101820; position: sticky; bottom: 0; }
.tip-actions a, .tip-actions button { flex: 1; padding: 10px; text-align: center; font: inherit; color: #fff; background: #2f6fdb; border: 0; border-radius: 6px; cursor: pointer; }
.tip-actions button { background: #2f3640; }

.entity .dtip { max-width: 560px; }
.small { font-size: 13px; }

/* планшет */
@media (width <= 820px) {
  main { padding: 12px; }
  .filter { margin: 0 -12px; padding: 0 12px; }
  .group > h2 { margin: 0 -12px 10px; padding-left: 12px; padding-right: 12px; }
  .dtip-title { font-size: 21px; }
  .entity { padding: 12px; }
}
/* телефон: меню-гамбургер, одна колонка */
@media (width <= 640px) {
  .nav-toggle { display: block; }
  .top nav { position: absolute; left: 0; right: 0; top: var(--hdr); display: none; flex-direction: column; gap: 0; padding: 6px 16px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
  .top.open nav { display: flex; }
  .top nav a { padding: 10px 0; }
  .langs { margin-left: 8px; }
}
@media (width <= 560px) {
  .top { padding: 0 12px; gap: 8px; }
  .top .brand { overflow: hidden; text-overflow: ellipsis; }
  .grid, .cards { grid-template-columns: 1fr; }
  .meta { grid-template-columns: 1fr; }
}

/* экран загрузки: список в порядке игры */
.gl { list-style: none; margin: 8px 0 0; padding: 0; max-width: 760px; background: var(--panel); border-radius: 8px; overflow: hidden; counter-reset: none; }
.gl-item { margin: 0; border-bottom: 1px solid var(--line); }
.gl-item:last-child { border-bottom: 0; }
.gl-row { display: flex; align-items: center; gap: 12px; padding: 8px 14px; color: var(--text); }
a.gl-row:hover { background: #2a2e35; text-decoration: none; }
.gl-none { padding: 10px 14px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); color: var(--muted); }
.gl-n { flex: none; width: 24px; text-align: right; color: var(--muted); font-size: 13px; }
.gl-name { flex: 1; min-width: 0; font-weight: 600; }
.gl-note { color: var(--muted); font-size: 14px; }
.gl-kind { flex: none; padding: 1px 8px; border-radius: 10px; font-size: 12.5px; background: #2f3640; color: #cfd3d8; }
.gl-kind.active { background: #3a2f1c; color: #ffd27a; }
.gl-kind.passive { background: #1f3340; color: #9fd3ff; }
.gl-tier { flex: none; width: 52px; text-align: right; color: var(--muted); font-size: 13px; }
.ico.sm { width: 36px; height: 36px; border-radius: 4px; }
@media (width <= 560px) { .gl-row { gap: 8px; padding: 8px 10px; } .gl-tier { width: auto; } .gl-kind { display: none; } }
