/* ═══════════════════════════════════════════════════
   SIDEBAR — NOVA DOMINATION
   ═══════════════════════════════════════════════════ */

.game-sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 8000;
  background: rgba(5,9,17,.96);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--t);
}

/* ── Backdrop mobile ──────────────────────────────── */
.game-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 7999;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
}
.game-sidebar-backdrop.active { display: block; }

/* ── Head ─────────────────────────────────────────── */
.game-sidebar-head {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}
.game-sidebar-planet-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  flex-shrink: 0;
}
.game-sidebar-head strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-sidebar-head span {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin-top: 1px;
}
.game-sidebar-close {
  margin-left: auto;
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

/* ── Navigation ───────────────────────────────────── */
.game-sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  scrollbar-width: none;
}
.game-sidebar-nav::-webkit-scrollbar { display: none; }

.game-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: all var(--t-fast);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}
.game-sidebar-item:hover {
  color: var(--text);
  background: rgba(255,255,255,.05);
  border-color: var(--border-soft);
}
.game-sidebar-item.active {
  color: var(--accent);
  background: rgba(0,207,255,.08);
  border-color: rgba(0,207,255,.2);
}
.game-sidebar-item.active .game-sidebar-icon {
  filter: drop-shadow(0 0 6px rgba(0,207,255,.6));
}

.game-sidebar-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.game-sidebar-label { font-size: 12px; }

/* ── Section divider ────────────────────────────── */
.game-sidebar-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 6px 10px;
}

/* ── Section planètes ───────────────────────────── */
.game-sidebar-planets {
  padding: 0 8px 8px;
}
.game-sidebar-planets:not(:empty) {
  border-top: 1px solid var(--border-soft);
  padding-top: 10px;
}
.game-sidebar-planets-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted-2);
  padding: 0 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.game-sidebar-planets-label::before {
  content: "";
  display: inline-block;
  width: 12px; height: 1px;
  background: var(--border-soft);
}
.game-sidebar-planets-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

.game-sidebar-planet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  position: relative;
}
.game-sidebar-planet-row.active {
  background: linear-gradient(135deg, rgba(0,207,255,.07), rgba(0,207,255,.03));
  border-color: rgba(0,207,255,.2);
}
.game-sidebar-planet-row.active::before {
  content: "";
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}
.game-sidebar-planet-row:not(.active):not(.colonizing):hover {
  background: rgba(255,255,255,.04);
  border-color: var(--border-soft);
}
.game-sidebar-planet-row.colonizing {
  cursor: default;
  opacity: 0.6;
}

.game-sidebar-planet-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border-soft);
}
.game-sidebar-planet-row.active .game-sidebar-planet-icon {
  background: rgba(0,207,255,.1);
  border-color: rgba(0,207,255,.25);
}

.game-sidebar-planet-info {
  flex: 1;
  min-width: 0;
}
.game-sidebar-planet-name {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
.game-sidebar-planet-coords {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  color: var(--muted);
  margin-top: 3px;
  font-family: monospace;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: .03em;
}

.game-sidebar-planet-rename {
  background: rgba(255,255,255,.05);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  opacity: 0;
  transition: opacity var(--t-fast), background var(--t-fast);
  padding: 4px 5px;
  flex-shrink: 0;
  color: var(--muted);
  line-height: 1;
}
.game-sidebar-planet-row:hover .game-sidebar-planet-rename {
  opacity: 1;
}
.game-sidebar-planet-rename:hover {
  background: rgba(0,207,255,.12);
  border-color: rgba(0,207,255,.2);
  color: var(--accent);
}

/* ── Modal renommage ─────────────────────────────── */
.sb-rename-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sb-rename-modal {
  background: #0c1629;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
  width: 320px;
  max-width: 90vw;
  box-shadow: 0 8px 48px rgba(0,0,0,.6);
}
.sb-rename-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
}
.sb-rename-input {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--t-fast);
}
.sb-rename-input:focus { border-color: var(--accent); }
.sb-rename-hint {
  font-size: 10px;
  color: var(--muted);
  margin: 6px 0 16px;
}
.sb-rename-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.sb-rename-cancel {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
}
.sb-rename-confirm {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #020617;
  font-weight: 700;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
}

/* ── Footer ────────────────────────────────────── */
.game-sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid var(--border-soft);
  font-size: 10px;
  color: var(--muted-2);
  text-align: center;
}

/* ════════════════════════════════════════════════
   TABLET 601–900px : sidebar icônes seulement
   ════════════════════════════════════════════════ */
@media (min-width: 601px) and (max-width: 900px) {
  .game-sidebar {
    width: 60px;
  }
  .game-sidebar-head {
    padding: 10px 6px;
    justify-content: center;
  }
  .game-sidebar-planets { display: none; }
  .game-sidebar-nav { padding: 8px 6px; }
  .game-sidebar-item {
    justify-content: center;
    padding: 10px 6px;
    gap: 0;
  }
  .game-sidebar-label { display: none; }
  .game-sidebar-icon { width: auto; font-size: 20px; }
  .game-sidebar-footer { display: none; }
  .game-sidebar-divider { margin: 4px 6px; }
}

/* ════════════════════════════════════════════════
   MOBILE ≤ 600px : bottom nav + drawer
   ════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .game-sidebar {
    top: auto;
    bottom: 0; left: 0; right: 0;
    width: 100%;
    height: auto;
    border-right: none;
    border-top: 1px solid var(--border);
    flex-direction: row;
    padding: 0;
    z-index: 8000;
  }
  .game-sidebar-head,
  .game-sidebar-divider,
  .game-sidebar-footer { display: none; }
  .game-sidebar-nav {
    flex-direction: row;
    padding: 6px 8px;
    gap: 0;
    overflow-x: auto;
    justify-content: space-around;
    width: 100%;
  }
  .game-sidebar-item {
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px;
    font-size: 9px;
    min-width: 52px;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-sm);
  }
  .game-sidebar-icon { font-size: 20px; width: auto; }
  .game-sidebar-label { font-size: 9px; }
  body { padding-bottom: 72px; padding-top: var(--header-h); }
}

/* ── Sidebar mobile/tablette ───────────────────────── */
/* Tablette (601-900px) : drawer latéral gauche, caché par défaut */
@media (max-width: 900px) {
  .game-sidebar {
    transform: translateX(-100%);
    width: 260px;
    top: var(--header-h);
    bottom: 0;
    height: auto;
    flex-direction: column;
    border-right: 1px solid var(--border);
    border-top: none;
    transition: transform 0.25s ease;
  }
  body.sidebar-open .game-sidebar {
    transform: translateX(0);
  }
  .game-sidebar-head { display: flex; }
  .game-sidebar-close { display: flex; }
  .game-sidebar-nav { flex-direction: column; overflow-y: auto; }
  .game-sidebar-item { justify-content: flex-start; flex-direction: row; min-width: unset; }
  .game-sidebar-label { display: block; }
  .game-sidebar-icon { font-size: 18px; width: 28px; }
  .game-sidebar-footer { display: block; }
}

/* Mobile (≤600px) : drawer du bas, caché par défaut */
@media (max-width: 600px) {
  .game-sidebar {
    top: auto;
    bottom: 0;
    height: 60vh;
    width: 100%;
    transform: translateY(100%);
    transition: transform 0.25s ease;
    border-right: none;
    border-top: 1px solid var(--border);
    overflow-y: auto;
  }
  body.sidebar-open .game-sidebar {
    transform: translateY(0);
  }
}
