/* ===== mode button (top center) — angular HUD tab ===== */
#modeBtn {
  position: absolute;
  top: 1.2vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  border: 1px solid var(--sci-cyan);
  border-radius: 0;
  clip-path: var(--clip-hud);
  padding: 10px 24px;
  font: 700 14px/1 var(--sci-font);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #eaffff;
  background: linear-gradient(180deg, rgba(53, 224, 255, 0.22), rgba(10, 20, 36, 0.9));
  text-shadow: 0 0 8px rgba(53, 224, 255, 0.6);
  box-shadow: inset 0 0 12px rgba(53, 224, 255, 0.2);
  filter: drop-shadow(0 0 8px rgba(53, 224, 255, 0.4));
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
#modeBtn b { color: #fff; }
#modeBtn .sub { opacity: .7; font-weight: 400; font-size: 10px; margin-left: 8px; letter-spacing: .5px; }

/* ===== shared HUD button (gizmo tools + paint buttons) ===== */
.pp-btn {
  border: 1px solid var(--sci-line);
  background: linear-gradient(180deg, rgba(24, 44, 66, 0.7), rgba(9, 16, 28, 0.9));
  color: var(--sci-text);
  border-radius: 3px;
  padding: 7px 12px;
  font: 600 12px/1 var(--sci-font);
  text-transform: uppercase;
  letter-spacing: .5px;
  box-shadow: inset 0 0 8px rgba(53, 224, 255, 0.08);
  -webkit-tap-highlight-color: transparent;
}
.pp-btn.on, .pp-btn.active {
  border-color: var(--sci-cyan-2);
  background: linear-gradient(180deg, rgba(53, 224, 255, 0.4), rgba(20, 56, 82, 0.85));
  color: #fff;
  box-shadow: 0 0 14px rgba(53, 224, 255, 0.55), inset 0 0 10px rgba(53, 224, 255, 0.25);
  text-shadow: 0 0 8px rgba(53, 224, 255, 0.8);
}

/* ===== gizmo tool switcher (Position/Rotate/Scale) ===== */
#gizmoTools {
  position: absolute;
  top: calc(1.2vh + 52px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: none;
  gap: 8px;
}
#gizmoTools .pp-btn { font-size: 12px; padding: 8px 16px; }

/* ===== pie (radial) pose menu: icon disc + page-shift center button ===== */
#pieMenu {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  background: rgba(2, 6, 12, 0.4);
  touch-action: none;
}
#pieMenu.open { display: block; }
.pieDisc {
  position: fixed;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  box-shadow: 0 0 48px rgba(53, 224, 255, 0.35),
              inset 0 0 0 1px rgba(53, 224, 255, 0.7),
              inset 0 0 30px rgba(53, 224, 255, 0.12);
  animation: pieIn .14s ease-out;
}
@keyframes pieIn {
  from { transform: translate(-50%,-50%) scale(.82); opacity: 0; }
}
.pieSep {
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  pointer-events: none;
}
.pieIcon {
  position: fixed;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  border: 1px solid rgba(53, 224, 255, 0.35);
  background: rgba(12, 24, 40, 0.5);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.pieIcon img { width: 92%; height: 92%; object-fit: contain; pointer-events: none; }
.pieIcon span {
  position: absolute;
  right: -3px;
  bottom: -3px;
  background: rgba(9, 16, 28, 0.95);
  color: var(--sci-cyan);
  font: 700 10px/1 var(--sci-font);
  border: 1px solid var(--sci-line-soft);
  padding: 2px 5px;
  border-radius: 6px;
  pointer-events: none;
}
.pieIcon.current {
  border-color: var(--sci-cyan);
  box-shadow: 0 0 0 2px rgba(53, 224, 255, 0.7), 0 0 16px rgba(53, 224, 255, 0.6);
  background: rgba(53, 224, 255, 0.18);
}
.pieIcon:active { background: rgba(53, 224, 255, 0.28); }
.pieCenter {
  position: fixed;
  transform: translate(-50%,-50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 44, 68, 0.98), rgba(8, 14, 24, 0.98));
  color: var(--sci-cyan);
  border: 1px solid var(--sci-cyan);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font: 800 15px/1 var(--sci-font);
  text-shadow: 0 0 8px rgba(53, 224, 255, 0.7);
  box-shadow: 0 0 18px rgba(53, 224, 255, 0.5), inset 0 0 10px rgba(53, 224, 255, 0.2);
  -webkit-tap-highlight-color: transparent;
}
.pieCenter span { font-size: 13px; opacity: .8; }

/* ===== paint panel (bottom sheet) ===== */
#paintPanel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  background: linear-gradient(180deg, rgba(10, 20, 34, 0.95), rgba(6, 12, 22, 0.96));
  border-top: 1px solid var(--sci-cyan);
  box-shadow: 0 -2px 24px rgba(53, 224, 255, 0.22);
  border-radius: 10px 10px 0 0;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  font: 12px/1.3 var(--sci-font);
  color: var(--sci-text);
  max-height: 46vh;
  overflow-y: auto;
  display: none;
  touch-action: pan-y;
}
#paintPanel.open { display: block; }
#paintPanel.collapsed { max-height: 44px; overflow: hidden; }
.pp-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
#ppSwatch {
  width: 40px; height: 28px; border-radius: 3px;
  border: 1px solid var(--sci-line); flex: none;
  box-shadow: 0 0 10px rgba(53, 224, 255, 0.3);
}
#ppHex { color: var(--sci-cyan); font-family: var(--sci-font); font-size: 13px; letter-spacing: 1px; }
#ppRgb { color: #7fb6cf; font-family: var(--sci-font); font-size: 11px; margin-left: auto; }
#ppCollapse { margin-left: auto; }
.pp-main { display: flex; gap: 14px; align-items: flex-start; }
#ppWheelWrap { position: relative; flex: none; }
#ppWheel { border-radius: 50%; display: block; touch-action: none; box-shadow: 0 0 14px rgba(53, 224, 255, 0.3); }
#ppWheelDot {
  position: absolute; width: 12px; height: 12px;
  border: 2px solid #fff; border-radius: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
  box-shadow: 0 0 6px rgba(53, 224, 255, 0.9);
}
.pp-sliders { flex: 1; min-width: 0; }
.pp-slider { display: grid; grid-template-columns: 72px 1fr 44px; align-items: center; gap: 8px; margin: 7px 0; }
.pp-slider label { color: #9fd6ee; white-space: nowrap; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; overflow: hidden; text-overflow: ellipsis; }
.pp-slider output { text-align: right; color: var(--sci-cyan); font-family: var(--sci-font); }
.pp-slider input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 6px;
  background: rgba(20, 34, 52, 0.9);
  border: 1px solid rgba(53, 224, 255, 0.25);
  outline: none;
}
.pp-slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--sci-cyan);
  border: 2px solid #eaffff;
  box-shadow: 0 0 10px rgba(53, 224, 255, 0.9);
}
