/* ==========================================================================
   Lunify Map — тема для squaremap в фирменном оформлении сайта lunify.ru
   ========================================================================== */

:root {
  --bg: #0B0E1A;
  --bg-2: #11152B;
  --surface: #161B33;
  --surface-2: #1B2140;
  --surface-fade: rgba(22, 27, 51, 0.55);
  --surface-soft: rgba(22, 27, 51, 0.8);
  --glass: rgba(17, 21, 43, 0.72);
  --inset: rgba(11, 14, 26, 0.5);
  --veil: rgba(11, 14, 26, 0.88);
  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.12);
  --silver: #C9D6FF;
  --silver-2: #8FA8E8;
  --amber: #F2A65A;
  --orange: #F2701E;
  --orange-soft: #FF8A4C;
  --green: #7FD99A;
  --text: #EDEFF7;
  --text-dim: rgba(237, 239, 247, 0.76);
  --plate-bg: rgba(17, 21, 43, 0.92);
  --shadow-panel: 0 18px 50px rgba(4, 6, 14, 0.55);
  --font-display: "Unbounded", sans-serif;
  --font-body: "Onest", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 20px;
  --radius-sm: 12px;
  --map-void: #070A14;
  color-scheme: dark;
}

@property --hue {
  syntax: "<number>";
  initial-value: 0;
  inherits: true;
}

:root[data-theme="light"] {
  --bg: #EEF1FA;
  --bg-2: #E3E8F5;
  --surface: #FFFFFF;
  --surface-2: #F7F9FE;
  --surface-fade: rgba(255, 255, 255, 0.72);
  --surface-soft: rgba(255, 255, 255, 0.9);
  --glass: rgba(255, 255, 255, 0.8);
  --inset: rgba(232, 236, 248, 0.85);
  --veil: rgba(244, 246, 253, 0.9);
  --line: rgba(18, 24, 48, 0.1);
  --line-strong: rgba(18, 24, 48, 0.18);
  --silver: #3A4780;
  --silver-2: #5B6BA8;
  --orange: #D95A0F;
  --orange-soft: #E8722A;
  --amber: #D9821E;
  --green: #37A15C;
  --text: #141A33;
  --text-dim: rgba(20, 26, 51, 0.78);
  --plate-bg: rgba(255, 255, 255, 0.94);
  --shadow-panel: 0 18px 50px rgba(38, 48, 90, 0.18);
  --map-void: #C9D2E8;
  color-scheme: light;
}

:root[data-theme="rgb"] {
  /* если браузер не знает @property, --hue не анимируется: оставляем статичный вид */
  --surface: #141326;
  --surface-2: #1B1A33;
  --glass: rgba(15, 14, 30, 0.78);
  --line: rgba(180, 120, 255, 0.16);
  --line-strong: rgba(180, 120, 255, 0.32);
  --silver: #A9E4FF;
  --silver-2: #8FC6F0;
  --orange: #FF5C7A;
  --orange-soft: #FF8A4C;
  --amber: #FFC46B;
  --green: #6BE3A8;
  --map-void: #07060F;
}

@supports (background: paint(x)) or (color: color-mix(in srgb, red, blue)) {
  :root[data-theme="rgb"] {
    animation: huecycle 12s linear infinite;
  --bg: #07070F;
  --bg-2: #0C0B1A;
  --surface: hsl(calc(var(--hue) + 240) 30% 12%);
  --surface-2: hsl(calc(var(--hue) + 240) 32% 16%);
  --surface-fade: hsl(calc(var(--hue) + 240) 30% 10% / 0.72);
  --surface-soft: hsl(calc(var(--hue) + 240) 30% 14% / 0.85);
  --glass: hsl(calc(var(--hue) + 245) 34% 10% / 0.78);
  --inset: hsl(calc(var(--hue) + 250) 40% 6% / 0.6);
  --veil: hsl(calc(var(--hue) + 250) 40% 5% / 0.9);
  --line: hsl(var(--hue) 80% 60% / 0.16);
  --line-strong: hsl(var(--hue) 85% 65% / 0.32);
  --silver: hsl(calc(var(--hue) + 180) 85% 78%);
  --silver-2: hsl(calc(var(--hue) + 200) 75% 68%);
  --orange: hsl(var(--hue) 90% 58%);
  --orange-soft: hsl(calc(var(--hue) + 20) 95% 68%);
  --amber: hsl(calc(var(--hue) + 30) 90% 60%);
  --green: hsl(calc(var(--hue) + 140) 70% 62%);
  --text: #F2F4FF;
  --text-dim: rgba(242, 244, 255, 0.78);
  --plate-bg: hsl(calc(var(--hue) + 245) 34% 10% / 0.92);
    --map-void: hsl(calc(var(--hue) + 250) 45% 5%);
  }
}

:root[data-theme="rgb"] { color-scheme: dark; }

@keyframes huecycle {
  from { --hue: 0; }
  to { --hue: 360; }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

[hidden] { display: none !important; }

/* панели появляются каскадом, когда карта готова */
.sidebar, .bottombar, .zoom-group, .ip-badge {
  opacity: 0;
  translate: 0 8px;
}

/* топбар центрируется через translate — ему только проявление */
.topbar { opacity: 0; }
body.ui-ready .topbar { animation: fade-in 0.55s var(--ease) backwards; opacity: 1; }

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.ui-ready .sidebar,
body.ui-ready .bottombar,
body.ui-ready .zoom-group,
body.ui-ready .ip-badge {
  animation: ui-in 0.55s var(--ease) backwards;
  opacity: 1;
  translate: 0 0;
}

body.ui-ready .topbar { animation-delay: 0.05s; }
body.ui-ready .ip-badge { animation-delay: 0.12s; }
body.ui-ready .sidebar { animation-delay: 0.18s; }
body.ui-ready .bottombar { animation-delay: 0.24s; }
body.ui-ready .zoom-group { animation-delay: 0.3s; }

body.ui-ready .sidebar.hidden { opacity: 0; translate: calc(-100% - 24px) 0; }

@keyframes ui-in {
  from { opacity: 0; translate: 0 10px; }
  to { opacity: 1; translate: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .bottombar, .zoom-group, .ip-badge { opacity: 1; translate: 0 0; }
  .topbar { opacity: 1; }
}

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--silver);
  outline-offset: 2px;
  border-radius: 6px;
}

/* --------------------------------------------------------------- карта -- */

#map {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--map-void);
  background-image:
    radial-gradient(1.5px 1.5px at 25% 20%, rgba(201, 214, 255, 0.35), transparent 100%),
    radial-gradient(1px 1px at 70% 60%, rgba(201, 214, 255, 0.22), transparent 100%),
    radial-gradient(1px 1px at 45% 85%, rgba(201, 214, 255, 0.2), transparent 100%),
    radial-gradient(1.5px 1.5px at 90% 35%, rgba(201, 214, 255, 0.28), transparent 100%),
    radial-gradient(1px 1px at 10% 55%, rgba(201, 214, 255, 0.2), transparent 100%);
  background-size: auto, 640px 640px, 640px 640px, 640px 640px, 640px 640px, 640px 640px;
  outline: none;
  cursor: grab;
}

#map.dragging, #map.dragging * { cursor: grabbing !important; }

/* у каждого мира своя подложка под тайлами */
#map[data-world="nether"] {
  background-color: #1A0906;
  background-image:
    radial-gradient(900px 600px at 30% 20%, rgba(242, 112, 30, 0.16), transparent 70%),
    radial-gradient(700px 500px at 75% 70%, rgba(180, 40, 20, 0.14), transparent 70%);
}

#map[data-world="the_end"] {
  background-color: #0D0A16;
  background-image:
    radial-gradient(900px 600px at 50% 40%, rgba(180, 160, 220, 0.12), transparent 70%),
    radial-gradient(1.5px 1.5px at 25% 20%, rgba(230, 220, 255, 0.4), transparent 100%),
    radial-gradient(1px 1px at 70% 60%, rgba(230, 220, 255, 0.3), transparent 100%);
  background-size: auto, auto, 520px 520px, 520px 520px;
}

.leaflet-container {
  background: transparent;
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

.leaflet-tile-container img {
  image-rendering: pixelated;
}

/* мягкая виньетка по краям карты, чтобы панели читались */
/* Затемнение только там, где лежат панели, и совсем лёгкое: карта должна
   оставаться такой же яркой, как в штатном интерфейсе squaremap. */
.vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 10, 20, 0.3) 0, transparent 90px),
    linear-gradient(0deg, rgba(7, 10, 20, 0.28) 0, transparent 90px);
}

:root[data-theme="light"] .vignette {
  background:
    linear-gradient(180deg, rgba(238, 241, 250, 0.42) 0, transparent 90px),
    linear-gradient(0deg, rgba(238, 241, 250, 0.4) 0, transparent 90px);
}

/* ------------------------------------------------- общие компоненты ----- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), translate 0.25s var(--ease);
}

.btn:hover { background: rgba(201, 214, 255, 0.08); border-color: rgba(201, 214, 255, 0.3); }
.btn:active { translate: 0 1px; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn-wide { width: 100%; }

.btn-cta {
  border-color: rgba(242, 112, 30, 0.7);
  background: linear-gradient(180deg, rgba(242, 112, 30, 0.35), rgba(242, 112, 30, 0.18));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 16px rgba(242, 112, 30, 0.25);
}

.btn-cta:hover {
  border-color: var(--orange);
  background: linear-gradient(180deg, rgba(242, 112, 30, 0.45), rgba(242, 112, 30, 0.25));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 6px 24px rgba(242, 112, 30, 0.35);
}

.icon-btn {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.icon-btn:hover { color: var(--text); background: rgba(201, 214, 255, 0.12); }
.icon-btn:active { translate: 0 1px; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.glass {
  background: var(--glass);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), var(--shadow-panel);
}

.live-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(127, 217, 154, 0.7);
  animation: pulse 2.4s var(--ease) infinite;
}

.live-dot.offline {
  background: #E4574C;
  box-shadow: 0 0 10px rgba(228, 87, 76, 0.6);
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ------------------------------------------------------- верхняя панель - */

.topbar {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  translate: -50% 0;
  z-index: 620;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 8px 10px 8px 18px;
  border-radius: 999px;
  max-width: calc(100vw - 32px);
  background: var(--glass);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 40px rgba(4, 6, 14, 0.5);
  transition: translate 0.4s var(--ease), opacity 0.3s var(--ease);
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
}

.nav-logo img { border-radius: 6px; }

.nav-links { display: flex; gap: 2px; }

.nav-links a {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.nav-links a:hover { color: var(--text); background: rgba(201, 214, 255, 0.08); }
.nav-links a[aria-current="page"] { color: var(--text); background: rgba(201, 214, 255, 0.1); }

.topbar-tools { display: flex; align-items: center; gap: 10px; }
.nav-cta { padding: 8px 16px; font-size: 0.85rem; }

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--inset);
}

.theme-switch button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.theme-switch button:hover { color: var(--text); background: rgba(201, 214, 255, 0.1); }
.theme-switch button[aria-pressed="true"] { color: var(--bg); background: var(--silver); }
.theme-switch button[data-theme="rgb"][aria-pressed="true"] {
  background: conic-gradient(#FF4D4D, #FFD24D, #4DFF88, #4DD2FF, #B84DFF, #FF4D4D);
  color: #0B0E1A;
}

.tile-progress {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  height: 2px;
  z-index: 700;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.tile-progress.active { opacity: 1; }

.tile-progress i {
  display: block;
  width: 34%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--orange), var(--orange-soft), transparent);
  animation: tileslide 1.1s linear infinite;
}

@keyframes tileslide {
  from { translate: -100% 0; }
  to { translate: 320% 0; }
}

.topbar-online {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--inset);
  font-size: 0.82rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.topbar-online b { color: var(--text); font-weight: 600; }

.nav-cabinet {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(242, 112, 30, 0.15), rgba(242, 112, 30, 0.05));
  border: 1px solid rgba(242, 112, 30, 0.3);
  text-decoration: none;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), scale 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.nav-cabinet svg { width: 18px; height: 18px; fill: none; stroke: var(--orange); stroke-width: 2; }

.nav-cabinet:hover {
  border-color: var(--orange);
  background: rgba(242, 112, 30, 0.25);
  scale: 1.08;
  box-shadow: 0 0 16px rgba(242, 112, 30, 0.4);
}

.nav-cabinet:hover svg { stroke: var(--orange-soft); }

.ip-badge {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right));
  top: calc(16px + env(safe-area-inset-top));
  z-index: 610;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), var(--shadow-panel);
  color: var(--text);
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), translate 0.25s var(--ease);
}

.ip-badge:hover {
  border-color: rgba(242, 112, 30, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 30px rgba(242, 112, 30, 0.22);
  translate: 0 -1px;
}

.ip-badge-label {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.ip-badge-ip {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ip-badge svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ip-badge:hover svg { stroke: var(--orange-soft); }

/* метка спавна */

.spawn-pin {
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.spawn-pin svg {
  position: relative;
  z-index: 2;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: #0B0E1A;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  padding: 5px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--amber), var(--orange));
  box-shadow: 0 4px 14px rgba(242, 112, 30, 0.5);
  box-sizing: content-box;
}

.spawn-pulse {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  border: 2px solid var(--orange);
  animation: spawnpulse 2.8s var(--ease) infinite;
}

@keyframes spawnpulse {
  0% { opacity: 0.7; scale: 0.9; }
  70%, 100% { opacity: 0; scale: 2.2; }
}

/* -------------------------------------------------------------- сайдбар - */

.sidebar {
  position: fixed;
  top: calc(84px + env(safe-area-inset-top));
  left: calc(16px + env(safe-area-inset-left));
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 610;
  width: 318px;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), var(--shadow-panel);
  transition: translate 0.45s var(--ease), opacity 0.3s var(--ease);
}

.sidebar.hidden {
  translate: calc(-100% - 24px) 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px 12px 16px;
  border-bottom: 1px solid var(--line);
}

.online-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

.online-badge b { color: var(--text); font-weight: 600; }

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 8px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 214, 255, 0.25) transparent;
}

.sidebar-scroll::-webkit-scrollbar { width: 8px; }
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(201, 214, 255, 0.22);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.sidebar-scroll::-webkit-scrollbar-thumb:hover { background: rgba(201, 214, 255, 0.35); background-clip: content-box; }

.panel { padding: 12px 8px 14px; }
.panel + .panel { border-top: 1px solid var(--line); }

.panel-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 8px 10px;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.panel-count {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--silver);
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(201, 214, 255, 0.1);
}

/* поиск */

.search-wrap { position: relative; margin: 0 6px 10px; }

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  translate: 0 -50%;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--inset);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
  user-select: text;
  -webkit-user-select: text;
}

.search-input::placeholder { color: var(--text-dim); }
.search-input:focus { outline: none; border-color: rgba(201, 214, 255, 0.35); background: var(--surface-fade); }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* список игроков */

.player-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }

.player-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.player-row:hover { background: rgba(201, 214, 255, 0.08); }

.player-row.following {
  border-color: rgba(242, 112, 30, 0.55);
  background: linear-gradient(180deg, rgba(242, 112, 30, 0.22), rgba(242, 112, 30, 0.08));
}

.player-head {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 7px;
  image-rendering: pixelated;
  background: var(--inset);
  border: 1px solid var(--line);
}

.player-meta { min-width: 0; flex: 1; }

.player-name {
  display: block;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-pos {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-row.other-world { color: var(--text-dim); }
.player-row.other-world .player-head { opacity: 0.6; }
.player-row.other-world .player-pos { color: var(--amber); }

.empty-note {
  padding: 6px 14px 2px;
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.empty-note b { color: var(--silver); font-weight: 600; }

/* миры */

.world-list { display: flex; flex-direction: column; gap: 4px; }

.world-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.world-row:hover { background: rgba(201, 214, 255, 0.08); color: var(--text); }

.world-row[aria-selected="true"] {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(201, 214, 255, 0.1);
}

.world-icon {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--inset);
}

.world-icon svg { width: 15px; height: 15px; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.world-row[data-type="normal"] .world-icon svg { stroke: var(--green); }
.world-row[data-type="nether"] .world-icon svg { stroke: var(--orange-soft); }
.world-row[data-type="the_end"] .world-icon svg { stroke: var(--silver); }

.world-sub {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* слои */

.layer-list { display: flex; flex-direction: column; gap: 2px; }

.layer-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-dim);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.layer-row:hover { background: rgba(201, 214, 255, 0.08); color: var(--text); }
.layer-row input { position: absolute; opacity: 0; pointer-events: none; }

.layer-box {
  width: 18px;
  height: 18px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--inset);
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.layer-box svg { width: 12px; height: 12px; fill: none; stroke: var(--bg); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.layer-row input:checked + .layer-box { background: var(--silver); border-color: var(--silver); }
.layer-row input:checked + .layer-box svg { opacity: 1; }
.layer-row input:checked ~ .layer-name { color: var(--text); }
.layer-row input:focus-visible + .layer-box { outline: 2px solid var(--silver); outline-offset: 2px; }

.sidebar-foot { padding: 12px 14px 14px; border-top: 1px solid var(--line); }

.sidebar-ip {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid rgba(242, 112, 30, 0.4);
  background: linear-gradient(180deg, rgba(242, 112, 30, 0.22), rgba(242, 112, 30, 0.1));
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.sidebar-ip svg { width: 15px; height: 15px; fill: none; stroke: var(--orange-soft); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.sidebar-nav { display: none; gap: 4px; padding-bottom: 10px; }

.sidebar-nav a {
  flex: 1;
  padding: 7px 0;
  border-radius: 999px;
  text-align: center;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--inset);
}

.sidebar-nav a:hover { color: var(--text); }

@media (max-width: 900px) {
  .sidebar-nav { display: flex; }
  .sidebar-ip { display: flex; }
}

/* ------------------------------------------------------- нижняя панель -- */

.bottombar {
  position: fixed;
  left: calc(16px + env(safe-area-inset-left));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 610;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 6px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), var(--shadow-panel);
}

.coords { display: flex; align-items: center; gap: 4px; padding: 0 6px 0 10px; }

.coord {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--inset);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.coord i {
  font-style: normal;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--silver-2);
}

.coord b { font-weight: 600; min-width: 42px; text-align: right; }

.tool-group { display: flex; align-items: center; gap: 2px; }

/* ---------------------------------------------------------------- зум --- */

.zoom-group {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 610;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), var(--shadow-panel);
}

.zoom-level {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  padding: 1px 0;
}

/* ------------------------------------------------------------- кнопка --- */

.fab {
  position: fixed;
  left: 16px;
  top: 84px;
  z-index: 605;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), var(--shadow-panel);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  scale: 0.8;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), scale 0.3s var(--ease), visibility 0.3s var(--ease), background-color 0.2s var(--ease);
}

.fab.visible { opacity: 1; scale: 1; visibility: visible; pointer-events: auto; }
.fab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.fab-badge {
  position: absolute;
  right: -3px;
  top: -3px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--orange-soft), var(--orange));
  color: #0B0E1A;
  font-size: 0.68rem;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(242, 112, 30, 0.4);
}

/* ------------------------------------------------------------ слежение -- */

.following-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  translate: -50% 0;
  z-index: 615;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-dim);
  background: var(--glass);
  border: 1px solid rgba(242, 112, 30, 0.45);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 10px 30px rgba(242, 112, 30, 0.18);
  animation: rise 0.35s var(--ease);
}

.following-bar b { color: var(--text); font-weight: 600; }
.following-bar img { border-radius: 6px; image-rendering: pixelated; flex: none; }

.following-bar button {
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(242, 112, 30, 0.16);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s var(--ease);
}

.following-bar button:hover { background: rgba(242, 112, 30, 0.3); }

@keyframes rise {
  from { opacity: 0; translate: -50% 12px; }
  to { opacity: 1; translate: -50% 0; }
}

/* ---------------------------------------------------- рисование зоны --- */

.draw-panel {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right));
  top: calc(84px + env(safe-area-inset-top));
  z-index: 630;
  width: 290px;
  max-width: calc(100vw - 32px);
  padding: 16px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid rgba(242, 112, 30, 0.45);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 14px 40px rgba(242, 112, 30, 0.18);
  animation: rise-right 0.35s var(--ease);
}

.draw-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }

.draw-badge {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(242, 112, 30, 0.2);
  border: 1px solid rgba(242, 112, 30, 0.4);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange-soft);
}

.draw-head strong {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.draw-hint { font-size: 0.8rem; color: var(--text-dim); line-height: 1.45; margin-bottom: 12px; }
.draw-hint.is-warn { color: var(--orange-soft); }

.draw-ghost-note {
  font-size: 0.76rem;
  color: var(--silver-2);
  line-height: 1.4;
  margin: -6px 0 12px;
}

.draw-ghost { stroke-dasharray: 3 6; pointer-events: none; }

.draw-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.draw-stats span {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--inset);
  font-size: 0.74rem;
  color: var(--text-dim);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.draw-stats b { display: block; font-size: 1rem; color: var(--text); font-weight: 600; }

.draw-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.draw-actions .btn { flex: 1; padding: 9px 12px; font-size: 0.82rem; justify-content: center; }
.draw-actions .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.draw-actions .btn-cta { flex-basis: 100%; }

.draw-remove {
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.78rem;
  cursor: pointer;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.draw-remove:hover { color: #FF7A6B; background: rgba(228, 87, 76, 0.12); }

body.is-drawing #map { cursor: crosshair; }
body.is-drawing .ip-badge { display: none; }

.draw-shape {
  stroke-dasharray: 8 5;
  animation: draw-dash 1.4s linear infinite;
}

@keyframes draw-dash {
  to { stroke-dashoffset: -26; }
}

.draw-dot span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--orange-soft), var(--orange));
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 10px rgba(242, 112, 30, 0.5);
  color: #0B0E1A;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
}

@media (max-width: 640px) {
  .draw-panel {
    right: 12px;
    left: 12px;
    top: auto;
    bottom: calc(78px + env(safe-area-inset-bottom));
    width: auto;
  }
}

.render-note {
  position: fixed;
  left: 50%;
  top: calc(84px + env(safe-area-inset-top));
  translate: -50% 0;
  z-index: 615;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 10px 8px 10px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text-dim);
  background: var(--glass);
  border: 1px solid rgba(242, 165, 90, 0.4);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), var(--shadow-panel);
  animation: rise 0.35s var(--ease);
}

.render-note[hidden] { display: none; }

.render-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px rgba(242, 165, 90, 0.7);
  animation: pulse 1.6s var(--ease) infinite;
}

.render-note button {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.render-note button:hover { color: var(--text); background: rgba(201, 214, 255, 0.12); }

@media (max-width: 900px) {
  .render-note { top: auto; bottom: calc(132px + env(safe-area-inset-bottom)); font-size: 0.78rem; }
}

/* -------------------------------------------------------------- тост ---- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 76px;
  translate: -50% 8px;
  z-index: 700;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-panel);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), translate 0.3s var(--ease);
}

.toast.show { opacity: 1; translate: -50% 0; }

/* ------------------------------------------------------------ загрузка -- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 700px at 50% 40%, rgba(143, 168, 232, 0.1), transparent 65%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 60%, var(--bg) 100%);
  transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
}

.boot.done { opacity: 0; visibility: hidden; }

.boot-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }

.boot-moon {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin-bottom: 10px;
  background: radial-gradient(circle at 50% 45%, rgba(242, 112, 30, 0.22), transparent 70%);
  animation: bob 3.6s var(--ease) infinite;
}

.boot-moon img { border-radius: 14px; filter: drop-shadow(0 8px 24px rgba(242, 112, 30, 0.35)); }

@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

.boot-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.boot-sub { font-size: 0.88rem; color: var(--text-dim); }

.boot-bar {
  margin-top: 14px;
  width: 180px;
  height: 3px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(201, 214, 255, 0.12);
}

.boot-bar i {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
  animation: slide 1.4s linear infinite;
}

@keyframes slide {
  from { translate: -100% 0; }
  to { translate: 260% 0; }
}

/* --------------------------------------------------------------- сбой --- */

.fatal {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--veil);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.fatal-card {
  max-width: 420px;
  padding: 28px;
  border-radius: var(--radius);
  text-align: center;
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-panel);
}

.fatal-card h2 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; margin-bottom: 10px; }
.fatal-card p { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 20px; }

/* --------------------------------------------------- leaflet-оформление - */

.leaflet-control-container { display: none; }

/* метка игрока: голова, конус взгляда и плавный ход между обновлениями */

.player-marker { transition: transform var(--player-ease, 2.6s) linear; }

.player-marker.no-anim,
.leaflet-zoom-anim .player-marker,
.leaflet-drag-target.player-marker { transition: none; }

.pm-head,
.pm-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  z-index: 2;
}

.pm-head {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  image-rendering: pixelated;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(4, 6, 14, 0.55);
  transition: border-color 0.25s var(--ease), scale 0.25s var(--ease);
}

.pm-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--orange);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(4, 6, 14, 0.5);
}

.player-marker.is-light .pm-cone { opacity: 0.75; scale: 0.7; }
.player-marker.is-light { transition-duration: 3s; }

.pm-cone {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  background: conic-gradient(from -26deg,
    rgba(255, 190, 120, 0.62), rgba(255, 170, 90, 0.24) 30deg, transparent 52deg);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 12%, rgba(0, 0, 0, 0.75) 38%, transparent 70%);
  mask-image: radial-gradient(circle at 50% 50%, #000 12%, rgba(0, 0, 0, 0.75) 38%, transparent 70%);
  transition: transform 0.6s var(--ease);
}

.pm-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 12px;
  z-index: 1;
  opacity: 0;
  border: 2px solid var(--orange);
  pointer-events: none;
}

.player-marker.is-followed .pm-head { border-color: var(--orange); scale: 1.1; }
.player-marker.is-followed .pm-ring { opacity: 1; animation: ring 2s var(--ease) infinite; }
.player-marker.is-followed .pm-cone {
  background: conic-gradient(from -26deg,
    rgba(242, 112, 30, 0.8), rgba(242, 112, 30, 0.28) 30deg, transparent 52deg);
}

.player-marker:hover .pm-head { scale: 1.14; }

@keyframes ring {
  0% { opacity: 0.85; scale: 1; }
  70% { opacity: 0; scale: 1.7; }
  100% { opacity: 0; scale: 1.7; }
}

/* территория клана */

.clan-zone {
  transition: fill-opacity 0.25s var(--ease), stroke-width 0.25s var(--ease);
  stroke-dasharray: 7 5;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 10px rgba(4, 6, 14, 0.45));
  cursor: pointer;
}

.clan-zone:hover { fill-opacity: 0.26; stroke-width: 3; }

/* метка базы клана */

.clan-pin { display: grid; place-items: center; }

.clan-pin-inner {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: 0 5px 16px rgba(4, 6, 14, 0.55);
  transition: scale 0.25s var(--ease), border-color 0.25s var(--ease);
}

.clan-pin:hover .clan-pin-inner { scale: 1.1; border-color: var(--amber); }

.clan-crest { width: 100%; height: 100%; object-fit: cover; display: block; }

.clan-letters {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--silver);
}

.clan-card { display: flex; gap: 12px; padding: 14px 16px; min-width: 220px; max-width: 300px; }

.clan-card-crest {
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  align-self: flex-start;
}

.clan-card-col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.clan-card-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.clan-card-tag { font-size: 0.75rem; color: var(--silver-2); font-weight: 600; letter-spacing: 0.04em; }

.clan-card-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.clan-card-leader { font-size: 0.78rem; color: var(--text-dim); margin-top: 3px; }
.clan-card-leader b { color: var(--text); font-weight: 600; }

.clan-card-pos {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

.clan-card-pos b {
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--silver-2);
  margin-right: 2px;
}

/* карточка игрока по клику на метку */

.player-popup .leaflet-popup-content { margin: 0; }
.player-popup .leaflet-popup-content-wrapper { padding: 0; overflow: hidden; }

.player-card { display: flex; gap: 12px; padding: 14px 16px 14px 14px; min-width: 232px; }

.player-card-body {
  width: 46px;
  height: 92px;
  object-fit: contain;
  image-rendering: pixelated;
  flex: none;
  align-self: center;
  filter: drop-shadow(0 6px 14px rgba(4, 6, 14, 0.5));
}

.player-card-col { display: flex; flex-direction: column; justify-content: center; gap: 10px; min-width: 0; }
.player-card-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.player-card-name {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-card-world { font-size: 0.76rem; color: var(--text-dim); }

.player-card-pos {
  font-size: 0.8rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.player-card-pos b {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--silver-2);
  margin-right: 2px;
}

.player-card-actions { display: flex; gap: 6px; }
.player-card-actions .btn { padding: 7px 14px; font-size: 0.8rem; }

.leaflet-nameplate-pane { pointer-events: none; }

.leaflet-nameplate-pane .leaflet-tooltip {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  white-space: nowrap;
}

.leaflet-nameplate-pane .leaflet-tooltip::before { display: none; }

.nameplate {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--plate-bg);
  border: 1px solid var(--line-strong);
  box-shadow: 0 6px 18px rgba(4, 6, 14, 0.45);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.6;
}

.nameplate.no-head { padding-left: 10px; }
.nameplate.is-followed { border-color: rgba(242, 112, 30, 0.6); }

.nameplate img {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  image-rendering: pixelated;
  flex: none;
}

/* тултипы и попапы маркеров */

.leaflet-tooltip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-panel);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
}

.leaflet-tooltip-top::before { border-top-color: var(--line-strong); }
.leaflet-tooltip-bottom::before { border-bottom-color: var(--line-strong); }
.leaflet-tooltip-left::before { border-left-color: var(--line-strong); }
.leaflet-tooltip-right::before { border-right-color: var(--line-strong); }

.leaflet-popup-content-wrapper {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-panel);
  color: var(--text);
  font-family: var(--font-body);
}

.leaflet-popup-content { margin: 13px 16px; font-size: 0.86rem; line-height: 1.5; user-select: text; -webkit-user-select: text; }
.leaflet-popup-content a { color: var(--orange-soft); }
.leaflet-popup-tip { background: var(--glass); border: 1px solid var(--line-strong); box-shadow: none; }
.leaflet-container a.leaflet-popup-close-button { color: var(--text-dim); padding: 8px 8px 0 0; font-size: 18px; }
.leaflet-container a.leaflet-popup-close-button:hover { color: var(--text); }

.coord-popup .leaflet-popup-content { margin: 10px 12px; }

.coord-menu { display: flex; flex-direction: column; gap: 4px; min-width: 190px; }

.coord-menu-head {
  padding: 2px 8px 8px;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.coord-menu-head b {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--silver-2);
  margin-right: 3px;
}

.coord-menu-head span { color: var(--text-dim); }

.coord-menu button {
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.84rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.coord-menu button:hover { background: rgba(201, 214, 255, 0.1); color: var(--text); }

/* масштабная линейка */

.scale-wrap {
  display: flex;
  align-items: center;
  padding: 0 10px 0 4px;
  border-left: 1px solid var(--line);
  margin-left: 2px;
  pointer-events: none;
}

.scale-bar {
  position: relative;
  height: 9px;
  min-width: 46px;
  margin-left: 8px;
  border-left: 2px solid var(--text-dim);
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  border-radius: 0 0 2px 2px;
  transition: width 0.25s var(--ease);
}

.scale-bar span {
  position: absolute;
  left: 0;
  bottom: 11px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}

/* сетка чанков */

:root { --grid-line: rgba(201, 214, 255, 0.16); }
:root[data-theme="light"] { --grid-line: rgba(20, 26, 51, 0.16); }

.grid-overlay { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 1; }

/* переход к координатам */

.jump-btn {
  display: block;
  width: calc(100% - 12px);
  margin: 0 6px 10px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid rgba(242, 112, 30, 0.5);
  background: linear-gradient(180deg, rgba(242, 112, 30, 0.3), rgba(242, 112, 30, 0.14));
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s var(--ease);
}

.jump-btn:hover { background: rgba(242, 112, 30, 0.34); }

/* подвал сайдбара */

.foot-row { display: flex; gap: 8px; align-items: center; }

.foot-icon {
  width: 42px;
  height: 42px;
  border-color: var(--line-strong);
  background: var(--inset);
}

/* подсказки */

.help-sheet {
  position: fixed;
  right: 16px;
  bottom: 118px;
  z-index: 640;
  width: 300px;
  max-width: calc(100vw - 32px);
  padding: 14px 16px 16px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), var(--shadow-panel);
  animation: rise-right 0.3s var(--ease);
}

@keyframes rise-right {
  from { opacity: 0; translate: 0 10px; }
  to { opacity: 1; translate: 0 0; }
}

.help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.help-head strong { font-family: var(--font-display); font-size: 0.92rem; font-weight: 600; }

.help-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.help-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.79rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.help-list kbd {
  flex: none;
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--inset);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
}

/* след игрока */

.player-trail { filter: drop-shadow(0 0 6px rgba(242, 112, 30, 0.5)); }

/* ------------------------------------------------------------ адаптив --- */

@media (max-width: 1080px) {
  .nav-links a { padding: 7px 10px; font-size: 0.84rem; }
  .topbar { gap: 14px; }
}

@media (max-width: 900px) {
  .topbar { left: 16px; translate: none; padding: 6px 8px 6px 14px; gap: 10px; }
  .nav-links { display: none; }
  .topbar-online { display: none; }
  .sidebar { top: 74px; }
  .fab { top: 74px; }
}

@media (max-width: 900px) {
  .ip-badge { padding: 8px 12px; }
  .ip-badge-label { display: none; }
}

@media (max-width: 640px) {
  .ip-badge { display: none; }
  .topbar {
    left: 12px;
    right: 12px;
    top: 12px;
    max-width: none;
    justify-content: space-between;
  }
  .nav-logo span { display: none; }
  .sidebar {
    top: calc(70px + env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    bottom: calc(116px + env(safe-area-inset-bottom));
    width: auto;
  }
  .fab { top: auto; bottom: 78px; left: 12px; }
  .bottombar { left: 12px; bottom: 16px; padding: 4px 5px; }
  .coord { padding: 4px 9px; font-size: 0.78rem; }
  .coord b { min-width: 34px; }
  .zoom-group { right: 12px; bottom: 16px; }
  .scale-wrap { display: none; }
  .help-sheet { bottom: 132px; }
  .help-sheet { right: 12px; left: 12px; width: auto; bottom: 78px; }
  .following-bar { bottom: 74px; font-size: 0.8rem; max-width: calc(100vw - 24px); }
  .toast { bottom: 130px; }
}

@media (max-width: 380px) {
  .nav-cta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
