:root {
  --bg-dark: #0a0a0f;
  --bg-card: rgba(20, 20, 35, 0.8);
  --pink: #ff006e;
  --cyan: #00f5d4;
  --purple: #8338ec;
  --orange: #ff8c00;
  --yellow: #ffbe0b;
}

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

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-dark);
  min-height: 100vh;
  color: white;
  overflow-x: hidden;
}

.app-container {
  min-height: 100vh;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(131, 56, 236, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(255, 0, 110, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 245, 212, 0.05) 0%, transparent 70%),
    var(--bg-dark);
  position: relative;
}

.sparkles {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background-image: 
    radial-gradient(2px 2px at 20% 30%, var(--pink), transparent),
    radial-gradient(2px 2px at 40% 70%, var(--cyan), transparent),
    radial-gradient(2px 2px at 80% 20%, var(--purple), transparent),
    radial-gradient(2px 2px at 60% 50%, var(--yellow), transparent);
  background-size: 200px 200px;
  animation: sparkle 15s linear infinite;
  opacity: 0.5;
}

@keyframes sparkle {
  0% { transform: translateY(0); }
  100% { transform: translateY(-200px); }
}

.header {
  text-align: center;
  padding: 3rem 1rem 2rem;
}

.title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.8rem, 6vw, 3.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--pink), var(--purple), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 60px rgba(255, 0, 110, 0.5);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { filter: drop-shadow(0 0 20px rgba(255, 0, 110, 0.5)); }
  to { filter: drop-shadow(0 0 40px rgba(0, 245, 212, 0.5)); }
}

.subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.5rem;
  letter-spacing: 0.1em;
}

.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.selection-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .selection-panels {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.selection-panel {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}

.panel-title {
  font-family: 'Orbitron', sans-serif;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--cyan);
  font-size: 0.9rem;
  letter-spacing: 0.15em;
}

.tool-grid {
  display: grid;
  gap: 0.75rem;
}

.tool-grid.selection {
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

.tool-grid.roster {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.tool-card {
  background: linear-gradient(135deg, rgba(30, 30, 50, 0.9), rgba(20, 20, 40, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: 0 10px 40px rgba(0, 245, 212, 0.2);
}

.tool-card:hover::before {
  opacity: 0.1;
}

.tool-card.selected {
  border-color: var(--pink);
  box-shadow: 0 0 30px rgba(255, 0, 110, 0.4);
}

.tool-card.selected::before {
  opacity: 0.2;
}

.tool-card.compact {
  padding: 0.75rem;
}

.tool-card.compact .tool-icon {
  font-size: 1.5rem;
}

.tool-card.compact .tool-name {
  font-size: 0.75rem;
}

.tool-card.compact .tool-tagline,
.tool-card.compact .vibe-rating {
  display: none;
}

.tool-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.tool-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  position: relative;
  z-index: 1;
}

.tool-tagline {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.vibe-rating {
  position: relative;
  z-index: 1;
}

.star-filled {
  color: var(--yellow);
}

.star-empty {
  color: rgba(255, 255, 255, 0.2);
}

.win-loss {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  position: relative;
  z-index: 1;
}

.wins {
  color: #4ade80;
}

.losses {
  color: #f87171;
}

.battle-arena {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  background: linear-gradient(180deg, rgba(30, 30, 50, 0.5), rgba(10, 10, 20, 0.8));
  border-radius: 20px;
  border: 2px solid rgba(131, 56, 236, 0.3);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.arena-fighter {
  flex: 1;
  min-width: 120px;
  max-width: 200px;
}

.fighter-display {
  text-align: center;
  animation: float 3s ease-in-out infinite;
}

.fighter-display.left {
  animation-delay: 0s;
}

.fighter-display.right {
  animation-delay: 1.5s;
}

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

.fighter-icon {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.fighter-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  color: var(--cyan);
}

.empty-slot {
  width: 100px;
  height: 100px;
  border: 3px dashed rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.3);
  margin: 0 auto;
}

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

.vs-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--pink), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.vs-text.battling {
  animation: pulse 0.3s ease-in-out infinite;
}

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

.battle-button {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border: none;
  border-radius: 50px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.battle-button:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(255, 0, 110, 0.6);
}

.battle-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.battle-results {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 100;
  overflow-y: auto;
}

.berrry-banner {
  background: linear-gradient(135deg, #ff006e, #ff4d94);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 700;
  margin-bottom: 1rem;
  animation: bounce 0.5s ease;
}

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

.winner-announcement {
  text-align: center;
  margin-bottom: 1rem;
}

.winner-crown {
  font-size: 3rem;
  animation: crownBounce 1s ease infinite;
}

@keyframes crownBounce {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-15px) rotate(5deg); }
}

.winner-icon {
  font-size: 5rem;
  margin: 0.5rem 0;
}

.winner-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.battle-quote {
  font-style: italic;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2rem;
  text-align: center;
}

.stats-comparison {
  display: flex;
  gap: 2rem;
  width: 100%;
  max-width: 600px;
  flex-wrap: wrap;
}

.stats-column {
  flex: 1;
  min-width: 200px;
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 12px;
}

.stats-header {
  font-family: 'Orbitron', sans-serif;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--cyan);
}

.stat-bar-container {
  margin-bottom: 0.75rem;
}

.stat-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease-out;
}

.bg-cyan { background: var(--cyan); }
.bg-pink { background: var(--pink); }
.bg-purple { background: var(--purple); }
.bg-orange { background: var(--orange); }
.bg-red { background: #ef4444; }

.close-results {
  margin-top: 2rem;
  font-family: 'Orbitron', sans-serif;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  border: none;
  border-radius: 50px;
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.close-results:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(0, 245, 212, 0.5);
}

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
  animation: fall 3s ease-out forwards;
}

@keyframes fall {
  to {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.roster-section {
  margin-bottom: 2rem;
}

.section-title {
  font-family: 'Orbitron', sans-serif;
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--purple);
}

.leaderboard {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.leaderboard-header h3 {
  font-family: 'Orbitron', sans-serif;
  color: var(--yellow);
}

.reset-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  color: white;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.reset-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.no-battles {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  padding: 1rem;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.rank {
  font-size: 1.2rem;
  min-width: 40px;
}

.tool-entry {
  flex: 1;
}

.record {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  color: var(--cyan);
}

.secret-unlock {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  padding: 1rem 2rem;
  border-radius: 12px;
  text-align: center;
  margin: 2rem 0;
  animation: rainbow 2s linear infinite;
}

@keyframes rainbow {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 2rem;
}

.footer a {
  color: var(--pink);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: var(--cyan);
}

.disclaimer {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.5rem;
}

@media (max-width: 480px) {
  .fighter-icon {
    font-size: 3rem;
  }
  
  .vs-text {
    font-size: 1.5rem;
  }
  
  .battle-button {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .winner-text {
    font-size: 1.5rem;
  }
  
  .stats-comparison {
    flex-direction: column;
  }
}