/* ============================================================
   AI UNIVERSE SMACKDOWN · BATTLE THEATER & ANIMATION
   Tactile Comic Physics, Screen Shake & Mobile Responsive
   ============================================================ */

.arena-wrapper {
  background: #0a0c13;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-elevated);
}

@media (max-width: 640px) {
  .arena-wrapper {
    padding: 14px 10px;
    border-radius: var(--radius-md);
  }
}

/* Screen Shake Effect */
.screen-shake {
  animation: shakeCanvas 0.35s var(--ease-spring);
}

@keyframes shakeCanvas {
  0%, 100% { transform: translate(0, 0) scale(1); }
  20% { transform: translate(-4px, 3px) scale(1.02); }
  40% { transform: translate(4px, -3px) scale(1.01); }
  60% { transform: translate(-2px, 2px) scale(1.01); }
  80% { transform: translate(2px, -1px) scale(1); }
}

/* Battle Stage HUD */
.arena-hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 580px) {
  .arena-hud {
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
  }
}

.fighter-hud {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fighter-hud.p2 {
  align-items: flex-end;
}

.fighter-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.fighter-name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-pure);
}

.fighter-title {
  font-size: 10px;
  color: var(--accent-muted);
}

.hp-bar-wrap {
  width: 100%;
  max-width: 220px;
  height: 12px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  position: relative;
}

.hp-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981);
  transition: width 0.3s var(--ease-spring);
}

.hp-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px #000000;
}

/* VS Center */
.vs-emblem {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.vs-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-pure);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.round-text {
  font-size: 9.5px;
  font-family: var(--font-mono);
  color: var(--accent-muted);
  font-weight: 600;
  margin-top: 2px;
}

/* Main Battle Stage Canvas / Stage */
.battle-stage {
  position: relative;
  width: 100%;
  height: 280px;
  background: linear-gradient(180deg, #0d0f18 0%, #06070a 100%);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 40px 30px;
}

@media (max-width: 580px) {
  .battle-stage {
    padding: 0 16px 20px;
    height: 220px;
  }
}

/* Stage Floor Grid */
.battle-stage::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -50%;
  right: -50%;
  height: 90px;
  background: 
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  transform: perspective(260px) rotateX(60deg);
  transform-origin: bottom center;
  pointer-events: none;
}

/* Fighter Sprites */
.fighter-entity {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s var(--ease-spring);
}

.fighter-sprite {
  width: 90px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.7));
  animation: fighterFloat 2.2s ease-in-out infinite alternate;
  position: relative;
}

@media (max-width: 580px) {
  .fighter-sprite {
    font-size: 42px;
    width: 70px;
    height: 80px;
  }
}

@keyframes fighterFloat {
  0% { transform: translateY(0) scaleY(1); }
  100% { transform: translateY(-6px) scaleY(1.02); }
}

/* Combat Actions */
.fighter-entity.attacking {
  animation: attackDash 0.35s var(--ease-spring);
}

.fighter-entity.p2.attacking {
  animation: attackDashP2 0.35s var(--ease-spring);
}

@keyframes attackDash {
  0% { transform: translateX(0); }
  50% { transform: translateX(60px) scale(1.1); }
  100% { transform: translateX(0); }
}

@keyframes attackDashP2 {
  0% { transform: translateX(0); }
  50% { transform: translateX(-60px) scale(1.1); }
  100% { transform: translateX(0); }
}

.fighter-entity.hurt {
  animation: hurtFlinch 0.35s var(--ease-spring);
}

@keyframes hurtFlinch {
  0%, 100% { transform: translateX(0); filter: brightness(1); }
  25% { transform: translateX(-12px) rotate(-4deg); filter: brightness(2); }
  75% { transform: translateX(12px) rotate(4deg); filter: brightness(1.8); }
}

/* Comic Word Popups */
.comic-word {
  position: absolute;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 2px 4px #000;
  pointer-events: none;
  animation: comicPop 0.6s var(--ease-bounce) forwards;
  z-index: 30;
}

@keyframes comicPop {
  0% { transform: scale(0.2) rotate(-10deg); opacity: 0; }
  40% { transform: scale(1.3) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) translateY(-30px); opacity: 0; }
}

/* Roast Bubble */
.roast-bubble {
  position: absolute;
  top: -55px;
  background: #ffffff;
  color: #090a0f;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  max-width: 180px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  pointer-events: none;
  animation: bubblePop 0.25s var(--ease-bounce);
  z-index: 20;
  line-height: 1.35;
}

.roast-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: #ffffff transparent;
}

@keyframes bubblePop {
  0% { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Damage Number */
.damage-pop {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 6px #000000;
  animation: dmgRise 0.7s ease-out forwards;
  pointer-events: none;
  z-index: 25;
}

@keyframes dmgRise {
  0% { transform: translateY(0) scale(0.7); opacity: 1; }
  50% { transform: translateY(-25px) scale(1.2); opacity: 1; }
  100% { transform: translateY(-50px) scale(1); opacity: 0; }
}

/* Arena Controls */
.arena-controls {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fighter-select-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(14, 17, 26, 0.8);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.fighter-chooser {
  display: flex;
  gap: 4px;
}

.select-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s var(--ease-spring);
}

.select-btn:hover {
  color: var(--text-pure);
  background: rgba(255, 255, 255, 0.08);
}

.select-btn.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-medium);
  color: var(--text-pure);
}

/* Action Buttons (Mobile-first Grid) */
.action-buttons-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto auto;
  gap: 8px;
}

@media (max-width: 768px) {
  .action-buttons-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .action-buttons-row {
    grid-template-columns: 1fr 1fr;
  }
}

.skill-btn {
  background: rgba(18, 22, 33, 0.9);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.18s var(--ease-spring);
}

.skill-btn:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
  background: rgba(25, 30, 45, 0.95);
  color: var(--text-pure);
}

.skill-btn.ultimate {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-medium);
  color: var(--text-pure);
}

/* Combat Feed */
.combat-feed {
  background: #08090d;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  max-height: 100px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.feed-item {
  color: var(--accent-muted);
  line-height: 1.4;
}

.feed-item.highlight {
  color: var(--text-pure);
}

.feed-item.crit {
  color: #ef4444;
}
