/* 28.09.2026: карта монстров /monster-map. Цвета и шрифты — как у остального сайта (ссылки #3f7fb4, панели ld-search). */
.mm {
  --ink: #1d2b36; --muted: #5b6b78; --line: #d6dfe7; --soft: #f3f6f9; --panel: #fff;
  --accent: #2f6ea5; --accent-soft: #e6f0f8; --map-bg: #c9c3a8; --focus: 0 0 0 3px rgba(47, 110, 165, .35);
  color: var(--ink);
}
.mm-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- шапка страницы */
.mm-top { padding: 14px 0 12px; }
.mm-crumbs { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mm-crumbs a { color: var(--accent); }
.mm-titlebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-top: 6px; }
.mm-top h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 700; text-wrap: balance; }
.mm-top h1 span { color: var(--accent); }
.mm-chron { display: inline-flex; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.mm-chron a { padding: 6px 14px; border-radius: 7px; font-weight: 600; font-size: 14px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.mm-chron a:hover { background: #fff; text-decoration: none; }
.mm-chron a[aria-current] { background: var(--accent); color: #fff; }
.mm-lead { margin: 10px 0 0; max-width: 78ch; color: #33434f; font-size: 15px; line-height: 1.55; }

/* ---------- приложение: панель + карта в колонке сайта (по бокам — фон-оформление сайта, туда не заходим) */
.mm-app {
  position: relative; display: grid; grid-template-columns: 340px minmax(0, 1fr);
  height: clamp(560px, calc(100vh - 110px), 940px);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel);
  isolation: isolate;   /* слои Leaflet (z-index до 1000) не вылезают поверх меню-бургера и его затемнения */
}
.mm-side { position: relative; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--panel); z-index: 500; }
.mm-grip, .mm-ftoggle { display: none; }

.mm-searchbox { position: relative; margin: 12px 12px 0; }
.mm-searchbox .mm-ico { position: absolute; left: 11px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: #7d8d99; stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.mm-searchbox input { width: 100%; height: 42px; padding: 0 12px 0 36px; border: 1px solid #b9c7d3; border-radius: 9px; font-size: 15px; background: #fff; color: var(--ink); }
.mm-searchbox input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.mm-sugg { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 1200; background: #fff; border: 1px solid #c3cfd9; border-radius: 9px; box-shadow: 0 12px 28px rgba(20, 40, 60, .2); max-height: min(60vh, 420px); overflow-y: auto; padding: 4px 0; }
.mm-sugg h3 { margin: 6px 12px 2px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #7d8d99; }
.mm-sugg [role=option] { display: flex; align-items: center; gap: 9px; padding: 7px 12px; cursor: pointer; font-size: 14px; line-height: 1.3; }
.mm-sugg [role=option][aria-selected=true], .mm-sugg [role=option]:hover { background: var(--accent-soft); }
.mm-sugg img, .mm-sugg .mm-noimg { flex: none; width: 24px; height: 24px; border-radius: 3px; background: var(--soft); }
.mm-sugg small { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.mm-sugg .mm-empty { padding: 8px 12px; color: var(--muted); font-size: 13px; }

.mm-itemchip[hidden], .mm-sugg[hidden], .mm-card[hidden], .mm-reset[hidden] { display: none !important; }
.mm-itemchip { margin: 8px 12px 0; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; border-radius: 9px; background: #fff6d8; border: 1px solid #efd68a; font-size: 13.5px; }
.mm-itemchip img { width: 22px; height: 22px; border-radius: 3px; }
.mm-itemchip b { font-weight: 600; }
.mm-itemchip button { margin-left: auto; border: 0; background: transparent; font-size: 20px; line-height: 1; color: #7a6320; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.mm-itemchip button:hover { background: rgba(0, 0, 0, .06); }

.mm-filters { padding: 4px 12px 8px; border-bottom: 1px solid var(--line); }
.mm-f { margin: 10px 0 0; padding: 0; border: 0; min-width: 0; }
.mm-f legend { display: flex; justify-content: space-between; width: 100%; margin: 0 0 2px; border: 0; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.mm-f legend output { font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--ink); font-variant-numeric: tabular-nums; }
.mm-f-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* двойной ползунок */
.mm-range { position: relative; height: 28px; }
.mm-range::before { content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 2px; background: #dfe6ec; }
.mm-range .mm-fill { position: absolute; top: 12px; height: 4px; border-radius: 2px; background: var(--accent); }
.mm-range input { position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; height: 28px; }
.mm-range input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); cursor: grab; }
.mm-range input::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); cursor: grab; }
.mm-range input::-moz-range-track { background: none; }
.mm-range input:focus-visible::-webkit-slider-thumb { box-shadow: var(--focus); }
.mm-range input:focus { outline: none; }

.mm-bands { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.mm-bands button, .mm-seg button { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 7px; font-size: 12.5px; font-weight: 600; padding: 4px 8px; cursor: pointer; line-height: 1.2; font-variant-numeric: tabular-nums; }
.mm-bands button { display: inline-flex; align-items: center; gap: 5px; }
.mm-bands i, .mm-legend i, .mm-list i, .mm-sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); flex: none; }
.mm-bands button:hover, .mm-seg button:hover { border-color: #a9bac8; }
.mm-bands button[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.mm-bands button.is-dim { opacity: .45; }
.mm-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.mm-seg button { border: 0; border-radius: 0; padding: 6px 10px; }
.mm-seg button + button { border-left: 1px solid var(--line); }
.mm-seg button[aria-pressed=true] { background: var(--accent); color: #fff; }
.mm-bands button:focus-visible, .mm-seg button:focus-visible, .mm-reset:focus-visible, .mm-chron a:focus-visible,
.mm-select select:focus-visible, .mm-sort select:focus-visible, .mm-list a:focus-visible, .mm-card button:focus-visible, .mm-card a:focus-visible { outline: none; box-shadow: var(--focus); }
.mm-select { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; font-size: 13px; color: var(--muted); }
.mm-select select, .mm-sort select { height: 30px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 13px; color: var(--ink); padding: 0 6px; max-width: 170px; }
.mm-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; font-size: 13px; cursor: pointer; }
.mm-check input { margin: 0; width: 16px; height: 16px; accent-color: var(--accent); }
.mm-reset { margin-left: auto; border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.mm-reset:hover { background: var(--accent-soft); }

.mm-listhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; }
.mm-count { margin: 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mm-list { list-style: none; margin: 0; padding: 0 6px 12px; overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.mm-list li { margin: 0; }
.mm-list a, .mm-list .mm-nolink { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; color: var(--ink); text-decoration: none; font-size: 14px; line-height: 1.3; cursor: pointer; }
.mm-list a:hover, .mm-list .mm-nolink:hover, .mm-list li.is-sel > * { background: var(--accent-soft); text-decoration: none; }
.mm-list b { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-list .mm-tag { font-size: 11px; font-weight: 700; color: #8a5a00; background: #fff1c9; border-radius: 4px; padding: 1px 5px; }
.mm-list .mm-tag.is-epic { color: #6b2bb8; background: #f1e6ff; }
.mm-list .mm-ch { font-size: 12px; color: #6a5200; font-variant-numeric: tabular-nums; }
.mm-list .mm-sp { font-size: 11px; font-weight: 700; color: #1f6b3a; background: #e3f6e9; border-radius: 4px; padding: 1px 5px; }
.mm-list li.is-raid i { border-radius: 2px; transform: rotate(45deg) scale(.9); }
.mm-lv { font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; }
.mm-list .mm-more { display: block; margin: 8px auto; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; }
.mm-list .mm-none { padding: 14px 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* ---------- карточка монстра */
.mm-card { position: absolute; inset: 0; z-index: 5; background: var(--panel); overflow-y: auto; padding: 12px 14px 18px; overscroll-behavior: contain; }
.mm-card-back { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 13.5px; padding: 4px 6px; margin-left: -6px; cursor: pointer; border-radius: 6px; }
.mm-card-back:hover { background: var(--accent-soft); }
.mm-card h2 { margin: 6px 0 2px; font-size: 20px; line-height: 1.25; font-weight: 700; }
.mm-card .mm-alt { margin: 0; color: var(--muted); font-size: 13.5px; }
.mm-card .mm-badges { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 10px; }
.mm-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 3px 7px; background: var(--soft); color: #35454f; }
.mm-badge.is-lvl { background: var(--c); color: #111; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.mm-badge.is-agro { background: #ffe3e3; color: #a3161a; }
.mm-badge.is-raid { background: #fff1c9; color: #8a5a00; }
.mm-badge.is-epic { background: #f1e6ff; color: #6b2bb8; }
.mm-badge.is-spoil { background: #e3f6e9; color: #1f6b3a; }
.mm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 10px; }
.mm-stats div { background: var(--soft); border-radius: 8px; padding: 7px 8px; }
.mm-stats dt { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.mm-stats dd { margin: 1px 0 0; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mm-card .mm-where { margin: 0 0 10px; font-size: 13.5px; color: #33434f; line-height: 1.5; }
.mm-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mm-actions a, .mm-actions button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.mm-actions a.is-main { background: var(--accent); border-color: var(--accent); color: #fff; }
.mm-actions a:hover, .mm-actions button:hover { text-decoration: none; filter: brightness(.97); }
.mm-drops h3 { margin: 12px 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.mm-drops table { display: table !important; width: 100% !important; border-collapse: collapse; font-size: 13.5px; }
.mm-drops td { padding: 4px 4px; border-bottom: 1px solid #edf1f4; vertical-align: middle; }
.mm-drops td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: #33434f; }
.mm-drops .mm-it { display: flex; align-items: center; gap: 7px; }
.mm-drops .mm-it img, .mm-drops .mm-noimg { flex: none; width: 24px; height: 24px; border-radius: 3px; background: var(--soft); }
.mm-drops tr.is-hit td { background: #fff6d8; }
.mm-drops .mm-muted { color: var(--muted); font-size: 13px; }

/* ---------- карта */
.mm-mapwrap { position: relative; min-width: 0; min-height: 0; }
.mm-map { position: absolute; inset: 0; background: var(--map-bg); }
.mm-map.leaflet-container { font: inherit; background: var(--map-bg); }
.mm-map .leaflet-control-zoom a { width: 34px; height: 34px; line-height: 32px; font-size: 20px; color: var(--ink); }
.mm-map .leaflet-control-zoom { border: 1px solid rgba(0, 0, 0, .2); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.mm-noscript { margin: 20px; padding: 12px 14px; background: #fff; border-radius: 8px; }
.mm-dots { position: absolute; left: 0; top: 0; pointer-events: none; transition: opacity .15s; }
.mm-tip { position: absolute; z-index: 800; pointer-events: none; background: rgba(20, 28, 36, .92); color: #fff; font-size: 13px; line-height: 1.35; padding: 5px 9px; border-radius: 7px; white-space: nowrap; transform: translate(12px, -50%); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.mm-tip b { font-weight: 600; }
.mm-tip span { color: #c3d1dc; }
.mm-legend { position: absolute; left: 10px; bottom: 10px; z-index: 600; display: flex; flex-wrap: wrap; gap: 3px 10px; max-width: calc(100% - 20px); background: rgba(255, 255, 255, .92); border-radius: 9px; padding: 6px 10px; font-size: 12px; font-weight: 600; color: #33434f; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); pointer-events: none; font-variant-numeric: tabular-nums; }
.mm-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mm-legend-raid i { --c: #fff; border-radius: 2px !important; transform: rotate(45deg) scale(.9); box-shadow: 0 0 0 2px #1c1c1c !important; }
.mm-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 700; display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .95); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; box-shadow: 0 4px 16px rgba(0, 0, 0, .2); }
.mm-loading span { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #cfdbe5; border-top-color: var(--accent); animation: mm-spin .8s linear infinite; }
.mm-loading[hidden] { display: none; }
@keyframes mm-spin { to { transform: rotate(360deg); } }

/* ---------- текст под картой */
.mm-seo { max-width: 920px; padding: 22px 0 10px; font-size: 15px; line-height: 1.6; }
.mm-seo h2 { font-size: 21px; font-weight: 700; margin: 26px 0 10px; text-wrap: balance; }
.mm-seo h2:first-child { margin-top: 4px; }
.mm-seo p { max-width: 75ch; }
.mm-tablewrap { overflow-x: auto; }
.mm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mm-table th { text-align: left; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--line); padding: 6px 8px; }
.mm-table td { border-bottom: 1px solid #e8eef3; padding: 7px 8px; vertical-align: top; }
.mm-table .mm-n { text-align: right; font-variant-numeric: tabular-nums; }
.mm-table td:first-child { white-space: nowrap; font-weight: 600; }
.mm-sw { margin-right: 8px; vertical-align: -1px; }
.mm-howto { padding-left: 20px; }
.mm-howto li { margin: 4px 0; }
.mm-raids { list-style: none; padding: 0; columns: 3 220px; column-gap: 24px; font-size: 14px; }
.mm-raids li { break-inside: avoid; padding: 2px 0; }
.mm-raids .mm-lv { margin-left: 4px; }
.mm-epic { font-size: 11px; font-weight: 700; color: #6b2bb8; background: #f1e6ff; border-radius: 4px; padding: 0 5px; }
.mm-more { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; }
.mm-src { color: var(--muted); font-size: 13px; }

/* ---------- телефон и узкие окна: карта на весь экран, панель — выезжающая снизу шторка */
@media (max-width: 899px) {
  .mm-top { padding: 10px 0 8px; }
  .mm-top h1 { font-size: 21px; }
  .mm-chron { width: 100%; }
  .mm-chron a { flex: 1; text-align: center; padding: 7px 6px; }
  .mm-lead { font-size: 14px; }
  /* на телефоне — от края до края: снимаем отступы контейнера Bootstrap (15px), без 100vw */
  .mm-app { display: block; margin: 0 -15px; border-radius: 0; border-left: 0; border-right: 0;
    height: calc(100svh - 64px); min-height: 460px; max-height: 900px; overflow: hidden; overflow: clip; }
  .mm-mapwrap { position: absolute; inset: 0; }
  /* шторка: меняется высота (а не сдвиг), содержимое прокручивается целиком — список виден в любом положении */
  .mm-side { position: absolute; left: 0; right: 0; bottom: 0; height: 118px; display: block; overflow: hidden auto; overscroll-behavior: contain;
    border-right: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 28px rgba(20, 40, 60, .22); transition: height .28s cubic-bezier(.2, .8, .2, 1); z-index: 900; }
  .mm-app[data-sheet=half] .mm-side { height: 55%; }
  .mm-app[data-sheet=full] .mm-side { height: 92%; }
  .mm-list { overflow: visible; padding-bottom: 24px; }
  .mm-ftoggle { display: flex; align-items: center; gap: 8px; margin: 8px 12px 0; width: calc(100% - 24px); height: 38px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 9px; background: var(--soft); font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
  .mm-ftoggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .mm-ftoggle[aria-expanded=true] { background: #fff; border-color: #a9bac8; }
  .mm-fcount { margin-left: auto; min-width: 22px; height: 22px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 12px; display: inline-grid; place-items: center; padding: 0 6px; }
  .mm-fcount[hidden] { display: none; }
  .mm-filters { display: none; border-bottom: 0; }
  .mm-filters.is-open { display: block; border-bottom: 1px solid var(--line); }
  .mm-card { top: 40px; }
  .mm-grip { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; border: 0; background: none; padding: 8px 12px 0; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
  .mm-grip-bar { width: 42px; height: 5px; border-radius: 3px; background: #c9d4dd; }
  .mm-searchbox { margin-top: 8px; }
  .mm-legend { bottom: 128px; font-size: 11px; gap: 2px 8px; padding: 5px 8px; }
  .mm-app[data-sheet=half] .mm-legend, .mm-app[data-sheet=full] .mm-legend { opacity: 0; }
  .mm-map .leaflet-bottom { bottom: 118px; }
  .mm-card { border-radius: 16px 16px 0 0; }
  .mm-list a, .mm-list .mm-nolink { padding: 9px 8px; }
  .mm-seo { padding-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .mm-side, .mm-dots { transition: none; }
  .mm-loading span { animation-duration: 2s; }
}

/* ---------- вариант 2: кнопки карты и полноэкранный режим */
.mm-ctrl { display: flex; flex-direction: column; background: #fff; border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, .22); overflow: hidden; }
.mm-ctrl button { width: 40px; height: 40px; border: 0; background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.mm-ctrl button + button { border-top: 1px solid #e3e9ee; }
.mm-ctrl button:hover { background: var(--accent-soft); }
.mm-ctrl button:disabled { color: #b7c2cb; cursor: default; background: #fff; }
.mm-ctrl button:focus-visible { outline: none; box-shadow: inset 0 0 0 3px rgba(47, 110, 165, .45); }
.mm-ctrl svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mm-app.is-fs { height: 100vh !important; max-height: none; border-radius: 0; }

/* 28.09.2026: скриншот монстра в карточке */
.mm-card-head { display: flex; gap: 12px; align-items: flex-start; }
.mm-card-title { flex: 1; min-width: 0; }
.mm-shot { flex: none; display: block; width: 92px; border-radius: 8px; overflow: hidden; background: var(--soft); box-shadow: 0 0 0 1px var(--line); margin-top: 6px; }
.mm-shot img { display: block; width: 100%; height: auto; }
