/* Shared Shader Inspector HUD & Back-to-Hub Pill */
:root {
  --hud-bg: rgba(10, 12, 18, 0.84);
  --hud-bg-elevated: rgba(18, 22, 32, 0.94);
  --hud-border: rgba(255, 255, 255, 0.14);
  --hud-border-strong: rgba(255, 255, 255, 0.26);
  --hud-text: #f3f6fc;
  --hud-muted: #98a4bc;
  --hud-accent: #7c5cff;
  --hud-accent-2: #00e5ff;
  --hud-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --hud-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, SFMono-Regular, monospace;
}

.shud-back-pill {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  color: var(--hud-text);
  font-family: var(--hud-font);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.shud-back-pill:hover {
  transform: translateY(-1px);
  border-color: var(--hud-border-strong);
  background: var(--hud-bg-elevated);
}

.shud-back-pill svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.shud-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  width: min(360px, calc(100vw - 32px));
  font-family: var(--hud-font);
  color: var(--hud-text);
  border-radius: 16px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: width 0.22s ease;
}

.shud-root.is-collapsed {
  width: auto;
  min-width: 220px;
}

.shud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
}

.shud-root:not(.is-collapsed) .shud-header {
  border-bottom-color: var(--hud-border);
}

.shud-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.shud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hud-accent-2), var(--hud-accent));
  box-shadow: 0 0 10px var(--hud-accent-2);
  flex-shrink: 0;
}

.shud-root.is-fallback .shud-dot {
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
}

.shud-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shud-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.22);
  border: 1px solid rgba(124, 92, 255, 0.45);
  color: #d6ccff;
  flex-shrink: 0;
}

.shud-collapse-btn {
  background: transparent;
  border: 0;
  color: var(--hud-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease, color 0.15s ease;
}

.shud-collapse-btn:hover {
  color: var(--hud-text);
}

.shud-root.is-collapsed .shud-collapse-btn {
  transform: rotate(180deg);
}

.shud-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(70vh, 560px);
  overflow-y: auto;
}

.shud-root.is-collapsed .shud-body {
  display: none;
}

.shud-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shud-slider-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shud-slider-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.shud-slider-label {
  color: #dce3f3;
  font-weight: 500;
}

.shud-slider-val {
  font-family: var(--hud-mono);
  font-size: 11px;
  color: var(--hud-accent-2);
}

.shud-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

.shud-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff, #b8e8ff);
  border: 2px solid var(--hud-accent);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(124, 92, 255, 0.55);
}

.shud-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff, #b8e8ff);
  border: 2px solid var(--hud-accent);
  cursor: pointer;
}

.shud-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.shud-btn {
  appearance: none;
  border: 1px solid var(--hud-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--hud-text);
  font-family: var(--hud-font);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.14s ease;
}

.shud-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--hud-border-strong);
}

.shud-btn.is-active {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.35), rgba(0, 229, 255, 0.2));
  border-color: rgba(0, 229, 255, 0.55);
  color: #ffffff;
}

.shud-btn.is-fallback-active {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fde68a;
}

.shud-note {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--hud-muted);
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.shud-note strong {
  color: #f8d486;
  font-weight: 600;
}

.shud-code-drawer {
  display: none;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--hud-border);
  padding-top: 10px;
}

.shud-code-drawer.is-open {
  display: flex;
}

.shud-code-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--hud-muted);
}

.shud-copy-btn {
  border: 1px solid var(--hud-border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--hud-text);
  font-family: var(--hud-font);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 7px;
  cursor: pointer;
}

.shud-copy-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.shud-pre {
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  background: rgba(5, 7, 12, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--hud-mono);
  font-size: 11px;
  line-height: 1.45;
  color: #cbe6ff;
  max-height: 220px;
  overflow: auto;
  white-space: pre;
  tab-size: 2;
}
