/* ══════════════════════════════════════════════════════════════
   Debug Menu — v0.2a Edgeless Battlefield
   Fixed panel, top-right, dark theme matching game UI
══════════════════════════════════════════════════════════════ */

.debug-menu {
  display: none;
  position: fixed;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  z-index: 10000;
  width: 272px;
  max-height: 65vh;
  overflow-y: auto;
  background: rgba(8,12,16,0.95);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 4px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 6px 0;
  user-select: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,212,255,0.2) transparent;
}
.debug-menu.visible { display: block; }

/* Scrollbar */
.debug-menu::-webkit-scrollbar { width: 4px; }
.debug-menu::-webkit-scrollbar-track { background: transparent; }
.debug-menu::-webkit-scrollbar-thumb { background: rgba(0,212,255,0.2); border-radius: 2px; }

/* ── Title bar ── */
.dbg-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 6px;
  font-size: 11px;
  letter-spacing: 3px;
  color: rgba(0,212,255,0.6);
  border-bottom: 1px solid rgba(0,212,255,0.1);
  margin-bottom: 2px;
}
.dbg-title-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dbg-title-key {
  font-size: 9px;
  color: rgba(255,255,255,0.25);
  letter-spacing: 1px;
}
.dbg-reset-btn {
  font: 600 8px/1 'Rajdhani', sans-serif;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,100,80,0.7);
  background: rgba(255,100,80,0.08);
  border: 1px solid rgba(255,100,80,0.2);
  border-radius: 2px;
  padding: 2px 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.dbg-reset-btn:hover {
  color: #ff6450;
  background: rgba(255,100,80,0.15);
  border-color: rgba(255,100,80,0.4);
}

/* ── Collapsible sections ── */
.dbg-section {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.dbg-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  cursor: pointer;
  color: rgba(0,212,255,0.5);
  transition: color 0.15s;
}
.dbg-section-hdr:hover { color: rgba(0,212,255,0.8); }
.dbg-section-hdr .dbg-chev {
  font-size: 8px;
  transition: transform 0.2s;
}
.dbg-section.collapsed .dbg-chev { transform: rotate(-90deg); }
.dbg-section.collapsed .dbg-section-body { display: none; }

.dbg-section-body {
  padding: 2px 10px 6px;
}

/* ── Row layout ── */
.dbg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0;
  min-height: 20px;
}
.dbg-row-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Pill toggle ── */
.dbg-toggle {
  position: relative;
  width: 28px;
  height: 14px;
  background: rgba(255,255,255,0.08);
  border-radius: 7px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.dbg-toggle.on { background: rgba(0,212,255,0.35); }
.dbg-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: transform 0.15s, background 0.15s;
}
.dbg-toggle.on::after {
  transform: translateX(14px);
  background: #00d4ff;
}

/* ── Slider ── */
.dbg-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  outline: none;
  flex-shrink: 0;
  margin-left: 6px;
}
.dbg-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00d4ff;
  cursor: pointer;
  border: none;
}
.dbg-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00d4ff;
  cursor: pointer;
  border: none;
}

.dbg-slider-val {
  width: 28px;
  text-align: right;
  font-size: 9px;
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
  margin-left: 4px;
}

/* ── Color picker ── */
.dbg-color {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 16px;
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 2px;
  background: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.dbg-color::-webkit-color-swatch-wrapper { padding: 0; }
.dbg-color::-webkit-color-swatch { border: none; border-radius: 1px; }

/* ── Dropdown select ── */
.dbg-select {
  -webkit-appearance: none;
  appearance: none;
  background: rgba(8,12,16,0.9);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 2px;
  font: 600 9px/1 'Rajdhani', sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 20px 3px 6px;
  cursor: pointer;
  width: 100%;
  margin-top: 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='rgba(0,212,255,0.4)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}
.dbg-select:focus { outline: none; border-color: rgba(0,212,255,0.5); }
.dbg-select option { background: #0c1018; color: rgba(255,255,255,0.7); }

/* ── Sub-section label (e.g. "Layer 1") ── */
.dbg-sub-label {
  font-size: 9px;
  color: rgba(0,212,255,0.3);
  letter-spacing: 2px;
  padding: 4px 0 1px;
}

/* ── Monospace display (FPS counter, game state, camera info) ── */
.dbg-display {
  font: 13px/1.6 monospace; color: #8af;
  padding: 4px 8px; white-space: pre;
}
.dbg-display-sm { font-size: 11px; }

/* ── Action buttons ── */
.dbg-btn {
  display: block; width: calc(100% - 16px); margin: 4px 8px;
  background: #1a1a2e; color: #c9a352;
  border: 1px solid rgba(201,163,82,0.3);
  padding: 5px 8px; font: 600 10px 'Rajdhani', sans-serif;
  letter-spacing: 1px; border-radius: 3px;
  cursor: pointer; text-transform: uppercase;
}
.dbg-btn:hover { border-color: rgba(201,163,82,0.5); }
.dbg-btn-green {
  background: #1a2e1a; color: #52c9a3;
  border-color: rgba(82,201,163,0.3);
}
.dbg-btn-green:hover { border-color: rgba(82,201,163,0.5); }
.dbg-btn-danger {
  background: #2e1a1a; color: #c95252;
  border-color: rgba(201,82,82,0.4);
}
.dbg-btn-danger:hover { border-color: rgba(201,82,82,0.6); }
.dbg-btn-cyan {
  background: rgba(0,212,255,0.1); color: #00d4ff;
  border-color: rgba(0,212,255,0.25);
}
.dbg-btn-cyan:hover { border-color: rgba(0,212,255,0.4); }

/* ── Fixture picker ── */
.dbg-fixture-label {
  padding: 6px 8px 2px; font: 600 9px 'Rajdhani', sans-serif;
  letter-spacing: 1.5px; color: #8a98ab; text-transform: uppercase;
}
.dbg-fixture-filter {
  display: block; width: calc(100% - 16px); margin: 0 8px 4px;
  background: #0a1424; color: #cde;
  border: 1px solid rgba(110,238,204,0.25);
  padding: 4px 8px; font: 500 10px 'Rajdhani', sans-serif;
  letter-spacing: 0.5px; border-radius: 3px; outline: none;
}
.dbg-fixture-filter:focus { border-color: rgba(110,238,204,0.6); }
.dbg-fixture-grid {
  display: flex; flex-wrap: wrap; gap: 3px; padding: 2px 8px 6px;
}
.dbg-fixture-btn {
  flex: 1 1 45%; background: #0e1a2e; color: #6ec;
  border: 1px solid rgba(110,238,204,0.25);
  padding: 4px 6px; font: 500 9px 'Rajdhani', sans-serif;
  letter-spacing: 0.5px; border-radius: 3px; cursor: pointer;
}
.dbg-fixture-btn:hover { border-color: rgba(110,238,204,0.5); }

/* ── Checkbox label rows (overlays section) ── */
.dbg-checkbox-row {
  display: flex; align-items: center; gap: 6px;
  padding: 2px 8px; cursor: pointer; color: #aac; font-size: 10px;
}
.dbg-checkbox { accent-color: #8af; cursor: pointer; }

/* ── Map/deploy select dropdown ── */
.dbg-map-select {
  width: 100%; min-height: 28px; background: #1a1a2e; color: #c9a352;
  border: 1px solid rgba(201,163,82,0.3); padding: 6px 8px;
  font: 500 12px 'Rajdhani', sans-serif; border-radius: 3px;
  cursor: pointer; -webkit-appearance: menulist;
}

/* ── Debug move-validation info panel ── */
#dbg-move-info {
  position: fixed; bottom: 52px; left: 228px; z-index: 900;
  background: rgba(16,20,26,0.95); border: 1px solid rgba(138,170,255,0.3);
  border-radius: 6px; padding: 6px 10px;
  font: 10px/1.4 monospace; color: #aac;
  max-width: 350px; pointer-events: none;
}

/* ── Cloud config status message ── */
.dbg-cfg-msg {
  font: 500 10px 'Rajdhani', sans-serif; padding: 4px 8px;
  display: none; border-radius: 3px; margin-top: 4px;
}
