/* [SPEC-LOOTMAP-001] Loot map, laid out as the Pencil design "Карта лута":
   a navbar of category dropdowns on top, a panel docked on the left that
   collapses to a rail, a bottom sheet on phones. */
:root {
  --bg: #0d0d0d;
  --bg-nav: #121212;
  --bg-panel: #151515;
  --bg-elev: #1e1e1e;
  --bg-hover: #262626;
  --border: #2a2a2a;
  --text: #ededed;
  --muted: #a3a3a3;
  --off: #5f5f5f;
  --discord: #5865f2;
  --bar: 52px;
  --panel-w: 300px;
  --rail-w: 56px;
  --map-left: var(--panel-w);
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font: 13px/1.4 var(--font); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ui-icon { display: block; flex: none; }
i[data-icon] { display: contents; }
.mobile-only { display: none !important; }

#map { position: fixed; top: var(--bar); right: 0; bottom: 0; left: var(--map-left); background: var(--bg); }
body.panel-collapsed { --map-left: var(--rail-w); }

/* Navbar */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--bar); z-index: 1100; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; background: var(--bg-nav); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 8px; flex: none; padding-right: 14px; border-right: 1px solid var(--border); height: 24px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.nav { flex: 1; display: flex; align-items: center; gap: 2px; min-width: 0; height: 100%; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
/* Icons sit at the right end of the bar, next to RU/EN; an auto margin
   (not justify-content) keeps the first ones reachable when the bar scrolls. */
.nav > :first-child { margin-left: auto; }
.nav-all { flex: none; }
.nav-all button { padding: 4px 8px; }
.nav-sep { flex: none; width: 1px; height: 22px; margin: 0 6px; background: var(--border); }
.nav-item { position: relative; display: flex; align-items: center; flex: none; height: 36px; border-radius: 8px; }
.nav-item:hover { background: var(--bg-hover); }
.nav-item.open { background: var(--bg-elev); }
.nav-item.open::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--cat); }
.nav-btn { position: relative; display: grid; place-items: center; width: 30px; height: 36px; padding: 0 0 0 6px; background: none; border: 0; cursor: pointer; color: var(--cat); }
.nav-btn[aria-pressed="false"] { color: var(--off); }
.nav-btn .glyph path { stroke: none; }
.nav-btn.partial::after { content: ""; position: absolute; top: 6px; right: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--cat); box-shadow: 0 0 0 1.5px var(--bg-nav); }
.nav-caret { display: grid; place-items: center; width: 18px; height: 36px; padding: 0 4px 0 0; background: none; border: 0; cursor: pointer; color: var(--off); }
.nav-caret[aria-expanded="true"] { color: var(--text); }
.nav-caret[aria-expanded="true"] .ui-icon { transform: rotate(180deg); }
.nav-tip { position: fixed; z-index: 1300; padding: 4px 8px; background: #2b2b2b; color: var(--text); border-radius: 5px; font-size: 12px; white-space: nowrap; pointer-events: none; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); transform: translateX(-50%); }
.nav-tip::before { content: ""; position: absolute; top: -4px; left: 50%; margin-left: -4px; border: 4px solid transparent; border-top: 0; border-bottom-color: #2b2b2b; }

.nav-end { display: flex; align-items: center; gap: 10px; flex: none; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: #0f0f0f; border: 1px solid var(--border); border-radius: 8px; }
.seg button { padding: 4px 9px; background: none; border: 0; border-radius: 6px; color: var(--off); font-size: 12px; font-weight: 600; cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--bg-hover); color: var(--text); }
.tool-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-weight: 500; }
.tool-btn:hover { background: var(--bg-hover); }
.tool-btn .caret { color: var(--muted); }
.tool-btn[aria-expanded="true"] .caret .ui-icon { transform: rotate(180deg); }
.more-btn { display: none; width: 40px; justify-content: center; padding: 0; background: none; border: 0; font-size: 20px; letter-spacing: 1px; }
.user-btn { padding-left: 6px; }
.avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--discord); color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.discord { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 14px; background: var(--discord); color: #fff; border: 0; border-radius: 8px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.discord:hover { background: #4752c4; }

/* Dropdowns */
.nav-menu { position: fixed; z-index: 1200; min-width: 260px; max-width: calc(100vw - 16px); max-height: calc(100vh - var(--bar) - 16px); overflow-y: auto; padding: 6px 0; background: #161616; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55); }
.menu-head { display: flex; align-items: center; gap: 4px; padding: 6px 14px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.menu-head span { flex: 1; margin-right: 8px; }
.menu-head button { padding: 2px 6px; background: none; border: 0; border-radius: 4px; color: var(--text); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; cursor: pointer; }
.menu-head button:hover { background: var(--bg-hover); }
.menu-sub { padding: 8px 14px 4px; color: var(--off); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.menu-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 4px 14px; background: none; border: 0; text-align: left; color: var(--row, var(--text)); font-size: 14px; cursor: pointer; user-select: none; }
.menu-row:hover { background: var(--bg-hover); }
.menu-row > span { flex: 1; min-width: 0; white-space: nowrap; }
.menu-row > .count { flex: none; margin-left: auto; padding-left: 12px; color: var(--off); font-size: 11px; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.menu-row[aria-pressed="false"] { color: var(--off); }
.menu-row[aria-pressed="false"] > span:first-of-type { text-decoration: line-through; }
.menu-row[aria-pressed="false"] .glyph { opacity: 0.35; }
.menu-row.danger { color: #ff6b6b; }
.menu-note { margin: 4px 0 0; padding: 8px 14px 4px; border-top: 1px solid var(--border); color: var(--off); font-size: 11px; line-height: 1.45; }
.menu-note:empty { display: none; }
.view-menu { min-width: 280px; }
.view-menu .menu-row { color: var(--text); }
.view-menu .ui-icon { color: var(--muted); }
.row-note { display: block; color: var(--off); font-size: 12px; }
.switch-row:has(.switch:disabled) { color: var(--off); cursor: default; }
.switch-row:has(.switch:disabled) .ui-icon { color: var(--off); }
.auth-message { color: #f2c94c; }
.menu-lang { align-items: center; justify-content: space-between; padding: 6px 14px 10px; }
.view-menu > .discord { width: calc(100% - 28px); margin: 0 14px 10px; }
.menu-user { display: flex; align-items: center; gap: 8px; padding: 4px 14px 10px; font-weight: 600; }
.menu-user .link { margin-left: auto; }
button.link { all: unset; color: #8ab4f8; cursor: pointer; font-size: 12px; }

/* Switch */
.switch { appearance: none; position: relative; flex: none; width: 32px; height: 18px; margin: 0 0 0 auto; border-radius: 9px; background: #3a3a3a; cursor: pointer; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #9a9a9a; transition: transform 0.15s, background 0.15s; }
.switch:checked { background: #f0f0f0; }
.switch:checked::after { transform: translateX(14px); background: #151515; }
.switch:disabled { opacity: 0.5; cursor: default; }
.switch-row { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }

/* Left panel */
.panel { position: fixed; top: var(--bar); left: 0; bottom: 0; z-index: 1000; width: var(--panel-w); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: var(--bg-panel); border-right: 1px solid var(--border); scrollbar-width: thin; scrollbar-color: #333 transparent; }
body.panel-collapsed .panel { display: none; }
.panel-body { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 22px; min-height: 100%; }
.sheet-head, .sheet-summary { display: none; }
.psec h2 { margin: 0 0 10px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.psec h2 .hint { margin-left: 4px; color: var(--off); font-weight: 400; letter-spacing: 0; text-transform: none; }
.worlds { display: flex; width: 100%; }
.worlds button { flex: 1; padding: 7px 0; font-size: 13px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; background: none; color: var(--muted); border: 1px solid #333; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500; }
.chip:hover { color: var(--text); border-color: #444; }
.chip[aria-pressed="true"] { background: #f0f0f0; border-color: #f0f0f0; color: #111; font-weight: 600; }
.fog-row b { flex: 1; font-size: 14px; }
.fog-row .ui-icon { color: var(--text); }
.note { margin: 6px 0 0; color: var(--off); font-size: 12px; line-height: 1.45; }
#sec-fog { padding-bottom: 22px; margin-bottom: -6px; border-bottom: 1px solid var(--border); }
.search { position: relative; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; background: #111; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); }
.search:focus-within { border-color: #444; }
.search input { flex: 1; min-width: 0; height: 100%; padding: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 14px; }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; background: none; border: 0; color: var(--muted); cursor: pointer; }
.item-cats { margin: 10px 0 8px; }
.item-cats .chip { padding: 4px 10px; }
.items { list-style: none; margin: 0; padding: 0; }
.items button { display: flex; align-items: center; gap: 10px; width: 100%; height: 31px; padding: 0 8px 0 10px; background: none; border: 0; border-radius: 6px; color: var(--text); text-align: left; cursor: pointer; }
.items button:hover { background: var(--bg-hover); }
.items button span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.items .radio { flex: none; width: 14px; height: 14px; border: 1.5px solid #555; border-radius: 50%; }
.items button[aria-pressed="true"] { background: var(--bg-elev); font-weight: 600; }
.items button[aria-pressed="true"] .radio { border-color: var(--text); background: radial-gradient(circle, var(--text) 0 3px, transparent 3.5px); }
.items button:disabled { color: var(--off); text-decoration: line-through; cursor: default; }
.items .count { font-family: var(--mono); }
.items .count, .spawn-head .hint { color: var(--off); font-size: 11px; font-variant-numeric: tabular-nums; flex: none; }
.items .empty { padding: 6px 10px; color: var(--off); font-size: 12px; }
.spawn-card { margin-top: 10px; padding: 12px; background: #121212; border: 1px solid var(--border); border-radius: 8px; }
.spawn-head { display: flex; align-items: baseline; gap: 5px; font-size: 12px; font-weight: 600; }
.spawn-head > span:first-child { flex: 1; min-width: 0; }
.spawn-head b { font-size: 14px; font-family: var(--mono); white-space: nowrap; }
.spawn-head .hint { white-space: nowrap; }
.spawn-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.kind-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; background: var(--bg-elev); border-radius: 999px; font-size: 11px; }
.kind-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.panel-foot { margin-top: auto; }
.panel-foot .note { font-size: 11px; overflow-wrap: anywhere; }

.panel-collapse { position: fixed; top: calc(var(--bar) + 26px); left: var(--map-left); z-index: 1000; display: grid; place-items: center; width: 22px; height: 30px; padding: 0; background: var(--bg-panel); border: 1px solid var(--border); border-left: 0; border-radius: 0 6px 6px 0; color: var(--text); cursor: pointer; }
.panel-collapse:hover { background: var(--bg-hover); }
body.panel-collapsed .panel-collapse .ui-icon { transform: rotate(180deg); }
.rail { display: none; position: fixed; top: var(--bar); left: 0; bottom: 0; z-index: 1000; width: var(--rail-w); flex-direction: column; align-items: center; gap: 6px; padding-top: 18px; background: var(--bg-panel); border-right: 1px solid var(--border); }
body.panel-collapsed .rail { display: flex; }
.rail button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; background: none; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer; }
.rail button:hover { background: var(--bg-hover); color: var(--text); }

/* Map furniture */
.legend { position: fixed; left: calc(var(--map-left) + 44px); bottom: 14px; z-index: 900; display: flex; gap: 14px; padding: 7px 12px; background: rgba(18, 18, 18, 0.92); border: 1px solid var(--border); border-radius: 8px; font-size: 11px; color: var(--text); pointer-events: none; }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend i { width: 18px; height: 0; border-top: 3px solid var(--c); border-radius: 2px; }
.legend i.dash { border-top-style: dashed; border-top-width: 2px; }
.legend i.area { width: 14px; height: 10px; border: 1px solid #fff; background: var(--c); opacity: 0.8; }
.coords { position: fixed; right: 14px; bottom: 14px; z-index: 900; display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: rgba(18, 18, 18, 0.92); border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font: 600 13px var(--mono); pointer-events: none; }
.coords span { color: var(--text); }
.leaflet-top.leaflet-right { top: 10px; right: 10px; }
.leaflet-touch .leaflet-bar, .leaflet-bar { border: 1px solid var(--border); border-radius: 8px; box-shadow: none; overflow: hidden; }
.leaflet-bar a, .leaflet-bar a:hover { width: 34px; height: 34px; line-height: 32px; background: var(--bg-nav); color: var(--text); border-bottom-color: var(--border); font: 400 20px/32px var(--font); }
.leaflet-bar a:hover { background: var(--bg-hover); }

.grid-labels { z-index: 640; pointer-events: none; }
.grid-labels span { position: absolute; padding: 0 2px; color: rgba(237, 237, 237, 0.85); font: 500 11px var(--mono); text-shadow: 0 0 3px #000, 0 0 2px #000; white-space: nowrap; }
.grid-labels .gx { transform: translateX(4px); }
.grid-labels .gz { transform: translateY(2px); }

.place { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; color: #f8fafc; font-weight: 600; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 1px 2px #000; }
.place--capital { font-size: 15px; font-weight: 700; }
.place--city { font-size: 14px; font-weight: 700; }
.place--village { font-size: 12px; font-weight: 500; }
.place--local { font-size: 11px; font-weight: 400; color: #d6dde5; }

/* Leaflet cards */
.leaflet-container { background: var(--bg); font: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #161616; color: var(--text); border: 1px solid var(--border); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55); }
.leaflet-popup-content-wrapper { border-radius: 10px; }
.leaflet-popup-content { margin: 10px 12px; font-size: 13px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-tooltip.loot-tip { background: #161616; color: var(--text); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55); padding: 7px 9px; font-size: 12px; }
.leaflet-tooltip.loot-tip::before { display: none; }
.loot-tip b { font-size: 13px; }
.loot-tip .muted, .loot-popup .muted { color: var(--muted); }
.loot-tip-body { display: grid; gap: 6px; width: 220px; white-space: normal; }
.loot-picture { width: 220px; height: 220px; border-radius: 6px; display: block; }
.loot-pictures { display: flex; gap: 6px; align-items: flex-start; }
.loot-tip-body.with-photo { width: 366px; }
.loot-photo { width: 220px; height: 165px; border-radius: 6px; object-fit: cover; background: var(--bg-elev); }
.with-photo .loot-picture { width: 140px; height: 140px; }
.loot-popup .leaflet-popup-content { margin: 8px; }
.loot-photo-card { display: block; width: 160px; height: 120px; object-fit: cover; border-radius: 4px; background: var(--bg-elev); }
/* Building hover card, 160 wide: picture with the tier, name, loot, spots. */
.leaflet-tooltip.loot-card { padding: 0; overflow: hidden; border-radius: 8px; }
.card-pic { position: relative; width: 160px; height: 72px; background: var(--bg-elev); }
.card-pic img, .card-pic canvas { display: block; width: 160px; height: 72px; object-fit: cover; }
.card-tier { position: absolute; top: 5px; left: 5px; padding: 1px 5px; background: rgba(0, 0, 0, 0.75); border-radius: 4px; font: 600 10px var(--mono); }
.card-body { width: 160px; padding: 7px 8px 7px; white-space: normal; }
.card-name { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; line-height: 1.3; }
.card-name i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.card-loot { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.card-spots { margin-top: 3px; color: var(--off); font-size: 10px; }

.marker-pin { width: 28px; height: 28px; display: grid; place-items: center; font-size: 16px; line-height: 1; background: #fff; border: 2px solid #121212; border-radius: 50%; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.marker-pin--private { background: #d6dde5; border-style: dashed; }
.marker-popup .muted, .marker-form .muted { color: var(--muted); font-size: 12px; }
.marker-actions { display: flex; gap: 6px; margin-top: 8px; }
.marker-actions button, .marker-form button { padding: 4px 10px; background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 12px; }
.marker-actions button.danger { color: #ff8a80; }
.marker-form { display: grid; gap: 6px; min-width: 200px; }
.marker-form select, .marker-form input[name="label"] { padding: 5px 6px; background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.marker-form label { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.marker-form .error { color: #ff8a80; }

.glyph { flex: none; display: block; }
.swatch { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.6); flex: none; }
.ring-swatch { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid rgba(170, 230, 100, 0.9); background: rgba(139, 195, 74, 0.25); flex: none; }
/* Footpath colour, as drawn by overlay.js (PATH_STYLE). */
.path-swatch { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: #ff4f3a; vertical-align: middle; }

/* Phones: categories scroll, the rest of the bar is the ⋯ menu, the panel is a bottom sheet. */
@media (max-width: 700px) {
  :root { --map-left: 0px; }
  body.panel-collapsed { --map-left: 0px; }
  .desktop-only { display: none !important; }
  .mobile-only { display: revert !important; }
  .mobile-only[hidden] { display: none !important; }
  .menu-lang.mobile-only, .menu-user.mobile-only:not([hidden]), .view-menu > .discord.mobile-only:not([hidden]) { display: flex !important; }
  .more-btn { display: inline-flex; }
  .topbar { gap: 4px; padding: 0 0 0 12px; }
  .brand { padding-right: 10px; }
  .brand span { display: none; }
  .nav-end { height: 100%; padding-left: 4px; border-left: 1px solid var(--border); }
  .nav-sep { display: none; }
  .nav > :first-child { margin-left: 0; }
  .panel-collapse, .rail, body.panel-collapsed .rail { display: none; }
  .panel, body.panel-collapsed .panel { display: block; top: auto; right: 0; bottom: 0; width: auto; max-height: 72vh; border-right: 0; border-top: 1px solid var(--border); border-radius: 16px 16px 0 0; box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.5); }
  .sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; width: 100%; padding: 22px 18px 10px; background: var(--bg-panel); border: 0; text-align: left; cursor: pointer; }
  .sheet-grip { position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: #3a3a3a; }
  .sheet-title { flex: 1; font-size: 17px; font-weight: 700; }
  .sheet-head .caret { color: var(--muted); }
  .sheet-head[aria-expanded="false"] .caret .ui-icon { transform: rotate(180deg); }
  .panel-body { padding-top: 6px; }
  body.panel-collapsed .panel-body { display: none; }
  body.panel-collapsed .sheet-summary { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 22px; }
  .sheet-summary .chip { pointer-events: none; padding: 4px 10px; font-size: 12px; color: var(--muted); }
  .legend { display: none !important; }
  .coords { top: calc(var(--bar) + 12px); right: 12px; bottom: auto; padding: 5px 10px; font-size: 12px; }
  .leaflet-top.leaflet-right { display: none; }
  .nav-menu { left: 8px !important; right: 8px; min-width: 0; }
  .view-menu, .user-menu { left: auto !important; right: 8px; width: 300px; }
  .menu-row { min-height: 40px; font-size: 15px; }
}

/* Rows with a switch (infected, their circles) instead of a struck-out label. */
.menu-row .switch { pointer-events: none; }
.menu-row[aria-pressed="true"] .switch { background: #f0f0f0; }
.menu-row[aria-pressed="true"] .switch::after { transform: translateX(14px); background: #151515; }
.menu-row:has(.switch)[aria-pressed="false"] { color: var(--row, var(--text)); }
.menu-row:has(.switch)[aria-pressed="false"] > span:first-of-type { text-decoration: none; }
.menu-row:has(.switch)[aria-pressed="false"] .glyph { opacity: 1; }

/* YMG Survivor (ymg.js): the switch at the top left and the YMG theme from
   the Pencil design «08 · Десктоп RU — тема YMG»: ember orange on warm black,
   Montserrat headings. */
:root { --ymg: #ff6a1a; --ymg-head: #ff8a4c; --ymg-font: Montserrat, var(--font); }
.ymg-toggle { display: inline-flex; align-items: center; gap: 8px; flex: none; height: 30px; padding: 0 10px 0 6px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 7px; color: var(--muted); font: 900 13px var(--ymg-font); letter-spacing: 0.09em; white-space: nowrap; cursor: pointer; }
.ymg-toggle:hover { color: var(--text); background: var(--bg-hover); }
.ymg-knob { position: relative; width: 30px; height: 18px; border-radius: 9px; background: #3a3a3a; transition: background 0.15s; }
.ymg-knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #9a9a9a; transition: transform 0.15s, background 0.15s; }
.ymg-toggle[aria-pressed="true"] { color: #fff; border-color: rgba(255, 122, 46, 0.5); background: rgba(255, 106, 26, 0.1); }
.ymg-toggle[aria-pressed="true"] .ymg-knob { background: var(--ymg); }
.ymg-toggle[aria-pressed="true"] .ymg-knob::after { transform: translateX(12px); background: #fff; }

body.ymg {
  --bg: #0b0b0b;
  --bg-nav: #0f0b09;
  --bg-panel: #120d0a;
  --bg-elev: #1c1511;
  --bg-hover: #2a1f18;
  --border: #33261d;
  --text: #f3ede6;
  --muted: #a89a8c;
  --off: #6e5f53;
}
body.ymg .topbar { border-bottom: 2px solid transparent; border-image: linear-gradient(90deg, #ff5a12, #ffb04a 45%, rgba(255, 90, 18, 0.25)) 1; }
body.ymg .brand { font-family: var(--ymg-font); font-weight: 800; }
body.ymg .brand .ui-icon { color: var(--ymg); }
body.ymg .nav-caret { color: #8a7a6c; }
body.ymg .panel { border-right-color: #2a1f18; }
body.ymg .psec h2 { color: var(--ymg-head); font-family: var(--ymg-font); font-weight: 800; letter-spacing: 0.1em; }
body.ymg .psec h2 .hint { color: var(--off); font-family: var(--font); }
body.ymg .seg { background: var(--bg-elev); border-color: var(--border); }
body.ymg .seg button { color: var(--muted); }
body.ymg .worlds button[aria-pressed="true"] { background: #3d2c20; color: var(--text); }
body.ymg .lang button[aria-pressed="true"] { background: var(--ymg); color: #fff; }
body.ymg .lang button:not([aria-pressed="true"]) { color: #8a7a6c; }
body.ymg .tool-btn { background: none; border-color: #3d2c20; }
body.ymg .tool-btn .caret { color: #8a7a6c; }
body.ymg .discord { background: var(--ymg); box-shadow: 0 4px 14px rgba(255, 106, 26, 0.25); }
body.ymg .discord:hover { background: #ff7f3a; }
body.ymg .avatar { background: var(--ymg); }
body.ymg .chip { border-color: #3d2c20; color: var(--muted); }
body.ymg .chip:hover { border-color: #5a4130; color: var(--text); }
body.ymg .chip[aria-pressed="true"] { background: var(--ymg); border-color: var(--ymg); color: #0f0b09; }
body.ymg .switch, body.ymg .menu-row .switch { background: #3d2c20; }
body.ymg .switch::after { background: var(--muted); }
body.ymg .switch:checked, body.ymg .menu-row[aria-pressed="true"] .switch { background: var(--ymg); }
body.ymg .switch:checked::after, body.ymg .menu-row[aria-pressed="true"] .switch::after { background: #fff; }
body.ymg .search { background: var(--bg-elev); border-color: #3d2c20; }
body.ymg .search:focus-within { border-color: var(--ymg); }
body.ymg .items button { color: #c9bfb4; }
body.ymg .items button[aria-pressed="true"] { background: #2a1f18; color: var(--text); }
body.ymg .items .radio { border-color: var(--off); }
body.ymg .items button[aria-pressed="true"] .radio { border-color: var(--ymg); background: radial-gradient(circle, var(--ymg) 0 3px, transparent 3.5px); }
body.ymg .spawn-card { background: #1a130f; }
body.ymg .panel-collapse { background: #1a130f; color: var(--ymg); }
body.ymg .rail button:hover { color: var(--ymg); }
body.ymg .nav-menu, body.ymg .leaflet-popup-content-wrapper, body.ymg .leaflet-popup-tip, body.ymg .leaflet-tooltip.loot-tip { background: #120d0a; }
body.ymg .nav-item.open { background: var(--bg-hover); }
body.ymg .nav-tip { background: #2a1f18; }
body.ymg .nav-tip::before { border-bottom-color: #2a1f18; }
body.ymg .leaflet-bar a { background: rgba(18, 13, 10, 0.95); }
body.ymg .legend, body.ymg .coords { background: rgba(15, 11, 9, 0.9); }

.ad { display: block; line-height: 0; border-radius: 10px; overflow: hidden; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.ad img { display: block; width: 100%; height: auto; }
.ad-wide { position: fixed; bottom: 14px; left: calc(var(--map-left) + (100vw - var(--map-left)) / 2); z-index: 950; width: min(728px, calc(100vw - var(--map-left) - 28px)); transform: translateX(-50%); }
body.ads .legend, body.ads .coords { bottom: calc(14px + min(90px, (100vw - var(--map-left) - 28px) * 90 / 728) + 10px); }
.ad-square-sec .ad { border-radius: 8px; }
.ad-promo { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; background: rgba(5, 4, 3, 0.72); backdrop-filter: blur(3px); }
.ad-promo-box { position: relative; width: min(1200px, 100%, (100vh - 120px) * 1200 / 628); }
.ad-promo-box .ad { border-radius: 14px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7); }
.ad-close { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; background: rgba(10, 8, 7, 0.75); color: #fff; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 50%; cursor: pointer; }
.ad-close:hover { background: var(--ymg); border-color: var(--ymg); }
.ad-note { margin: 10px 0 0; color: #d6d0c8; font-size: 13px; text-align: center; }

@media (max-width: 700px) {
  .ymg-toggle { height: 28px; padding: 0 8px 0 4px; gap: 6px; font-size: 11px; }
  .ad-wide { display: none; }
  body.ads .coords { bottom: auto; }
}

/* [SPEC-LOOTMAP-GROUPS-001] Custom groups (groups.js): group markers, toasts, the «Группы» window. */
.marker-pin--group { border-color: var(--group); box-shadow: 0 0 0 2px #121212, 0 2px 6px rgba(0, 0, 0, 0.5); }
.group-dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; background: var(--group); vertical-align: -1px; }
.toasts { position: fixed; left: 50%; bottom: 64px; z-index: 1300; display: grid; gap: 6px; width: min(420px, calc(100vw - 32px)); transform: translateX(-50%); pointer-events: none; }
.toast { padding: 10px 14px; background: #161616; color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--group, #f0f0f0); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); font: inherit; font-size: 13px; text-align: left; pointer-events: auto; }
button.toast { cursor: pointer; }
.groups-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 0 16px 16px; background: #161616; color: var(--text); border: 1px solid var(--border); border-radius: 12px; }
.groups-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.groups-dialog .muted { color: var(--muted); font-size: 12px; }
.groups-dialog button, .groups-dialog input { padding: 5px 10px; background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: 13px; }
.groups-dialog button { cursor: pointer; }
.groups-dialog button.danger { color: #ff8a80; }
.groups-dialog input[type="checkbox"] { padding: 0; }
.groups-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px 0 10px; background: #161616; }
.groups-create, .group-invite { display: flex; gap: 6px; }
.groups-create input, .group-invite input { flex: 1; min-width: 0; }
.group { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--border); border-left: 4px solid var(--group); border-radius: 8px; }
.group-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.group-show { margin-left: auto; display: flex; gap: 6px; align-items: center; font-size: 12px; }
.group-sub { display: grid; gap: 6px; margin-top: 8px; }
.group-members { margin: 8px 0; padding: 0; list-style: none; }
.group-members li { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 4px 0; border-top: 1px solid var(--border); }
.group-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.group-actions button { padding: 3px 8px; font-size: 12px; }
.groups-toasts { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 13px; }
.marker-form select[name="scope"] { padding: 5px 6px; background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font: inherit; }

/* [SPEC-LOOTMAP-PARTY-001] Steam sign-in and the me-and-my-party layer */
.steam { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 34px; padding: 0 14px; background: #1b2838; color: #fff; border: 1px solid #66c0f4; border-radius: 8px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.steam:hover { background: #2a475e; }
.party-pin { position: relative; }
.party-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #11151a; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 2px 6px rgba(0, 0, 0, 0.5); }
.party-dot--me { background: #34c759; }
.party-dot--friend { background: #3ba7ff; }
.party-label { position: absolute; left: 20px; top: -1px; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; text-shadow: 0 0 3px #000, 0 0 3px #000; pointer-events: none; }
.party-dot--away { background: #8e8e93; border-style: dashed; opacity: 0.85; }
.party-label--away { color: #c7c7cc; font-weight: 500; }
.party-roster { position: fixed; top: calc(var(--bar) + 90px); right: 10px; z-index: 950; width: 210px; max-height: calc(100vh - var(--bar) - 160px); overflow-y: auto; background: rgba(18, 18, 18, 0.97); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
.party-roster-head { display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 12px; background: none; border: 0; text-align: left; font-weight: 700; cursor: pointer; }
.party-roster-head .hint { color: var(--muted); font-weight: 600; }
.party-roster ul { margin: 0; padding: 0 0 6px; list-style: none; }
.party-roster--closed ul { display: none; }
.party-row { display: grid; grid-template-columns: 14px 1fr; column-gap: 8px; align-items: center; width: 100%; padding: 5px 12px; background: none; border: 0; text-align: left; cursor: pointer; }
.party-row:hover { background: var(--bg-hover); }
.party-row .party-dot { width: 10px; height: 10px; border-width: 1px; box-shadow: none; grid-row: span 2; }
.party-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.party-row-note { color: var(--muted); font-size: 11px; }
.party-row--away .party-row-name { color: var(--muted); }
@media (max-width: 700px) {
  .party-roster { top: calc(var(--bar) + 50px); right: 12px; width: 180px; max-height: 40vh; }
}
