* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: #0b0e14;
  color: #e2e8f0;
  height: 100vh;
  display: flex;
  overflow: hidden;
}

/* Line-icon sprite (codicon-style: stroke/fill inherit via currentColor) */
.l2m-ic {
  display: inline-block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.14em;
  flex-shrink: 0;
  overflow: visible;
  pointer-events: none;
}

.ticker-icon .l2m-ic {
  width: 14px;
  height: 14px;
  stroke: #ffd700;
  vertical-align: -2px;
}

/* Sidebar Styling - Lineage 2M PURPLE Theme */
.sidebar {
  width: 380px;
  flex: 0 0 380px;
  background: linear-gradient(180deg, #131722 0%, #0d1017 100%);
  border-right: 1px solid rgba(212, 175, 55, 0.25);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.header {
  padding: 12px 16px;
  background: rgba(16, 20, 30, 0.85);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 64px;
  box-sizing: border-box;
}

.logo-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark-frame {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, 0.42);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.16), rgba(15, 23, 42, 0.92));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), 0 0 14px rgba(212, 175, 55, 0.08);
}

.brand-mark {
  display: block;
  width: 15px;
  height: 31px;
  object-fit: contain;
  filter: sepia(1) saturate(2.3) brightness(1.12) drop-shadow(0 0 5px rgba(212, 175, 55, 0.32));
}

.logo-badge {
  background: linear-gradient(135deg, #d4af37, #aa8210);
  color: #000;
  font-weight: 900;
  font-size: 13px;
  padding: 3px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.logo-title h1 {
  font-size: 17px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Module Navigation Switcher (Radar <-> Boss Tracker)
   Large Standalone Icons (No Confining Box, Vibrant Golden Glow)
   ========================================================================== */
.module-nav-switcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0 auto;
}

.module-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-sizing: border-box;
}

.module-nav-btn:hover {
  transform: translateY(-2px) scale(1.08);
}

/* Notifications popover (unified HUD: bell before logout on all pages). */
.notify-pop {
  position: absolute;
  top: 46px;
  right: 0;
  width: 220px;
  background: linear-gradient(180deg, rgba(14, 18, 26, 0.98) 0%, rgba(8, 10, 15, 0.99) 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1300;
}
.notify-pop[hidden] { display: none; }
.notify-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #e2e8f0;
  cursor: pointer;
}
.notify-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #d4af37;
  text-transform: uppercase;
  margin-top: 2px;
}
.notify-test-row {
  display: flex;
  gap: 6px;
}
.notify-test-row .notify-test-btn { flex: 1; }
.notify-test-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: linear-gradient(180deg, #1e2636, #151b26);
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.2s;
}
.notify-test-btn:hover { border-color: #d4af37; color: #d4af37; }


/* Count badge on switcher icons (alerts / boss chain). Calm gold, hidden when zero. */
.module-nav-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: linear-gradient(180deg, #b8860b, #8a6508);
  border: 1px solid rgba(255, 215, 0, 0.8);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
  z-index: 3;
}

.module-nav-btn .module-icon {
  display: block;
  transition: all 0.22s ease;
}

.module-nav-btn .crystal-radar-icon {
  width: 40px;
  height: 40px;
}

.module-nav-btn .boss-skull-icon {
  width: 31px;
  height: 31px;
} /* Clan icon (single-file brand: /core/clan-icon.svg) */ .module-nav-btn img.clan-icon {   width: 44px;   height: 44px;   display: block; } /* Clan gold glow (filter works on <img>, keeps clan colors) */ .module-nav-btn.active img.clan-icon {   filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.85)); } .module-nav-btn:hover img.clan-icon {   filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.7)); }

/* --- Crystal Radar Icon Styling --- */
.crystal-radar-icon .crystal-frame {
  stroke: #cbd5e1;
  stroke-width: 2;
  stroke-linejoin: round;
  fill: none;
  transition: stroke 0.22s ease, filter 0.22s ease;
}
.crystal-radar-icon .crystal-arc {
  stroke: rgba(203, 213, 225, 0.55);
  stroke-width: 2.2;
  stroke-linecap: round;
  fill: none;
  transition: stroke 0.22s ease, filter 0.22s ease;
}
.crystal-radar-icon .crystal-facet {
  transition: fill 0.22s ease;
}
.crystal-radar-icon .facet-ul { fill: #f8fafc; }
.crystal-radar-icon .facet-ur { fill: #e2e8f0; }
.crystal-radar-icon .facet-ll { fill: #94a3b8; }
.crystal-radar-icon .facet-lr { fill: #64748b; }

/* Crystal Radar Active (Vibrant Gold + Drop Shadow) */
.module-nav-btn.active .crystal-radar-icon .crystal-frame {
  stroke: #ffd700;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.85));
}
.module-nav-btn.active .crystal-radar-icon .crystal-arc {
  stroke: #ffd700;
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.7));
}
.module-nav-btn.active .crystal-radar-icon .crystal-arc-outer {
  stroke: rgba(255, 215, 0, 0.9);
}
.module-nav-btn.active .crystal-radar-icon .facet-ul { fill: #fff4a3; }
.module-nav-btn.active .crystal-radar-icon .facet-ur { fill: #ffd700; }
.module-nav-btn.active .crystal-radar-icon .facet-ll { fill: #d4af37; }
.module-nav-btn.active .crystal-radar-icon .facet-lr { fill: #926310; }

/* Crystal Radar Hover */
.module-nav-btn:hover .crystal-radar-icon .crystal-frame {
  stroke: #ffd700;
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.7));
}
.module-nav-btn:hover .crystal-radar-icon .crystal-arc {
  stroke: #ffd700;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5));
}
.module-nav-btn:hover .crystal-radar-icon .facet-ul { fill: #fff; }
.module-nav-btn:hover .crystal-radar-icon .facet-ur { fill: #ffe57f; }

/* --- Boss Skull Icon Styling --- */
.boss-skull-icon {
  color: #94a3b8;
  opacity: 0.75;
  transition: all 0.22s ease;
}
.boss-skull-icon path {
  fill: currentColor;
}
.module-nav-btn.active .boss-skull-icon {
  color: #ffd700;
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.85)) drop-shadow(0 0 16px rgba(255, 215, 0, 0.45));
}
.module-nav-btn:hover .boss-skull-icon {
  color: #ffd700;
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.65));
}

/* --- Clan crest icon styling (same gold language as the former shield) --- */
.module-nav-btn .admin-shield-icon {
  width: 44px;
  height: 44px;
}
.admin-shield-icon .crest-radiance {
  fill: #cbd5e1;
  transition: fill 0.22s ease, filter 0.22s ease;
}
.admin-shield-icon .crest-core {
  fill: #94a3b8;
  transition: fill 0.22s ease;
}
.module-nav-btn.active .admin-shield-icon .crest-radiance {
  fill: #ffd700;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.85));
}
.module-nav-btn.active .admin-shield-icon .crest-core { fill: #ffd700; }
.module-nav-btn:hover .admin-shield-icon .crest-radiance {
  fill: #ffd700;
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.7));
}
.module-nav-btn:hover .admin-shield-icon .crest-core { fill: #ffe57f; }

/* --- Active Button State Glow (Subtle Underglow, No Harsh Box) --- */
.module-nav-btn.active {
  background: rgba(212, 175, 55, 0.08);
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.25);
  transform: translateY(-1px);
}

/* Region Selector Tabs (Tile Grid matching l2m-boss) */
.region-tabs {
  display: flex;
  flex-wrap: wrap;
  overflow-x: hidden;
  scrollbar-width: none;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 2px;
}
.region-tabs::-webkit-scrollbar {
  display: none;
}

.region-tabs .tab-btn {
  flex: 1 1 22%;
  text-align: center;
  padding: 5px 4px;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
}

.region-tabs .tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.region-tabs .tab-btn.active {
  background: rgba(212, 175, 55, 0.18);
  border-color: rgba(212, 175, 55, 0.4);
  color: #ffd700;
}

/* Search bar */
.search-container {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 10px 12px 10px 34px;
  background: #1a202c;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 6px;
  color: #f8fafc;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: #e6c875;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.search-icon {
  position: absolute;
  left: 10px;
  color: #64748b;
  font-size: 14px;
  pointer-events: none;
}

/* Action buttons */
.quick-actions {
  display: flex;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.action-btn-sos {
  width: 100%;
  padding: 9px 12px;
  background: #b91c1c;
  border: 1px solid #ef4444;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 8px rgba(239, 68, 68, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.action-btn-sos:hover {
  background: #dc2626;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), 0 0 12px rgba(239, 68, 68, 0.4);
}

.action-btn {
  flex: 1;
  padding: 8px;
  background: linear-gradient(180deg, #1e2636, #151b26);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 4px;
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.action-btn:hover {
  background: linear-gradient(180deg, #273145, #1b2333);
  border-color: #d4af37;
  color: #ffd700;
}

.action-btn.primary {
  background: linear-gradient(180deg, #991b1b, #7f1d1d);
  border-color: #ef4444;
}

.action-btn.primary:hover {
  background: linear-gradient(180deg, #b91c1c, #991b1b);
}

/* Location List */
.list-header {
  padding: 10px 16px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.8px;
}

.locations-list {
  flex: 1;
  min-height: 72px;
  overflow-y: auto;
  padding: 4px 8px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.4) transparent;
}

.locations-list::-webkit-scrollbar {
  width: 6px;
}

.locations-list::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.locations-list::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.4);
  border-radius: 3px;
}

.locations-list::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.7);
}

.location-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  margin-bottom: 5px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.location-item:hover {
  background: rgba(212, 175, 55, 0.08);
  border-color: rgba(212, 175, 55, 0.4);
  transform: translateX(2px);
}

.loc-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  margin-right: 8px;
}

.loc-icon {
  width: 20px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-pin-svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
}

.loc-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.loc-name {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-name-ru {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-badge {
  font-size: 10px;
  padding: 2px 6px;
  background: #1e293b;
  border-radius: 4px;
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

/* Dungeon Category Headers in Sidebar */
.dungeon-category-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 4px;
  margin-top: 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  color: #ffd700;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dungeon-cat-icon {
  font-size: 12px;
}

.dungeon-cat-title {
  flex: 1;
}

.dungeon-cat-count {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 10px;
  color: #94a3b8;
}

.loc-reg-pill.master-pill {
  border-color: #f59e0b;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
}

.loc-reg-pill.world-pill {
  border-color: #38bdf8;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.loc-reg-pill.server-pill {
  border-color: #a855f7;
  color: #c084fc;
  background: rgba(168, 85, 247, 0.12);
}

.dungeon-floors-badge {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-weight: 600;
}

/* Cross-Server / Master Dungeon Tactical Dock — центрированная карточка
   поверх карты (true center, без бэкдропа: карта остаётся интерактивной,
   скрытие по zoomstart/movestart продолжает работать). */
.dungeon-tactical-banner {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 360px;
  max-width: min(360px, calc(100vw - 24px));
  min-width: 0;
  min-height: 38px;
  height: auto;
  max-height: min(520px, calc(100dvh - 120px));
  overflow-y: auto;
  box-sizing: border-box;
  z-index: 1600;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(14, 18, 26, 0.96) 0%, rgba(8, 10, 15, 0.98) 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.65);
  /* Perf: no backdrop-filter over the live map — static gradient instead (Quick Wins Этап 1) */
  animation: dockCenterIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dockCenterIn {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.dungeon-dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.dungeon-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.dungeon-banner-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(212, 175, 55, 0.2);
  color: #ffd700;
  border: 1px solid rgba(212, 175, 55, 0.4);
  white-space: nowrap;
  flex-shrink: 0;
}

.dungeon-banner-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.dungeon-banner-title {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dungeon-banner-floor {
  font-size: 11px;
  font-weight: 600;
  color: #38bdf8;
  white-space: nowrap;
  flex-shrink: 0;
}

.dungeon-banner-floor-select {
  height: 24px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  color: #38bdf8;
  background: #0b0f17;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  max-width: 170px;
  box-sizing: border-box;
}

.dungeon-banner-floor-select:hover,
.dungeon-banner-floor-select:focus {
  border-color: #38bdf8;
  background-color: #111827;
}

.dungeon-dock-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dungeon-dock-summary {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dungeon-summary-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  white-space: nowrap;
}

.dungeon-summary-pill.sos {
  background: rgba(220, 38, 38, 0.25);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #fca5a5;
}

.dungeon-summary-pill.farm {
  background: rgba(217, 119, 6, 0.25);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fde68a;
}

.dungeon-summary-pill.checked {
  background: rgba(5, 150, 105, 0.25);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #a7f3d0;
}

.dungeon-banner-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s ease;
}

.dungeon-banner-close:hover {
  color: #f1f5f9;
}

.dungeon-dock-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.action-btn-sos-mini {
  padding: 2px 8px;
  height: 24px;
  box-sizing: border-box;
  background-color: #dc2626;
  border: 1px solid #ef4444;
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(239, 68, 68, 0.35);
  transition: background-color 0.15s ease, border-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.action-btn-sos-mini:hover {
  background-color: #ef4444;
}

/* Dungeon Dock Floor Chips Strip */
.dungeon-dock-floors {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.dock-floors-row {
  display: grid;
  grid-template-columns: repeat(var(--dock-cols, 5), minmax(0, 1fr));
  align-items: stretch;
  gap: 5px;
  width: 100%;
  box-sizing: border-box;
}

.floor-chip {
  width: 100%;
  min-width: 0;
  min-height: 27px;
  height: auto;
  padding: 3px 6px;
  box-sizing: border-box;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.floor-chip-left {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.floor-chip-num {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.floor-chip-timer {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 0;
  align-self: center;
  flex-shrink: 0;
}

.floor-chip-timer.checked {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.22);
}

.floor-chip-timer.sos {
  color: #fee2e2;
  background: rgba(220, 38, 38, 0.35);
  font-weight: 800;
}

.floor-chip-timer.farm {
  color: #fef3c7;
  background: rgba(217, 119, 6, 0.3);
}

.floor-chip:hover {
  background-color: rgba(255, 255, 255, 0.09);
  border-color: rgba(212, 175, 55, 0.6);
  color: #f8fafc;
}

.floor-chip.is-selected {
  background-color: rgba(212, 175, 55, 0.18);
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.floor-chip.status-checked {
  border-color: rgba(52, 211, 153, 0.6);
  background-color: rgba(5, 150, 105, 0.18);
  color: #6ee7b7;
}

.floor-chip.status-checked.is-selected {
  border-color: #34d399;
  background-color: rgba(5, 150, 105, 0.3);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.floor-chip.status-farm {
  border-color: rgba(251, 191, 36, 0.6);
  background-color: rgba(217, 119, 6, 0.2);
  color: #fde68a;
}

.floor-chip.status-farm.is-selected {
  border-color: #fbbf24;
  background-color: rgba(217, 119, 6, 0.35);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.floor-chip.status-sos {
  border-color: rgba(248, 113, 113, 0.7);
  background-color: rgba(220, 38, 38, 0.25);
  color: #fca5a5;
}

.floor-chip.status-sos.is-selected {
  border-color: #ef4444;
  background-color: rgba(220, 38, 38, 0.35);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.floor-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.floor-chip-dot.dot-empty {
  background-color: rgba(255, 255, 255, 0.25);
}

.floor-chip-dot.dot-checked {
  background-color: #10b981;
  box-shadow: 0 0 4px #10b981;
}

.floor-chip-dot.dot-farm {
  background-color: #f59e0b;
  box-shadow: 0 0 4px #f59e0b;
}

.floor-chip-dot.dot-sos {
  background-color: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

/* Dock Context Action Strip (Expanded 2-tier telemetry layout) */
.dungeon-dock-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dungeon-dock-active-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.dock-info-title-row {
  display: flex;
  align-items: baseline;
  gap: 2px 6px;
  flex-wrap: wrap;
  font-size: 12px;
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
}

.dock-info-lead {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  flex-shrink: 0;
}

.dock-info-name {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  flex: 1 1 140px;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.dock-info-sub {
  font-size: 11px;
  color: #cbd5e1;
  font-style: italic;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-status-card {
  display: flex;
  align-items: center;
  gap: 4px 8px;
  flex-wrap: wrap;
  min-height: 32px;
  height: auto;
  box-sizing: border-box;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  overflow: hidden;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.dock-status-card .dock-status-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.dock-status-card .dock-status-item {
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.dock-status-card .dock-status-item b {
  font-weight: 700;
}

.dock-status-card.checked {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #ecfdf5;
}

.dock-status-card.checked .dock-status-badge {
  background: #065f46;
  color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.4);
}

.dock-status-card.checked .dock-status-item b {
  color: #a7f3d0;
}

.dock-status-card.checked .dock-status-item.age {
  color: #94a3b8;
  margin-left: auto;
  flex-shrink: 0;
}

.dock-status-card.checked .dock-status-item.age b {
  color: #cbd5e1;
}

.dock-status-card.sos {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fee2e2;
}

.dock-status-card.sos .dock-status-badge {
  background: #dc2626;
  color: #fff;
  border: 1px solid rgba(248, 113, 113, 0.5);
}

.dock-status-card.sos .dock-status-item.war b {
  color: #fca5a5;
}

.dock-status-card.sos .dock-status-item.timer {
  margin-left: auto;
  color: #fca5a5;
  font-weight: 800;
  flex-shrink: 0;
}

.dock-status-card.farm {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fef3c7;
}

.dock-status-card.farm .dock-status-badge {
  background: #d97706;
  color: #fff;
  border: 1px solid rgba(251, 191, 36, 0.5);
}

.dock-status-card.farm .dock-status-item.war b {
  color: #fde68a;
}

.dock-status-card.farm .dock-status-item.timer {
  margin-left: auto;
  color: #fde68a;
  font-weight: 800;
  flex-shrink: 0;
}

.dock-status-card.empty {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #94a3b8;
}

.dock-status-card.empty .dock-status-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.dock-status-card.empty .dock-status-item.muted {
  color: #64748b;
  font-style: italic;
}

.dungeon-dock-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

/* 4 кнопки (патруль: Обновить/Снять/SOS/Вар) — строгая сетка 2x2, чтобы не было схемы 3+1 */
.dungeon-dock-btn-group:has(> :nth-child(4)) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.btn-dock-action {
  height: 28px;
  padding: 0 11px;
  box-sizing: border-box;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}

.btn-dock-action:hover {
  transform: translateY(-1px);
}

.btn-dock-sos {
  background-color: #dc2626;
  border: 1px solid #ef4444;
  color: #fff;
  box-shadow: 0 1px 6px rgba(239, 68, 68, 0.35);
}

.btn-dock-sos:hover {
  background-color: #ef4444;
}

.btn-dock-farm {
  background-color: #d97706;
  border: 1px solid #fbbf24;
  color: #fff;
  box-shadow: 0 1px 6px rgba(245, 158, 11, 0.35);
}

.btn-dock-farm:hover {
  background-color: #f59e0b;
}

.btn-dock-check {
  background-color: #065f46;
  border: 1px solid #10b981;
  color: #ecfdf5;
  box-shadow: 0 1px 6px rgba(16, 185, 129, 0.3);
}

.btn-dock-check:hover {
  background-color: #047857;
  border-color: #34d399;
}

.btn-dock-uncheck {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.btn-dock-uncheck:hover {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

.btn-dock-resolve {
  background-color: #0369a1;
  border: 1px solid #38bdf8;
  color: #f0f9ff;
}

.btn-dock-resolve:hover {
  background-color: #0284c7;
}

/* Floor Pips Matrix (Sidebar and Locations List) */
.dungeon-right-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.floor-pips-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
  flex-shrink: 0;
}

.floor-pips-row {
  display: flex;
  gap: 2px;
  align-items: center;
}

.floor-pip {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  box-sizing: border-box;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.floor-pip:hover {
  transform: scale(1.35);
  z-index: 5;
}

.floor-pip.pip-empty {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.floor-pip.pip-checked {
  background-color: #059669;
  border: 1px solid #34d399;
  box-shadow: 0 0 4px rgba(16, 185, 129, 0.55);
}

.floor-pip.pip-farm {
  background-color: #d97706;
  border: 1px solid #fbbf24;
  box-shadow: 0 0 5px rgba(245, 158, 11, 0.6);
}

.floor-pip.pip-sos {
  background-color: #dc2626;
  border: 1px solid #f87171;
  box-shadow: 0 0 5px rgba(220, 38, 38, 0.6);
}

/* ==========================================================================
   FLOATING TACTICAL ALERTS HUB (Dynamic Island / Mobile Stack Overlay)
   ========================================================================== */
.tactical-alerts-hub {
  position: absolute;
  z-index: 1100;
  top: 56px;
  right: 12px;
  width: 320px;
  max-height: calc(100vh - 148px);
  display: flex;
  flex-direction: column;
  pointer-events: none;
  font-family: inherit;
}

.alerts-hub-header {
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(14, 18, 26, 0.96) 0%, rgba(8, 10, 15, 0.98) 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  /* Perf: no backdrop-filter over the live map (Quick Wins Этап 1) */
  user-select: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.alerts-hub-header:hover {
  border-color: rgba(212, 175, 55, 0.6);
  /* Фон намеренно не меняем: градиент→градиент/цвет браузеры переключают
     дискретным щелчком (background-image не интерполируется) — именно он и
     давал «моргание». Ховер читается по рамке и тени, они едут гладко */
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
}

.alerts-hub-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alerts-hub-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  /* Только неанимируемые keyframes-проперти: transform/opacity крутит
     pulse-dot-anim, транзишн на них давал подергивание */
  transition: background-color 0.3s, box-shadow 0.3s;
}

.alerts-hub-pulse-dot.sos {
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  animation: pulse-dot-anim 1.4s infinite;
}

.alerts-hub-pulse-dot.farming {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

@keyframes pulse-dot-anim {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px #ef4444; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.alerts-hub-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #ffd700;
}

.alerts-hub-count {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  transition: all 0.2s;
}

.tactical-alerts-hub.has-alerts .alerts-hub-count {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.alerts-hub-toggle-icon {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1;
  transition: transform 0.2s;
}

.tactical-alerts-hub.is-collapsed .alerts-hub-toggle-icon {
  transform: rotate(-90deg);
}

.alerts-hub-content {
  pointer-events: auto;
  margin-top: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 196px);
  display: flex;
  flex-direction: column;
  padding-right: 0;
  padding-bottom: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.4) transparent;
}

.alerts-hub-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alerts-hub-content::-webkit-scrollbar {
  width: 6px;
}

.alerts-hub-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.alerts-hub-content::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.4);
  border-radius: 3px;
}

.alerts-hub-content::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.7);
}

.tactical-alerts-hub.is-collapsed .alerts-hub-content {
  display: none;
}

.alerts-empty-state {
  padding: 12px 14px;
  text-align: center;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  background: rgba(13, 17, 26, 0.9);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  /* Perf: no backdrop-filter over the live map (Quick Wins Этап 1) */
}

.alerts-empty-state .empty-icon {
  font-size: 14px;
}

.tactical-alert-card {
  position: relative;
  background: rgba(15, 20, 30, 0.94);
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-left: 3px solid #ef4444;
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  /* Perf: no backdrop-filter over the live map (Quick Wins Этап 1) */
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s, transform 0.15s;
  animation: alert-card-enter 220ms ease-out both;
}

.tactical-alert-card.farming {
  border-color: rgba(245, 158, 11, 0.45);
  border-left-color: #f59e0b;
}

.tactical-alert-card:hover {
  background: rgba(24, 32, 48, 0.97);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  transform: translateY(-1px);
}

@keyframes alert-card-enter {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 6px;
}

.alert-card-top-left {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
}

.alert-card-type-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #f87171;
  white-space: nowrap;
  flex-shrink: 0;
}

.tactical-alert-card.farming .alert-card-type-badge {
  color: #fbbf24;
}

.alert-timer-badge {
  font-size: 10px;
  font-weight: 800;
  font-family: monospace;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
  white-space: nowrap;
  flex-shrink: 0;
}

.tactical-alert-card.farming .alert-timer-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.45);
}

.alert-timer-badge.is-urgent {
  background: rgba(239, 68, 68, 0.4);
  color: #ffffff;
  border-color: rgba(248, 113, 113, 0.85);
  font-weight: 800;
}

.tactical-alert-card.farming .alert-timer-badge.is-urgent {
  background: rgba(245, 158, 11, 0.4);
  color: #ffffff;
  border-color: rgba(251, 191, 36, 0.85);
  font-weight: 800;
}

.alert-card-location {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.35;
  margin-top: 1px;
  word-break: break-word;
}

.alert-card-location .loc-primary {
  color: #ffffff;
}

.alert-card-location .loc-secondary {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
}

.alert-card-location .continent-tag {
  color: #38bdf8;
  font-size: 10px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 3px;
  padding: 0 4px;
  margin-right: 4px;
  display: inline-block;
  vertical-align: middle;
}

.alert-card-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 2px;
}

.alert-card-bottom-row .author-tag {
  font-size: 10px;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.alert-card-actions-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.btn-resolve-mini {
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s;
}

.btn-resolve-mini.killed {
  background: rgba(21, 128, 61, 0.85);
  color: #ecfdf5;
  border-color: rgba(34, 197, 94, 0.35);
}

.btn-resolve-mini.killed:hover {
  background: #16a34a;
  color: #fff;
  border-color: #22c55e;
}

.btn-resolve-mini.empty {
  background: rgba(51, 65, 85, 0.85);
  color: #cbd5e1;
  border-color: rgba(100, 116, 139, 0.35);
}

.btn-resolve-mini.empty:hover {
  background: #475569;
  color: #fff;
}

.alert-floor-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #ffd700;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.45);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: 0.3px;
  vertical-align: middle;
}

.alert-card-meta {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
}

.alert-card-meta .author-tag {
  color: #cbd5e1;
}

.alert-card-enemies {
  font-size: 11px;
  color: #f87171;
  margin-top: 2px;
  line-height: 1.35;
  word-break: break-word;
}

.tactical-alert-card.farming .alert-card-enemies {
  color: #fbbf24;
}

.alert-card-enemies strong {
  font-weight: 700;
  color: #fecaca;
}

.tactical-alert-card.farming .alert-card-enemies strong {
  color: #fef3c7;
}

.alert-card-enemies .enemies-icon {
  font-size: 10px;
  margin-right: 2px;
}

.alert-card-comment {
  font-size: 11px;
  color: #cbd5e1;
  font-style: italic;
  line-height: 1.35;
  margin-top: 2px;
  word-break: break-word;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 2px solid rgba(212, 175, 55, 0.45);
  border-radius: 0 4px 4px 0;
}

.alert-card-comment .comment-icon {
  font-size: 10px;
  font-style: normal;
  margin-right: 3px;
}

.alert-flags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.flag-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 1px 7px;
  border-radius: 20px;
  border: 1px solid;
  white-space: nowrap;
}

.flag-badge.redroom {
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.16);
  border-color: rgba(239, 68, 68, 0.55);
}

.flag-badge.invasion {
  color: #d8b4fe;
  background: rgba(147, 51, 234, 0.16);
  border-color: rgba(168, 85, 247, 0.55);
}

.flags-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

/* NOTE: specificity must beat `.form-group label` (0,1,1) — hence `.flags-row .flag-check` (0,2,0) */
.flags-row .flag-check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #e2e8f0;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  user-select: none;
  flex: 1;
}

.flags-row .flag-check.invasion {
  background: rgba(147, 51, 234, 0.08);
  border-color: rgba(168, 85, 247, 0.35);
}

/* Themed custom checkbox (native white box caused baseline drift — now fully controlled) */
.flags-row .flag-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  display: grid;
  place-content: center;
  cursor: pointer;
  border: 1.5px solid rgba(239, 68, 68, 0.65);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
}

.flags-row .flag-check.invasion input[type="checkbox"] {
  border-color: rgba(168, 85, 247, 0.65);
}

.flags-row .flag-check input[type="checkbox"]::before {
  content: '✓';
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  color: #fca5a5;
  transform: scale(0);
  transition: transform 0.1s ease;
}

.flags-row .flag-check.invasion input[type="checkbox"]::before {
  color: #d8b4fe;
}

.flags-row .flag-check input[type="checkbox"]:checked {
  background: rgba(220, 38, 38, 0.3);
  border-color: #ef4444;
}

.flags-row .flag-check.invasion input[type="checkbox"]:checked {
  background: rgba(147, 51, 234, 0.3);
  border-color: #a855f7;
}

.flags-row .flag-check input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.pin-flag-dots {
  position: absolute;
  top: -4px;
  right: -4px;
  display: flex;
  gap: 2px;
  z-index: 5;
}

.pin-flag-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid #fff;
}

.pin-flag-dot.redroom {
  background: #ef4444;
}

.pin-flag-dot.invasion {
  background: #a855f7;
}

.alert-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  width: 100%;
}

.btn-resolve {
  flex: 1;
  padding: 5px 8px;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s;
}

.btn-resolve.killed {
  background: #15803d;
  color: #fff;
}

.btn-resolve.killed:hover {
  background: #16a34a;
}

.btn-resolve.empty {
  background: #334155;
  color: #cbd5e1;
}

.btn-resolve.empty:hover {
  background: #475569;
  color: #fff;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.list-header {
  flex: 0 0 auto;
  padding: 9px 14px 5px;
}

/* Map Container */
.map-container {
  flex: 1;
  height: 100vh;
  position: relative;
  background: #06090e;
}

#map,
.leaflet-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 50% 50%, #6d7b8b 0%, #3d4a57 45%, #222b35 75%, #141a22 100%) !important;
  overflow: hidden !important;
  contain: strict;
  isolation: isolate;
}

.leaflet-image-layer {
  image-rendering: -webkit-optimize-contrast;
  -webkit-user-drag: none !important;
  user-drag: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  pointer-events: none !important;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  outline: 1px solid transparent;
}

/* Authentic In-Game Cloud System */
.l2m-clouds-frame-layer {
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
  mix-blend-mode: normal;
  image-rendering: auto;
  transition: opacity 0.3s ease;
}

.leaflet-marker-pane {
  will-change: transform;
  transform: translateZ(0);
}

/* While dragging, disable pointer events on markers to eliminate hover/restyle CPU spikes */
.leaflet-dragging .leaflet-marker-pane {
  pointer-events: none !important;
}

/* Markers containment: keeps style/layout changes strictly internal */
.custom-l2m-marker,
.custom-region-title-icon {
  contain: layout style;
}

/* ==========================================================================
   LEAFLET ZOOM CONTROLS (Lineage 2M Obsidian & Gold Theme)
   ========================================================================== */
.leaflet-top.leaflet-left {
  top: 12px;
  left: 16px;
}

.leaflet-control-zoom.leaflet-bar,
.leaflet-touch .leaflet-control-zoom.leaflet-bar {
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.65), 0 0 12px rgba(212, 175, 55, 0.12) !important;
  overflow: hidden;
  /* Perf: no backdrop-filter over the live map (Quick Wins Этап 1) */
  background: linear-gradient(180deg, rgba(14, 18, 26, 0.96) 0%, rgba(8, 10, 15, 0.98) 100%) !important;
  margin: 0 !important;
}

.leaflet-control-zoom a,
.leaflet-touch .leaflet-control-zoom a {
  width: 32px !important;
  height: 32px !important;
  line-height: 30px !important;
  color: #ffd700 !important;
  background: linear-gradient(180deg, #1e2535 0%, #111622 100%) !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  font-family: system-ui, -apple-system, sans-serif !important;
  text-indent: 0 !important;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  border: none !important;
  outline: none !important;
  user-select: none;
}

.leaflet-control-zoom a:first-child,
.leaflet-touch .leaflet-control-zoom a:first-child {
  border-top-left-radius: 7px !important;
  border-top-right-radius: 7px !important;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25) !important;
}

.leaflet-control-zoom a:last-child,
.leaflet-touch .leaflet-control-zoom a:last-child {
  border-bottom-left-radius: 7px !important;
  border-bottom-right-radius: 7px !important;
}

.leaflet-control-zoom a:hover,
.leaflet-touch .leaflet-control-zoom a:hover {
  background: linear-gradient(180deg, #2a3449 0%, #1a2233 100%) !important;
  color: #fff !important;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8) !important;
  box-shadow: inset 0 0 8px rgba(212, 175, 55, 0.3) !important;
}

.leaflet-control-zoom a:active,
.leaflet-touch .leaflet-control-zoom a:active {
  background: #0d111a !important;
  color: #fef08a !important;
  transform: scale(0.95);
}

.leaflet-control-zoom a.leaflet-disabled,
.leaflet-touch .leaflet-control-zoom a.leaflet-disabled,
.leaflet-control-zoom a.leaflet-disabled:hover,
.leaflet-touch .leaflet-control-zoom a.leaflet-disabled:hover {
  background: #0d111a !important;
  color: #475569 !important;
  cursor: not-allowed !important;
  opacity: 0.4 !important;
  text-shadow: none !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Lineage 2M Map HUD Overlay */
/* Tactical right stack: pass-through wrapper by default (children keep their
   absolute positions); becomes a real flex column only on medium screens
   (769-1250px) where HUD + dock + hub must stack without magic top offsets. */
.tactical-right-stack {
  display: contents;
}

.map-hud-top {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1200;
  display: flex;
  width: 320px;
  pointer-events: auto;
}

.user-clan-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 38px;
  box-sizing: border-box;
  padding: 4px 8px 4px 10px;
  background: linear-gradient(180deg, rgba(14, 18, 26, 0.96) 0%, rgba(8, 10, 15, 0.98) 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  /* Perf: no backdrop-filter over the live map (Quick Wins Этап 1) */
  overflow: hidden;
}

/* User Badge & Connection Status Dot */
.user-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  padding: 2px 4px;
  border-radius: 6px;
  transition: background 0.15s;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.user-badge-wrap:hover {
  background: rgba(255, 255, 255, 0.05);
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.user-clan-tag {
  font-size: 11px;
  font-weight: 800;
  color: #ffd700;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  white-space: nowrap;
}

.user-nick-text {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 24px;
  flex: 0 1 auto;
}

.user-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}

.user-role-pill.admin {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.user-role-pill.leader {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.45);
  color: #fde047;
}

.user-role-pill.officer {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #d8b4fe;
}

.user-role-pill.member {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.user-role-pill.viewer {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
}

.hud-clock {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  font-family: ui-monospace, monospace;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hud-btn-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.hud-mini-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s;
}

.hud-mini-btn:hover {
  background: rgba(212, 175, 55, 0.18);
  border-color: rgba(212, 175, 55, 0.45);
  color: #fff;
}

.hud-mini-btn.logout:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}

.hud-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.hud-status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.9);
}

.hud-status-dot.reconnecting {
  background: #eab308;
  box-shadow: 0 0 6px rgba(234, 179, 8, 0.9);
  animation: ssePulse 1s infinite alternate;
}

.hud-status-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.9);
}

@keyframes ssePulse {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

/* ==========================================================================
   MOBILE-ONLY CONTROLS (Hidden by default on Desktop)
   ========================================================================== */
.mobile-menu-btn,
.mobile-sos-fab,
.drawer-close-btn,
.mobile-drawer-backdrop {
  display: none;
}

@media (min-width: 769px) {
  .sidebar {
    visibility: visible !important;
    transform: none !important;
  }
}

@media (max-width: 1250px) and (min-width: 769px) {
  .sidebar {
    width: 320px;
    flex: 0 0 320px;
  }

  .map-hud-top {
    right: 12px;
    top: 12px;
    width: 320px;
  }

  .leaflet-top.leaflet-left {
    top: 12px;
    left: 12px;
  }

  .tactical-alerts-hub {
    width: 320px;
    top: 56px;
    right: 12px;
    max-height: calc(100vh - 140px);
  }

  .alerts-hub-content {
    max-height: calc(100vh - 188px);
  }

  /* Dungeon Dock on Laptop & Tablet: right flex column (HUD + dock + hub in
     normal flow), so any dock height works on every screen without overlap */
  .tactical-right-stack {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 320px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    z-index: 1200 !important;
    pointer-events: none !important;
  }

  .tactical-right-stack > .map-hud-top,
  .tactical-right-stack > .dungeon-tactical-banner,
  .tactical-right-stack > .tactical-alerts-hub {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: none !important;
  }

  .tactical-right-stack > .map-hud-top,
  .tactical-right-stack > .dungeon-tactical-banner,
  .tactical-right-stack > .tactical-alerts-hub {
    pointer-events: auto !important;
  }

  .tactical-right-stack > .map-hud-top {
    z-index: 1200 !important;
  }

  .tactical-right-stack > .dungeon-tactical-banner {
    /* Док живёт по центру экрана, а не в правой колонке (HUD и хаб остаются в потоке). */
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 360px !important;
    max-width: min(360px, calc(100vw - 24px)) !important;
    z-index: 1600 !important;
    max-height: min(520px, calc(100dvh - 120px)) !important;
    overflow-y: auto !important;
  }

  .tactical-right-stack > .tactical-alerts-hub {
    z-index: 1100 !important;
    max-height: calc(100vh - 140px) !important;
  }
}

.tier-pill-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  color: #f1f5f9;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.tier-pill-label:hover {
  border-color: #ffd700;
  background: rgba(212, 175, 55, 0.15);
}

.tier-pill-label input[type="checkbox"] {
  cursor: pointer;
  accent-color: #d4af37;
}

/* ==========================================================================
   SMARTPHONE UX (< 768px) — FULLSCREEN MAP + OFF-CANVAS DRAWER + 1-TAP SOS
   ========================================================================== */
@media (max-width: 768px) {
  body {
    overflow: hidden;
  }

  .map-container {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    flex: 1 1 100% !important;
    position: relative !important;
    overflow: hidden !important;
  }

  /* Off-Canvas Sidebar Drawer */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: min(340px, 86vw) !important;
    height: 100vh !important;
    height: 100dvh !important;
    flex: none !important;
    z-index: 2000 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1) !important;
    box-shadow: none !important;
    visibility: hidden !important;
  }

  .sidebar.is-open {
    transform: translateX(0) !important;
    visibility: visible !important;
    box-shadow: 6px 0 35px rgba(0, 0, 0, 0.95), 0 0 25px rgba(212, 175, 55, 0.25) !important;
  }

  /* Drawer Backdrop */
  .mobile-drawer-backdrop {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 12, 0.78);
    /* Perf: no backdrop-filter over the live map (Quick Wins Этап 1) */
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .mobile-drawer-backdrop.is-active {
    opacity: 1;
    pointer-events: auto;
  }

  /* Drawer Header with Close Button */
  .sidebar .header {
    justify-content: center;
    padding: 10px 14px;
    position: relative;
  }

  .drawer-close-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.18s;
  }

  .drawer-close-btn:hover,
  .drawer-close-btn:active {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    border-color: #ef4444;
  }

  /* Mobile Menu Opener Button (Top-Left) */
  .mobile-menu-btn {
    display: inline-flex !important;
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1200;
    align-items: center;
    gap: 5px;
    height: 34px;
    padding: 0 10px;
    box-sizing: border-box;
    white-space: nowrap;
    background: rgba(13, 17, 26, 0.94);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    color: #ffd700;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
    /* Perf: no backdrop-filter over the live map (Quick Wins Этап 1) */
    cursor: pointer;
    user-select: none;
    transition: all 0.18s;
  }

  .mobile-menu-btn:hover,
  .mobile-menu-btn:active {
    background: rgba(24, 32, 48, 0.98);
    border-color: #d4af37;
    color: #fff;
    transform: scale(0.97);
  }

  .mobile-menu-btn .menu-icon {
    font-size: 15px;
    line-height: 1;
  }

  /* Position Leaflet zoom buttons safely above the Mobile SOS button on the bottom left */
  .leaflet-top.leaflet-left {
    top: auto !important;
    bottom: 72px !important;
    left: 14px !important;
    z-index: 1000 !important;
  }

  /* Top Right Clan HUD Bar: standard 320px, dynamically shrinks against mobileMenuBtn on narrow screens */
  .map-hud-top {
    top: 12px !important;
    right: 12px !important;
    z-index: 1200 !important;
    width: 320px !important;
    max-width: calc(100vw - 116px) !important;
  }

  .user-clan-bar {
    width: 100% !important;
    max-width: none !important;
    height: 34px !important;
    padding: 3px 6px 3px 8px !important;
    gap: 5px !important;
  }

  .user-badge-wrap {
    gap: 4px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }

  .user-badge {
    font-size: 11px !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    gap: 4px !important;
  }

  .user-clan-tag {
    font-size: 10px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  .user-role-pill {
    font-size: 9px !important;
    padding: 1px 4px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  .user-nick-text {
    font-size: 11.5px !important;
    font-weight: 700 !important;
    min-width: 18px !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .hud-clock {
    font-size: 11px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  .hud-btn-group {
    gap: 3px !important;
    flex-shrink: 0 !important;
  }

  .hud-mini-btn {
    width: 26px !important;
    height: 26px !important;
    font-size: 12px !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Tactical Alerts Hub */
  .tactical-alerts-hub {
    top: 52px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100vh - 130px) !important;
    transition: top 0.2s ease, max-height 0.2s ease;
  }

  .alerts-hub-content {
    max-height: calc(100vh - 180px) !important;
  }

  /* Dungeon Tactical Dock on Mobile: центрированная карточка с учётом safe-area */
  .dungeon-tactical-banner {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    right: auto !important;
    width: min(360px, calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right))) !important;
    max-width: none !important;
    max-height: calc(100dvh - 120px) !important;
    overflow-y: auto !important;
    padding: 8px 10px !important;
    gap: 6px !important;
    border-radius: 8px !important;
  }

  .dungeon-dock-header {
    gap: 6px !important;
  }

  .dungeon-banner-badge {
    font-size: 9.5px !important;
    padding: 1px 5px !important;
  }

  .dungeon-banner-title {
    font-size: 11.5px !important;
  }

  .dungeon-dock-summary {
    gap: 3px !important;
  }

  .dungeon-summary-pill {
    font-size: 9.5px !important;
    padding: 1px 4px !important;
  }

  /* Compact floor chips for small smartphone viewports */
  .dock-floors-row {
    gap: 4px !important;
  }

  .floor-chip {
    min-height: 26px !important;
    height: auto !important;
    padding: 2px 4px !important;
    font-size: 10px !important;
    border-radius: 4px !important;
  }

  .floor-chip-num {
    font-size: 10px !important;
    line-height: 1.25 !important;
  }

  .floor-chip-timer {
    font-size: 8.5px !important;
    padding: 1px 3px !important;
  }

  .floor-chip-dot {
    width: 5px !important;
    height: 5px !important;
  }

  /* Compact action tier */
  .dungeon-dock-actions {
    padding-top: 5px !important;
    gap: 5px !important;
  }

  .dock-info-title-row {
    font-size: 10.5px !important;
    line-height: 1.2 !important;
    gap: 4px !important;
  }

  .dock-info-lead {
    font-size: 9px !important;
  }

  .dock-info-name {
    font-size: 11px !important;
  }

  .dock-info-sub {
    font-size: 9.5px !important;
  }

  .dock-status-card {
    min-height: 25px !important;
    height: auto !important;
    padding: 2px 7px !important;
    font-size: 10px !important;
    gap: 5px !important;
  }

  .dock-status-badge {
    font-size: 9px !important;
    padding: 1px 4px !important;
  }

  .dock-status-item {
    font-size: 9.5px !important;
  }

  /* 1-tap thumb strip for dock actions: 3 кнопки — флекс в ряд, 4 кнопки — сетка 2x2 */
  .dungeon-dock-btn-group {
    display: flex !important;
    gap: 5px !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
  }

  .dungeon-dock-btn-group:has(> :nth-child(4)) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  }

  .btn-dock-action {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 32px !important;
    padding: 0 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    justify-content: center !important;
    text-align: center !important;
    border-radius: 5px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* Mobile Fast SOS Button (Bottom-Left) — flat strict red, HUD 8px language. */
  .mobile-sos-fab {
    display: inline-flex !important;
    position: absolute;
    bottom: 22px;
    left: 14px;
    z-index: 1200;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    background: #b91c1c;
    border: 1px solid #ef4444;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.6px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 8px rgba(239, 68, 68, 0.25);
    user-select: none;
    transition: transform 0.15s, background 0.15s;
    /* Perf: no infinite box-shadow repaint in idle. Pulse only on real SOS. */
    animation: none;
  }

  /* Attention pulse only while an SOS is active — toggled from renderActiveAlerts. */
  .mobile-sos-fab.has-active-sos {
    animation: fab-pulse 2.2s infinite;
  }

  .fab-spot-name {
    font-size: 10px;
    font-weight: 700;
    color: #fef08a;
    background: rgba(0, 0, 0, 0.45);
    padding: 1px 7px;
    border-radius: 10px;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid rgba(254, 240, 138, 0.35);
    line-height: 1.4;
  }

  .mobile-sos-fab:active {
    transform: scale(0.95);
    background: #991b1b;
  }

  @keyframes fab-pulse {
    0%, 100% {
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 8px rgba(239, 68, 68, 0.25);
    }
    50% {
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), 0 0 16px rgba(239, 68, 68, 0.55);
    }
  }

  /* Continent Dock & Button on Mobile */
  .continent-dock {
    bottom: 22px !important;
    right: 14px !important;
    width: auto !important;
    gap: 6px !important;
  }

  /* Announcements ticker on narrow screens: second row under zoom + HUD. */
  .announce-ticker {
    top: 58px !important;
    left: 12px !important;
    right: 12px !important;
  }

  /* Строка видна — сводка уезжает под неё (58 + 38 + 8); раскрытая — ещё ниже. */
  body.has-announce-ticker .tactical-alerts-hub {
    top: 104px !important;
  }

  body.has-announce-ticker.ticker-expanded .tactical-alerts-hub {
    top: 164px !important;
  }

  .continent-dock .game-continent-btn {
    padding: 0 12px !important;
    height: 38px !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    gap: 6px !important;
    letter-spacing: 0.3px !important;
    max-width: 38vw !important;
    min-width: 0 !important;
  }

  #gameContinentBtnText {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    min-width: 0 !important;
  }

  /* SOS + континент — единый нижний ряд 38px без налезания на 390px. */
  .mobile-sos-fab {
    max-width: 56vw !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .mobile-sos-fab .fab-spot-name {
    max-width: 22vw !important;
  }

  @media (max-width: 400px) {
    .continent-dock .game-continent-btn .dia-icon {
      display: none !important;
    }
    .mobile-sos-fab {
      padding: 0 12px !important;
      gap: 5px !important;
    }
  }

  /* Modals responsiveness */
  .modal-card {
    max-width: calc(100vw - 24px) !important;
    margin: 10px !important;
    padding: 16px !important;
  }

  /* Perf (Этап 1): живой blur над картой убран полностью, оверрайд больше не нужен. */
}

@media (max-height: 760px) {
  .tactical-alerts-hub {
    top: 54px;
    max-height: calc(100vh - 135px);
  }

  .alerts-hub-content {
    max-height: calc(100vh - 180px);
  }

  .search-container {
    padding-block: 7px;
  }

  .quick-actions {
    padding-block: 6px !important;
  }
}

@media (max-height: 520px) {
  .dungeon-tactical-banner {
    /* Док центрирован (top 50% + translate), здесь только ужатие под низкий экран. */
    max-height: calc(100dvh - 54px) !important;
    overflow-y: auto !important;
    padding: 5px 8px !important;
    gap: 4px !important;
  }
  .floor-chip {
    min-height: 23px !important;
    height: auto !important;
  }
  .btn-dock-action {
    height: 27px !important;
  }
  .dungeon-dock-actions {
    padding-top: 4px !important;
    gap: 4px !important;
  }
}

/* Custom Marker & Teleport Pin Styling */
.l2m-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.15s ease-out;
  transform-origin: 14px 38px;
}

.l2m-pin.has-combat-alert {
  z-index: 1000 !important;
}

.l2m-pin:hover {
  transform: scale(1.25);
  z-index: 9999 !important;
}

.game-teleport-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 22px;
  height: 34px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

/* Combat Beacon Bubble (floating directly above diamond apex) */
.combat-beacon-bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 2px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 9999px;
  font-weight: 900;
  font-size: 10px;
  color: #ffffff;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.85);
  z-index: 25;
  pointer-events: none;
}

.combat-beacon-bubble.sos {
  background: #dc2626;
  border: 1.5px solid #fecaca;
  box-shadow: 0 0 14px rgba(220, 38, 38, 0.95);
}

.combat-beacon-bubble.farming {
  background: #d97706;
  border: 1.5px solid #fde68a;
  box-shadow: 0 0 14px rgba(217, 119, 6, 0.95);
}

.combat-beacon-bubble .beacon-timer {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Mathematically Dead-Centered Pulse Rings */
/* Rhombus in 22x34 SVG: Center X = 11px, Center Y = 12px */
.pulse-ring-dead-center {
  position: absolute;
  top: 12px;
  left: 11px;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  margin-left: -16px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  transform-origin: center center;
}

.pulse-ring-dead-center.ring-1 {
  animation: pulse-ring-expand 1.8s infinite cubic-bezier(0.2, 0.6, 0.35, 1);
}

.pulse-ring-dead-center.ring-2 {
  animation: pulse-ring-expand 1.8s infinite cubic-bezier(0.2, 0.6, 0.35, 1) 0.6s;
}

.pulse-ring-dead-center.sos {
  background: rgba(239, 68, 68, 0.42);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.75);
}

.pulse-ring-dead-center.farming {
  background: rgba(245, 158, 11, 0.42);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.75);
}

@keyframes pulse-ring-expand {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

.game-teleport-pin.peace svg {
  filter: drop-shadow(0 0 6px rgba(14, 165, 233, 0.8));
}

.game-teleport-pin.combat svg {
  filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.8));
}

.game-teleport-pin.dungeon svg {
  filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.9));
}

.game-teleport-pin.boss svg {
  filter: drop-shadow(0 0 10px rgba(234, 88, 12, 1));
}

.pin-label {
  margin-top: 1px;
  padding: 1px 6px;
  background: rgba(10, 15, 26, 0.82);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 2px 4px #000;
  transition: opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pin-label.sos {
  border-color: rgba(239, 68, 68, 0.85);
  color: #fee2e2;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.45);
}

.pin-label.farming {
  border-color: rgba(245, 158, 11, 0.85);
  color: #fef3c7;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.45);
}

/* Quiet patrol mark: frame-only accent, letters stay white for readability.
   No pulse, dimmer glow than combat frames (SOS > farming > checked). */
.pin-label.checked {
  border-color: rgba(16, 185, 129, 0.8);
  box-shadow: 0 0 7px rgba(16, 185, 129, 0.3);
}

/* Zoomed out mode: hide labels and scale pins for clean continent overview */
.map-zoomed-out .pin-label {
  opacity: 0;
  display: none;
}

.map-zoomed-out .l2m-pin {
  transform: scale(0.85);
}

.map-zoomed-out .l2m-pin:hover {
  transform: scale(1.2);
}

.map-zoomed-out .l2m-pin:hover .pin-label {
  display: block;
  opacity: 1;
}

/* Overview Mode (Continent Zoom): Hide peaceful spots, keep combat alerts visible without layer swapping */
.map-overview-mode .custom-l2m-marker:not(.has-combat-alert) {
  display: none !important;
  pointer-events: none !important;
}

.map-overview-mode .custom-l2m-marker.has-combat-alert {
  display: block !important;
  pointer-events: auto !important;
  z-index: 1000 !important;
}

/* Floating Region Titles (Continent Zoom Out Mode) */
.custom-region-title-icon {
  display: none !important;
  pointer-events: none !important;
  background: transparent !important;
  border: none !important;
}

.map-overview-mode .custom-region-title-icon {
  display: flex !important;
  pointer-events: auto !important;
}

.region-floating-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
}

.region-text {
  font-family: 'Cinzel', 'Trajan Pro', Georgia, serif;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 5px;
  color: #ffd875;
  text-transform: uppercase;
  text-shadow: 
    0 0 12px rgba(212, 175, 55, 0.8),
    0 0 24px rgba(212, 175, 55, 0.4),
    -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000,
    0 3px 8px rgba(0, 0, 0, 0.95);
  transition: color 0.2s, text-shadow 0.2s;
}

.region-floating-label:hover .region-text {
  color: #ffffff;
  text-shadow: 
    0 0 18px rgba(255, 230, 130, 1),
    0 0 32px rgba(212, 175, 55, 0.9),
    -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000,
    0 4px 12px rgba(0, 0, 0, 1);
}

.region-war-chip {
  margin-top: 5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: rgba(185, 28, 28, 0.9);
  border: 1px solid #ef4444;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.85);
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
}

/* Region pill in sidebar */
.loc-reg-pill {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  color: #d4af37;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
}

/* Location item selected state */
.location-item.selected {
  background: rgba(212, 175, 55, 0.18) !important;
  border-left: 3px solid #d4af37 !important;
}

/* L2M Custom Popup Styling */
.leaflet-popup {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.leaflet-popup-content-wrapper {
  background: #101622 !important;
  border: 1px solid rgba(212, 175, 55, 0.5) !important;
  border-radius: 6px !important;
  box-shadow: 0 10px 25px rgba(0,0,0,0.85) !important;
  padding: 0 !important;
  color: #f8fafc !important;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.leaflet-popup-tip {
  background: #101622 !important;
  border: 1px solid rgba(212, 175, 55, 0.5) !important;
}

.leaflet-container a.leaflet-popup-close-button {
  color: #94a3b8 !important;
  padding: 6px 8px 0 0 !important;
  font-size: 16px !important;
  transition: color 0.15s ease;
}

.leaflet-container a.leaflet-popup-close-button:hover {
  color: #ffd700 !important;
}

.l2m-popup-card {
  padding: 12px 14px;
  min-width: 210px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.popup-title {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 800;
  color: #ffd700;
}

.popup-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 4px;
  color: #cbd5e1;
}

.popup-action-btn {
  width: 100%;
  margin-top: 10px;
  padding: 7px 10px;
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #fff;
  border: 1px solid #f87171;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.popup-action-btn:hover {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border-color: #fca5a5;
  color: #ffffff;
}



/* Unified Smart Combat Popup Card */
.l2m-popup-card.combat-popup {
  padding: 0;
  overflow: hidden;
  border-radius: 6px;
  min-width: 230px;
}

.combat-popup-header {
  padding: 10px 14px;
  background: linear-gradient(135deg, #450a0a, #7f1d1d);
  border-bottom: 1px solid #991b1b;
}

.combat-popup-header.farming {
  background: linear-gradient(135deg, #451a03, #78350f);
  border-bottom: 1px solid #92400e;
}

.combat-popup-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.combat-status-badge {
  font-weight: 900;
  font-size: 11px;
  color: #ffffff;
  letter-spacing: 0.03em;
}

.combat-timer-tag {
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 11px;
  color: #fde68a;
  white-space: nowrap;
}

.combat-spot-name {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 2px;
}

.combat-spot-ru {
  font-size: 11px;
  color: #cbd5e1;
  font-weight: 600;
}

.combat-meta-row {
  font-size: 11px;
  color: #fecaca;
  margin-bottom: 6px;
}

.combat-popup-header.farming .combat-meta-row {
  color: #fde68a;
}

.combat-popup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.combat-popup-spot-context {
  padding: 10px 14px;
  background: #090d16;
  font-size: 11px;
  color: #94a3b8;
}

.spot-context-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.spot-context-buttons {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.btn-compact {
  padding: 6px 8px !important;
  font-size: 11px !important;
  margin-top: 0 !important;
}

.btn-repeat-alert {
  background: #334155 !important;
  color: #e2e8f0 !important;
  border: 1px solid #475569 !important;
}

.btn-repeat-alert:hover {
  background: #475569 !important;
}

/* Modal Popup */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 3000;
  align-items: center;
  justify-content: center;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  margin: 0 10px;
  background: #141923;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  max-height: calc(100dvh - 30px);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 12px 16px;
  background: #1a202c;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-body {
  padding: 14px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  background: #0b0e14;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  outline: none;
}
.form-control:focus {
  border-color: #d4af37;
}

.modal-footer {
  padding: 10px 16px;
  background: #0d1118;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Location Picker Enhancements: Search & Recent Chips */
.loc-origin-badge {
  font-size: 10px;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 1px 6px;
  border-radius: 10px;
}

.recent-spots-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  overflow: hidden;
}

.recent-spots-label {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
  flex-shrink: 0;
}

.recent-spots-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow: hidden;
}

.recent-spot-chip {
  flex: 1;
  min-width: 0;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  transition: all 0.15s ease;
}

.recent-spot-chip:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #fff;
}

.recent-spot-chip.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.location-search-wrap {
  position: relative;
}

.location-search-input {
  padding-right: 28px !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
  font-size: 12px !important;
  padding: 6px 10px !important;
}

.location-search-input:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25) !important;
}

.btn-clear-loc-search {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.btn-clear-loc-search:hover {
  color: #fff;
}

.loc-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #0f172a;
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 4px;
  max-height: 180px;
  overflow-y: auto;
  z-index: 1060;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.95);
  margin-top: 2px;
}

.loc-search-item {
  padding: 6px 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s;
}

.loc-search-item:last-child {
  border-bottom: none;
}

.loc-search-item:hover, .loc-search-item.selected {
  background: rgba(212, 175, 55, 0.18);
}

.loc-search-item-title {
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
}

.loc-search-item-title .ru-name {
  color: #ffd700;
  font-weight: 600;
  font-size: 11px;
}

.loc-search-item-sub {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Continent Switcher Tabs in Sidebar */
.continent-switch-tabs {
  display: flex;
  background: #080a0f;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  padding: 6px;
  gap: 6px;
}

.continent-tab-btn {
  flex: 1;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.continent-tab-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  color: #f1f5f9;
  border-color: rgba(212, 175, 55, 0.35);
}

.continent-tab-btn.active {
  background: linear-gradient(180deg, #242c3d 0%, #151b26 100%);
  color: #fef08a;
  border-color: #d4af37;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(212, 175, 55, 0.4);
}

/* ==========================================================================
   CONTINENT DOCK & CLAN ANNOUNCEMENTS INFO PANEL (Bottom Right)
   ========================================================================== */
.continent-dock {
  position: absolute;
  bottom: 24px;
  right: 28px;
  z-index: 1200;
  width: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  pointer-events: none;
}

.continent-dock > * {
  pointer-events: auto;
}

.continent-dock .game-continent-btn {
  position: static;
  width: 100%;
  bottom: auto;
  right: auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Top clan announcements ticker: single 38px strip from zoom controls to HUD. */
.announce-ticker {
  position: absolute;
  top: 12px;
  left: 62px;
  right: 344px;
  height: 38px;
  box-sizing: border-box;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  background: linear-gradient(180deg, rgba(14, 18, 26, 0.96) 0%, rgba(8, 10, 15, 0.98) 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  pointer-events: auto;
  user-select: none;
  contain: paint;
  isolation: isolate;
}

.announce-ticker.pulse-highlight {
  animation: ticker-glow 1.5s ease-in-out 3;
}

@keyframes ticker-glow {
  0%, 100% { border-color: rgba(212, 175, 55, 0.35); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45); }
  50% { border-color: #ffd700; box-shadow: 0 0 20px rgba(255, 215, 0, 0.65); }
}

.ticker-icon {
  font-size: 12px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
}

.ticker-icon .l2m-ic,
.ticker-icon svg {
  display: block;
}

.ticker-viewport {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  height: 100%;
}

.ticker-track {
  display: flex;
  align-items: center;
  height: 100%;
  will-change: transform;
  animation: ticker-scroll 20s linear infinite;
}

.ticker-chunk {
  font-size: 12px;
  line-height: 1.45;
  color: #f1f5f9;
  padding-right: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticker-chunk a {
  color: #ffd700;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
  word-break: break-all;
}

.ticker-chunk a:hover {
  color: #fff;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.6);
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.announce-ticker:hover .ticker-track,
.announce-ticker:focus-within .ticker-track,
.ticker-viewport:active .ticker-track {
  animation-play-state: paused;
}

.announce-ticker.is-static .ticker-track {
  animation: none;
}

.announce-ticker.is-static .ticker-chunk[data-dup] {
  display: none;
}

/* Раскрытый вид: полный текст до 3 строк, marquee остановлен. */
.announce-ticker.is-expanded {
  height: auto;
  min-height: 38px;
}

.announce-ticker.is-expanded .ticker-viewport {
  white-space: normal;
  cursor: pointer;
}

.announce-ticker.is-expanded .ticker-track {
  animation: none;
  display: block;
  max-height: calc(1.45em * 3 + 8px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.4) transparent;
}

.announce-ticker.is-expanded .ticker-track::-webkit-scrollbar {
  width: 6px;
}

.announce-ticker.is-expanded .ticker-track::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.announce-ticker.is-expanded .ticker-track::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.4);
  border-radius: 3px;
}

.announce-ticker.is-expanded .ticker-track::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.7);
}

.announce-ticker.is-expanded .ticker-chunk {
  white-space: pre-wrap;
  word-break: break-word;
  padding-right: 0;
  overflow: visible;
  text-overflow: clip;
}

.announce-ticker.is-expanded .ticker-chunk[data-dup] {
  display: none;
}

.ticker-counter {
  font-size: 10px;
  font-weight: 800;
  color: #ffd700;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
  white-space: nowrap;
}

.ticker-nav-btn,
.ticker-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  width: 22px;
  line-height: 1;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  top: -0.5px;
}

.ticker-nav-btn:hover,
.ticker-close-btn:hover {
  color: #ffd700;
  background: rgba(255, 255, 255, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    animation: none;
  }
}

/* Announcements Admin Management Cards in Clan Modal */
.announcement-admin-card {
  background: rgba(15, 20, 30, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.15s;
}

.announcement-admin-card:hover {
  border-color: rgba(212, 175, 55, 0.5);
}

.announcement-admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.announcement-admin-meta {
  font-size: 10px;
  color: #94a3b8;
}

.announcement-admin-text {
  font-size: 11px;
  color: #e2e8f0;
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap;
}

.announcement-admin-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 4px;
}

.btn-ann-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-ann-action:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: #ffd700;
  color: #ffd700;
}

.btn-ann-action.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fca5a5;
}

/* In-Game Continent Button (Bottom Right) */
.game-continent-btn {
  position: absolute;
  bottom: 24px;
  right: 28px;
  z-index: 1200;
  background: linear-gradient(180deg, #222938 0%, #131824 100%);
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.6px;
  padding: 10px 22px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

#gameContinentBtnText {
  white-space: nowrap;
  text-align: center;
}

.game-continent-btn:hover {
  background: linear-gradient(180deg, #2b364e 0%, #192233 100%);
  border-color: #d4af37;
  color: #ffd700;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.45), 0 4px 20px rgba(0, 0, 0, 0.85);
  transform: translateY(-2px);
}

.game-continent-btn:active {
  transform: translateY(0);
}

.game-continent-btn .dia-icon {
  font-size: 11px;
  color: #94a3b8;
  transition: color 0.2s;
}

.game-continent-btn:hover .dia-icon {
  color: #ffd700;
}


/* ==========================================================================
   ALERT CREATION & TABS
   ========================================================================== */
.alert-type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.alert-type-tab {
  flex: 1;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.alert-type-tab.active-sos {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fca5a5;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.alert-type-tab.active-farming {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fcd34d;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

/* Lucide type dots: color carries the meaning (SOS red / farm amber) */
.alert-type-tab .l2m-ic.dot-sos { color: #ef4444; }
.alert-type-tab .l2m-ic.dot-farm { color: #f59e0b; }

/* ==========================================================================
   POPUP ENHANCEMENTS
   ========================================================================== */
.popup-action-btn.sos-btn {
  background: #dc2626;
  color: #fff;
  border-color: #ef4444;
  margin-top: 6px;
  font-weight: 800;
}
.popup-action-btn.sos-btn:hover {
  background: #ef4444;
  border-color: #f87171;
  color: #fff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.popup-action-btn.farm-btn {
  background: linear-gradient(135deg, #b45309, #78350f);
  border: 1px solid #f59e0b;
  color: #fff;
  margin-top: 4px;
  font-weight: 700;
}
.popup-action-btn.farm-btn:hover {
  background: linear-gradient(135deg, #d97706, #92400e);
  border-color: #fbbf24;
  color: #fff;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.popup-floor-row {
  margin: 6px 0 8px 0;
  text-align: left;
}

.popup-floor-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #ffd700;
  margin-bottom: 3px;
  letter-spacing: 0.3px;
}

.popup-floor-select {
  width: 100%;
  padding: 5px 8px;
  font-size: 11px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #f8fafc;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.popup-floor-select:focus {
  border-color: #ffd700;
}

.popup-action-btn.secondary {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #475569;
  margin-top: 4px;
}
.popup-action-btn.secondary:hover {
  background: #334155;
  border-color: #64748b;
  color: #fff;
}

.history-floor-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #fef08a;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ==========================================================================
   SPOT HISTORY & CLAN MEMBERS MODAL
   ========================================================================== */
.history-item {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid #64748b;
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 11px;
}
.history-item.killed {
  border-left-color: #22c55e;
}
.history-item.empty {
  border-left-color: #94a3b8;
}
.history-item.expired {
  border-left-color: #ef4444;
}

.history-item.expired {
  border-left-color: #ef4444;
}

/* Clan Management Modal & HUD Card Styles */
.clan-management-card {
  max-width: 860px;
  width: 95%;
}

.clan-capacity-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.15);
  color: #ffd700;
  border: 1px solid rgba(212, 175, 55, 0.4);
  letter-spacing: 0.5px;
}

.clan-tabs-bar {
  display: flex;
  background: rgba(11, 15, 23, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 8px;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.clan-tabs-bar::-webkit-scrollbar {
  display: none;
}

.clan-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 600;
  padding: 9px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: -1px;
}

.clan-tab-btn:hover {
  color: #f1f5f9;
}

.clan-tab-btn.active {
  color: #ffd700;
  font-weight: 700;
  border-bottom: 2px solid #ffd700;
}

.clan-tab-panel {
  display: block;
}

/* Sub-filter & search */
.members-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.members-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 260px;
}

.members-search {
  width: 100%;
  padding: 6px 26px 6px 10px;
  font-size: 11px;
}

.members-search-clear {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}

.members-search-clear:hover {
  color: #ffd700;
}

.members-sub-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  padding: 2px;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.members-sub-tabs::-webkit-scrollbar {
  display: none;
}

.members-sub-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}

.members-sub-btn.active {
  background: #334155;
  color: #f8fafc;
}

/* Members Table Container & Header */
.members-table-container {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 6px;
  background: rgba(11, 15, 25, 0.7);
  overflow: hidden;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
}

.members-table-head {
  display: grid;
  grid-template-columns: 20px 60px minmax(90px, 1fr) 95px 85px 242px;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-left: 3px solid transparent;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 5;
  box-sizing: border-box;
}

.members-table-head .col-head {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.members-table-head .col-actions {
  text-align: right;
  padding-right: 4px;
}

/* Members Scrollable List */
.clan-members-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: min(520px, calc(100dvh - 280px));
  min-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.4) transparent;
}

.clan-members-list::-webkit-scrollbar {
  width: 6px;
}

.clan-members-list::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.clan-members-list::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.4);
  border-radius: 3px;
}

.clan-members-list::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.7);
}

.clan-member-card {
  display: grid;
  grid-template-columns: 20px 60px minmax(90px, 1fr) 95px 85px 242px;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 4px 12px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  box-sizing: border-box;
}

.clan-member-card:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(212, 175, 55, 0.35);
}

.clan-member-card.is-revoked {
  opacity: 0.65;
  border-left: 3px solid #ef4444;
}

.clan-member-card.is-active {
  border-left: 3px solid #22c55e;
}

.cell-status {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cell-tag {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  font-weight: 700;
  color: #ffd700;
}

.cell-tag .empty-tag {
  color: #475569;
  font-weight: 400;
}

.cell-nick {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-role {
  white-space: nowrap;
}

.cell-inviter {
  font-size: 10.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-inviter .inviter-label {
  display: none;
}

.cell-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  white-space: nowrap;
}

.cell-actions .btn-card-action {
  padding: 3px 6px;
  font-size: 11px;
}

.cell-actions select.role-select {
  padding: 2px 14px 2px 5px;
  font-size: 10.5px;
  max-width: 80px;
}

.cell-actions .btn-card-action.delete-btn {
  padding: 3px 4px;
}

.member-info-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.member-status-indicator.active,
.member-status-indicator.online {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.member-status-indicator.offline {
  background: #475569;
}

.member-status-indicator.revoked {
  background: #ef4444;
}

.member-name-block {
  display: flex;
  flex-direction: column;
}

.member-nickname {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.member-nickname.leader {
  color: #ffd700;
}

.member-nickname.officer {
  color: #38bdf8;
}

.member-details-sub {
  font-size: 10px;
  color: #94a3b8;
  display: flex;
  gap: 6px;
  margin-top: 1px;
}

.member-badge-role {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
}

.member-badge-role.leader {
  background: rgba(212, 175, 55, 0.2);
  color: #ffd700;
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.member-badge-role.officer {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.member-badge-role.member {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.member-badge-role.viewer {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

.member-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-card-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-card-action:hover {
  background-color: rgba(255, 255, 255, 0.18);
  color: #f8fafc;
}

.btn-card-action.perm-btn {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.25);
  color: #ffd700;
}

.btn-card-action.perm-btn.viewer {
  background: rgba(100, 116, 139, 0.15);
  border-color: rgba(100, 116, 139, 0.3);
  color: #94a3b8;
}

.btn-card-action.danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.btn-card-action.danger:hover {
  background: #dc2626;
  color: #fff;
}

.btn-card-action.success {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.btn-card-action.delete-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: 13px;
  padding: 4px 6px;
  cursor: pointer;
}

.btn-card-action.delete-btn:hover {
  color: #ef4444;
}

/* Role Selector Styling */
select.role-select {
  background-color: #1e293b;
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #f1f5f9;
  padding: 3px 20px 3px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23d4af37' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 8px 5px;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  line-height: 1.3;
}

select.role-select:hover {
  background-color: #273549;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23ffd700' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 8px 5px;
  border-color: #d4af37;
  color: #ffd700;
}

select.role-select:focus {
  outline: none;
  border-color: #ffd700;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* Fix for Chromium/Windows OS white dropdown popup across all selects */
select option,
select.form-control option,
select.role-select option {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
  padding: 8px 12px;
  font-size: 12px;
}

/* Responsive Members Table for Mobile Screens */
@media (max-width: 680px) {
  .members-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .members-search-wrap {
    max-width: none;
    flex: 1 1 100%;
    width: 100%;
  }

  .members-sub-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .members-table-head {
    display: none;
  }

  .clan-members-list {
    max-height: calc(100dvh - 300px);
    min-height: 240px;
    padding: 3px;
    gap: 4px;
  }

  .clan-member-card {
    display: grid;
    grid-template-columns: 18px auto 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "status tag nick role"
      "inviter actions actions actions";
    row-gap: 5px;
    column-gap: 6px;
    padding: 6px 8px;
    border-radius: 4px;
  }

  .cell-status { grid-area: status; }
  .cell-tag { grid-area: tag; }
  .cell-nick { grid-area: nick; }
  .cell-role { grid-area: role; justify-self: end; }

  .cell-inviter {
    grid-area: inviter;
    font-size: 10px;
    color: #64748b;
    max-width: 90px;
  }

  .cell-inviter .inviter-label {
    display: inline;
  }

  .cell-actions {
    grid-area: actions;
    justify-self: end;
    gap: 3px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .btn-card-action {
    padding: 3px 6px;
    font-size: 10px;
  }

  select.role-select {
    padding: 2px 16px 2px 4px;
    font-size: 10.5px;
  }
}

/* Invites Form & Cards */
.invite-create-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 12px;
}

.invite-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

@media (max-width: 600px) {
  .invite-form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group-compact label {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 4px;
}

.clan-invites-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.invite-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 6px;
  padding: 8px 12px;
}

.invite-info-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.invite-code-pill {
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  color: #ffd700;
}

.invite-meta-sub {
  font-size: 10px;
  color: #94a3b8;
}

.invite-card.is-expired {
  opacity: 0.55;
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(100, 116, 139, 0.4);
}

.invite-card.is-expired .invite-code-pill {
  color: #94a3b8;
}

.invite-meta-sub.expired {
  color: #ef4444;
  font-weight: 700;
}

.wars-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 5;
}

/* Floor pill on Map Pin */
.event-pin-floor-tag {
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #0f172a;
  border: 1px solid #ffd700;
  color: #ffd700;
  font-size: 9px;
  font-weight: 800;
  padding: 0 5px;
  border-radius: 3px;
  line-height: 14px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.8);
  pointer-events: none;
  z-index: 10;
}

/* ============================================================
   WAR LIST & ALERT SUGGESTIONS STYLES
   ============================================================ */

/* Meta buttons in war label (no wrap, compact) */
.btn-war-meta {
  font-size: 10px;
  padding: 2px 8px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #ffd700;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.3;
}
.btn-war-meta:hover {
  background: rgba(212, 175, 55, 0.25);
  color: #fff;
}
.btn-war-meta.add {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.5);
  color: #fca5a5;
}
.btn-war-meta.add:hover {
  background: rgba(220, 38, 38, 0.35);
  color: #fff;
}

/* War chips container in Alert Modal (Compact, NO scrollbars) */
.war-chips-container {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  padding: 2px 0 4px 0;
}

.war-chip {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.war-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.war-chip:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
  transform: translateY(-1px);
}

.war-chip.active {
  background: #dc2626;
  border-color: #f87171;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.55);
  font-weight: 700;
}

.war-chip-comment {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: normal;
}

/* Autocomplete floating dropdown */
.war-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #0f172a;
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 4px;
  max-height: 160px;
  overflow-y: auto;
  z-index: 1050;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85);
  margin-top: 2px;
}

.war-autocomplete-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s;
}

.war-autocomplete-item:last-child {
  border-bottom: none;
}

.war-autocomplete-item:hover,
.war-autocomplete-item.selected {
  background: rgba(212, 175, 55, 0.18);
}

.war-autocomplete-name {
  font-size: 12px;
  font-weight: 700;
  color: #ffd700;
}

.war-autocomplete-comment {
  font-size: 10px;
  color: #94a3b8;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Clan Wars List Panel */
.clan-wars-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.4) transparent;
}

.clan-wars-list::-webkit-scrollbar,
.clan-invites-list::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
  width: 6px;
}

.clan-wars-list::-webkit-scrollbar-track,
.clan-invites-list::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.clan-wars-list::-webkit-scrollbar-thumb,
.clan-invites-list::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.4);
  border-radius: 3px;
}

.clan-wars-list::-webkit-scrollbar-thumb:hover,
.clan-invites-list::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.7);
}

.clan-invites-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.4) transparent;
}

.modal-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.4) transparent;
}

/* Приглушённое золото для остальных скроллеров радара: тактический док данжа,
   дропдауны поиска спота и автокомплита варов (горизонталь дока — те же 6px). */
.dungeon-tactical-banner,
.loc-search-dropdown,
.war-autocomplete-dropdown {
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.4) transparent;
}

.dungeon-tactical-banner::-webkit-scrollbar,
.loc-search-dropdown::-webkit-scrollbar,
.war-autocomplete-dropdown::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.dungeon-tactical-banner::-webkit-scrollbar-track,
.loc-search-dropdown::-webkit-scrollbar-track,
.war-autocomplete-dropdown::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.dungeon-tactical-banner::-webkit-scrollbar-thumb,
.loc-search-dropdown::-webkit-scrollbar-thumb,
.war-autocomplete-dropdown::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.4);
  border-radius: 3px;
}

.dungeon-tactical-banner::-webkit-scrollbar-thumb:hover,
.loc-search-dropdown::-webkit-scrollbar-thumb:hover,
.war-autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.7);
}

.war-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 5px;
  padding: 8px 12px;
  transition: border-color 0.2s, background 0.2s;
}

.war-card:hover {
  border-color: rgba(212, 175, 55, 0.45);
  background: rgba(15, 23, 42, 0.85);
}

.war-card-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.war-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.war-card-name {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.3px;
}

.war-card-badge {
  font-size: 10px;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.war-card-meta {
  font-size: 10px;
  color: #64748b;
}

.war-delete-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.war-delete-btn:hover {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff;
}




/* Quiet patrol marks ("checked, empty") — no pulse, no alarm colors.
   Near-solid dark pill + near-white text: readable over bright and dark map areas. */
.spot-check-badge {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  color: #ecfdf5;
  text-shadow: 0 1px 2px #000;
  background: rgba(6, 32, 24, 0.92);
  border: 1px solid rgba(16, 185, 129, 0.6);
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: auto;
}

.map-zoomed-out .spot-check-badge {
  display: none;
}

.spot-check-suffix {
  margin-left: auto;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  color: #ecfdf5;
  text-shadow: 0 1px 2px #000;
  background: rgba(6, 32, 24, 0.92);
  border: 1px solid rgba(16, 185, 129, 0.6);
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.spot-check-suffix.multi-count {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.5);
  color: #a7f3d0;
  letter-spacing: 0.02em;
}

.spot-check-line:empty {
  display: none;
}

.spot-check-title {
  font-size: 10px;
  font-weight: 700;
  color: #6ee7b7;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 8px 0 4px;
}

.spot-check-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #cbd5e1;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 6px;
  padding: 4px 6px;
  margin-bottom: 4px;
}

.spot-check-row.selected {
  border-color: rgba(16, 185, 129, 0.6);
}

.spot-check-remain {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: #a7f3d0;
  white-space: nowrap;
}

.spot-check-remove {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #94a3b8;
  border-radius: 4px;
  font-size: 10px;
  padding: 1px 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.spot-check-remove:hover {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.5);
}

.popup-action-btn.check-btn {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #a7f3d0;
  margin-top: 4px;
}

.popup-action-btn.check-btn:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(52, 211, 153, 0.7);
  color: #ecfdf5;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.35);
}

/* HUD Toast Notifications (copy of the /boss set — modules stay zero-coupled).
   Container is always above modals; radar toasts use a colored dot glyph. */
.hud-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 400px;
  width: calc(100vw - 48px);
}

.hud-toast {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #f1f5f9;
  animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.2s ease;
}

.hud-toast.success {
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.15);
}
.hud-toast.info {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
}
.hud-toast.warning {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}
.hud-toast.danger {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

.hud-toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1;
  background: none;
  border-radius: 0;
  width: auto;
  height: auto;
}
.hud-toast-icon .l2m-ic {
  display: block;
}
.hud-toast.success .hud-toast-icon { color: #4ade80; }
.hud-toast.info .hud-toast-icon { color: #38bdf8; }
.hud-toast.warning .hud-toast-icon { color: #fbbf24; }
.hud-toast.danger .hud-toast-icon { color: #f87171; }

.hud-toast-icon:empty {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
}
.hud-toast.success .hud-toast-icon:empty { background: #4ade80; }
.hud-toast.info .hud-toast-icon:empty { background: #38bdf8; }
.hud-toast.warning .hud-toast-icon:empty { background: #fbbf24; }
.hud-toast.danger .hud-toast-icon:empty { background: #f87171; }
.hud-toast-content {
  flex: 1;
  line-height: 1.4;
  word-break: break-word;
}
.hud-toast-title {
  font-weight: 700;
  margin-bottom: 2px;
  color: #ffd700;
}
.hud-toast.success .hud-toast-title { color: #4ade80; }
.hud-toast.info .hud-toast-title { color: #38bdf8; }
.hud-toast.warning .hud-toast-title { color: #fbbf24; }
.hud-toast.danger .hud-toast-title { color: #f87171; }

.hud-toast-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
}
.hud-toast-close:hover {
  color: #fff;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
