/* ── profpi / Complex Plane Explorer (Phase 5) ── */
/* Loaded after ode-explorer.css, same convention: every var() carries a
   fallback so this still renders correctly standalone, but a real token
   from tokens.css always wins once loaded. Reuses .control-panel,
   .field-group, .field-label, .expr-input, .preset-row, .preset-chip,
   .btn-primary/.btn-secondary, .error-banner, .canvas-wrap, .tool-notes
   etc. from ode-explorer.css rather than redefining them. */

:root {
  --cp-pole-color: #ef4444;
  --cp-zero-color: #10b981;
}

/* Stacked canvases: WebGL render + 2D overlay (poles/zeros, crosshair) share
   the same box via ode-explorer.css's .canvas-wrap, positioned absolutely. */
.canvas-wrap.cp-stack {
  width: 100%;
  max-width: 700px;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  margin: 0 auto;
}

@media (max-height: 850px) {
  .canvas-wrap.cp-stack { max-width: 600px; }
}
@media (max-height: 750px) {
  .canvas-wrap.cp-stack { max-width: 500px; }
}
@media (max-height: 650px) {
  .canvas-wrap.cp-stack { max-width: 400px; }
}

#glCanvas,
#overlayCanvas {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  border-radius: calc(var(--radius-lg, 16px) - 6px);
}

#glCanvas {
  display: block;
  cursor: crosshair;
  touch-action: none;
}

#overlayCanvas {
  pointer-events: none;
}

/* Banner shown when WebGL is unavailable and we've dropped to the slower
   canvas-2D fallback renderer. Informational, not an error. */
.fallback-banner {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md, 10px);
  padding: 10px 12px;
}

html[data-theme="dark"] .fallback-banner {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}

/* Ring-strength slider readout, matches the density-slider label pattern
   already used on the ODE Explorer page. */
.slider-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  display: flex;
  justify-content: space-between;
}

/* Click-to-inspect readout card */
.inspect-panel {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-lg, 16px);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.inspect-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inspect-stat .stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
}

.inspect-stat .stat-value {
  font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-main, #0f172a);
}

.inspect-hint {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  grid-column: 1 / -1;
}

/* Poles/zeros legend chips, reusing .legend-chip from ode-explorer.css */
.legend-swatch.pole { background: var(--cp-pole-color); }
.legend-swatch.zero { background: var(--cp-zero-color); }

.unavailable-note {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  font-style: italic;
}

@media (max-width: 480px) {
  #glCanvas, #overlayCanvas {
    inset: 6px;
    width: calc(100% - 12px);
    height: calc(100% - 12px);
  }
}


/* Fullscreen */
.fullscreen-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-muted, #64748b);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: all 0.2s;
  z-index: 10;
}
.canvas-wrap.cp-stack:hover .fullscreen-toggle {
  opacity: 1;
}
.fullscreen-toggle:hover {
  color: var(--accent, #6366f1);
  border-color: var(--accent, #6366f1);
}
.canvas-wrap.cp-stack.is-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  z-index: 9999 !important;
  background: var(--bg-space, #f8fafc) !important;
  margin: 0 !important;
  border-radius: 0 !important;
  aspect-ratio: auto !important;
}
.canvas-wrap.cp-stack.is-fullscreen canvas {
  width: 100% !important;
  height: 100% !important;
  inset: 0 !important;
  border-radius: 0 !important;
}


