/* ========================================
   BATTLEMON - STADIUM ARENA
   Photo-realistic Battle Game Styles
   ======================================== */

:root {
  /* Color Palette */
  --bg-dark: #0a0a1a;
  --bg-medium: #1a1a2a;
  --bg-light: #2a2a4a;
  --accent-cyan: #64c8ff;
  --accent-pink: #ff6496;
  --accent-gold: #ffd700;
  --accent-green: #4ade80;
  --accent-red: #ef4444;
  --accent-orange: #f97316;
  --accent-purple: #a855f7;
  --accent-blue: #3b82f6;
  --text-primary: #ffffff;
  --text-secondary: #a0a0c0;
  --text-muted: #606080;
  
  /* Type Colors */
  --type-fire: #ff6b35;
  --type-water: #4a90d9;
  --type-electric: #f9d71c;
  --type-grass: #7ac74c;
  --type-ice: #96d9d6;
  --type-physical: #c22e28;
  --type-status: #a855f7;
  
  /* Fonts - fallback for offline */
  --font-display: 'Orbitron', 'Segoe UI', Tahoma, sans-serif;
  --font-body: 'Rajdhani', 'Segoe UI', Tahoma, sans-serif;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow-cyan: 0 0 20px rgba(100,200,255,0.5);
  --shadow-glow-pink: 0 0 20px rgba(255,100,150,0.5);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-primary);
}

/* ========================================
   SCREENS
   ======================================== */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ========================================
   TITLE SCREEN
   ======================================== */
#title-screen {
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #0a0a1a 0%, #1a1a3a 50%, #0a0a2a 100%);
}

.title-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.stadium-lights {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse 30% 50% at 20% 30%, rgba(100,200,255,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 30% 50% at 80% 30%, rgba(255,100,150,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 50% 30% at 50% 80%, rgba(255,215,0,0.1) 0%, transparent 70%);
  animation: lightsFlicker 4s ease-in-out infinite;
}

@keyframes lightsFlicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.particle-field {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.title-content {
  position: relative;
  z-index: 10;
  text-align: center;
}

.game-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  text-shadow: 
    0 0 20px rgba(100,200,255,0.8),
    0 0 40px rgba(100,200,255,0.4),
    0 4px 8px rgba(0,0,0,0.5);
}

.title-battle {
  color: var(--accent-cyan);
  display: block;
  animation: titleGlow 2s ease-in-out infinite alternate;
}

.title-mon {
  color: var(--accent-pink);
  display: block;
  animation: titleGlow 2s ease-in-out infinite alternate-reverse;
}

@keyframes titleGlow {
  from { filter: brightness(1) drop-shadow(0 0 10px currentColor); }
  to { filter: brightness(1.2) drop-shadow(0 0 30px currentColor); }
}

.subtitle {
  font-family: var(--font-display);
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: var(--accent-gold);
  letter-spacing: 0.5em;
  margin-bottom: 3rem;
  text-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.title-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.btn-primary, .btn-secondary {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  padding: 1rem 3rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent-cyan) 0%, #3a9ad9 100%);
  color: var(--bg-dark);
  box-shadow: var(--shadow-glow-cyan), var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 40px rgba(100,200,255,0.8), var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--accent-pink);
  box-shadow: var(--shadow-glow-pink);
}

.btn-secondary:hover {
  background: rgba(255,100,150,0.2);
  transform: translateY(-2px);
}

.btn-pvp {
  background: linear-gradient(180deg, var(--accent-pink) 0%, #d9366e 100%);
  color: var(--bg-dark);
  box-shadow: var(--shadow-glow-pink), var(--shadow-md);
}

.btn-pvp:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 40px rgba(255,100,150,0.8), var(--shadow-lg);
}

.version {
  margin-top: 3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Credits Section */
.credits {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.credits-text {
  color: var(--text-muted);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: creditsPulse 3s ease-in-out infinite;
}

.studio-name {
  color: #a855f7;
  font-weight: bold;
  font-size: 1.2rem;
  text-shadow: 0 0 20px rgba(168, 85, 247, 0.6), 0 0 40px rgba(168, 85, 247, 0.4);
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #f97316 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: studioGlow 2s ease-in-out infinite alternate;
}

@keyframes creditsPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes studioGlow {
  0% { 
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.5));
    transform: scale(1);
  }
  100% { 
    filter: drop-shadow(0 0 20px rgba(236, 72, 153, 0.7));
    transform: scale(1.02);
  }
}

/* ========================================
   SELECT SCREEN
   ======================================== */
#select-screen {
  background: linear-gradient(180deg, #0a0a1a 0%, #1a1a3a 100%);
  padding: 2rem;
  overflow-y: auto;
}

.select-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.select-header h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent-cyan);
  text-shadow: var(--shadow-glow-cyan);
}

.select-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.team-count {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent-gold);
}

.btn-back {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-back:hover {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
}

/* Team Slots Container */
.team-slots-container {
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.team-slots-container h3 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  letter-spacing: 0.1em;
}

.team-slots {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.team-slot {
  width: 100px;
  height: 120px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.team-slot:hover {
  border-color: var(--accent-pink);
}

.team-slot.filled {
  border-color: var(--accent-cyan);
  background: linear-gradient(180deg, rgba(100,200,255,0.1) 0%, rgba(100,200,255,0.05) 100%);
}

.team-slot.filled:hover {
  border-color: var(--accent-red);
}

.team-slot .slot-creature {
  width: 60px;
  height: 60px;
}

.team-slot .slot-creature svg {
  width: 100%;
  height: 100%;
}

.team-slot .slot-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: center;
}

.team-slot.filled .slot-label {
  color: var(--text-primary);
}

/* Pokeball Icon */
.pokeball-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ef4444 0%, #ef4444 45%, #1f2937 45%, #1f2937 55%, #f5f5f5 55%, #f5f5f5 100%);
  position: relative;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.3);
}

.pokeball-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: #f5f5f5;
  border-radius: 50%;
  border: 3px solid #1f2937;
}

.team-slot.empty .pokeball-icon {
  opacity: 0.3;
}

.creature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.creature-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.creature-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow-cyan);
}

.creature-card.selected {
  border-color: var(--accent-gold);
  box-shadow: 0 0 30px rgba(255,215,0,0.5);
}

.creature-card .creature-thumb {
  width: 120px;
  height: 120px;
  margin-bottom: 0.5rem;
}

.creature-card .creature-thumb svg {
  width: 100%;
  height: 100%;
}

.creature-card .creature-info {
  text-align: center;
}

.creature-card .creature-info h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.creature-card .creature-info .type-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.creature-card.disabled {
  opacity: 0.5;
  pointer-events: none;
  border-color: var(--accent-pink);
  position: relative;
}

.creature-card.disabled:hover {
  transform: none;
  border-color: var(--accent-pink);
  box-shadow: none;
}

.creature-card .disabled-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent-pink);
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.selected-preview {
  display: flex;
  gap: 2rem;
  padding: 1.5rem;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  margin: 1rem 0;
  min-height: 200px;
}

.preview-creature {
  width: 200px;
  height: 200px;
}

.preview-stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-confirm {
  align-self: center;
  margin-top: 1rem;
}

.btn-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   BATTLE SCREEN
   ======================================== */
#battle-screen {
  flex-direction: column;
}

.stadium-container {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.stadium-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.battle-circle {
  animation: circleGlow 2s ease-in-out infinite alternate;
}

@keyframes circleGlow {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* Particle Layer */
.particle-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: particleFade 1s ease-out forwards;
}

@keyframes particleFade {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0); }
}

/* Combatants Layer */
.combatants-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
}

.combatant {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s ease;
}

.player-combatant {
  bottom: 28%;
  left: 18%;
  transform-origin: center bottom;
}

.enemy-combatant {
  bottom: 32%;
  right: 18%;
  transform-origin: center bottom;
}

.creature-shadow {
  position: absolute;
  bottom: -10px;
  width: 150px;
  height: 30px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.5) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
}

.creature-container {
  width: 250px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.creature-container svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}

.enemy-combatant .creature-container {
  width: 220px;
  height: 220px;
}

/* Attack Animations */
.combatant.attacking {
  animation: attackLunge 0.4s ease-out;
}

.combatant.hit {
  animation: hitShake 0.3s ease-out;
}

.combatant.fainted {
  animation: faintFall 1s ease-out forwards;
}

@keyframes attackLunge {
  0% { transform: translateX(0); }
  30% { transform: translateX(30px) scale(1.1); }
  100% { transform: translateX(0) scale(1); }
}

.enemy-combatant.attacking {
  animation: attackLungeEnemy 0.4s ease-out;
}

@keyframes attackLungeEnemy {
  0% { transform: translateX(0); }
  30% { transform: translateX(-30px) scale(1.1); }
  100% { transform: translateX(0) scale(1); }
}

@keyframes hitShake {
  0%, 100% { transform: translateX(0); filter: brightness(1); }
  20% { transform: translateX(-10px); filter: brightness(2); }
  40% { transform: translateX(10px); filter: brightness(1.5); }
  60% { transform: translateX(-5px); filter: brightness(1.2); }
  80% { transform: translateX(5px); filter: brightness(1); }
}

@keyframes faintFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(50px) rotate(-15deg); opacity: 0; }
}

/* Status Effects */
.status-effects {
  position: absolute;
  top: -20px;
  display: flex;
  gap: 4px;
}

/* Effects Layer */
.effects-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

/* ========================================
   BATTLE UI
   ======================================== */
.battle-ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

.battle-ui > * {
  pointer-events: auto;
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem 2rem;
  gap: 1rem;
}

.hp-panel {
  background: linear-gradient(180deg, rgba(20,20,40,0.95) 0%, rgba(10,10,30,0.95) 100%);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  min-width: 280px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.1);
}

.enemy-panel {
  border-left: 4px solid var(--accent-pink);
}

.player-panel {
  border-right: 4px solid var(--accent-cyan);
  text-align: right;
}

.creature-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.level-badge {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.hp-bar-container {
  position: relative;
}

.hp-bar {
  height: 20px;
  background: rgba(0,0,0,0.5);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(180deg, var(--accent-green) 0%, #22c55e 50%, #16a34a 100%);
  border-radius: 10px;
  transition: width 0.5s ease-out;
  position: relative;
}

.hp-fill.low {
  background: linear-gradient(180deg, var(--accent-orange) 0%, #ea580c 100%);
}

.hp-fill.critical {
  background: linear-gradient(180deg, var(--accent-red) 0%, #dc2626 100%);
  animation: criticalPulse 0.5s ease-in-out infinite;
}

@keyframes criticalPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.hp-shine {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
  border-radius: 10px 10px 0 0;
}

.hp-text {
  font-family: var(--font-display);
  font-size: 0.9rem;
  margin-top: 0.25rem;
  color: var(--text-secondary);
}

.status-icons {
  display: flex;
  gap: 4px;
  margin-top: 0.5rem;
}

.player-panel .status-icons {
  justify-content: flex-end;
}

.status-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.status-icon.burn {
  background: var(--type-fire);
  animation: burnPulse 1s ease-in-out infinite;
}

.status-icon.frozen {
  background: var(--type-ice);
}

.status-icon.paralyzed {
  background: var(--type-electric);
}

.status-icon.poisoned, .status-icon.poison {
  background: var(--accent-purple);
  animation: poisonPulse 1.5s ease-in-out infinite;
}

.status-icon.sleep {
  background: #c084fc;
  animation: sleepPulse 2s ease-in-out infinite;
}

@keyframes poisonPulse {
  0%, 100% { box-shadow: 0 0 5px var(--accent-purple); }
  50% { box-shadow: 0 0 15px var(--accent-purple); }
}

@keyframes sleepPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes burnPulse {
  0%, 100% { box-shadow: 0 0 5px var(--type-fire); }
  50% { box-shadow: 0 0 15px var(--type-fire); }
}

/* Team Pokeballs in Battle */
.team-pokeballs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.3);
  border-radius: 20px;
}

.team-pokeballs .pokeball {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ef4444 0%, #ef4444 45%, #374151 45%, #374151 55%, #f5f5f5 55%, #f5f5f5 100%);
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

.team-pokeballs .pokeball::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: #f5f5f5;
  border-radius: 50%;
  border: 2px solid #374151;
}

.team-pokeballs .pokeball.fainted {
  background: linear-gradient(180deg, #4b5563 0%, #4b5563 45%, #1f2937 45%, #1f2937 55%, #6b7280 55%, #6b7280 100%);
  opacity: 0.5;
}

.team-pokeballs .pokeball.fainted::after {
  background: #6b7280;
  border-color: #1f2937;
}

.team-pokeballs .pokeball.active-mon {
  box-shadow: 0 0 10px var(--accent-gold), 0 2px 4px rgba(0,0,0,0.3);
  transform: scale(1.1);
}

/* Turn Indicator */
.turn-indicator {
  background: linear-gradient(180deg, rgba(30,30,60,0.95) 0%, rgba(20,20,50,0.95) 100%);
  padding: 0.75rem 2rem;
  border-radius: 30px;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--accent-gold);
}

.turn-text {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Battle Log */
.battle-log {
  position: absolute;
  top: 120px;
  right: 2rem;
  width: 320px;
  max-height: 200px;
  background: linear-gradient(180deg, rgba(20,20,40,0.9) 0%, rgba(10,10,30,0.9) 100%);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.1);
}

.log-header {
  font-family: var(--font-display);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  background: rgba(0,0,0,0.3);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.log-content {
  padding: 0.75rem 1rem;
  max-height: 150px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.4;
}

.log-entry {
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  animation: logSlideIn 0.3s ease-out;
}

.log-entry:last-child {
  border-bottom: none;
}

.log-entry.damage {
  color: var(--accent-red);
}

.log-entry.heal {
  color: var(--accent-green);
}

.log-entry.status {
  color: var(--accent-purple);
}

.log-entry.miss {
  color: var(--text-muted);
  font-style: italic;
}

@keyframes logSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Bottom Controls */
.bottom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 2rem;
  display: flex;
  gap: 1.5rem;
  background: linear-gradient(0deg, rgba(10,10,26,0.98) 0%, rgba(10,10,26,0.9) 80%, transparent 100%);
}

.move-panel {
  flex: 1;
  background: linear-gradient(180deg, rgba(30,30,60,0.95) 0%, rgba(20,20,50,0.95) 100%);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.1);
}

.panel-header {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  letter-spacing: 0.1em;
}

.moves-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.move-btn {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.move-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events: none;
}

.move-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.move-btn:active:not(:disabled) {
  transform: translateY(0);
}

.move-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.move-btn .move-name {
  display: block;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.move-btn .move-info {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Move Type Colors */
.move-btn.fire {
  background: linear-gradient(135deg, var(--type-fire) 0%, #c2410c 100%);
  color: white;
}

.move-btn.water {
  background: linear-gradient(135deg, var(--type-water) 0%, #1d4ed8 100%);
  color: white;
}

.move-btn.electric {
  background: linear-gradient(135deg, var(--type-electric) 0%, #ca8a04 100%);
  color: #1a1a1a;
}

.move-btn.grass {
  background: linear-gradient(135deg, var(--type-grass) 0%, #15803d 100%);
  color: white;
}

.move-btn.ice {
  background: linear-gradient(135deg, var(--type-ice) 0%, #0891b2 100%);
  color: #1a1a1a;
}

.move-btn.physical {
  background: linear-gradient(135deg, var(--type-physical) 0%, #991b1b 100%);
  color: white;
}

.move-btn.status {
  background: linear-gradient(135deg, var(--type-status) 0%, #7c3aed 100%);
  color: white;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-action {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  background: rgba(255,255,255,0.1);
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action:hover:not(:disabled) {
  background: rgba(255,255,255,0.2);
  color: var(--text-primary);
}

.btn-action:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-switch {
  background: linear-gradient(180deg, var(--accent-cyan) 0%, #0891b2 100%);
  color: var(--bg-dark);
  border-color: var(--accent-cyan);
}

.btn-switch:hover:not(:disabled) {
  background: linear-gradient(180deg, #67e8f9 0%, var(--accent-cyan) 100%);
}

/* Switch Panel */
.switch-panel {
  position: absolute;
  bottom: 180px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 800px;
  background: linear-gradient(180deg, rgba(20,20,40,0.98) 0%, rgba(10,10,30,0.98) 100%);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(0,0,0,0.5);
  border: 2px solid var(--accent-cyan);
  display: none;
  z-index: 50;
}

.switch-panel.active {
  display: block;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.switch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.switch-header h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--accent-cyan);
}

.btn-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  background: var(--accent-red);
}

.switch-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.switch-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.switch-card:hover:not(.fainted):not(.active) {
  border-color: var(--accent-cyan);
  transform: translateY(-4px);
}

.switch-card.active {
  border-color: var(--accent-gold);
  background: linear-gradient(180deg, rgba(255,215,0,0.1) 0%, rgba(255,215,0,0.05) 100%);
  cursor: default;
}

.switch-card.fainted {
  opacity: 0.4;
  cursor: not-allowed;
}

.switch-card .switch-creature {
  width: 60px;
  height: 60px;
  margin: 0 auto 0.5rem;
}

.switch-card .switch-creature svg {
  width: 100%;
  height: 100%;
}

.switch-card .switch-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.switch-card .switch-hp {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.switch-card .switch-hp.low {
  color: var(--accent-orange);
}

.switch-card .switch-hp.critical {
  color: var(--accent-red);
}

.switch-card .switch-status {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* Forced Switch Overlay */
.forced-switch-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10,10,26,0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.forced-switch-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.forced-switch-content {
  text-align: center;
  max-width: 900px;
  padding: 2rem;
}

.forced-switch-content h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent-red);
  margin-bottom: 0.5rem;
}

.forced-switch-content p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.forced-switch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  justify-content: center;
}

.forced-switch-grid .switch-card {
  padding: 1.5rem;
}

.forced-switch-grid .switch-card .switch-creature {
  width: 80px;
  height: 80px;
}

/* Preview hint */
.preview-hint {
  color: var(--text-muted);
  font-style: italic;
}

/* ========================================
   PHOTO-REALISTIC ATTACK ANIMATIONS
   ======================================== */

/* Fire Effects */
@keyframes fireRise {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-60px) scale(0.3); }
}

@keyframes emberFly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0.2); }
}

/* Water Effects */
@keyframes dropletFly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0.5); }
}

@keyframes bubbleRise {
  0% { opacity: 0.8; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-80px) scale(1.5); }
}

/* Electric Effects */
@keyframes sparkFlash {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.5); }
  100% { opacity: 0; transform: scale(0.5); }
}

@keyframes arcFlash {
  0% { opacity: 1; transform: rotate(var(--angle, 0deg)) scaleX(0); }
  50% { opacity: 1; transform: rotate(var(--angle, 0deg)) scaleX(1); }
  100% { opacity: 0; transform: rotate(var(--angle, 0deg)) scaleX(0.5); }
}

/* Ice Effects */
@keyframes shardBurst {
  0% { opacity: 0; transform: rotate(var(--angle, 0deg)) scale(0) translateY(0); }
  30% { opacity: 1; transform: rotate(var(--angle, 0deg)) scale(1.2) translateY(-10px); }
  100% { opacity: 0; transform: rotate(var(--angle, 0deg)) scale(0.8) translateY(-30px); }
}

@keyframes frostFloat {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(-50px) rotate(180deg); }
}

/* Grass Effects */
@keyframes leafSpin {
  0% { opacity: 1; transform: rotate(0deg) translate(0, 0) scale(1); }
  100% { opacity: 0; transform: rotate(360deg) translate(30px, -40px) scale(0.5); }
}

@keyframes energyPulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.5); }
  100% { opacity: 0; transform: scale(2); }
}

/* Physical Effects */
@keyframes debrisFly {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) rotate(720deg) scale(0.3); }
}

@keyframes speedLineFade {
  0% { opacity: 0; transform: scaleX(0); }
  30% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(0.5); }
}

/* Status/Magic Effects */
@keyframes magicFloat {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-40px) scale(0.5); }
}

/* General particle animation */
@keyframes particleBurst {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0); }
}

/* ========================================
   RESULT OVERLAY
   ======================================== */
.result-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10,10,26,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.result-overlay.active {
  display: flex;
  opacity: 1;
}

.result-content {
  text-align: center;
  animation: resultPopIn 0.5s ease-out;
}

@keyframes resultPopIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.result-title {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 900;
  margin-bottom: 1rem;
  text-shadow: 0 0 30px currentColor;
}

.result-title.victory {
  color: var(--accent-gold);
}

.result-title.defeat {
  color: var(--accent-red);
}

.result-message {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.result-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* ========================================
   SPECIAL EFFECTS
   ======================================== */

/* Fire Effect */
.effect-fire {
  position: absolute;
  width: 100px;
  height: 100px;
  background: radial-gradient(ellipse, var(--type-fire) 0%, transparent 70%);
  border-radius: 50%;
  animation: fireBlast 0.5s ease-out forwards;
  filter: blur(5px);
}

@keyframes fireBlast {
  0% { transform: scale(0); opacity: 1; }
  50% { transform: scale(2); opacity: 0.8; }
  100% { transform: scale(3); opacity: 0; }
}

/* Water Effect */
.effect-water {
  position: absolute;
  width: 150px;
  height: 40px;
  background: linear-gradient(90deg, transparent, var(--type-water), transparent);
  border-radius: 50%;
  animation: waterJet 0.4s ease-out forwards;
  filter: blur(3px);
}

@keyframes waterJet {
  0% { transform: scaleX(0); opacity: 1; }
  100% { transform: scaleX(3); opacity: 0; }
}

/* Electric Effect */
.effect-electric {
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(ellipse, var(--type-electric) 0%, transparent 50%);
  animation: electricShock 0.3s ease-out forwards;
}

@keyframes electricShock {
  0%, 20%, 40%, 60%, 80% { opacity: 1; }
  10%, 30%, 50%, 70%, 90% { opacity: 0.3; }
  100% { opacity: 0; }
}

/* Heal Effect */
.effect-heal {
  position: absolute;
  width: 150px;
  height: 150px;
  border: 3px solid var(--accent-green);
  border-radius: 50%;
  animation: healPulse 0.8s ease-out forwards;
}

@keyframes healPulse {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

/* Sparkle particles */
.sparkle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  animation: sparkle 0.6s ease-out forwards;
}

@keyframes sparkle {
  0% { transform: scale(0) translateY(0); opacity: 1; }
  100% { transform: scale(1) translateY(-30px); opacity: 0; }
}

/* Screen Shake Effect for powerful attacks */
@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-8px, -5px); }
  20% { transform: translate(8px, 5px); }
  30% { transform: translate(-6px, 4px); }
  40% { transform: translate(6px, -4px); }
  50% { transform: translate(-4px, 3px); }
  60% { transform: translate(4px, -3px); }
  70% { transform: translate(-3px, 2px); }
  80% { transform: translate(3px, -2px); }
  90% { transform: translate(-1px, 1px); }
}

/* ========================================
   SCROLLBAR
   ======================================== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.3);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .top-bar {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .hp-panel {
    min-width: 220px;
  }
  
  .battle-log {
    display: none;
  }
  
  .bottom-controls {
    flex-direction: column;
  }
  
  .action-buttons {
    flex-direction: row;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .player-combatant {
    left: 5%;
    bottom: 20%;
  }
  
  .enemy-combatant {
    right: 5%;
    bottom: 30%;
  }
  
  .creature-container {
    width: 150px;
    height: 150px;
  }
  
  .enemy-combatant .creature-container {
    width: 130px;
    height: 130px;
  }
  
  .moves-grid {
    grid-template-columns: 1fr;
  }
  
  .hp-panel {
    min-width: 150px;
    padding: 0.75rem;
  }
  
  .creature-name {
    font-size: 1rem;
  }
}
