/* ==========================================================================
   Dragon Ball Clash Action TCG — Arena Battlefield Layout Engine
   CSS Grid 3-zone vertical layout, HP bars, Ki gauge, fan hand, reactions
   ========================================================================== */

/* ── Arena Screen: 3-Zone Vertical Grid ──────────────────────────────────── */
#arena-screen,
#scene-arena {
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr;
  flex-direction: column;
  height: 100%;
  background: url('../imagens/background_arenapc1.jpg') center center / cover no-repeat !important;
  position: relative;
  overflow: hidden;
  padding: 0;
  gap: 0;
}

@media (max-width: 768px) {
  #arena-screen,
  #scene-arena {
    background: url('../imagens/background_arenamobile1.png') center center / cover no-repeat !important;
  }
}

/* ── FX Canvas Overlay (Sits on top of UI overlays for blinding beam visibility) ── */
#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10000 !important;
}

/* ── Zone 1: Phase Banner + Opponent HUD ──────────────────────────────────── */
.arena-zone-top {
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

/* Turn Phase Banner */
.phase-banner {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 7px 20px;
  border-radius: var(--r-full);
  text-align: center;
  font-weight: 900;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--t-fast);
}

.phase-banner.phase-player {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.92), rgba(255, 140, 0, 0.92));
  color: #000;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.phase-banner.phase-opponent {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.85), rgba(127, 29, 29, 0.85));
  color: #fff;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.3);
}

.phase-banner.phase-reaction {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.92), rgba(6, 182, 212, 0.92));
  color: #000;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.4);
  animation: reactionPulse 1s infinite alternate;
}

@keyframes reactionPulse {
  0% { box-shadow: 0 0 16px rgba(34, 211, 238, 0.3); }
  100% { box-shadow: 0 0 28px rgba(34, 211, 238, 0.6); }
}

/* Official DBZ Arcade Fighter HUD Box */
.fighter-hud {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border-radius: 8px;
  max-width: 540px;
  width: 100%;
  position: relative;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(10, 14, 26, 0.98) 100%);
  border: 2px solid rgba(255, 215, 0, 0.6);
  box-shadow: 
    0 0 20px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 15px rgba(255, 215, 0, 0.25);
  backdrop-filter: blur(12px);
  overflow: visible;
  margin: 0 auto;
}

.fighter-hud.hud-player {
  border-top: 3px solid #ffd700;
  border-left: 3px solid #ffd700;
}

.fighter-hud.hud-opponent {
  border-top: 3px solid #ef4444;
  border-right: 3px solid #ef4444;
}

/* Portrait */
.hud-portrait {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 215, 0, 0.4);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,215,0,0.06), rgba(0,0,0,0.5));
  position: relative;
  box-shadow: 0 0 12px rgba(255,215,0,0.1);
}

/* Animated conic gradient ring */
.hud-portrait::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255,215,0,0.3), transparent 25%, rgba(0,200,255,0.2) 50%, transparent 75%, rgba(255,215,0,0.3));
  animation: spinRing 4s linear infinite;
  z-index: -1;
}

.hud-portrait.awakened {
  border-color: var(--shield-cyan);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.6);
  animation: awakenGlow 2s infinite alternate;
}

@keyframes awakenGlow {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.2); }
}

.hud-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Fighter Info Column */
.hud-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud-name {
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.awaken-badge {
  font-size: 0.55rem;
  font-weight: 900;
  background: linear-gradient(135deg, #22d3ee, #06b6d4);
  color: #000;
  padding: 1px 6px;
  border-radius: var(--r-xs);
  display: none;
}

.hud-portrait.awakened ~ .hud-info .awaken-badge {
  display: inline-block;
}

/* HP Bar */
.hp-bar-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hp-bar-track {
  flex: 1;
  height: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--r-full);
  overflow: hidden;
  position: relative;
}

.hp-bar-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, #22d3ee, #06b6d4);
  transition: width 0.4s var(--ease-out);
  position: relative;
  overflow: hidden;
}

/* Shimmer running across HP bar */
.hp-bar-fill::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 80%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: shimmerSweep 3s linear infinite;
}

.hp-bar-fill.hp-low {
  background: linear-gradient(90deg, #ef4444, #b91c1c);
}

.hp-bar-fill.hp-mid {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.hp-bar-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 30px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
  border-radius: var(--r-full);
}

.hp-text {
  font-size: 0.68rem;
  font-weight: 900;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 68px;
  text-align: right;
}

/* Shields Row */
.shields-row {
  display: flex;
  gap: 3px;
}

.shield-pip {
  width: 11px;
  height: 16px;
  border-radius: 2px 2px 5px 5px;
  background: linear-gradient(180deg, #5ee7f5 0%, #22d3ee 40%, #0891b2 100%);
  border: 1px solid rgba(255,255,255,0.35);
  transition: all var(--t-fast);
  box-shadow: 0 0 4px rgba(34,211,238,0.3), inset 0 1px 0 rgba(255,255,255,0.4);
}

.shield-pip.broken {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.06);
  opacity: 0.25;
  transform: scale(0.75);
  box-shadow: none;
}

/* Ki Gauge */
.ki-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ki-pips {
  display: flex;
  gap: 3px;
}

.ki-pip {
  width: 10px;
  height: 20px;
  border-radius: 2px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255, 215, 0, 0.12);
  transition: all var(--t-fast);
}

.ki-pip.filled {
  background: linear-gradient(180deg, #ffe566 0%, #ffd700 40%, #ff8c00 100%);
  border-color: rgba(255, 215, 0, 0.7);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.4), 0 0 16px rgba(255,215,0,0.15);
  animation: pulseGlow 2s ease-in-out infinite;
}

.ki-label {
  font-size: 0.68rem;
  font-weight: 900;
  color: var(--ki-yellow);
}

/* Open Guard Warning */
.guard-warn {
  position: absolute;
  top: -8px;
  right: 12px;
  background: var(--dmg-red);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: var(--r-full);
  text-transform: uppercase;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
  display: none;
}

.fighter-hud.open-guard .guard-warn { display: block; }

/* ── Zone 2: Battlefield Center ───────────────────────────────────────────── */
.arena-zone-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 20;
  padding: 8px;
  overflow: visible;
  flex: 1;
}

/* Drop Zone (Fits 1 full 5:7 TCG card without clipping) */
/* Central Drop Zone — Completely Transparent Center Field */
.drop-zone {
  width: 220px;
  height: 280px;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
  transition: all var(--t-med);
}

.drop-zone::before {
  display: none !important;
}

.drop-zone.drag-over {
  background: rgba(255, 215, 0, 0.08) !important;
  border-radius: var(--r-md);
  box-shadow: inset 0 0 35px rgba(255, 215, 0, 0.3) !important;
}

.dz-label {
  display: none !important;
}

/* Minimal Action Indicator Badge */
.minimal-action-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(4, 7, 16, 0.9);
  border: 1.5px solid var(--arcade-gold);
  border-radius: var(--r-full);
  padding: 6px 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 215, 0, 0.5);
  margin-bottom: 12px;
  animation: pulseGlow 1.5s infinite alternate, floatY 3s ease-in-out infinite;
  z-index: 10;
}

.mab-icon {
  font-size: 1.1rem;
}

.mab-text {
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--arcade-gold);
  letter-spacing: 1px;
  white-space: nowrap;
}

/* Played Card Center Display — Bigger Size with Holo Aura */
.played-card-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: cardPlayEntry 0.4s var(--ease-out);
}

.played-card-slot .card {
  width: 175px !important;
  height: 245px !important;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.95), 0 0 35px rgba(255, 215, 0, 0.6) !important;
  border-width: 2px !important;
}

@keyframes cardPlayEntry {
  0% { transform: scale(0.6) translateY(30px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Reaction Timer */
.reaction-strip {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast);
  z-index: 100;
}

.reaction-strip.active { opacity: 1; }

.reaction-label {
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--dmg-red);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.timer-track {
  width: 200px;
  height: 6px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--r-full);
  overflow: hidden;
}

.timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ef4444, #ff8c00);
  transition: width 0.1s linear;
}

/* ── Zone 3: Player HUD + Hand + Action Buttons ───────────────────────────── */
.arena-zone-bot {
  padding: 6px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
  overflow: visible;
}

/* Action buttons row */
/* Official DBZ Action Buttons Row */
.action-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  margin: 10px auto;
  width: 100%;
  max-width: 580px;
  z-index: 60;
}

/* Charge Ki Button - DBZ Energetic Golden Metallic Bevel Button */
.btn-charge {
  flex: 1.4;
  height: 52px;
  position: relative;
  transform: skewX(-12deg);
  border-radius: 6px;
  background: linear-gradient(135deg, #ffe600 0%, #ff9500 50%, #d97706 100%);
  border: 2px solid #ffffff;
  box-shadow: 
    0 0 20px rgba(255, 215, 0, 0.75),
    inset 0 2px 0 rgba(255, 255, 255, 0.8),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4),
    0 4px 15px rgba(0, 0, 0, 0.8);
  color: #000000;
  font-family: var(--font-title, 'Outfit', 'Arial Black', sans-serif);
  font-weight: 900;
  font-style: italic;
  font-size: 0.96rem;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-charge > * {
  transform: skewX(12deg);
}

.btn-charge::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 70%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: shimmerSweep 2.5s linear infinite;
  pointer-events: none;
}

.btn-charge:hover:not(:disabled) {
  transform: skewX(-12deg) translateY(-2px) scale(1.02);
  background: linear-gradient(135deg, #ffffff 0%, #ffe600 40%, #ff9500 100%);
  box-shadow: 
    0 0 30px rgba(255, 230, 0, 0.95),
    0 0 50px rgba(255, 149, 0, 0.6),
    0 6px 20px rgba(0, 0, 0, 0.9);
  border-color: #ffffff;
}

.btn-charge:active:not(:disabled) {
  transform: skewX(-12deg) translateY(1px) scale(0.98);
}

.btn-charge:disabled {
  opacity: 0.45;
  filter: grayscale(0.8);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-charge.overcharge {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #991b1b 100%);
  color: #ffffff;
  border-color: #fca5a5;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
}

/* Pass Turn Button - DBZ Dark Titanium Metallic Bevel Button */
.btn-pass {
  flex: 1;
  height: 52px;
  position: relative;
  transform: skewX(-12deg);
  border-radius: 6px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 60%, #020617 100%);
  border: 2px solid #38bdf8;
  box-shadow: 
    0 0 15px rgba(56, 189, 248, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.25),
    0 4px 15px rgba(0, 0, 0, 0.8);
  color: #ffffff;
  font-family: var(--font-title, 'Outfit', 'Arial Black', sans-serif);
  font-weight: 900;
  font-style: italic;
  font-size: 0.92rem;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-pass > * {
  transform: skewX(12deg);
}

.btn-pass:hover:not(:disabled) {
  transform: skewX(-12deg) translateY(-2px) scale(1.02);
  background: linear-gradient(135deg, #334155 0%, #1e293b 60%, #0f172a 100%);
  border-color: #00f2fe;
  box-shadow: 
    0 0 25px rgba(0, 242, 254, 0.75),
    0 6px 20px rgba(0, 0, 0, 0.9);
  color: #00f2fe;
}

.btn-pass:active:not(:disabled) {
  transform: skewX(-12deg) translateY(1px) scale(0.98);
}

.btn-pass:disabled {
  opacity: 0.45;
  filter: grayscale(0.8);
  cursor: not-allowed;
  box-shadow: none;
}

/* Hand Container — Fan Layout (Overflow visible so card hover elevation is never cut off!) */
.hand-zone {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 185px;
  padding: 10px 12px 4px;
  position: relative;
  overflow: visible;
  z-index: 100;
}
/* ── Beam Clash Overlay (Transparent center so vertical canvas beam clash is 100% visible) ── */
.beam-overlay {
  display: none !important;
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(4, 6, 14, 0.75) 85%) !important;
  z-index: 9000 !important;
  align-items: center;
  justify-content: space-between;
  padding: 60px 20px;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast);
}

.beam-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: all !important;
}

.beam-title {
  font-size: 2rem;
  font-weight: 900;
  font-style: italic;
  color: var(--ki-yellow);
  text-shadow: 0 0 20px rgba(255, 140, 0, 0.6);
  text-transform: uppercase;
}

.beam-bar-track {
  width: 80%;
  max-width: 480px;
  height: 20px;
  background: rgba(255,255,255,0.08);
  border: 2px solid var(--ki-yellow);
  border-radius: var(--r-full);
  overflow: hidden;
}

.beam-bar-fill {
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, #22d3ee, #ffd700);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.5);
  transition: width 0.1s linear;
}

.btn-mash {
  background: radial-gradient(circle, #ef4444, #7f1d1d);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 900;
  padding: 20px 44px;
  border-radius: var(--r-full);
  border: 3px solid #fff;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
  animation: mashPulse 0.8s infinite alternate;
}

@keyframes mashPulse {
  0% { transform: scale(1); box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
  100% { transform: scale(1.06); box-shadow: 0 0 36px rgba(239, 68, 68, 0.7); }
}

/* ── Battle Log ───────────────────────────────────────────────────────────── */
.battle-log {
  position: absolute;
  bottom: 16px;
  left: 16px;
  width: 220px;
  max-height: 110px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  pointer-events: none;
  z-index: 20;
  font-size: 0.7rem;
}

.log-line {
  background: rgba(0,0,0,0.55);
  padding: 3px 8px;
  border-radius: var(--r-xs);
  border-left: 2.5px solid var(--ki-yellow);
  color: #ccc;
}

.log-line.damage { border-left-color: var(--dmg-red); }
.log-line.evade { border-left-color: var(--c-evade); }

/* ── Cutscene Banner ──────────────────────────────────────────────────────── */
.anime-cutscene-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.anime-cutscene-overlay.active { opacity: 1; }

.cutscene-banner {
  width: 100vw;
  height: 160px;
  background: linear-gradient(135deg, rgba(0,0,0,0.95), rgba(20,20,30,0.95));
  border-top: 3px solid var(--ki-yellow);
  border-bottom: 3px solid var(--ki-yellow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8%;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
  transform: skewY(-3deg);
  position: relative;
}

.cutscene-speed-lines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 10px, rgba(255,255,255,0.06) 10px 12px);
  animation: speedLines 0.2s linear infinite;
  pointer-events: none;
}

@keyframes speedLines {
  0% { transform: translateX(0); }
  100% { transform: translateX(-40px); }
}

.cutscene-portrait { font-size: 4.5rem; z-index: 2; filter: drop-shadow(0 0 16px var(--ki-yellow)); }
.cutscene-text-box { z-index: 2; text-align: right; }
.cutscene-title {
  font-size: 2.2rem;
  font-weight: 900;
  font-style: italic;
  color: var(--ki-yellow);
  text-shadow: 0 0 16px rgba(255, 140, 0, 0.6);
  text-transform: uppercase;
}
.cutscene-quote {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  font-style: italic;
}

/* ── Tutorial Highlight ───────────────────────────────────────────────────── */
.tutorial-highlight {
  outline: 3px solid var(--ki-yellow) !important;
  box-shadow: 0 0 24px rgba(255, 140, 0, 0.5) !important;
  z-index: 999 !important;
}

/* Leader selection locked state */
.leader-pick.locked {
  filter: grayscale(0.8);
  opacity: 0.6;
}

/* ── Screen shake animations ──────────────────────────────────────────────── */
.screen-shake-light {
  animation: shakeL 0.3s ease both;
}
.screen-shake-heavy {
  animation: shakeH 0.4s ease both;
}

@keyframes shakeL {
  10%, 90% { transform: translate(-2px, 0); }
  20%, 80% { transform: translate(3px, 0); }
  30%, 50%, 70% { transform: translate(-4px, 0); }
  40%, 60% { transform: translate(4px, 0); }
}

@keyframes shakeH {
  10%, 90% { transform: translate(-5px, 3px); }
  20%, 80% { transform: translate(7px, -5px); }
  30%, 50%, 70% { transform: translate(-9px, 7px); }
  40%, 60% { transform: translate(9px, -7px); }
}

/* ── Arena Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .arena-zone-top, .arena-zone-bot { padding: 6px 10px; }

  .phase-banner { font-size: 0.7rem; padding: 6px 14px; max-width: 92%; }

  .fighter-hud { padding: 8px 10px; max-width: 100%; }

  .hud-portrait { width: 40px; height: 40px; font-size: 1.2rem; }
  .hud-name { font-size: 0.78rem; }
  .hp-bar-track { height: 7px; }
  .hp-text { font-size: 0.6rem; min-width: 56px; }
  .shield-pip { width: 9px; height: 13px; }
  .ki-pip { width: 8px; height: 16px; }

  .drop-zone { width: 220px; height: 110px; }
  .dz-label { font-size: 0.68rem; }

  .hand-zone { min-height: 145px; }

  .btn-charge { font-size: 0.72rem; padding: 8px 16px; }
  .btn-pass { font-size: 0.68rem; padding: 8px 14px; }

  .battle-log { display: none; }

  .beam-title { font-size: 1.3rem; }
  .btn-mash { font-size: 1.1rem; padding: 16px 32px; }
}

#arena-screen.active { display: grid !important; }


/* ── VISUAL JUICE & ANIME ACTION ANIMATIONS ───────────────────────────── */
@keyframes shakeScreen {
  0% { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(-8px, 6px) rotate(-1deg); }
  40% { transform: translate(8px, -6px) rotate(1deg); }
  60% { transform: translate(-6px, -4px) rotate(-0.5deg); }
  80% { transform: translate(6px, 4px) rotate(0.5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.shake-screen {
  animation: shakeScreen 0.35s ease-in-out !important;
}

.floating-damage-popup {
  position: absolute;
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-weight: 900;
  font-size: 2.2rem;
  color: #ff3b30;
  text-shadow: 0 0 14px #ff3b30, 0 2px 8px #000;
  pointer-events: none;
  z-index: 500;
  animation: floatDamageUp 0.85s ease-out forwards;
}

@keyframes floatDamageUp {
  0% { opacity: 1; transform: translateY(0) scale(0.8); }
  40% { transform: translateY(-35px) scale(1.35); }
  100% { opacity: 0; transform: translateY(-70px) scale(1); }
}

/* Manga-style Impact Starburst on HP Bar */
.manga-impact-starburst {
  position: absolute;
  width: 110px;
  height: 110px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9000;
  animation: starburstPop 0.65s ease-out forwards;
  background: radial-gradient(circle at center, #fff 0%, #ffd700 35%, #ff3b30 65%, transparent 100%);
  clip-path: polygon(
    50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%,
    50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%
  );
}

@keyframes starburstPop {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.3) rotate(-15deg); }
  35%  { opacity: 1; transform: translate(-50%, -50%) scale(1.3) rotate(8deg); }
  60%  { opacity: 1; transform: translate(-50%, -50%) scale(1.1) rotate(-4deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5) rotate(0deg); }
}

.impact-damage-num {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-weight: 900;
  font-size: 1.4rem;
  color: #000;
  text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
  white-space: nowrap;
  letter-spacing: -1px;
}

/* Red Flash Overlay on Impact */
.impact-flash-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 30, 0, 0.28);
  pointer-events: none;
  z-index: 8999;
  animation: impactFlash 0.26s ease-out forwards;
}

@keyframes impactFlash {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* Pixel Art Sprite Damage Popup Number */
.sprite-damage-number {
  font-family: var(--font-title, 'Outfit', 'Arial Black', sans-serif);
  font-weight: 900;
  font-size: 2.5rem;
  color: #ff2a2a;
  text-shadow: 
    -2px -2px 0 #000,  
     2px -2px 0 #000,
    -2px  2px 0 #000,
     2px  2px 0 #000,
     0 0 12px #ff8800,
     0 0 20px #ffff00;
  letter-spacing: -1px;
  animation: spriteDamagePop 0.75s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  white-space: nowrap;
}

@keyframes spriteDamagePop {
  0% { opacity: 0; transform: translateX(-50%) scale(0.2) translateY(20px); }
  25% { opacity: 1; transform: translateX(-50%) scale(1.4) translateY(-10px); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1) translateY(-25px); }
  100% { opacity: 0; transform: translateX(-50%) scale(1.0) translateY(-50px); }
}

/* Official DBZ Fighting Game Action Slash Banner */
.dbz-action-banner-container {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) scaleX(0);
  width: 92%;
  max-width: 680px;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 9200;
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease-out;
}

.dbz-action-banner-container.active {
  opacity: 1;
  transform: translate(-50%, -50%) scaleX(1);
}

.dbz-banner-slash-bg {
  position: absolute;
  inset: 0;
  transform: skewX(-16deg);
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(15, 18, 30, 0.96) 12%, rgba(10, 12, 22, 0.98) 88%, rgba(0,0,0,0) 100%);
  border-top: 3px solid #ffd700;
  border-bottom: 3px solid #ffd700;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.7), inset 0 0 20px rgba(255, 215, 0, 0.35);
}

.dbz-banner-slash-bg.act-charge {
  border-color: #00f2fe;
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.75), inset 0 0 20px rgba(0, 242, 254, 0.35);
}

.dbz-banner-slash-bg.act-ultimate {
  border-color: #ff2a2a;
  box-shadow: 0 0 32px rgba(255, 42, 42, 0.9), inset 0 0 25px rgba(255, 42, 42, 0.4);
}

.dbz-banner-slash-bg.act-special {
  border-color: #ff9500;
  box-shadow: 0 0 28px rgba(255, 149, 0, 0.8), inset 0 0 20px rgba(255, 149, 0, 0.35);
}

.dbz-banner-slash-bg.act-physical {
  border-color: #eab308;
  box-shadow: 0 0 25px rgba(234, 179, 8, 0.75), inset 0 0 20px rgba(234, 179, 8, 0.3);
}

.dbz-banner-slash-bg.act-evade {
  border-color: #a855f7;
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.75), inset 0 0 20px rgba(168, 85, 247, 0.35);
}

.dbz-banner-slash-bg.act-awaken {
  border-color: #38ef7d;
  box-shadow: 0 0 30px rgba(56, 239, 125, 0.85), inset 0 0 25px rgba(56, 239, 125, 0.4);
}

.dbz-banner-content {
  position: relative;
  z-index: 2;
}

/* ── CARD CLASH REACTION ANIMATION ────────────────────────────────────────── */
.card-clash-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 9100;
}

.clash-card-wrapper {
  position: absolute;
  width: 130px;
  height: 182px;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.clash-card-wrapper.left {
  animation: clashSlideLeft 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.clash-card-wrapper.right {
  animation: clashSlideRight 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.clash-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 12px rgba(255, 215, 0, 0.6));
  border-radius: 8px;
}

.clash-card-title {
  display: none;
}

@keyframes clashSlideLeft {
  0% { transform: translate(-300px, -50%) rotate(-25deg) scale(0.5); opacity: 0; }
  75% { transform: translate(-80px, -50%) rotate(4deg) scale(1.15); opacity: 1; }
  100% { transform: translate(-65px, -50%) rotate(0deg) scale(1); opacity: 1; }
}

@keyframes clashSlideRight {
  0% { transform: translate(300px, -50%) rotate(25deg) scale(0.5); opacity: 0; }
  75% { transform: translate(80px, -50%) rotate(-4deg) scale(1.15); opacity: 1; }
  100% { transform: translate(65px, -50%) rotate(0deg) scale(1); opacity: 1; }
}

.clash-impact-star {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 170px;
  height: 170px;
  background: radial-gradient(circle at center, #ffffff 0%, #ffd700 35%, #ff3b30 70%, transparent 100%);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: clashBurst 0.65s ease-out 0.28s forwards;
  z-index: 9150;
  pointer-events: none;
}

@keyframes clashBurst {
  0% { transform: translate(-50%, -50%) scale(0.2) rotate(-20deg); opacity: 1; }
  40% { transform: translate(-50%, -50%) scale(1.4) rotate(10deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.85) rotate(0deg); opacity: 0; }
}

.dbz-banner-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dbz-banner-badge {
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 3px;
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
  margin-bottom: 2px;
}

.dbz-banner-title {
  font-family: var(--font-title, 'Outfit', 'Arial Black', sans-serif);
  font-weight: 900;
  font-size: 1.85rem;
  font-style: italic;
  letter-spacing: 2px;
  color: #ffffff;
  text-transform: uppercase;
  text-shadow: 
    -2px -2px 0 #000,  
     2px -2px 0 #000,
    -2px  2px 0 #000,
     2px  2px 0 #000,
     0 0 15px #ffd700;
  line-height: 1.05;
}

.dbz-banner-sub {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 2px;
  color: #cbd5e1;
  text-shadow: 0 1px 4px #000;
  margin-top: 2px;
}

/* ── ANIMATED PIXEL ART FIGHTERS ON BATTLEFIELD FLOOR ─────────────────────── */
.arena-fighters-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
}

.fighter-sprite-box {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.p1-sprite {
  align-self: flex-end;
  margin-bottom: 20px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.8));
}

.p2-sprite {
  align-self: flex-start;
  margin-top: 20px;
  transform: scaleX(-1); /* Face left towards player 1 */
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.8));
}

.pixel-fighter-img, .pixel-fighter-canvas {
  width: 110px;
  height: 110px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 0 14px rgba(255, 215, 0, 0.4));
}

.fighter-shadow {
  width: 70px;
  height: 14px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  filter: blur(4px);
  margin-top: -6px;
}

.pixel-aura-flare {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.25) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.fighter-sprite-box.charging .pixel-aura-flare {
  opacity: 1;
  animation: auraPulse 0.5s infinite alternate;
}

@keyframes auraPulse {
  0% { transform: scale(0.9); opacity: 0.5; }
  100% { transform: scale(1.2); opacity: 1; }
}

/* Fighter Attack Lunge Animations */
.p1-sprite.lunge-attack {
  animation: p1Lunge 0.5s ease forwards;
}

@keyframes p1Lunge {
  0% { transform: translateX(0) scale(1); }
  40% { transform: translateX(140px) scale(1.25) rotate(5deg); }
  100% { transform: translateX(0) scale(1); }
}

.p2-sprite.lunge-attack {
  animation: p2Lunge 0.5s ease forwards;
}

@keyframes p2Lunge {
  0% { transform: scaleX(-1) translateX(0) scale(1); }
  40% { transform: scaleX(-1) translateX(140px) scale(1.25) rotate(5deg); }
  100% { transform: scaleX(-1) translateX(0) scale(1); }
}

.fighter-sprite-box.hit-recoil {
  animation: hitRecoil 0.4s ease forwards;
}

@keyframes hitRecoil {
  0% { filter: brightness(3) drop-shadow(0 0 20px red); }
  30% { transform: translateX(-20px) rotate(-10deg); }
  100% { transform: translateX(0) rotate(0deg); filter: none; }
}

@media (max-width: 768px) {
  .arena-fighters-container {
    padding: 0 10px;
  }
  .fighter-sprite-box {
    width: 80px;
    height: 80px;
  }
  .pixel-fighter-img {
    width: 70px;
    height: 70px;
  }
}



/* ==========================================================================
   OFFICIAL DOKKAN GREEN SCOUTER UI (Pixel-Perfect Cyber Tech Frame)
   ========================================================================== */

.fighter-hud.dokkan-scouter-hud {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 24px 8px 10px;
  max-width: 580px;
  width: 100%;
  border-radius: 24px 6px 24px 6px;
  overflow: visible;
  margin: 0 auto;
  backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Player HUD — Neon Green Scouter Tube Frame */
.fighter-hud.hud-player {
  background: linear-gradient(180deg, #013816 0%, #001f0c 45%, #001507 100%);
  border: 3px solid #00ff41;
  box-shadow: 
    0 0 25px rgba(0, 255, 65, 0.65),
    inset 0 0 15px rgba(0, 255, 65, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    0 6px 25px rgba(0, 0, 0, 0.95);
}

/* Opponent HUD — Crimson Red Scouter Tube Frame */
.fighter-hud.hud-opponent {
  background: linear-gradient(180deg, #3d0312 0%, #24020a 45%, #140105 100%);
  border: 3px solid #ff0055;
  box-shadow: 
    0 0 25px rgba(255, 0, 85, 0.65),
    inset 0 0 15px rgba(255, 0, 85, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    0 6px 25px rgba(0, 0, 0, 0.95);
}

/* Scouter Tech Grid / Scanlines Overlay */
.scouter-scanlines {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: 
    linear-gradient(rgba(0, 255, 65, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 65, 0.12) 1px, transparent 1px);
  background-size: 10px 10px, 10px 10px;
  pointer-events: none;
  opacity: 0.5;
}

.hud-opponent .scouter-scanlines {
  background-image: 
    linear-gradient(rgba(255, 0, 85, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 0, 85, 0.12) 1px, transparent 1px);
}

/* Right Scouter Ear Module (Capsule Corp White Metallic Ear Piece) */
.scouter-ear-cap {
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 38px;
  background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 40%, #94a3b8 100%);
  border: 2px solid #000000;
  border-radius: 6px 12px 12px 6px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.8), 0 4px 10px rgba(0, 0, 0, 0.9);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sec-slot {
  width: 6px;
  height: 18px;
  background: #1e293b;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.9);
}

.sec-slot::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 1px;
  width: 4px;
  height: 4px;
  background: #ff0055;
  border-radius: 50%;
  box-shadow: 0 0 8px #ff0055;
  animation: radarPulse 1.2s infinite alternate;
}

@keyframes radarPulse {
  0% { opacity: 0.4; }
  100% { opacity: 1; filter: brightness(1.4); }
}

/* Scouter Portrait Lock-on Ring */
.scouter-portrait-wrapper {
  position: relative;
  flex-shrink: 0;
  z-index: 5;
}

.hud-portrait {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 3px solid #00ff41;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.8), inset 0 0 10px rgba(0, 0, 0, 0.9);
  position: relative;
  background: radial-gradient(circle at 30% 30%, rgba(0, 255, 65, 0.3), #000);
  overflow: hidden;
  z-index: 2;
}

.hud-opponent .hud-portrait {
  border-color: #ff0055;
  box-shadow: 0 0 20px rgba(255, 0, 85, 0.8);
  background: radial-gradient(circle at 30% 30%, rgba(255, 0, 85, 0.3), #000);
}

.scouter-lockon-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px dashed #00ff41;
  animation: spinRing 10s linear infinite;
  pointer-events: none;
}

.hud-opponent .scouter-lockon-ring {
  border-color: #ff0055;
}

.hud-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  z-index: 5;
}

.hud-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hud-name {
  font-family: var(--font-title, 'Outfit', 'Arial Black', sans-serif);
  font-weight: 900;
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-shadow: 
    -1.5px -1.5px 0 #000,
     1.5px -1.5px 0 #000,
    -1.5px  1.5px 0 #000,
     1.5px  1.5px 0 #000,
     0 0 10px rgba(0, 255, 65, 0.6);
}

.hud-opponent .hud-name {
  text-shadow: 
    -1.5px -1.5px 0 #000,
     1.5px -1.5px 0 #000,
    -1.5px  1.5px 0 #000,
     1.5px  1.5px 0 #000,
     0 0 10px rgba(255, 0, 85, 0.6);
}

.hp-text {
  font-family: var(--font-title, 'Outfit', 'Consolas', sans-serif);
  font-weight: 900;
  font-style: italic;
  font-size: 0.9rem;
  color: #00ff41;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 0 10px rgba(0, 255, 65, 0.9);
  letter-spacing: 0.8px;
}

.hud-opponent .hp-text {
  color: #ff0055;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 0 10px rgba(255, 0, 85, 0.9);
}

.hp-bar-container {
  width: 100%;
  margin: 1px 0;
}

.hp-bar-track {
  height: 15px;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 4px;
  border: 1.5px solid #00ff41;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.95);
}

.hud-opponent .hp-bar-track {
  border-color: #ff0055;
}

.hp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f2fe 0%, #4facfe 100%);
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.95);
  transition: width 0.4s ease-out;
  clip-path: polygon(0 0, 100% 0, 97% 100%, 0 100%);
}

.hp-bar-fill.hp-low {
  background: linear-gradient(90deg, #ff0055 0%, #ef4444 100%);
  box-shadow: 0 0 14px rgba(255, 0, 85, 0.95);
}

.hud-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* Action Buttons */
.action-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  margin: 8px auto;
  width: 100%;
  max-width: 580px;
  z-index: 60;
}

.btn-charge {
  flex: 1.4;
  height: 50px;
  position: relative;
  transform: skewX(-12deg);
  border-radius: 6px;
  background: linear-gradient(135deg, #ffe600 0%, #ff9500 50%, #d97706 100%);
  border: 2px solid #ffffff;
  box-shadow: 
    0 0 20px rgba(255, 215, 0, 0.75),
    inset 0 2px 0 rgba(255, 255, 255, 0.8),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4),
    0 4px 15px rgba(0, 0, 0, 0.8);
  color: #000000;
  font-family: var(--font-title, 'Outfit', 'Arial Black', sans-serif);
  font-weight: 900;
  font-style: italic;
  font-size: 0.94rem;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-charge > * {
  transform: skewX(12deg);
}

.btn-pass {
  flex: 1;
  height: 50px;
  position: relative;
  transform: skewX(-12deg);
  border-radius: 6px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 60%, #020617 100%);
  border: 2px solid #38bdf8;
  box-shadow: 
    0 0 15px rgba(56, 189, 248, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.25),
    0 4px 15px rgba(0, 0, 0, 0.8);
  color: #ffffff;
  font-family: var(--font-title, 'Outfit', 'Arial Black', sans-serif);
  font-weight: 900;
  font-style: italic;
  font-size: 0.9rem;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-pass > * {
  transform: skewX(12deg);
}


/* ==========================================================================
   OFFICIAL DBZ ACTION SLASH BADGE & TOP TURN PHASE BANNER
   ========================================================================== */

/* Official DBZ Pending Action Slash Badge in Drop Zone */
.dbz-pending-action-badge {
  position: relative;
  width: 90%;
  max-width: 480px;
  height: 50px;
  margin: 0 auto 12px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  animation: cardPlayEntry 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dpab-bg {
  position: absolute;
  inset: 0;
  transform: skewX(-14deg);
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(15, 23, 42, 0.96) 15%, rgba(10, 14, 26, 0.98) 85%, rgba(0,0,0,0) 100%);
  border-top: 2.5px solid #ffd700;
  border-bottom: 2.5px solid #ffd700;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.75), inset 0 0 15px rgba(255, 215, 0, 0.35);
}

.dpab-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dpab-tag {
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-weight: 800;
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: #ffd700;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.8);
  margin-bottom: 1px;
}

.dpab-title {
  font-family: var(--font-title, 'Outfit', 'Arial Black', sans-serif);
  font-weight: 900;
  font-style: italic;
  font-size: 1.15rem;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-transform: uppercase;
  text-shadow: 
    -1.5px -1.5px 0 #000,  
     1.5px -1.5px 0 #000,
    -1.5px  1.5px 0 #000,
     1.5px  1.5px 0 #000,
     0 0 12px #ffd700;
  line-height: 1;
}

.dpab-sub {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  color: #cbd5e1;
  text-shadow: 0 1px 3px #000;
  margin-top: 1px;
}

/* Official DBZ Turn Phase Slash Banner */
.dbz-phase-banner {
  position: relative;
  width: 92%;
  max-width: 580px;
  height: 44px;
  margin: 0 auto 8px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  transition: all 0.3s ease-out;
}

.dbz-phase-bg {
  position: absolute;
  inset: 0;
  transform: skewX(-14deg);
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(255, 215, 0, 0.92) 15%, rgba(255, 140, 0, 0.96) 50%, rgba(255, 215, 0, 0.92) 85%, rgba(0,0,0,0) 100%);
  border-top: 2.5px solid #ffffff;
  border-bottom: 2.5px solid #ffffff;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.75), inset 0 0 15px rgba(255, 255, 255, 0.4);
}

.phase-player .dbz-phase-bg {
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(255, 215, 0, 0.95) 15%, rgba(255, 140, 0, 0.98) 50%, rgba(255, 215, 0, 0.95) 85%, rgba(0,0,0,0) 100%);
  border-color: #ffffff;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.8), inset 0 0 15px rgba(255, 255, 255, 0.5);
}

.phase-opponent .dbz-phase-bg {
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(239, 68, 68, 0.92) 15%, rgba(185, 28, 28, 0.95) 50%, rgba(239, 68, 68, 0.92) 85%, rgba(0,0,0,0) 100%);
  border-color: #ff8888;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.8), inset 0 0 15px rgba(255, 255, 255, 0.3);
}

.phase-reaction .dbz-phase-bg {
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0, 242, 254, 0.92) 15%, rgba(6, 182, 212, 0.95) 50%, rgba(0, 242, 254, 0.92) 85%, rgba(0,0,0,0) 100%);
  border-color: #ffffff;
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.85), inset 0 0 15px rgba(255, 255, 255, 0.5);
  animation: reactionGlowPulse 0.9s infinite alternate;
}

.dbz-phase-badge {
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-weight: 800;
  font-size: 0.68rem;
  letter-spacing: 2px;
  color: #000000;
  opacity: 0.85;
  margin-right: 6px;
}

.phase-opponent .dbz-phase-badge {
  color: #ffd700;
  opacity: 1;
}

.dbz-phase-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.dbz-phase-text {
  font-family: var(--font-title, 'Outfit', 'Arial Black', sans-serif);
  font-weight: 900;
  font-style: italic;
  font-size: 1.02rem;
  letter-spacing: 1.8px;
  color: #000000;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

.phase-opponent .dbz-phase-text {
  color: #ffffff;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}


/* Mobile Responsive Fix for Top Turn Phase Banner */
@media (max-width: 768px) {
  .dbz-phase-banner {
    width: 95vw !important;
    max-width: 95vw !important;
    height: 38px !important;
    margin: 0 auto 4px auto !important;
    overflow: hidden !important;
    padding: 0 8px !important;
    box-sizing: border-box !important;
  }

  .dbz-phase-content {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    white-space: nowrap !important;
  }

  .dbz-phase-badge {
    font-size: clamp(0.55rem, 2.4vw, 0.72rem) !important;
    letter-spacing: 0.5px !important;
    margin-right: 2px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .dbz-phase-text {
    font-size: clamp(0.64rem, 2.7vw, 0.88rem) !important;
    letter-spacing: 0.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex-shrink: 1 !important;
  }
}


/* ── ULTRA RESPONSIVE MOBILE FIX ─────────────────────────── */
@media (max-width: 768px) {
  #scene-arena.active {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important; /* For iOS Safari */
    overflow: hidden !important;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) 0 !important;
    box-sizing: border-box !important;
  }
  
  /* Scale down the arena content proportionally */
  .arena-inner, .arena-layout-container {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
  }
  
  .arena-zone-top, .arena-zone-bot {
    flex-shrink: 0 !important;
    padding: 4px 8px !important;
  }
  
  .arena-zone-mid {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    min-height: 0 !important;
  }
  
  .dokkan-scouter-hud {
    max-width: 100% !important;
    width: 100% !important;
    margin: 2px auto !important;
    padding: 6px 10px !important;
    border-radius: 16px 4px 16px 4px !important;
    gap: 10px !important;
  }
  
  .dbz-hand-container {
    transform: scale(0.9) !important;
    transform-origin: bottom center !important;
    padding-bottom: 5px !important;
  }

  .clash-card-img {
    max-width: 80px !important; /* Prevent huge cards from overlapping */
    max-height: 120px !important;
  }
}


@media (max-width: 768px) {
  .clash-card-wrapper {
    width: 105px !important;
    height: 147px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }
  
  .clash-card-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    filter: drop-shadow(0 6px 18px rgba(0,0,0,0.9)) drop-shadow(0 0 10px rgba(255,215,0,0.7)) !important;
  }
}

/* ── Game Result (KO/Victory/Defeat) Modal ──────────────────────── */
.game-result-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  transition: opacity 0.5s ease;
  backdrop-filter: blur(6px);
}
.game-result-overlay.active {
  opacity: 1;
}

.game-result-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.game-result-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 48px;
  background: linear-gradient(135deg, rgba(10, 14, 26, 0.98), rgba(6, 9, 18, 0.98));
  border: 2px solid #ffd700;
  border-radius: 16px;
  box-shadow: 0 0 60px rgba(255, 215, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: resultPopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 90vw;
}

@keyframes resultPopIn {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.result-ko {
  font-family: 'Outfit', 'Impact', sans-serif;
  font-size: 4.5rem;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  text-shadow: 0 0 30px currentColor, 0 4px 0 #000;
  letter-spacing: 6px;
}
.ko-win {
  color: #00ff41;
}
.ko-lose {
  color: #ff0055;
}

.result-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 4px;
  text-transform: uppercase;
}
.title-win {
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}
.title-lose {
  color: #94a3b8;
  text-shadow: 0 0 20px rgba(148, 163, 184, 0.3);
}

.result-divider {
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ffd700, transparent);
  margin: 4px 0;
}

.result-rp {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.rp-gain {
  color: #00ff41;
  text-shadow: 0 0 12px rgba(0, 255, 65, 0.5);
}
.rp-loss {
  color: #ef4444;
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.result-btn {
  font-family: 'Outfit', 'Impact', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 14px 40px;
  border: 2px solid #ffd700;
  border-radius: 6px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #000;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  transition: all 0.2s;
}
.result-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

@media (max-width: 480px) {
  .result-ko { font-size: 3rem; }
  .result-title { font-size: 1.3rem; }
  .game-result-content { padding: 30px 32px; }
  .result-btn { font-size: 0.85rem; padding: 12px 30px; }
}


/* ==========================================================================
   2v2 REALTIME — Official Arena Integration
   Extends the existing arena language instead of drawing a second game screen.
   ========================================================================== */

#scene-arena.squad-realtime-mode .arena-zone-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 7px 12px;
  align-items: start;
}

#scene-arena.squad-realtime-mode #turn-phase-bar {
  grid-column: 1 / -1;
  grid-row: 1;
}

#scene-arena.squad-realtime-mode #p2-leader-box {
  grid-column: 1;
  grid-row: 2;
  margin: 0 0 0 auto;
}

#scene-arena.squad-realtime-mode #squad-enemy-secondary-hud {
  grid-column: 2;
  grid-row: 2;
  margin: 0 auto 0 0;
}

#scene-arena.squad-realtime-mode .arena-zone-bot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "player ally"
    "actions actions"
    "hand hand";
  gap: 7px 12px;
  align-items: end;
}

#scene-arena.squad-realtime-mode #p1-leader-box {
  grid-area: player;
  margin: 0 0 0 auto;
}

#scene-arena.squad-realtime-mode #squad-ally-secondary-hud {
  grid-area: ally;
  margin: 0 auto 0 0;
}

#scene-arena.squad-realtime-mode .arena-zone-bot > .action-row {
  grid-area: actions;
}

#scene-arena.squad-realtime-mode #p1-hand {
  grid-area: hand;
}

#scene-arena.squad-realtime-mode .fighter-hud {
  max-width: 480px;
}

.squad-secondary-hud {
  appearance: none;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: default;
}

.squad-secondary-hud.hud-opponent:not(:disabled),
#scene-arena.squad-realtime-mode #p2-leader-box {
  cursor: crosshair;
}

.squad-secondary-hud:disabled {
  opacity: 1;
}

.squad-target-selected {
  border-color: #ffd700 !important;
  box-shadow:
    0 0 22px rgba(255, 215, 0, 0.65),
    inset 0 1px 0 rgba(255,255,255,.18) !important;
}

.squad-target-selected::after {
  content: 'TARGET';
  position: absolute;
  top: -8px;
  right: 18px;
  z-index: 12;
  padding: 2px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #090909;
  font-size: .56rem;
  font-weight: 1000;
  letter-spacing: .08em;
  box-shadow: 0 0 12px rgba(255,215,0,.65);
}

.squad-ko {
  opacity: .52 !important;
  filter: grayscale(.75);
}

.squad-cpu-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(34,211,238,.14);
  border: 1px solid rgba(34,211,238,.55);
  color: #67e8f9;
  font-size: .5rem;
  font-weight: 1000;
  vertical-align: middle;
}

.squad-name {
  display: flex !important;
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.squad-player-label,
.squad-user-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.squad-user-label {
  color: rgba(255,255,255,.62);
  font-size: .62rem;
}

.squad-state-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(16,185,129,.14);
  border: 1px solid rgba(52,211,153,.38);
  color: #86efac;
  font-size: .55rem;
  font-weight: 1000;
  white-space: nowrap;
}

.squad-state-pill.ko {
  background: rgba(239,68,68,.16);
  border-color: rgba(248,113,113,.45);
  color: #fca5a5;
}

#scene-arena.squad-realtime-mode .squad-phase {
  max-width: 760px;
}

#scene-arena.squad-realtime-mode .squad-target-indicator {
  pointer-events: none;
  min-width: 270px;
  justify-content: center;
}

.squad-partner-status {
  padding-left: 10px;
  margin-left: 3px;
  border-left: 1px solid rgba(255,255,255,.18);
  color: #7dd3fc;
  font-size: .64rem;
  font-weight: 900;
  white-space: nowrap;
}

#scene-arena.squad-realtime-mode .card.card-phase-disabled {
  pointer-events: none !important;
}

#scene-arena.squad-realtime-mode .battle-log {
  z-index: 65;
}

.squad-hit-flash {
  animation: squadHitFlash .42s ease-out !important;
}

@keyframes squadHitFlash {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  30% {
    transform: scale(1.035);
    filter: brightness(2.2) saturate(1.4);
    box-shadow: 0 0 38px rgba(255,70,70,.9);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@media (max-width: 900px) {
  #scene-arena.squad-realtime-mode .arena-zone-top,
  #scene-arena.squad-realtime-mode .arena-zone-bot {
    gap: 5px 7px;
  }

  #scene-arena.squad-realtime-mode .fighter-hud {
    padding: 7px 8px;
    gap: 7px;
  }

  #scene-arena.squad-realtime-mode .hud-portrait {
    width: 42px;
    height: 42px;
  }

  #scene-arena.squad-realtime-mode .hud-name {
    font-size: .72rem;
  }

  #scene-arena.squad-realtime-mode .ki-pip {
    width: 7px;
    height: 14px;
  }

  .squad-user-label,
  .squad-partner-status {
    display: none;
  }
}

@media (max-width: 640px) {
  #scene-arena.squad-realtime-mode .arena-zone-top {
    grid-template-columns: 1fr 1fr;
    padding-left: 5px !important;
    padding-right: 5px !important;
  }

  #scene-arena.squad-realtime-mode .arena-zone-bot {
    grid-template-columns: 1fr 1fr;
    padding-left: 5px !important;
    padding-right: 5px !important;
  }

  #scene-arena.squad-realtime-mode .fighter-hud {
    min-width: 0;
    padding: 5px 6px;
    border-width: 1px;
  }

  #scene-arena.squad-realtime-mode .hud-portrait {
    width: 34px;
    height: 34px;
  }

  #scene-arena.squad-realtime-mode .hp-text,
  #scene-arena.squad-realtime-mode .ki-label {
    font-size: .53rem;
  }

  #scene-arena.squad-realtime-mode .ki-pips {
    gap: 1px;
  }

  #scene-arena.squad-realtime-mode .ki-pip {
    width: 5px;
    height: 10px;
  }

  #scene-arena.squad-realtime-mode .shields-row {
    display: none;
  }

  #scene-arena.squad-realtime-mode .squad-target-indicator {
    min-width: 0;
    max-width: 92vw;
    padding: 5px 9px;
  }
}



/* ==========================================================================
   2v2 Combat Presentation — attack/response cards + Beam Clash
   ========================================================================== */

#scene-arena.squad-realtime-mode #drop-zone {
  width: min(520px, 92vw);
  height: 292px;
  justify-content: center;
  overflow: visible;
}

.squad-combat-center {
  position: relative;
  width: 100%;
  min-height: 272px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 45;
}

.squad-center-banner {
  margin-bottom: 8px;
  max-width: 430px;
}

.squad-center-cards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 205px;
}

.squad-center-card {
  position: relative;
  animation: squadCardEnter .26s cubic-bezier(.2,.9,.3,1.2) both;
}

.squad-center-card.response {
  animation-name: squadResponseEnter;
}

.squad-center-card .card {
  width: 128px !important;
  height: auto !important;
  aspect-ratio: 5 / 7;
  transform: none !important;
  pointer-events: none !important;
  box-shadow:
    0 14px 35px rgba(0,0,0,.88),
    0 0 24px rgba(255,215,0,.25) !important;
}

.squad-center-card.response .card {
  box-shadow:
    0 14px 35px rgba(0,0,0,.88),
    0 0 28px rgba(34,211,238,.4) !important;
}

.squad-center-label {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(3,7,18,.94);
  border: 1px solid #ffd700;
  color: #ffd700;
  font-size: .52rem;
  font-weight: 1000;
  letter-spacing: .08em;
}

.squad-center-card.response .squad-center-label {
  color: #67e8f9;
  border-color: #22d3ee;
}

.squad-center-card-name {
  position: absolute;
  top: 5%;
  left: 20%;
  right: 5%;
  z-index: 12;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.squad-vs-mark {
  font-family: var(--font-header);
  font-size: 1.55rem;
  font-weight: 1000;
  font-style: italic;
  color: #fff;
  text-shadow:
    0 0 10px #ff3d6e,
    0 0 20px #ffd700;
  animation: reactionPulse .7s infinite alternate;
}

.squad-combat-center.clash .squad-center-cards {
  filter: brightness(1.13) saturate(1.16);
}

#beam-clash-overlay.active {
  z-index: 15000 !important;
}

#scene-arena.squad-realtime-mode #reaction-banner.active {
  opacity: 1;
}

@keyframes squadCardEnter {
  from {
    opacity: 0;
    transform: translateX(-90px) rotate(-8deg) scale(.72);
  }
  to {
    opacity: 1;
    transform: translateX(0) rotate(0) scale(1);
  }
}

@keyframes squadResponseEnter {
  from {
    opacity: 0;
    transform: translateX(90px) rotate(8deg) scale(.72);
  }
  to {
    opacity: 1;
    transform: translateX(0) rotate(0) scale(1);
  }
}

@media (max-width: 640px) {
  #scene-arena.squad-realtime-mode #drop-zone {
    width: 96vw;
    height: 230px;
  }

  .squad-center-cards {
    gap: 9px;
    min-height: 170px;
  }

  .squad-center-card .card {
    width: 94px !important;
  }

  .squad-vs-mark {
    font-size: 1.05rem;
  }

  .squad-center-banner {
    transform: scale(.86);
    transform-origin: center;
    margin-bottom: 2px;
  }
}

