/* Imagoteca Universalis — shared VJ layer styles */

.iu-shell {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, rgba(0, 212, 255, 0.06) 0%, transparent 55%),
              radial-gradient(ellipse at 50% 100%, #050508 0%, #000 70%);
}

.iu-compact .iu-side { width: 130px; height: 200px; margin-left: -65px; margin-top: -100px; }
.iu-compact .iu-cap { width: 260px; height: 260px; margin-left: -130px; margin-top: -130px; }
.iu-compact .iu-ring-card { width: 140px; height: 200px; margin-left: -70px; margin-top: -100px; }
.iu-compact .iu-satellite { width: 72px; height: 108px; margin-left: -36px; margin-top: -54px; }
.iu-compact .iu-helix-node { width: 80px; height: 120px; margin-left: -40px; margin-top: -60px; }
.iu-compact .iu-orbit-core { width: 100px; height: 100px; margin-left: -50px; margin-top: -50px; }

.iu-viewport {
  width: 100%;
  height: 100%;
  perspective: 1100px;
  cursor: grab;
  position: relative;
}

.iu-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
}

.iu-scene {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.05s linear;
}

.iu-prism, .iu-ring, .iu-orbit, .iu-helix {
  transform-style: preserve-3d;
  animation: iuSpin 28s linear infinite;
}

.iu-paused { animation-play-state: paused !important; }

@keyframes iuSpin {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

.iu-face, .iu-ring-card, .iu-satellite, .iu-helix-node, .iu-orbit-core {
  position: absolute;
  left: 50%;
  top: 50%;
  overflow: hidden;
  background: #0a0a12;
  border: 1px solid rgba(0, 212, 255, 0.22);
  box-shadow: 0 0 28px rgba(0, 212, 255, 0.12), inset 0 0 40px rgba(0, 0, 0, 0.7);
  backface-visibility: visible;
}

.iu-face::after, .iu-ring-card::after, .iu-satellite::after, .iu-helix-node::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(0, 212, 255, 0.18), transparent 40%, rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

.iu-side { width: 180px; height: 280px; margin-left: -90px; margin-top: -140px; }
.iu-cap {
  width: 360px; height: 360px;
  margin-left: -180px; margin-top: -180px;
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

.iu-ring-card { width: 180px; height: 260px; margin-left: -90px; margin-top: -130px; border-radius: 4px; }
.iu-satellite { width: 96px; height: 144px; margin-left: -48px; margin-top: -72px; border-radius: 3px; }
.iu-orbit-core {
  width: 130px; height: 130px; margin-left: -65px; margin-top: -65px;
  border-radius: 50%;
  border-color: rgba(201, 168, 76, 0.45);
  box-shadow: 0 0 40px rgba(201, 168, 76, 0.25);
  clip-path: circle(50%);
}
.iu-helix-node { width: 100px; height: 150px; margin-left: -50px; margin-top: -75px; }

.iu-face img, .iu-ring-card img, .iu-satellite img, .iu-helix-node img, .iu-orbit-core img,
.iu-mosaic-cell img, .iu-slideshow img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.iu-grad { width: 100%; height: 100%; }

.iu-mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 3px;
  width: 92%;
  height: 88%;
  padding: 4px;
}

.iu-mosaic-cell {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: iuPulse 3.5s ease-in-out infinite;
}

@keyframes iuPulse {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

.iu-slideshow {
  position: absolute;
  inset: 0;
}

.iu-slide-a, .iu-slide-b {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s ease, transform 8s ease-out;
  transform: scale(1.05);
}

.iu-slide-active {
  opacity: 1;
  transform: scale(1);
}

.iu-slideshow img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.iu-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  z-index: 2;
}

.iu-empty-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: #00D4FF;
  letter-spacing: 0.15em;
  text-transform: lowercase;
}

.iu-empty-hint {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #7A7670;
}

.iu-dropzone {
  position: absolute;
  inset: 12px;
  border: 2px dashed rgba(0, 212, 255, 0.35);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #00D4FF;
  z-index: 5;
  background: rgba(0, 0, 0, 0.4);
}

.iu-drop-active {
  border-color: #1DB87A;
  background: rgba(29, 184, 122, 0.12);
}

.iu-hud {
  position: absolute;
  top: 8px;
  right: 10px;
  display: flex;
  gap: 10px;
  z-index: 6;
  pointer-events: none;
}

.iu-hud-lib, .iu-hud-mode {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  color: #C9A84C;
  text-transform: lowercase;
}

.iu-hud-mode { color: #00D4FF; }

.iu-hud-audio { color: #1DB87A; }

.iu-shell {
  --iu-base-opacity: 1;
  --iu-fx-opacity: 0.85;
  --iu-url-opacity: 0.55;
}

.iu-layer-base {
  opacity: var(--iu-base-opacity);
}

.iu-fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 8;
  opacity: var(--iu-fx-opacity);
  mix-blend-mode: screen;
}

.iu-url-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
  z-index: 6;
  opacity: var(--iu-url-opacity);
  background: transparent;
  mix-blend-mode: screen;
}

/* Circus monitor integration */
.monitor-imagoteca-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.monitor-imagoteca-layer.active {
  opacity: 1;
}

.monitor-imagoteca-layer.active ~ .monitor-stage {
  opacity: 0;
}

.viewer-chip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2, 8px);
  margin-top: var(--space-2, 8px);
}

.viewer-chip {
  background: var(--obsidian, #08080F);
  border: 1px solid var(--border-glass, rgba(255,255,255,0.08));
  color: var(--text-secondary, #A8A4A0);
  padding: 8px 6px;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  cursor: pointer;
  border-radius: 3px;
  text-align: center;
  transition: all 0.2s ease;
}

.viewer-chip:hover {
  border-color: var(--cyan, #00D4FF);
  color: var(--cyan, #00D4FF);
}

.viewer-chip.selected {
  background: rgba(0, 212, 255, 0.12);
  border-color: var(--cyan, #00D4FF);
  color: var(--cyan, #00D4FF);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.2);
}

.viewer-chip .chip-icon {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}