/* Card Battles — duel cinema, editor, hub (motion-safe) */

.battle-seller-strip {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line, #ccc);
  font-size: 0.85rem;
  background: var(--accent-soft, rgba(0, 0, 0, 0.04));
}

.battle-seller-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-right: 0.35rem;
}

.battle-stage {
  position: relative;
  min-height: 70vh;
  overflow: hidden;
}

.battle-stage[data-phase="intro"] .battle-reveal,
.battle-stage[data-phase="intro"] .battle-gallery {
  opacity: 0;
  pointer-events: none;
}

.battle-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1rem;
  text-align: center;
  animation: battle-vs-in 0.7s ease-out;
}

.battle-vs-side {
  flex: 1;
  max-width: 200px;
}

.battle-vs-side h2 {
  margin: 0.35rem 0 0;
  font-size: 1.1rem;
}

.battle-vs-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

.battle-vs-mid {
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 800;
  line-height: 1;
  color: var(--accent, #c45c26);
  animation: battle-pulse 1.2s ease-in-out infinite;
}

.battle-power-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1rem 0;
}

.battle-power-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--line, rgba(0, 0, 0, 0.12));
  overflow: hidden;
}

.battle-power-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
  background: linear-gradient(90deg, var(--accent, #c45c26), #e8a87c);
}

.battle-power-fill.side-b {
  background: linear-gradient(90deg, #4a6fa5, #7eb8da);
}

.battle-suspense {
  text-align: center;
  font-size: 0.95rem;
  margin: 0.5rem 0 1rem;
  min-height: 1.5em;
  font-style: italic;
}

.battle-reveal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .battle-reveal-grid {
    grid-template-columns: 1fr;
  }
}

.battle-card-slot {
  perspective: 800px;
  min-height: 88px;
}

.battle-flip {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface, #fff);
  transform: rotateY(90deg);
  opacity: 0;
  animation: battle-flip-in 0.55s ease forwards;
}

.battle-flip img {
  width: 48px;
  height: 68px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--surface-2, #f4f4f4);
}

.battle-flip strong {
  font-size: 0.85rem;
}

.battle-climax {
  text-align: center;
  padding: 1.25rem;
  margin: 1rem 0;
  border-radius: 12px;
  border: 2px solid var(--accent, #c45c26);
  background: var(--accent-soft, rgba(196, 92, 38, 0.08));
  transform: scale(0.92);
  opacity: 0;
}

.battle-climax.show {
  animation: battle-climax-pop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.battle-climax.tie {
  border-color: var(--line);
}

.battle-cheer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
}

.battle-cheer button {
  font-size: 1.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.battle-cheer button:active {
  transform: scale(1.2);
}

.battle-cheer button.picked {
  border-color: var(--accent);
  background: var(--accent-soft, rgba(0, 0, 0, 0.05));
}

.battle-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.battle-skip {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.75rem;
  opacity: 0.7;
}

.battle-gallery .deck-col {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem;
}

.battle-mvp {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  border-radius: 8px;
  background: var(--accent-soft, rgba(0, 0, 0, 0.04));
  font-size: 0.85rem;
}

.battle-mvp img {
  width: 40px;
  height: 56px;
  object-fit: contain;
}

/* Editor */
.battle-deck-power {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--accent, #c45c26);
}

.battle-deck-card-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.25rem 0;
  font-size: 0.8rem;
}

.battle-deck-card-row img {
  width: 28px;
  height: 40px;
  object-fit: contain;
  border-radius: 3px;
}

.battle-deck-card-row button {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
}

.battle-inv-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  text-align: left;
  margin: 0.2rem 0;
  padding: 0.35rem;
  font-size: 0.8rem;
}

.battle-inv-row img {
  width: 32px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.battle-quick-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}

.battle-quick-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.battle-streak {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft, rgba(0, 0, 0, 0.06));
  margin-left: 0.5rem;
}

@keyframes battle-vs-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes battle-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes battle-flip-in {
  to {
    transform: rotateY(0);
    opacity: 1;
  }
}

@keyframes battle-climax-pop {
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes battle-confetti-fall {
  to {
    transform: translateY(120vh) rotate(720deg);
    opacity: 0;
  }
}

.battle-confetti {
  position: fixed;
  width: 8px;
  height: 8px;
  top: -10px;
  pointer-events: none;
  z-index: 99;
  animation: battle-confetti-fall 2.5s ease-in forwards;
}

@media (prefers-reduced-motion: reduce) {
  .battle-vs-mid,
  .battle-flip,
  .battle-climax.show,
  .battle-power-fill {
    animation: none !important;
    transition: none !important;
  }
  .battle-flip {
    transform: none;
    opacity: 1;
  }
}
