* {
  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;
}

/* 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: 14px 18px;
  background: rgba(16, 20, 30, 0.8);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.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;
}

/* Region Selector Tabs */
.region-tabs {
  display: flex;
  background: #090c12;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.35) transparent;
  padding: 0 4px;
  gap: 2px;
}
.region-tabs::-webkit-scrollbar {
  height: 3px;
}
.region-tabs::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.4);
  border-radius: 2px;
}

.tab-btn {
  padding: 8px 10px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  flex-shrink: 0;
}

.tab-btn:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: #e6c875;
  border-bottom: 2px solid #d4af37;
  background: rgba(212, 175, 55, 0.07);
}

/* 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: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
  border: 1px solid #ef4444;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.action-btn-sos:hover {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.55);
}

.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;
}

.locations-list::-webkit-scrollbar {
  width: 6px;
}
.locations-list::-webkit-scrollbar-thumb {
  background: #2d3748;
  border-radius: 3px;
}

.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;
}

/* ==========================================================================
   FLOATING TACTICAL ALERTS HUB (Dynamic Island / Mobile Stack Overlay)
   ========================================================================== */
.tactical-alerts-hub {
  position: absolute;
  z-index: 1100;
  top: 60px;
  right: 16px;
  width: min(380px, calc(100vw - 32px));
  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: rgba(13, 17, 26, 0.94);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  user-select: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.alerts-hub-header:hover {
  border-color: rgba(212, 175, 55, 0.6);
  background: rgba(20, 26, 40, 0.96);
  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;
  transition: all 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: 4px;
  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: 5px;
}

.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;
  backdrop-filter: blur(8px);
}

.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: 4px solid #ef4444;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px 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 10px 28px 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%;
}

.alert-card-type-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #f87171;
}

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

.alert-timer-badge {
  font-size: 11px;
  font-weight: 800;
  font-family: monospace;
  font-variant-numeric: tabular-nums;
  padding: 2px 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;
}

.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: #dc2626;
  color: #fff;
  border-color: #f87171;
  animation: alert-urgent-blink 0.8s infinite;
}

@keyframes alert-urgent-blink {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

.alert-card-location {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.alert-card-location .continent-tag {
  color: #ffd700;
  margin-right: 4px;
}

.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;
}

.alert-card-comment {
  font-size: 10px;
  color: #94a3b8;
  font-style: italic;
  margin-top: 2px;
}

.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 {
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 50% 50%, #151e2e 0%, #0d1522 55%, #06090e 100%);
  will-change: transform;
}

.leaflet-image-layer {
  image-rendering: -webkit-optimize-contrast;
  will-change: transform;
  transform: translateZ(0);
}

/* ==========================================================================
   LEAFLET ZOOM CONTROLS (Lineage 2M Obsidian & Gold Theme)
   ========================================================================== */
.leaflet-top.leaflet-left {
  top: 14px;
  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;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(13, 17, 26, 0.94) !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 */
.map-hud-top {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 1200;
  display: flex;
  pointer-events: auto;
}

.user-clan-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  height: 38px;
  box-sizing: border-box;
  padding: 4px 8px 4px 10px;
  background: rgba(13, 17, 26, 0.94);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  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-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: 900px) and (min-width: 769px) {
  .sidebar {
    width: 320px;
    flex: 0 0 320px;
  }

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

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

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

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

/* ==========================================================================
   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.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    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: space-between;
    padding: 12px 14px;
  }

  .drawer-close-btn {
    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: 6px;
    height: 34px;
    padding: 0 12px;
    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);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    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 underneath the Mobile Menu button */
  .leaflet-top.leaflet-left {
    top: 54px !important;
    left: 12px !important;
  }

  /* Top Right Clan HUD Bar */
  .map-hud-top {
    top: 12px !important;
    right: 12px !important;
    z-index: 1200 !important;
  }

  .user-clan-bar {
    width: auto !important;
    max-width: calc(100vw - 110px) !important;
    height: 34px !important;
    padding: 3px 6px 3px 10px !important;
    gap: 6px !important;
  }

  .user-badge {
    font-size: 11px !important;
    max-width: 105px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .hud-btn-group {
    gap: 4px !important;
  }

  .hud-mini-btn {
    width: 26px !important;
    height: 26px !important;
    font-size: 12px !important;
  }

  /* Tactical Alerts Hub */
  .tactical-alerts-hub {
    top: 52px !important;
    right: 12px !important;
    width: min(320px, calc(100vw - 24px)) !important;
    max-height: calc(100vh - 130px) !important;
  }

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

  /* Mobile Fast SOS Button (Bottom-Left) */
  .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: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
    border: 1px solid #ef4444;
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.6px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(220, 38, 38, 0.6), 0 0 10px rgba(239, 68, 68, 0.35);
    user-select: none;
    transition: transform 0.15s, background 0.15s;
    animation: fab-pulse 2.2s infinite;
  }

  .mobile-sos-fab:active {
    transform: scale(0.95);
    background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  }

  @keyframes fab-pulse {
    0%, 100% {
      box-shadow: 0 4px 18px rgba(220, 38, 38, 0.6), 0 0 10px rgba(239, 68, 68, 0.35);
    }
    50% {
      box-shadow: 0 4px 22px rgba(220, 38, 38, 0.85), 0 0 18px rgba(239, 68, 68, 0.6);
    }
  }

  /* Continent Switch Button on Mobile */
  .game-continent-btn {
    bottom: 22px !important;
    right: 14px !important;
    padding: 8px 12px !important;
    font-size: 11px !important;
    gap: 6px !important;
    letter-spacing: 0.3px !important;
  }

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

@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;
  }
}

/* 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:hover {
  transform: scale(1.25);
  z-index: 9999 !important;
}

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

.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;
}

/* 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;
}

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

.region-floating-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  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);
  animation: pulse-war-chip 1.6s infinite ease-in-out;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

@keyframes pulse-war-chip {
  0% { transform: scale(1); box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
  50% { transform: scale(1.08); box-shadow: 0 0 20px rgba(239, 68, 68, 1); }
  100% { transform: scale(1); box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
}

.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-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;
}

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

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

.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: filter 0.15s;
}

.popup-action-btn:hover {
  filter: brightness(1.2);
}



/* Event Alert Pin with Pulse Animation */
.event-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.pulse-ring {
  position: absolute;
  width: 44px;
  height: 44px;
  top: -4px;
  left: -4px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.5);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.event-icon {
  width: 34px;
  height: 34px;
  background: #dc2626;
  border: 2px solid #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.95);
  z-index: 2;
}

/* 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: 440px;
  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;
}

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

.modal-body {
  padding: 18px;
}

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

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

.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: 12px 18px;
  background: #0d1118;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 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);
}

/* 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;
  gap: 10px;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.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;
}

/* ==========================================================================
   GATEKEEPER & ACCESS CONTROL
   ========================================================================== */
.gatekeeper-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.94);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gatekeeper-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, #181d2a 0%, #0e121a 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9), 0 0 25px rgba(212, 175, 55, 0.15);
  overflow: hidden;
}

.gatekeeper-header {
  padding: 24px 24px 16px 24px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gatekeeper-header h2 {
  font-size: 18px;
  color: #f8fafc;
  margin-top: 8px;
  letter-spacing: 0.5px;
}

.gatekeeper-header p {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

.gatekeeper-body {
  padding: 20px 24px;
}

.gatekeeper-body label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #d4af37;
  margin-bottom: 8px;
}

.gatekeeper-error {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  border-radius: 4px;
  font-size: 12px;
  color: #fca5a5;
  text-align: center;
}

.gatekeeper-hint {
  margin-top: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.5;
}

.gatekeeper-footer {
  padding: 16px 24px 24px 24px;
}



/* ==========================================================================
   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);
}

/* ==========================================================================
   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;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.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-color: #475569;
  margin-top: 4px;
}
.popup-action-btn.secondary:hover {
  background: #334155;
  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: 680px;
  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(15, 23, 42, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 16px;
  gap: 8px;
}

.clan-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.clan-tab-btn.active {
  color: #ffd700;
  border-bottom-color: #ffd700;
}

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

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

.members-sub-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  padding: 2px;
  gap: 2px;
}

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

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

.members-search {
  max-width: 200px;
  padding: 5px 10px;
  font-size: 11px;
}

/* Members Card List */
.clan-members-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

.clan-member-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 8px 12px;
  transition: all 0.15s ease;
}

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

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

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

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

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

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

.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: 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;
}

/* 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;
}

.join-invite-info {
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 6px;
  padding: 12px;
}

/* 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;
}

@media (max-width: 480px) {
  .user-role-pill .role-text {
    display: none;
  }
}

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

/* War chips container in Alert Modal */
.war-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 84px;
  overflow-y: auto;
  padding: 4px 2px;
}

.war-chip {
  display: inline-flex;
  align-items: 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: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.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;
}

.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;
}



