/* Dual-view spell stage — matches report paper tokens */

.spell-stage {
  --stage-paper: #101218;
  --stage-card: #171b24;
  --stage-ink: #ece7dc;
  --stage-muted: #9aa3b2;
  --stage-accent: #e0a14a;
  --stage-line: #2a3140;
  --stage-ground: #1a1f2a;
  margin: 16px 0 20px;
  background: var(--stage-paper);
  border: 1px solid var(--stage-line);
  border-radius: 4px;
  overflow: hidden;
}

.spell-stage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--stage-line);
  background: var(--stage-card);
}

.spell-stage-caption {
  flex: 1;
  min-width: 12rem;
  font-size: 13px;
  color: var(--stage-ink);
}

.spell-stage-caption strong {
  color: var(--stage-accent);
  font-weight: 600;
  margin-right: 2px;
}

.spell-stage-badge {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--stage-line);
  color: var(--stage-muted);
}

.spell-stage-badge.ok {
  color: #7dcea0;
  border-color: #3a5a48;
  background: #142018;
}

.spell-stage-badge.fail {
  color: #e07a7a;
  border-color: #5a3a3a;
  background: #201414;
}

.spell-stage-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spell-stage-controls button {
  background: var(--stage-paper);
  color: var(--stage-ink);
  border: 1px solid var(--stage-line);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 3px;
}

.spell-stage-controls button:hover {
  border-color: var(--stage-accent);
}

.spell-stage-loop {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--stage-ink);
  cursor: pointer;
  user-select: none;
}

.spell-stage-loop input {
  margin: 0;
  accent-color: var(--stage-accent);
}

.spell-stage-controls input[type="range"] {
  width: 120px;
  accent-color: var(--stage-accent);
}

.spell-stage-views {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.spell-stage-view {
  position: relative;
  min-height: 260px;
  border-right: 1px solid var(--stage-line);
  background:
    radial-gradient(ellipse 80% 50% at 30% 20%, rgba(110, 168, 254, 0.06), transparent 60%),
    var(--stage-paper);
}

.spell-stage-view:last-child {
  border-right: none;
}

.spell-stage-view-label {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 3;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stage-muted);
  pointer-events: none;
}

.spell-stage-view svg,
.spell-stage-view canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.spell-stage-view canvas {
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: screen;
}

.spell-stage-view svg {
  z-index: 1;
}

.spell-stage tr.scene-active td {
  background: #2a2118;
}

.spell-stage-trials {
  margin: 0;
}

@media (max-width: 900px) {
  .spell-stage-views {
    grid-template-columns: 1fr;
  }
  .spell-stage-view {
    border-right: none;
    border-bottom: 1px solid var(--stage-line);
    min-height: 220px;
  }
  .spell-stage-view:last-child {
    border-bottom: none;
  }
}
