* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: linear-gradient(135deg, #0f0a1a 0%, #1a0a2e 50%, #0a1628 100%);
  min-height: 100vh;
  color: #fff;
  overflow-x: hidden;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Header */
.header {
  text-align: center;
  padding: 2rem 1rem;
  position: relative;
}

.title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 900;
  background: linear-gradient(90deg, #8B5CF6, #EC4899, #F59E0B);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 40px rgba(139, 92, 246, 0.5);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { filter: drop-shadow(0 0 20px rgba(236, 72, 153, 0.5)); }
  to { filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.7)); }
}

.subtitle {
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: #a78bfa;
  margin-top: 0.5rem;
  animation: bounce 2s ease-in-out infinite;
}

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

.header-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.control-button {
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.control-button:hover {
  background: rgba(139, 92, 246, 0.4);
  transform: scale(1.05);
}

.control-button.share {
  font-family: 'Space Grotesk', sans-serif;
}

/* Main content */
.main-content {
  display: flex;
  flex: 1;
  gap: 2rem;
  padding: 1rem;
  flex-wrap: wrap;
}

.arena-section {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.battle-arena {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: 900px;
}

/* Setup Card */
.setup-card {
  background: linear-gradient(135deg, rgba(30, 20, 50, 0.8), rgba(20, 30, 60, 0.8));
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 1.5rem;
  width: 100%;
  max-width: 340px;
  min-width: 280px;
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(139, 92, 246, 0.3);
  transition: all 0.4s ease;
}

.setup-card.left.animate-in {
  animation: slideInLeft 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.setup-card.right.animate-in {
  animation: slideInRight 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideInLeft {
  from { transform: translateX(-100px) rotate(-5deg); opacity: 0; }
  to { transform: translateX(0) rotate(0); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100px) rotate(5deg); opacity: 0; }
  to { transform: translateX(0) rotate(0); opacity: 1; }
}

.setup-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--card-color);
}

.setup-card.winner {
  animation: winner-shake 0.5s ease-in-out;
  border-color: #F59E0B;
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.5);
}

@keyframes winner-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px) rotate(-2deg); }
  40% { transform: translateX(10px) rotate(2deg); }
  60% { transform: translateX(-5px) rotate(-1deg); }
  80% { transform: translateX(5px) rotate(1deg); }
}

.card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--card-color) 0%, transparent 50%);
  opacity: 0.1;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.1; transform: scale(1); }
  50% { opacity: 0.2; transform: scale(1.1); }
}

.card-content {
  position: relative;
  z-index: 1;
}

.card-emoji {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 0.5rem;
  animation: float 3s ease-in-out infinite;
}

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

.card-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.25rem;
  text-align: center;
  color: #fff;
  margin-bottom: 1rem;
  text-shadow: 0 0 10px var(--card-color);
}

.card-stats {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.power-bar-container {
  height: 12px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.power-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.vote-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.vote-button {
  background: linear-gradient(135deg, #8B5CF6, #EC4899);
  border: none;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.vote-button:hover:not(:disabled) {
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(236, 72, 153, 0.5);
}

.vote-button:disabled {
  cursor: default;
}

.vote-button.voted {
  background: linear-gradient(135deg, #10B981, #06B6D4);
}

.vote-count {
  text-align: right;
}

.vote-number {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  color: #F59E0B;
}

.vote-label {
  font-size: 0.75rem;
  color: #a78bfa;
}

/* VS Badge */
.vs-badge {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vs-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, #F59E0B, #EF4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  z-index: 2;
  animation: vs-pulse 1s ease-in-out infinite;
}

@keyframes vs-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.vs-badge.active .vs-text {
  animation: vs-explode 0.5s ease-out;
}

@keyframes vs-explode {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.5); }
  100% { transform: scale(1); opacity: 1; }
}

.vs-fire, .vs-lightning {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.vs-fire::before, .vs-fire::after {
  content: '🔥';
  position: absolute;
  font-size: 1.5rem;
  animation: fire-dance 0.5s ease-in-out infinite alternate;
}

.vs-fire::before { left: -10px; top: 0; }
.vs-fire::after { right: -10px; bottom: 0; animation-delay: 0.25s; }

@keyframes fire-dance {
  from { transform: translateY(0) scale(1); opacity: 0.8; }
  to { transform: translateY(-10px) scale(1.2); opacity: 1; }
}

.vs-lightning::before {
  content: '⚡';
  position: absolute;
  font-size: 1rem;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: lightning-flash 0.3s linear infinite;
  opacity: 0;
}

@keyframes lightning-flash {
  0%, 90%, 100% { opacity: 0; }
  95% { opacity: 1; }
}

/* Random Battle Button */
.random-battle-btn {
  margin-top: 2rem;
  background: linear-gradient(135deg, #F59E0B, #EF4444);
  border: none;
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 15px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.3);
}

.random-battle-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 40px rgba(245, 158, 11, 0.5);
}

.random-battle-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Sidebar */
.sidebar {
  width: 100%;
  max-width: 300px;
}

.leaderboard {
  background: linear-gradient(135deg, rgba(30, 20, 50, 0.8), rgba(20, 30, 60, 0.8));
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 1.5rem;
  border: 2px solid rgba(139, 92, 246, 0.3);
}

.leaderboard-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.25rem;
  text-align: center;
  margin-bottom: 1rem;
  color: #F59E0B;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.leaderboard-item:hover {
  background: rgba(139, 92, 246, 0.2);
  transform: translateX(5px);
}

.rank {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.875rem;
  color: #EC4899;
  width: 30px;
}

.lb-emoji {
  font-size: 1.25rem;
}

.lb-name {
  flex: 1;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-votes {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.875rem;
  color: #06B6D4;
}

/* Create Section */
.create-section {
  padding: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.create-toggle {
  background: rgba(139, 92, 246, 0.2);
  border: 2px solid rgba(139, 92, 246, 0.4);
  color: #a78bfa;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
}

.create-toggle:hover {
  background: rgba(139, 92, 246, 0.3);
  border-color: rgba(139, 92, 246, 0.6);
}

.create-form {
  margin-top: 1rem;
  background: linear-gradient(135deg, rgba(30, 20, 50, 0.8), rgba(20, 30, 60, 0.8));
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 1.5rem;
  border: 2px solid rgba(139, 92, 246, 0.3);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-input {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(139, 92, 246, 0.3);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: #8B5CF6;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.emoji-option {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(139, 92, 246, 0.2);
  padding: 0.5rem;
  border-radius: 8px;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.emoji-option:hover {
  background: rgba(139, 92, 246, 0.2);
  transform: scale(1.1);
}

.emoji-option.selected {
  border-color: #EC4899;
  background: rgba(236, 72, 153, 0.2);
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.slider-group label {
  font-size: 0.875rem;
  color: #a78bfa;
}

.stat-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.4);
  outline: none;
}

.stat-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.stat-slider.pink::-webkit-slider-thumb {
  background: linear-gradient(135deg, #EC4899, #8B5CF6);
}

.stat-slider.cyan::-webkit-slider-thumb {
  background: linear-gradient(135deg, #06B6D4, #3B82F6);
}

.stat-slider.orange::-webkit-slider-thumb {
  background: linear-gradient(135deg, #F59E0B, #EF4444);
}

.stat-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.submit-button {
  background: linear-gradient(135deg, #10B981, #06B6D4);
  border: none;
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 10px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
}

.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #a78bfa;
  font-size: 0.875rem;
}

.footer-link {
  cursor: pointer;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: #EC4899;
}

.footer-link-url {
  color: #EC4899;
  text-decoration: none;
  font-weight: bold;
}

.footer-link-url:hover {
  text-decoration: underline;
}

/* Confetti */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.confetti-particle {
  position: absolute;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Berry Rain */
.berry-rain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.falling-berry {
  position: absolute;
  top: -50px;
  font-size: 2rem;
  animation: berry-fall linear forwards;
}

@keyframes berry-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
    align-items: center;
  }
  
  .sidebar {
    max-width: 100%;
  }
  
  .battle-arena {
    flex-direction: column;
  }
  
  .vs-badge {
    margin: 1rem 0;
  }
  
  .setup-card {
    max-width: 100%;
  }
  
  .setup-card.left.animate-in {
    animation: slideInTop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }
  
  .setup-card.right.animate-in {
    animation: slideInBottom 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }
  
  @keyframes slideInTop {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  
  @keyframes slideInBottom {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.7);
}