:root {
  --bg-dark: #120e1f;
  --bg-card: #1e1a2f;
  --magenta: #e900ff;
  --cyan: #00ffed;
  --lime: #00ff66;
  --purple: #9333ea;
  --yellow: #fbbf24;
}

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

body {
  font-family: 'Orbitron', sans-serif;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1528 50%, var(--bg-dark) 100%);
  min-height: 100vh;
  color: #fff;
  overflow-x: hidden;
}

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

.main-content {
  flex: 1;
  padding-bottom: 60px;
}

/* Header */
.header-bar {
  background: rgba(30, 26, 47, 0.9);
  border-bottom: 1px solid rgba(233, 0, 255, 0.3);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-text {
  font-family: 'Press Start 2P', cursive;
  background: linear-gradient(90deg, var(--magenta), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(233, 0, 255, 0.5);
  font-size: 0.9rem;
}

@media (min-width: 640px) {
  .logo-text {
    font-size: 1.2rem;
  }
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(30, 26, 47, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.85rem;
}

/* Glass Card */
.glass-card {
  background: rgba(30, 26, 47, 0.7);
  border: 1px solid rgba(233, 0, 255, 0.2);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 40px rgba(233, 0, 255, 0.1);
}

/* BPM Slider */
.bpm-slider {
  -webkit-appearance: none;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--magenta), var(--cyan));
  outline: none;
}

.bpm-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 0 20px var(--cyan);
}

/* Genre Pills */
.genre-pill {
  padding: 8px 16px;
  border-radius: 20px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
}

.genre-pill:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(0, 255, 237, 0.3);
}

.genre-pill.active {
  background: linear-gradient(90deg, var(--magenta), var(--cyan));
  border-color: transparent;
  box-shadow: 0 0 20px rgba(233, 0, 255, 0.5);
}

/* Role Cards */
.role-card {
  padding: 20px;
  border-radius: 12px;
  background: rgba(30, 26, 47, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.role-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(233, 0, 255, 0.2);
}

.role-card.selected {
  border-color: var(--magenta);
  box-shadow: 0 0 30px rgba(233, 0, 255, 0.4);
}

.role-magenta.selected { border-color: var(--magenta); box-shadow: 0 0 30px rgba(233, 0, 255, 0.4); }
.role-cyan.selected { border-color: var(--cyan); box-shadow: 0 0 30px rgba(0, 255, 237, 0.4); }
.role-lime.selected { border-color: var(--lime); box-shadow: 0 0 30px rgba(0, 255, 102, 0.4); }
.role-purple.selected { border-color: var(--purple); box-shadow: 0 0 30px rgba(147, 51, 234, 0.4); }

/* Start Button */
.start-button {
  padding: 16px 48px;
  font-size: 1.1rem;
  font-family: 'Orbitron', sans-serif;
  font-weight: bold;
  background: linear-gradient(90deg, var(--magenta), var(--cyan));
  border: none;
  border-radius: 30px;
  color: #fff;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.start-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  100% { left: 100%; }
}

.start-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(233, 0, 255, 0.6);
}

/* Countdown */
.countdown-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60vh;
}

.countdown-number {
  font-size: 8rem;
  font-weight: 900;
  background: linear-gradient(90deg, var(--magenta), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pulse 1s ease-in-out infinite;
}

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

/* Session Header */
.session-timer {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--cyan);
}

.session-timer.pulse-warning {
  color: #ff4444;
  animation: pulse 0.5s infinite;
}

.end-button {
  padding: 8px 16px;
  background: rgba(255, 68, 68, 0.3);
  border: 1px solid #ff4444;
  border-radius: 8px;
  color: #ff4444;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
}

/* Sequencer */
.sequencer-container {
  position: relative;
  padding: 10px 0;
}

.sequencer-grid {
  display: flex;
  gap: 4px;
  min-width: max-content;
}

.sequencer-step {
  width: 40px;
  height: 60px;
  background: rgba(30, 26, 47, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.sequencer-step.active {
  background: rgba(0, 255, 237, 0.3);
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(0, 255, 237, 0.5);
}

.sequencer-step.has-content {
  background: rgba(233, 0, 255, 0.2);
}

.step-number {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
}

.step-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 4px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.dot-beat { background: var(--magenta); }
.dot-melody { background: var(--cyan); }
.dot-bass { background: var(--lime); }
.dot-fx { background: var(--purple); }

.playhead {
  position: absolute;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--lime);
  box-shadow: 0 0 15px var(--lime);
  transition: left 0.1s linear;
  pointer-events: none;
}

/* Instrument Panels */
.instrument-panel {
  min-height: 200px;
}

.drum-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 400px;
  margin: 0 auto;
}

.drum-pad {
  aspect-ratio: 1;
  min-height: 80px;
  background: linear-gradient(135deg, rgba(233, 0, 255, 0.3), rgba(147, 51, 234, 0.3));
  border: 2px solid var(--magenta);
  border-radius: 16px;
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.drum-pad:hover {
  box-shadow: 0 0 30px rgba(233, 0, 255, 0.5);
}

.drum-pad:active, .drum-pad.active {
  transform: scale(0.95);
  background: linear-gradient(135deg, var(--magenta), var(--purple));
  box-shadow: 0 0 50px var(--magenta);
}

.melody-grid {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.melody-key {
  width: 50px;
  height: 120px;
  background: linear-gradient(180deg, #fff 0%, #ddd 100%);
  border: 1px solid #999;
  border-radius: 0 0 8px 8px;
  color: #333;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.1s ease;
}

.melody-key:hover {
  background: linear-gradient(180deg, var(--cyan), #00ccbb);
  color: #fff;
}

.melody-key:active {
  transform: translateY(4px);
  box-shadow: 0 0 20px var(--cyan);
}

.bass-grid, .fx-grid {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.bass-button {
  padding: 20px 40px;
  background: linear-gradient(135deg, rgba(0, 255, 102, 0.3), rgba(0, 200, 80, 0.3));
  border: 2px solid var(--lime);
  border-radius: 12px;
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.1s ease;
}

.bass-button:hover {
  box-shadow: 0 0 30px rgba(0, 255, 102, 0.5);
}

.bass-button:active {
  transform: scale(0.95);
  background: var(--lime);
  color: #000;
}

.fx-button {
  padding: 20px 40px;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.3), rgba(100, 30, 180, 0.3));
  border: 2px solid var(--purple);
  border-radius: 12px;
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.1s ease;
}

.fx-button:hover {
  box-shadow: 0 0 30px rgba(147, 51, 234, 0.5);
}

.fx-button:active {
  transform: scale(0.95);
  background: var(--purple);
}

/* Players Bar */
.players-bar {
  padding: 10px;
  background: rgba(30, 26, 47, 0.5);
  border-radius: 12px;
}

.player-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.player-avatar.you {
  background: linear-gradient(135deg, var(--magenta), var(--cyan));
  border: 2px solid #fff;
}

.player-avatar.ai {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Reactions */
.reaction-bar {
  padding: 10px;
}

.reaction-btn {
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  background: rgba(30, 26, 47, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reaction-btn:hover {
  transform: scale(1.2);
  border-color: var(--yellow);
}

.floating-reaction {
  position: fixed;
  bottom: 150px;
  font-size: 2rem;
  animation: floatUp 2s ease-out forwards;
  pointer-events: none;
  z-index: 1000;
}

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

/* Results */
.results-stats {
  margin-top: 20px;
}

.stat-box {
  background: rgba(30, 26, 47, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--cyan);
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

.mvp-badge {
  padding: 12px 24px;
  background: linear-gradient(90deg, var(--yellow), #fcd34d);
  border-radius: 30px;
  color: #000;
  font-weight: bold;
  display: inline-block;
  animation: pulse 1s infinite;
}

.rewards-display {
  padding: 20px 0;
}

.reward-item {
  text-align: center;
}

.reward-value {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  color: var(--lime);
}

.reward-label {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.level-progress {
  max-width: 300px;
  margin: 0 auto;
}

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

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--magenta), var(--cyan));
  transition: width 0.5s ease;
}

/* Footer */
.footer {
  padding: 20px;
  text-align: center;
  background: rgba(18, 14, 31, 0.9);
  border-top: 1px solid rgba(233, 0, 255, 0.2);
}

.footer a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.3s ease;
}

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

/* Responsive */
@media (max-width: 640px) {
  .sequencer-step {
    width: 32px;
    height: 50px;
  }
  
  .drum-pad {
    min-height: 70px;
  }
  
  .melody-key {
    width: 40px;
    height: 100px;
  }
  
  .bass-button, .fx-button {
    padding: 16px 24px;
    font-size: 0.9rem;
  }
  
  .session-timer {
    font-size: 1.2rem;
  }
}