*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --bg:      #0d1a0f;
      --bg2:     #111f13;
      --bg3:     #162019;
      --border:  #1e3322;
      --text:    #d4e8d0;
      --text2:   #8aaa86;
      --text3:   #4a6a46;
      --accent:  #00aaff;
      --accent2: #00cc66;
    }

    html, body {
      width: 100%; height: 100%;
      background: var(--bg);
      color: var(--text);
      font-family: 'Rajdhani', sans-serif;
      overflow: hidden;
    }

    /* ── Top bar ── */
    #topbar {
      position: absolute;
      top: 0; left: 0; right: 0;
      height: 48px;
      background: var(--bg2);
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      gap: 20px;
      padding: 0 16px;
      z-index: 100;
    }

    #topbar-title {
      font-family: 'Orbitron', monospace;
      font-size: 15px;
      color: var(--accent2);
      letter-spacing: 1px;
      white-space: nowrap;
    }

    .wm-legend {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: var(--text2);
      font-weight: 600;
    }
    .wm-dot {
      width: 12px; height: 12px;
      border-radius: 50%;
      display: inline-block;
      flex-shrink: 0;
    }
    .wm-blue  { background:#4488ff; box-shadow:0 0 6px #4488ff88; }
    .wm-red   { background:#ff4444; box-shadow:0 0 6px #ff444488; }
    .wm-grey  { background:#4a4a5a; }

    #topbar-coords {
      margin-left: auto;
      font-size: 11px;
      color: var(--text3);
      font-family: 'Orbitron', monospace;
      white-space: nowrap;
    }

    #back-btn {
      background: rgba(0,170,255,0.08);
      border: 1px solid rgba(0,170,255,0.25);
      border-radius: 5px;
      color: var(--accent);
      cursor: pointer;
      font-family: 'Rajdhani', sans-serif;
      font-size: 13px;
      font-weight: 700;
      padding: 4px 14px;
      transition: all 0.15s;
      white-space: nowrap;
    }
    #back-btn:hover { background: rgba(0,170,255,0.16); border-color: var(--accent); }

    /* ── Map canvas ── */
    #map-wrap {
      position: absolute;
      top: 48px; left: 0; right: 0; bottom: 0;
      overflow: hidden;
      cursor: grab;
      background: #080e09;
    }
    #map-wrap.grabbing { cursor: grabbing; }

    #map-svg {
      display: block;
      position: absolute;
      top: 0; left: 0;
    }

    /* ── Tooltip ── */
    #wm-tooltip {
      position: absolute;
      background: rgba(8,18,10,0.97);
      border: 1px solid var(--border);
      border-radius: 7px;
      padding: 10px 14px;
      font-size: 13px;
      color: var(--text);
      font-family: 'Rajdhani', sans-serif;
      line-height: 1.6;
      pointer-events: none;
      z-index: 200;
      display: none;
      min-width: 140px;
    }
    #wm-tooltip strong { color: var(--accent); font-size: 14px; }

    /* ── Loading ── */
    #wm-loading {
      position: absolute;
      top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      text-align: center;
      color: var(--text2);
      font-size: 15px;
    }
    #loading .spinner {
      width: 36px; height: 36px;
      border: 3px solid var(--border);
      border-top-color: var(--accent2);
      border-radius: 50%;
      margin: 0 auto 14px;
      animation: spin 0.8s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ── Mini-compass ── */
    #compass {
      position: absolute;
      bottom: 20px; right: 20px;
      width: 60px; height: 60px;
      background: var(--bg2);
      border: 1px solid var(--border);
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-size: 20px;
      color: var(--text3);
      user-select: none;
      z-index: 100;
    }

    /* ── Zoom controls ── */
    #zoom-controls {
      position: absolute;
      bottom: 20px; right: 90px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      z-index: 100;
    }
    .zoom-btn {
      width: 32px; height: 32px;
      background: var(--bg2);
      border: 1px solid var(--border);
      border-radius: 5px;
      color: var(--text2);
      font-size: 18px;
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: all 0.15s;
      user-select: none;
    }
    .zoom-btn:hover { background: var(--bg3); color: var(--text); }

    /* ── Recenter btn ── */
    #recenter-btn {
      position: absolute;
      bottom: 20px; left: 20px;
      background: rgba(0,204,102,0.08);
      border: 1px solid rgba(0,204,102,0.25);
      border-radius: 5px;
      color: var(--accent2);
      cursor: pointer;
      font-family: 'Rajdhani', sans-serif;
      font-size: 12px;
      font-weight: 700;
      padding: 6px 12px;
      z-index: 100;
      transition: all 0.15s;
    }
    #recenter-btn:hover { background: rgba(0,204,102,0.15); }

/* ── Base Info Panel ── */
#wm-base-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 240px;
  background: rgba(8,18,10,0.97);
  border: 1px solid #1e3322;
  border-radius: 10px;
  box-shadow: 0 6px 32px rgba(0,0,0,0.7);
  z-index: 500;
  font-family: 'Rajdhani', sans-serif;
  overflow: hidden;
}

.wm-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 2px solid #1e3322;
}

.wm-panel-name {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.wm-panel-close {
  background: none;
  border: none;
  color: #4a6a46;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
}
.wm-panel-close:hover { color: #ff6060; }

.wm-panel-body {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.wm-panel-row {
  font-size: 13px;
  color: #8aaa86;
  font-weight: 600;
}

.wm-panel-row strong {
  color: #d4e8d0;
}

.wm-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px 14px;
  border-top: 1px solid #1e3322;
}

.wm-panel-btn {
  width: 100%;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.wm-btn-enter {
  background: rgba(68,136,255,0.1);
  border-color: rgba(68,136,255,0.35);
  color: #4488ff;
}
.wm-btn-enter:hover { background: rgba(68,136,255,0.2); }

.wm-btn-scout {
  background: rgba(255,220,0,0.08);
  border-color: rgba(255,220,0,0.3);
  color: #ffe060;
}
.wm-btn-scout:hover { background: rgba(255,220,0,0.15); }

.wm-btn-attack {
  background: rgba(255,68,68,0.08);
  border-color: rgba(255,68,68,0.3);
  color: #ff4444;
}
.wm-btn-attack:hover { background: rgba(255,68,68,0.18); }

.wm-btn-platoon {
  background: rgba(0,204,102,0.08);
  border-color: rgba(0,204,102,0.3);
  color: #00cc66;
}
.wm-btn-platoon:hover { background: rgba(0,204,102,0.15); }

#scene-worldmap {
  position: fixed;
  inset: 0;
  overflow: hidden;
  /* panels use absolute positioning within this context */
}

/* ── Platoon selector modal ── */
.wm-modal {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
}

.wm-modal-box {
  background: var(--bg2, #111f13);
  border: 1px solid var(--border, #1e3322);
  border-radius: 10px;
  padding: 20px;
  min-width: 280px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}

.wm-modal-title {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  color: var(--accent2, #00cc66);
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

.wm-platoon-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  max-height: 280px;
  overflow-y: auto;
}

.wm-platoon-row {
  background: rgba(0,204,102,0.06);
  border: 1px solid rgba(0,204,102,0.2);
  border-radius: 7px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.wm-platoon-row:hover { background: rgba(0,204,102,0.14); border-color: rgba(0,204,102,0.5); }

.wm-platoon-row-name {
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  color: #fff;
  margin-bottom: 4px;
}

.wm-platoon-row-units {
  font-size: 13px;
  color: var(--text2, #8aaa86);
  font-family: 'Rajdhani', sans-serif;
}

.wm-modal-close {
  width: 100%;
  padding: 8px;
  background: rgba(255,80,80,0.08);
  border: 1px solid rgba(255,80,80,0.25);
  border-radius: 6px;
  color: #ff6060;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.wm-modal-close:hover { background: rgba(255,80,80,0.18); }

/* ── Move Here prompt ── */
.wm-move-prompt {
  position: absolute;
  background: rgba(8,20,12,0.97);
  border: 1px solid var(--border, #1e3322);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 300;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  pointer-events: all;
}

.wm-move-prompt-coords {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  color: var(--text3, #4a6a46);
  margin-right: 4px;
}

.wm-move-prompt button {
  border-radius: 5px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 5px 12px;
  border: 1px solid;
  transition: all 0.15s;
}

#wm-move-confirm {
  background: rgba(0,204,102,0.1);
  border-color: rgba(0,204,102,0.35);
  color: #00cc66;
}
#wm-move-confirm:hover { background: rgba(0,204,102,0.2); }

#wm-move-cancel {
  background: rgba(255,80,80,0.08);
  border-color: rgba(255,80,80,0.25);
  color: #ff6060;
}
#wm-move-cancel:hover { background: rgba(255,80,80,0.18); }

/* ── Raid invite bar ── */
.wm-raid-invite-bar {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8,18,10,0.97);
  border: 1px solid rgba(255,120,0,0.5);
  border-radius: 10px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 500;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 4px 24px rgba(0,0,0,0.6);
  white-space: nowrap;
}

.wm-raid-invite-bar button {
  padding: 6px 14px;
  border-radius: 5px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.15s;
}

#wm-raid-join-btn {
  background: rgba(255,120,0,0.15);
  border-color: rgba(255,120,0,0.5);
  color: #ff8040;
}
#wm-raid-join-btn:hover { background: rgba(255,120,0,0.3); }

#wm-raid-decline-btn {
  background: rgba(255,80,80,0.08);
  border-color: rgba(255,80,80,0.25);
  color: #ff6060;
}