/* Live spectator layer — stage, commentary, moments */

.live-stage.is-live-match {
  position: relative;
  border-color: rgba(247, 147, 26, 0.22);
  box-shadow: 0 0 0 1px rgba(247, 147, 26, 0.12), 0 12px 48px rgba(0, 0, 0, 0.35);
}

.live-stage.is-live-match::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(247, 147, 26, 0.15);
  animation: stageLiveRing 2.8s ease-in-out infinite;
}

@keyframes stageLiveRing {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.spectator-commentary {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.82rem;
  color: var(--muted);
  min-height: 2.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.spectator-commentary[hidden] { display: none !important; }
.spectator-commentary strong { color: var(--text); font-weight: 600; }
.spectator-commentary.commentary-flash {
  border-color: rgba(247, 147, 26, 0.35);
  color: var(--text);
  animation: commentaryIn 0.45s ease-out;
}
@keyframes commentaryIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.duel-spotlight {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(247, 147, 26, 0.25);
  background: rgba(0, 0, 0, 0.25);
}
.duel-spotlight[hidden] { display: none !important; }
.duel-agent {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.duel-agent-b { flex-direction: row-reverse; text-align: right; }
.duel-agent-avatar {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 2px solid rgba(247, 147, 26, 0.35);
  flex-shrink: 0;
}
.duel-agent-name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.duel-agent-meta { font-size: 0.68rem; color: var(--muted); }
.duel-vs {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--gold);
  opacity: 0.85;
}
.duel-agent.is-typing .duel-agent-avatar {
  box-shadow: 0 0 16px rgba(247, 147, 26, 0.35);
  animation: typingPulse 1.2s ease infinite;
}
.duel-agent.is-winner .duel-agent-avatar {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(247, 147, 26, 0.45);
}
@keyframes typingPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

body.mode-solo-chapter-live .duel-spotlight { display: none !important; }

.confetti-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}
.confetti-piece {
  position: absolute;
  top: -8px;
  width: 6px;
  height: 10px;
  border-radius: 1px;
  background: var(--gold);
  opacity: 0.85;
  animation: confettiFall 2.4s ease-out forwards;
}
.confetti-piece:nth-child(3n) { background: rgba(255, 255, 255, 0.55); }
.confetti-piece:nth-child(5n) { background: rgba(247, 147, 26, 0.45); width: 4px; height: 8px; }
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(420px) rotate(540deg); opacity: 0; }
}

.chapter-moment {
  text-align: center;
  padding: 0.65rem;
  margin-bottom: 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(247, 147, 26, 0.3);
  background: rgba(247, 147, 26, 0.06);
  font-family: var(--font-display);
  font-size: 0.88rem;
  animation: chapterMoment 0.6s ease-out;
}
@keyframes chapterMoment {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.operator-panel {
  margin-top: 0.75rem;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
}
.operator-panel summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--muted);
}
.operator-funding { font-size: 0.78rem; line-height: 1.5; color: var(--muted); }
.operator-funding strong { color: var(--text); }
.operator-funding a { color: var(--gold); }
.operator-funding code {
  display: block;
  margin: 0.35rem 0;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.68rem;
  word-break: break-all;
}
