/* pokemon-party: a 3×2 grid of flip cards inside the shared arena. */

.arena.party {
  height: auto;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 16px;
  margin-bottom: 1.25rem;
}

/* ── Flip card ── */
.card {
  position: relative; /* sit above the arena's grid lines */
  height: 240px;
  perspective: 900px;
  outline: none;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
}

.card.ready:hover .card-inner,
.card.ready:focus-visible .card-inner,
.card.ready.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #1e293b;
  border-radius: 12px;
  background: #0f1117;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.card.ready:hover .card-face,
.card.ready:focus-visible .card-face {
  border-color: #6366f1;
  box-shadow: 0 0 24px rgba(99,102,241,.35);
}

/* front: artwork + name */
.card-front {
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1rem;
}

.card-front img {
  width: 128px;
  height: 128px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(99,102,241,.45));
}

.card-name {
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  color: #a5b4fc;
  text-transform: capitalize;
}

.card-id {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: #475569;
}

/* back: types + stat bars */
.card-back {
  transform: rotateY(180deg);
  padding: 0.9rem 1rem;
  gap: 0.45rem;
}

.card-back .card-name {
  font-size: 0.85rem;
}

.types {
  display: flex;
  gap: 4px;
  margin-bottom: 0.2rem;
}

.type {
  font-size: 0.6rem;
  font-family: monospace;
  padding: 2px 8px;
  border-radius: 999px;
  background: #1e2d45;
  color: #60a5fa;
}

.stat {
  display: grid;
  grid-template-columns: 3.2rem 1.8rem 1fr;
  align-items: center;
  gap: 6px;
}

.stat .stat-label {
  font-size: 0.6rem;
}

.stat-num {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: #a5b4fc;
  text-align: right;
}

.stat-bar {
  height: 5px;
  border-radius: 999px;
  background: #1e293b;
  overflow: hidden;
}

.stat-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

/* loading + error states (front face only, no flip) */
.card.loading .card-front::before {
  content: '';
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #13192a;
  animation: pulse 1.2s ease-in-out infinite;
}

.card.error .card-front {
  color: #ef4444;
  font-size: 0.75rem;
  text-align: center;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

@media (max-width: 700px) {
  .arena.party { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .card-inner { transition: none; }
  .card.loading .card-front::before { animation: none; }
}

.card-measures {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid #1e293b;
  font-size: 0.65rem;
  color: #64748b;
}
