/* Import Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;500;700;900&display=swap');

:root {
  /* Palette */
  --bg-deep: #0f172a;
  --bg-dark: #020617;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.15);

  /* Accents */
  --cyan-primary: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.6);
  --amber-primary: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.6);
  --red-vital: #ef4444;
  --green-success: #22c55e;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;

  /* Sizing */
  --radius-lg: 24px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

/* --- Layout Main --- */
.arena-view {
  width: 100%;
  height: 100%;
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 40%);
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* Ambient floating blobs */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  z-index: 0;
  animation: float 10s infinite ease-in-out;
}

.glow-1 {
  width: 400px;
  height: 400px;
  background: var(--cyan-primary);
  top: -100px;
  left: -100px;
}

.glow-2 {
  width: 500px;
  height: 500px;
  background: #7e22ce; /* Purple accent */
  bottom: -100px;
  right: -100px;
  animation-delay: -5s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, 40px); }
}

/* --- Header --- */
.arena-header {
  text-align: center;
  z-index: 2;
  margin-bottom: 2rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.header-badge {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--cyan-primary);
  background: rgba(6, 182, 212, 0.1);
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.arena-header h1 {
  margin: 0;
  font-size: 3rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -1px;
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.5));
}

/* Player Info Bar */
.player-info-bar {
  display: flex;
  gap: 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  padding: 0.75rem 2rem;
  border-radius: 100px;
  border: 1px solid var(--glass-border);
  font-weight: 600;
  font-size: 1.1rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.info-value {
  color: #fff;
}

.info-value.coins { color: #fbbf24; }
.info-value.atk { color: var(--red-vital); }
.info-value.def { color: var(--cyan-primary); }

/* --- Content Area --- */
.arena-content {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  gap: 2rem;
}

/* --- PvE Scene (Champion) --- */
.arena-scene {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.champion-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-top: 4px solid var(--amber-primary);
  border-radius: var(--radius-lg);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.champion-card.revealed {
  transform: scale(1);
  opacity: 1;
}

.champion-avatar {
  font-size: 8rem;
  filter: drop-shadow(0 0 30px var(--amber-glow));
  animation: float 6s ease-in-out infinite;
}

.champion-info {
  text-align: center;
}

.champion-name {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.5rem;
}

.champion-title {
  color: var(--amber-primary);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.champion-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
}

.stat-pill {
  background: rgba(255,255,255,0.05);
  padding: 0.5rem 1.5rem;
  border-radius: 100px;
  font-weight: 700;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- PvP Scene (Opponents) --- */
.opponents-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
  min-height: 0; /* For flex scrolling */
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.opponents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  overflow-y: auto;
  padding: 1rem;
  /* Custom Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--cyan-primary) rgba(0,0,0,0.3);
}

.opponents-grid::-webkit-scrollbar {
  width: 6px;
}
.opponents-grid::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.3);
}
.opponents-grid::-webkit-scrollbar-thumb {
  background: var(--cyan-primary);
  border-radius: 10px;
}

.opponent-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.opponent-card:hover {
  transform: translateY(-5px);
  border-color: var(--cyan-primary);
  box-shadow: 0 10px 30px -10px var(--cyan-glow);
}

.opponent-card.selected {
  border-color: var(--cyan-primary);
  background: rgba(6, 182, 212, 0.1);
  box-shadow: 0 0 0 2px var(--cyan-primary);
}

.opponent-card.faded {
  opacity: 0.4;
  filter: grayscale(0.8);
}

/* Difficulty Indicators */
.opponent-card.weak { border-top: 4px solid var(--green-success); }
.opponent-card.medium { border-top: 4px solid var(--amber-primary); }
.opponent-card.strong { border-top: 4px solid var(--red-vital); }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.opp-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.opp-stats-row {
  display: flex;
  justify-content: space-between;
  background: rgba(0,0,0,0.2);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
}

.opp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
}

.stat-val {
  font-weight: 700;
  font-size: 1.1rem;
}

.steal-info {
  text-align: center;
  color: var(--amber-primary);
  font-weight: 700;
  font-size: 0.9rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* --- Message / Status --- */
.arena-message-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 100%;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.arena-message {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  padding: 1rem 3rem;
  border-radius: 100px;
  border: 1px solid var(--glass-border);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.arena-message.active {
  transform: translateY(0);
  opacity: 1;
}

.arena-message.welcome { border-color: var(--cyan-primary); }
.arena-message.danger { border-color: var(--red-vital); color: var(--red-vital); }
.arena-message.success { border-color: var(--green-success); color: var(--green-success); }

/* --- Battle Intro Overlay --- */
.battle-intro-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.95);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.battle-intro-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.vs-container {
  display: flex;
  align-items: center;
  gap: 4rem;
}

.fighter-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.fighter-preview .avatar {
  font-size: 6rem;
  filter: drop-shadow(0 0 20px rgba(255,255,255,0.2));
}

.fighter-preview .name {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
}

.vs-text {
  font-size: 5rem;
  font-weight: 900;
  font-style: italic;
  color: var(--red-vital);
  text-shadow: 0 0 30px var(--red-vital);
}

/* --- Result Overlay --- */
.result-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.9);
  backdrop-filter: blur(8px);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.result-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.result-icon {
  font-size: 8rem;
  animation: bounce 1s infinite;
}

.result-title {
  font-size: 4rem;
  font-weight: 900;
  text-transform: uppercase;
}

.victory .result-title { color: var(--green-success); text-shadow: 0 0 30px rgba(34, 197, 94, 0.5); }
.defeat .result-title { color: var(--red-vital); text-shadow: 0 0 30px rgba(239, 68, 68, 0.5); }

.result-details {
  background: var(--glass-bg);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  text-align: center;
}

.gold-change {
  font-size: 3rem;
  font-weight: 800;
  margin: 1rem 0;
}

.gold-gain { color: #fbbf24; }
.gold-loss { color: var(--red-vital); }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}
