:root {
  --bg: #130a04;
  --surface: #24140b;
  --panel: #361f12;
  --line: #4e2f1d;
  --text: #fef3c7;
  --muted: #d97706;
  --gold: #f59e0b;
  --amber: #fbbf24;
  --teal: #10b981;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Lexend", system-ui, sans-serif;
}

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

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--surface);
  border-bottom: 2px solid var(--line);
  padding: 0.75rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  font-size: 2rem;
  background: linear-gradient(135deg, #d97706, #92400e);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.brand h1 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
}

.brand p {
  font-size: 0.8rem;
  color: #fbbf24;
}

.controls-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.controls-bar select {
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: #fff;
  cursor: pointer;
  outline: none;
}

.btn-header {
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-header:hover {
  background: var(--gold);
  color: #130a04;
}

main {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Music HUD */
.music-hud {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 0.8rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #d97706;
}

.hud-val {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
}

.prompt-box {
  flex: 1;
  text-align: center;
}

.topic-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mission-text {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.hud-streak {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold);
}

/* Arena Card */
.arena-card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 22px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* Instrument Player */
.instrument-player {
  background: radial-gradient(circle at 10% 20%, #3d2315, var(--surface) 90%);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 1.4rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.instrument-pic {
  font-size: 4rem;
  background: var(--panel);
  border: 2px solid var(--gold);
  width: 86px;
  height: 86px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
  animation: notePulse 3s infinite;
}

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

.player-controls {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.btn-play-note {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 800;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #130a04;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-play-note:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.clue-caption {
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.45;
}

/* Rhythm Tap Pad */
.rhythm-container {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 600px;
  width: 100%;
}

.rhythm-instructions {
  font-size: 0.95rem;
  color: var(--amber);
  font-weight: 700;
}

.btn-tap-beat {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 800;
  padding: 1.2rem 2.8rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #d97706, #92400e);
  color: #fff;
  border: 3px solid #fbbf24;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.4);
  transition: transform 0.1s;
}

.btn-tap-beat:active {
  transform: scale(0.95);
  background: #f59e0b;
}

.rhythm-feedback {
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
}

/* Choices Grid */
.choices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  width: 100%;
  max-width: 640px;
}

.choice-btn {
  font-family: var(--body);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 1.1rem 1.4rem;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.choice-btn:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  background: #472a19;
}

.choice-btn.correct {
  background: #064e3b;
  border-color: var(--teal);
  color: #a7f3d0;
}

.choice-btn.wrong {
  background: #7f1d1d;
  border-color: #ef4444;
  color: #fecaca;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(19, 10, 4, 0.85);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 22px;
  padding: 2.2rem 2rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.modal-card h2 {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
}

.modal-card p {
  color: #cbd5e1;
  margin: 0.6rem 0 1.2rem;
}

.badge-award {
  background: var(--panel);
  border: 2px solid var(--gold);
  padding: 0.8rem 1.4rem;
  border-radius: 12px;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.modal-btn {
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #130a04;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

