/* Sax Hero - Saxophone-Centered Game */

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

:root {
  --bg: #0a0a12;
  --pink: #f72585;
  --purple: #7209b7;
  --blue: #4361ee;
  --cyan: #4cc9f0;
  --gold: #d4a853;
  --gold-dark: #8b6914;
  --gold-light: #f4d03f;
  --text: #ffffff;
  --muted: #888888;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: rgba(10, 10, 18, 0.95);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  z-index: 1000;
  border-bottom: 1px solid rgba(247, 37, 133, 0.2);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: bold;
}

.nav-logo img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-links a {
  padding: 0.4rem 0.8rem;
  text-decoration: none;
  color: var(--muted);
  border-radius: 4px;
  font-size: 0.85rem;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--pink);
  background: rgba(247, 37, 133, 0.1);
}

/* Screens */
.screen {
  display: none;
  min-height: 100vh;
  padding-top: 50px;
}

.screen.active {
  display: flex;
}

/* Start Screen */
.start-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f1a 100%);
  padding: 1rem;
}

.start-screen h1 {
  font-size: clamp(2.5rem, 10vw, 4rem);
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.tagline {
  color: var(--muted);
  margin-bottom: 2rem;
}

.track-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(247, 37, 133, 0.3);
  border-radius: 10px;
  padding: 1rem 2rem;
  margin-bottom: 1.5rem;
}

.track-name {
  font-size: 1.3rem;
  color: var(--cyan);
  font-weight: bold;
}

.track-artist {
  color: var(--muted);
  font-size: 0.9rem;
}

.btn-play {
  padding: 0.8rem 2.5rem;
  font-size: 1.1rem;
  font-weight: bold;
  border: none;
  border-radius: 30px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-play:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(247, 37, 133, 0.5);
}

.btn-play:disabled {
  background: #444;
  cursor: not-allowed;
}

.controls-hint {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.key-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.key-hint b {
  color: var(--gold);
}

/* Game Screen */
.game-screen {
  flex-direction: column;
  background: linear-gradient(180deg, #0a0a12 0%, #1a1a2e 100%);
  position: relative;
}

/* HUD */
.hud {
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 100;
}

.hud-score, .hud-combo {
  background: rgba(0, 0, 0, 0.5);
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.hud-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
}

.hud-score #score {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--cyan);
}

.hud-combo {
  text-align: right;
}

.hud-combo #combo {
  font-size: 2rem;
  font-weight: bold;
  color: var(--pink);
}

.hud-combo #multiplier {
  font-size: 1rem;
  color: var(--gold);
}

/* Feedback */
.feedback {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.5rem;
  font-weight: bold;
  text-transform: uppercase;
  opacity: 0;
  z-index: 200;
  text-shadow: 0 0 20px currentColor;
  pointer-events: none;
}

.feedback.show {
  animation: feedbackPop 0.5s ease-out;
}

.feedback.perfect { color: var(--cyan); }
.feedback.good { color: var(--gold); }
.feedback.miss { color: #ef233c; }

@keyframes feedbackPop {
  0% { opacity: 0; transform: translateX(-50%) scale(0.5); }
  20% { opacity: 1; transform: translateX(-50%) scale(1.2); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* Saxophone Game Area */
.sax-game-area {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  position: relative;
  padding-bottom: 50px;
}

/* Note Highway - 10 lanes total */
.note-highway {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: calc(100% - 250px);
  display: flex;
  flex-direction: row;
  z-index: 10;
}

/* Lane Labels - horizontal at TOP of highway */
.lane-labels {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  z-index: 15;
}

.lane-label {
  width: 30px;
  text-align: center;
  font-size: 0.65rem;
  font-weight: bold;
  color: var(--muted);
  text-transform: uppercase;
}

/* Special Bars for Octave and Power - RIGHT side tall bars */
.special-bars {
  position: absolute;
  top: 100px;
  right: 30px;
  bottom: 250px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 20;
}

.special-bar {
  width: 70px;
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 3px solid var(--muted);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.1s;
}

.special-bar .label {
  font-size: 0.7rem;
  font-weight: bold;
  color: var(--muted);
  letter-spacing: 1px;
}

.special-bar .key {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--text);
}

/* Octave bar - cyan theme */
.special-bar.octave.active {
  background: linear-gradient(180deg, rgba(76, 201, 240, 0.3), rgba(76, 201, 240, 0.6));
  border-color: var(--cyan);
  box-shadow: 0 0 30px var(--cyan), inset 0 0 30px rgba(76, 201, 240, 0.3);
  animation: octavePulse 0.15s infinite alternate;
}

/* Power bar - pink/purple theme */
.special-bar.power.active {
  background: linear-gradient(180deg, rgba(247, 37, 133, 0.3), rgba(114, 9, 183, 0.6));
  border-color: var(--pink);
  box-shadow: 0 0 30px var(--pink), inset 0 0 30px rgba(247, 37, 133, 0.3);
  animation: powerPulse 0.1s infinite alternate;
}

@keyframes octavePulse {
  0% {
    box-shadow: 0 0 20px var(--cyan), inset 0 0 20px rgba(76, 201, 240, 0.2);
    border-color: var(--cyan);
  }
  100% {
    box-shadow: 0 0 50px var(--cyan), 0 0 80px var(--blue), inset 0 0 40px rgba(76, 201, 240, 0.5);
    border-color: var(--blue);
  }
}

@keyframes powerPulse {
  0% {
    box-shadow: 0 0 20px var(--pink), inset 0 0 20px rgba(247, 37, 133, 0.2);
    border-color: var(--pink);
    background: linear-gradient(180deg, rgba(247, 37, 133, 0.3), rgba(114, 9, 183, 0.6));
  }
  100% {
    box-shadow: 0 0 60px var(--pink), 0 0 100px var(--purple), inset 0 0 50px rgba(247, 37, 133, 0.6);
    border-color: #ff00ff;
    background: linear-gradient(180deg, rgba(255, 0, 255, 0.4), rgba(247, 37, 133, 0.8));
  }
}

.lane {
  flex: 1;
  position: relative;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Strike Zone - matches highway width */
.strike-zone {
  position: absolute;
  bottom: 200px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 4px;
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--blue), var(--cyan));
  box-shadow: 0 0 20px var(--pink);
  z-index: 20;
}

/* Notes */
.note {
  position: absolute;
  width: 26px;
  height: 12px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  border: 2px solid var(--gold-dark);
  border-radius: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  box-shadow: 0 0 6px rgba(212, 168, 83, 0.5);
}

.note.power {
  background: linear-gradient(180deg, #ff6b9d, var(--pink));
  border-color: var(--purple);
  width: 34px;
  box-shadow: 0 0 12px var(--pink);
  animation: notePulse 0.3s infinite alternate;
}

/* Long/Held Notes */
.note.long {
  border-radius: 6px 6px 0 0;
}

.note .note-tail {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  border-left: 2px solid var(--gold-dark);
  border-right: 2px solid var(--gold-dark);
  opacity: 0.8;
}

.note.long.holding .note-tail {
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  border-color: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.note.long.dropped .note-tail {
  background: linear-gradient(180deg, #666, #444);
  border-color: #555;
  opacity: 0.4;
}

@keyframes notePulse {
  from { box-shadow: 0 0 10px var(--pink); }
  to { box-shadow: 0 0 25px var(--pink); }
}

.note.hit {
  animation: noteHit 0.2s forwards;
}

@keyframes noteHit {
  to { transform: translateX(-50%) scale(1.5); opacity: 0; }
}

.note.miss {
  opacity: 0.3;
  filter: grayscale(1);
}

/* Saxophone */
.saxophone {
  position: relative;
  width: 180px;
  max-width: 180px;
  height: 240px;
  max-height: 240px;
  z-index: 50;
  flex-shrink: 0;
}

.sax-svg {
  width: 180px;
  height: 240px;
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 0 15px rgba(212, 168, 83, 0.3));
}

/* Sax Keys */
.sax-keys {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.sax-key {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--gold-light), var(--gold-dark));
  border: 2px solid var(--gold-dark);
  color: #1a1a2e;
  font-weight: bold;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.05s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.sax-key.palm { width: 24px; height: 24px; font-size: 0.7rem; }
.sax-key.pinky { width: 26px; height: 26px; }

.sax-key.pressed,
.sax-key:active {
  background: linear-gradient(145deg, var(--pink), #b5179e);
  border-color: var(--pink);
  color: white;
  box-shadow: 0 0 20px var(--pink), 0 0 40px rgba(247, 37, 133, 0.5);
  transform: scale(1.1);
}

.sax-key.hit {
  animation: keyHit 0.2s;
}

@keyframes keyHit {
  50% { box-shadow: 0 0 30px var(--cyan), 0 0 60px var(--cyan); }
}

/* Power Button */
.power-btn {
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.4rem 1rem;
  background: linear-gradient(135deg, #2a2a4a, #1a1a2e);
  border: 2px solid var(--purple);
  border-radius: 15px;
  color: var(--muted);
  font-weight: bold;
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.1s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.power-btn:hover {
  border-color: var(--pink);
  color: var(--pink);
}

.power-btn.active {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border-color: white;
  color: white;
  box-shadow: 0 0 30px var(--pink);
}

/* Effects */
.sparkles, .fart {
  position: fixed;
  pointer-events: none;
  z-index: 500;
}

.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--cyan);
  animation: sparkleFly 0.5s forwards;
}

@keyframes sparkleFly {
  to { opacity: 0; transform: translate(var(--x), var(--y)) scale(0); }
}

.fart.active::before {
  content: '';
  position: fixed;
  bottom: 200px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 60px;
  background: radial-gradient(ellipse, rgba(139, 105, 20, 0.6), transparent);
  border-radius: 50%;
  filter: blur(10px);
  animation: fartPoof 0.6s forwards;
}

@keyframes fartPoof {
  0% { opacity: 0.8; transform: translateX(-50%) scale(0.5); }
  100% { opacity: 0; transform: translateX(-50%) scale(2) translateY(-50px); }
}

/* Progress */
.progress-bar {
  position: absolute;
  bottom: 25px;
  left: 1rem;
  right: 1rem;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  border-radius: 2px;
  width: 0%;
}

.time {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--muted);
}

/* Game Over Screen */
.gameover-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 18, 0.98);
  text-align: center;
}

.gameover-screen h2 {
  font-size: 2.5rem;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2rem;
}

.stats {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(247, 37, 133, 0.2);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  min-width: 280px;
}

.stat {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat:last-child {
  border-bottom: none;
}

.stat span:first-child {
  color: var(--muted);
}

.stat span:last-child {
  font-weight: bold;
  color: var(--cyan);
}

.spotify-link {
  display: block;
  margin-top: 1.5rem;
  color: var(--pink);
  text-decoration: none;
}

.spotify-link:hover {
  text-decoration: underline;
}

/* YouTube Container (hidden) */
#yt-container {
  position: fixed;
  top: -9999px;
  left: -9999px;
  width: 200px;
  height: 200px;
  opacity: 0;
  pointer-events: none;
}

/* Show screens */
#start-screen { display: flex; }
#game-screen { display: none; }
#gameover-screen { display: none; }

#game-screen.active { display: flex; }
#gameover-screen.active { display: flex; }
#start-screen.hidden { display: none; }
