/* ============================================================
   ShaderClaw 3 — Viewport: Canvas fills everything
   ============================================================ */

/* ===== CANVAS (fills the entire viewport) ===== */
.sc3-canvas, #main {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
  z-index: 0;
}

#preview, .sc3-preview {
  position: absolute;
  inset: 0;
  background: #000;
}

#gl-canvas, #three-canvas {
  width: 100%; height: 100%;
  display: block;
  position: absolute;
  top: 0; left: 0;
  touch-action: none;
}
#preview { touch-action: none; }
/* No double-tap zoom on controls (iOS ignores user-scalable=no) */
html, body { touch-action: manipulation; }
#three-canvas { display: none; }

#overlay-gizmo {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* ===== CANVAS BUTTONS (live in the top bar — see topbar.css) ===== */
.canvas-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.75);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: background var(--sc-duration), color var(--sc-duration), transform var(--sc-duration) var(--sc-ease-out);
}
.canvas-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.canvas-btn:active { transform: scale(0.92); }
.canvas-btn.active {
  color: var(--sc-accent);
}
.canvas-btn.active svg { stroke: var(--sc-accent); }

/* ===== EXPORT BUTTON ===== */
.export-btn:hover {
  background: var(--sc-accent);
  color: #fff;
}
.export-btn:hover svg { stroke: #fff; }
.export-btn:active { transform: scale(0.92); }

/* ===== ERROR BAR ===== */
#error-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(232, 64, 87, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(232, 64, 87, 0.5);
  color: #ff8a9e;
  font-size: var(--sc-font-size-base);
  padding: 6px var(--sc-space-3);
  display: none;
  max-height: 80px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: var(--sc-font-mono);
  z-index: 30;
}
#error-bar.show { display: block; }
#error-bar[data-init] { display: none !important; }

/* ===== DEBUG OVERLAY (right of toolbar strip) ===== */
#debug-overlay {
  position: absolute;
  top: calc(var(--sc-topbar-h) + var(--sc-space-2));
  left: calc(var(--sc-toolbar-w) + var(--sc-panel-gap) * 2 + var(--sc-space-2));
  z-index: 999;
  color: #0f0;
  font: 12px monospace;
  background: rgba(0,0,0,0.85);
  padding: var(--sc-space-3);
  border-radius: 4px;
  pointer-events: none;
  white-space: pre;
  max-width: 50%;
  overflow: hidden;
  max-height: 60vh;
}

/* ===== CHAT BAR (hidden for now) ===== */
.sc3-chat-bar { display: none !important; }
.sc3-chat-history { display: none !important; }

/* ===== INTERACT HINT — transient, first load ===== */
#interact-hint {
  position: absolute;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  background: rgba(12, 12, 14, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--sc-radius-pill);
  color: rgba(255,255,255,0.85);
  font-family: var(--sc-font);
  font-size: var(--sc-font-size-md);
  font-weight: 500;
  letter-spacing: var(--sc-tracking);
  white-space: nowrap;
  pointer-events: none;
  z-index: 34;
  opacity: 0;
  animation: hint-cycle 7s var(--sc-ease) 1.2s forwards;
}
#interact-hint.dismissed { animation: none; opacity: 0; }
@keyframes hint-cycle {
  0%   { opacity: 0; transform: translateX(-50%) translateY(6px); }
  8%   { opacity: 1; transform: translateX(-50%) translateY(0); }
  82%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-4px); }
}

/* ===== NDI INDICATOR ===== */
.ndi-indicator {
  display: flex; align-items: center; gap: 5px;
  padding: 0 12px; border-radius: var(--sc-radius-pill);
  background: transparent; border: none;
  height: 32px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.4px;
  color: var(--sc-text-dim); transition: all 0.3s;
  pointer-events: auto; cursor: pointer; user-select: none;
}
.ndi-indicator.active .ndi-label { color: var(--sc-accent); }
.ndi-indicator.active .ndi-dot { background: var(--sc-accent); box-shadow: 0 0 6px var(--sc-accent); }
.ndi-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.3); transition: all 0.3s;
}
.ndi-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--sc-text-dim); transition: background 0.2s;
}
.ndi-status-dot.active { background: var(--sc-accent); box-shadow: 0 0 6px var(--sc-accent); }

/* Audio level (canvas) */
.audio-level-indicator {
  display: none; align-items: center; gap: 6px;
  background: transparent;
  border: none; border-radius: var(--sc-radius-pill);
  padding: 0 10px; height: 32px;
}
.audio-level-indicator.active { display: flex; }
.audio-level-indicator svg { color: var(--sc-accent); flex-shrink: 0; }
.audio-level-track { width: 72px; height: 4px; background: rgba(255,255,255,0.12); border-radius: 2px; overflow: hidden; }
.audio-level-fill { display: block; height: 100%; width: 0%; background: var(--sc-accent); border-radius: 2px; transition: width 0.06s; }

#canvas-logo { display: none; }

/* ===== FULLSCREEN MODE — hide all UI, pure canvas ===== */
#preview:fullscreen .canvas-controls,
#preview:fullscreen #error-bar,
#preview:fullscreen #debug-overlay {
  display: none !important;
}
#preview:fullscreen {
  cursor: none;
}
#preview:fullscreen.show-cursor {
  cursor: default;
}

