/* =========================================================================
   PianoBoss — visual design system
   Palette: obsidian background, warm brass accent, piano ivory, ember red.
   Typography: Playfair Display (serif, brand) + Inter (UI).
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Core palette */
  --bg-0:        #08080c;       /* deepest background */
  --bg-1:        #0f0f16;       /* panel bg */
  --bg-2:        #181823;       /* elevated panel */
  --bg-3:        #22222f;       /* hover */
  --line:        rgba(201,165,90,0.12);

  /* Brass / gold — the PianoBoss signature */
  --brass:       #c9a55a;
  --brass-hi:    #e8c886;
  --brass-lo:    #8a6e3a;
  --brass-glow:  rgba(201,165,90,0.35);

  /* Piano-inspired */
  --ivory:       #f5ecd9;
  --ivory-warm:  #e6dcc3;
  --ebony:       #0c0c12;

  /* Level accents */
  --beginner:    #7fb069;     /* sage green */
  --intermed:    #5aa0d6;     /* sky blue */
  --advanced:    #b96ad6;     /* royal violet */

  /* Semantic */
  --text:        #ece5d5;
  --text-dim:    #98927f;
  --muted:       #6c6759;
  --success:     #7fb069;
  --error:       #e07b5a;

  /* Key colors */
  --white-key:            #f5ecd9;
  --white-key-active:     #ffe8a8;
  --white-key-target:     #bfe0ff;
  --white-key-correct:    #a6e0a6;
  --white-key-wrong:      #ffb3a3;
  --black-key:            #16161e;
  --black-key-active:     #c9a55a;
  --black-key-target:     #5aa0d6;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(ellipse 1200px 600px at 20% -10%, rgba(201,165,90,0.08), transparent 60%),
    radial-gradient(ellipse 900px 500px at 90% 110%, rgba(185,106,214,0.06), transparent 60%),
    var(--bg-0);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* =========================================================================
   Header
   ========================================================================= */
header {
  padding: 18px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(10,10,16,0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-logo {
  width: 38px; height: 38px;
  display: inline-block;
  position: relative;
}
h1.brand-name {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 0.5px;
  color: var(--ivory);
}
h1.brand-name span {
  color: var(--brass);
  font-style: italic;
  font-weight: 700;
}
h1 { /* fallback for old markup */
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 0.5px;
  color: var(--ivory);
}
h1 span { color: var(--brass); font-style: italic; font-weight: 700; }

nav { display: flex; gap: 4px; background: rgba(255,255,255,0.03); padding: 4px; border-radius: 10px; border: 1px solid var(--line); }
.nav-btn {
  padding: 8px 16px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font: 500 13px 'Inter', sans-serif;
  letter-spacing: 0.2px;
  transition: all 0.18s;
}
.nav-btn:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-btn.active {
  color: var(--ebony);
  background: linear-gradient(180deg, var(--brass-hi), var(--brass));
  box-shadow: 0 2px 10px var(--brass-glow);
}
.user-menu { display: flex; align-items: center; gap: 10px; }

/* =========================================================================
   Container + typography
   ========================================================================= */
.container { max-width: 1280px; margin: 0 auto; padding: 32px 40px 60px; }
h2, h3 { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--ivory); }
h2 { font-size: 32px; margin: 0 0 8px 0; letter-spacing: 0.3px; }
h3 { font-size: 20px; margin: 0 0 10px 0; }

.view { display: none; }
.view.active { display: block; }

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  position: relative;
  background:
    linear-gradient(180deg, rgba(20,20,28,0.95) 0%, rgba(12,12,18,0.95) 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 56px 40px 44px;
  margin-bottom: 28px;
  text-align: center;
  overflow: hidden;
}
/* Faint keyboard pattern as hero background */
.hero::before {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 120px;
  background-image:
    linear-gradient(180deg, transparent 0%, rgba(245,236,217,0.025) 60%, rgba(245,236,217,0.04) 100%),
    repeating-linear-gradient(90deg,
      rgba(245,236,217,0.03) 0,
      rgba(245,236,217,0.03) 44px,
      rgba(12,12,18,0.6) 44px,
      rgba(12,12,18,0.6) 46px);
  pointer-events: none;
  opacity: 0.7;
}
/* Decorative brass line above content */
.hero::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 26px;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
  transform: translateX(-50%);
}
.hero h2 {
  font-size: 40px;
  letter-spacing: 0.3px;
  margin: 0 0 12px 0;
}
.hero p {
  color: var(--text-dim);
  margin: 0 0 30px 0;
  font-size: 15px;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

.stats {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.stat {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  padding: 18px 28px;
  border-radius: 12px;
  min-width: 150px;
  transition: all 0.2s;
}
.stat:hover { border-color: var(--brass-lo); transform: translateY(-1px); }
.stat .num {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--brass-hi);
  line-height: 1;
}
.stat .lbl {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 8px;
  font-weight: 500;
}

/* =========================================================================
   Track cards
   ========================================================================= */
.tracks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}
.track-card {
  position: relative;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 24px 24px;
  transition: all 0.25s;
  overflow: hidden;
}
.track-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
  opacity: 0.7;
}
.track-card:hover {
  border-color: rgba(201,165,90,0.3);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
/* Level-specific accent stripes */
.track-card:nth-child(1)::before { background: linear-gradient(90deg, transparent, var(--beginner), transparent); }
.track-card:nth-child(2)::before { background: linear-gradient(90deg, transparent, var(--intermed), transparent); }
.track-card:nth-child(3)::before { background: linear-gradient(90deg, transparent, var(--advanced), transparent); }

.track-card h3 {
  font-size: 24px;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.track-card .track-desc {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.5;
}
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brass-lo), var(--brass-hi));
  box-shadow: 0 0 10px var(--brass-glow);
  transition: width 0.5s ease;
}
.track-card:nth-child(1) .progress-fill { background: linear-gradient(90deg, #4d7d3d, var(--beginner)); box-shadow: 0 0 10px rgba(127,176,105,0.4); }
.track-card:nth-child(2) .progress-fill { background: linear-gradient(90deg, #376b95, var(--intermed)); box-shadow: 0 0 10px rgba(90,160,214,0.4); }
.track-card:nth-child(3) .progress-fill { background: linear-gradient(90deg, #7a4390, var(--advanced)); box-shadow: 0 0 10px rgba(185,106,214,0.4); }

.progress-text { font-size: 11px; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; }

.lesson-list { margin-top: 18px; }
.lesson-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.lesson-item:hover {
  background: rgba(201,165,90,0.06);
  border-color: rgba(201,165,90,0.15);
  transform: translateX(2px);
}
.lesson-item.done {
  background: rgba(127,176,105,0.05);
}
.lesson-item.locked { opacity: 0.55; cursor: not-allowed; }
.lesson-item.locked:hover { background: rgba(255,255,255,0.02); transform: none; border-color: transparent; }
.lesson-item .check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(236,229,213,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  transition: all 0.2s;
}
.lesson-item.done .check { background: var(--success); border-color: var(--success); color: var(--ebony); }
.lesson-item .info { flex: 1; min-width: 0; }
.lesson-item .title { font-size: 14px; font-weight: 500; color: var(--text); }
.lesson-item .meta {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-top: 2px;
  font-weight: 600;
}

.pro-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--brass-hi), var(--brass-lo));
  color: var(--ebony);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 1.5px;
  vertical-align: middle;
  margin-left: 6px;
}

/* =========================================================================
   Upgrade card
   ========================================================================= */
.upgrade-card {
  background: linear-gradient(135deg, rgba(201,165,90,0.08) 0%, rgba(12,12,18,0.4) 60%);
  border: 1px solid rgba(201,165,90,0.25);
  border-radius: 16px;
  padding: 28px 32px;
  margin-top: 24px;
  text-align: center;
}
.upgrade-card h3 { font-size: 22px; color: var(--brass-hi); margin-bottom: 8px; }
.upgrade-card p { color: var(--text-dim); margin: 0 0 16px 0; font-size: 14px; }

/* =========================================================================
   Info / prompt panel
   ========================================================================= */
.info-panel {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 26px;
  margin-bottom: 20px;
  border-left: 3px solid var(--brass);
}
.info-panel h2 { font-size: 22px; margin: 0 0 8px 0; }
.info-panel p { margin: 0; color: var(--text-dim); line-height: 1.6; }

/* =========================================================================
   Lesson header & prompt
   ========================================================================= */
.lesson-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.lesson-header h2 { font-size: 26px; }

.lesson-prompt {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px 28px;
  margin-bottom: 20px;
  text-align: center;
}
.lesson-prompt .big-note {
  font-family: 'Playfair Display', serif;
  font-size: 64px;
  font-weight: 700;
  color: var(--brass-hi);
  margin: 14px 0;
  letter-spacing: 3px;
  text-shadow: 0 0 30px var(--brass-glow);
}
.lesson-prompt .instruction { color: var(--text-dim); font-size: 15px; }
.lesson-prompt .score {
  display: inline-block;
  background: rgba(201,165,90,0.08);
  border: 1px solid rgba(201,165,90,0.25);
  color: var(--brass-hi);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  margin-top: 12px;
  letter-spacing: 0.5px;
  font-weight: 500;
}
.feedback {
  padding: 14px 18px;
  border-radius: 10px;
  margin-top: 18px;
  font-weight: 500;
  display: none;
  font-size: 14px;
}
.feedback.show { display: block; }
.feedback.correct { background: rgba(127,176,105,0.12); color: var(--success); border: 1px solid rgba(127,176,105,0.4); }
.feedback.wrong { background: rgba(224,123,90,0.12); color: var(--error); border: 1px solid rgba(224,123,90,0.4); }

.answer-choices {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.choice-btn {
  padding: 12px 26px;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font: 500 15px 'Inter', sans-serif;
  min-width: 80px;
  transition: all 0.15s;
}
.choice-btn:hover {
  background: var(--bg-3);
  border-color: var(--brass);
  color: var(--brass-hi);
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 20px;
  font: 500 14px 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.2px;
}
.btn:hover { background: var(--bg-3); border-color: var(--brass-lo); color: var(--brass-hi); }
.btn-primary {
  background: linear-gradient(180deg, var(--brass-hi) 0%, var(--brass) 100%);
  color: var(--ebony);
  border: 1px solid var(--brass);
  font-weight: 600;
  box-shadow: 0 2px 16px var(--brass-glow);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #f4d89a 0%, var(--brass-hi) 100%);
  color: var(--ebony);
  border-color: var(--brass-hi);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--brass-glow);
}

/* =========================================================================
   Level chips (Free Play range selector)
   ========================================================================= */
.level-selector { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 24px; }
.level-chip {
  padding: 9px 18px;
  background: var(--bg-2);
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font: 500 13px 'Inter', sans-serif;
  transition: all 0.15s;
  letter-spacing: 0.2px;
}
.level-chip:hover { color: var(--text); border-color: var(--brass-lo); }
.level-chip.active {
  background: linear-gradient(180deg, var(--brass-hi), var(--brass));
  color: var(--ebony);
  border-color: var(--brass);
  font-weight: 600;
}

/* =========================================================================
   Sound bank
   ========================================================================= */
.soundbank {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
}
.soundbank-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.current-patch {
  color: var(--brass-hi);
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 15px;
}
.categories { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cat-btn {
  padding: 8px 16px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font: 500 12px 'Inter', sans-serif;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.15s;
}
.cat-btn:hover { color: var(--text); border-color: var(--brass-lo); }
.cat-btn.active { color: var(--brass-hi); border-color: var(--brass); background: rgba(201,165,90,0.05); }
.patches { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.patch-btn {
  padding: 12px 14px;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font: 500 13px 'Inter', sans-serif;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.15s;
}
.patch-btn:hover { background: var(--bg-3); border-color: var(--brass-lo); }
.patch-btn.active {
  background: linear-gradient(135deg, rgba(201,165,90,0.15), rgba(201,165,90,0.05));
  border-color: var(--brass);
  color: var(--brass-hi);
}
.patch-btn .engine {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}

/* =========================================================================
   Falling notes (play-along)
   ========================================================================= */
.falling-stage {
  position: relative;
  height: 300px;
  background:
    linear-gradient(180deg, rgba(10,10,18,0.95) 0%, rgba(20,20,30,0.95) 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}
.falling-note {
  position: absolute;
  background: linear-gradient(180deg, var(--brass-hi), var(--brass));
  border-radius: 4px;
  box-shadow: 0 0 14px var(--brass-glow), inset 0 1px 0 rgba(255,255,255,0.2);
  color: var(--ebony);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 4px;
}
.falling-note.hit { background: linear-gradient(180deg, #9fd085, var(--success)); box-shadow: 0 0 16px rgba(127,176,105,0.5); }
.falling-note.miss { background: linear-gradient(180deg, var(--error), #b85a3f); opacity: 0.45; }
.strike-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brass-hi) 20%, var(--brass-hi) 80%, transparent);
  box-shadow: 0 0 12px var(--brass-glow);
}

/* =========================================================================
   Piano
   ========================================================================= */
.piano-wrap {
  background: linear-gradient(180deg, #1a1a22 0%, #0c0c12 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 20px 16px;
  overflow-x: auto;
  box-shadow: inset 0 2px 20px rgba(0,0,0,0.5);
}
.piano {
  position: relative;
  display: flex;
  height: 220px;
  user-select: none;
  min-width: min-content;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.key {
  position: relative;
  cursor: pointer;
  transition: background 0.06s, transform 0.06s;
}
.key.white {
  width: 52px;
  height: 100%;
  background: linear-gradient(180deg, var(--white-key) 0%, var(--ivory-warm) 100%);
  border: 1px solid #3a3529;
  border-radius: 0 0 5px 5px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 12px;
  color: #4a402c;
  font-size: 11px;
  font-weight: 500;
  box-shadow: inset 0 -2px 6px rgba(58,53,41,0.25);
}
.key.white:active,
.key.white.active { background: linear-gradient(180deg, var(--white-key-active), #fbd987); }
.key.white.target { background: linear-gradient(180deg, var(--white-key-target), #9fc7e8); }
.key.white.correct { background: linear-gradient(180deg, var(--white-key-correct), #7fc67f); }
.key.white.wrong { background: linear-gradient(180deg, var(--white-key-wrong), #e89080); }
.key.black {
  position: absolute;
  width: 32px;
  height: 130px;
  background: linear-gradient(180deg, #2a2a33 0%, var(--black-key) 100%);
  border-radius: 0 0 4px 4px;
  z-index: 2;
  color: #ddd;
  font-size: 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 10px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.5), inset 0 -3px 2px rgba(201,165,90,0.1);
}
.key.black:active,
.key.black.active { background: linear-gradient(180deg, var(--brass-hi), var(--black-key-active)); color: var(--ebony); }
.key.black.target { background: linear-gradient(180deg, #8bc6ee, var(--black-key-target)); }
.key.black.correct { background: linear-gradient(180deg, #9fd085, var(--success)); }
.key.black.wrong { background: linear-gradient(180deg, var(--error), #b85a3f); }

.key-binding {
  font-size: 9px;
  color: rgba(0,0,0,0.35);
  margin-top: 2px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.key.black .key-binding { color: rgba(255,255,255,0.35); }
.note-label { font-weight: 600; font-size: 11px; }

/* Piano controls */
.controls {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 0 4px;
}
.controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}
.controls input[type="range"] { accent-color: var(--brass); }
.controls button {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font: 500 12px 'Inter', sans-serif;
  transition: all 0.15s;
}
.controls button:hover { border-color: var(--brass-lo); color: var(--brass-hi); }

/* =========================================================================
   Footer
   ========================================================================= */
footer {
  text-align: center;
  padding: 40px 20px 24px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.5px;
  border-top: 1px solid var(--line);
  margin-top: 60px;
}

/* =========================================================================
   Auth modal
   ========================================================================= */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,5,10,0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px 36px 30px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  position: relative;
}
.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}
.auth-tabs { display: flex; gap: 6px; margin-bottom: 22px; background: rgba(255,255,255,0.03); padding: 4px; border-radius: 10px; }
.auth-tab {
  flex: 1;
  padding: 10px;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-radius: 7px;
  font: 500 14px 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.auth-tab.active {
  background: linear-gradient(180deg, var(--brass-hi), var(--brass));
  color: var(--ebony);
  font-weight: 600;
}
.auth-field { margin-bottom: 14px; }
.auth-field label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.auth-field input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  font: 400 14px 'Inter', sans-serif;
  transition: all 0.15s;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px var(--brass-glow);
}
.auth-submit {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  font-size: 15px;
}
.auth-close {
  position: absolute;
  top: 14px; right: 14px;
  background: none; border: none;
  color: var(--text-dim); font-size: 22px; cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%;
}
.auth-close:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.auth-error { color: var(--error); font-size: 13px; margin-top: 8px; min-height: 18px; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
}
.plan-label {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg-3);
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1px;
}
.user-chip:has(.plan-label):not(:has(.plan-label:contains("Pro"))) .plan-label { background: var(--bg-3); }
/* Pro plan label gets the brass treatment */
.user-chip .plan-label { background: var(--bg-3); color: var(--text-dim); }

/* =========================================================================
   Concept lesson styling
   ========================================================================= */
.concept { max-width: 720px; margin: 0 auto; text-align: left; }
.concept-block { margin: 20px 0; line-height: 1.7; color: var(--text); font-size: 15px; }
.concept h3 {
  font-family: 'Playfair Display', serif;
  margin-top: 28px;
  margin-bottom: 8px;
  color: var(--brass-hi);
  font-size: 22px;
}
.concept p { margin: 10px 0; }
.concept ul, .concept ol { padding-left: 22px; }
.concept li { margin: 6px 0; }
.concept strong { color: var(--brass-hi); font-weight: 600; }
.concept em { color: var(--ivory-warm); }
.concept-listen, .concept-try {
  background: linear-gradient(135deg, rgba(201,165,90,0.06), rgba(12,12,18,0.3));
  border-left: 3px solid var(--brass);
  padding: 16px 20px;
  border-radius: 6px;
  margin: 18px 0;
}
.concept-try {
  border-left-color: var(--intermed);
  background: linear-gradient(135deg, rgba(90,160,214,0.06), rgba(12,12,18,0.3));
}
.concept-try .try-status { margin-top: 10px; font-size: 13px; color: var(--muted); }
.concept-try .try-status .ok { color: var(--success); font-weight: 600; }
.concept-done { display: block; margin: 36px auto 10px; padding: 14px 36px; font-size: 15px; }
.caption {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

/* concept diagrams */
.diagram-kb, .diagram-staff, .diagram-steps { text-align: center; margin: 16px 0; }
.diagram-hands { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; margin: 20px 0; }
.diagram-hands .hand { text-align: center; }
.hand-label {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--ivory);
  font-size: 16px;
}
.diagram-hands .fingers { display: flex; gap: 8px; justify-content: center; }
.finger {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
  border: 2px solid;
  background: rgba(12,12,18,0.5);
}
.finger.f-r { border-color: var(--intermed); color: var(--intermed); }
.finger.f-l { border-color: var(--error); color: var(--error); }
.finger-names { font-size: 11px; color: var(--muted); margin-top: 8px; letter-spacing: 0.3px; }

.diagram-notes { display: flex; gap: 28px; justify-content: center; margin: 20px 0; }
.note-val { text-align: center; }
.nv-sym { font-size: 52px; line-height: 1; color: var(--ivory); }
.nv-label { font-size: 12px; color: var(--muted); margin-top: 6px; letter-spacing: 0.3px; }

/* finger badge on piano key */
.finger-badge {
  position: absolute;
  bottom: 6px; left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: #fff;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.finger-badge.f-r { background: var(--intermed); }
.finger-badge.f-l { background: var(--error); }
.key.black .finger-badge { bottom: 4px; width: 18px; height: 18px; font-size: 10px; }

/* finger tag next to big-note */
.finger-tag {
  display: inline-block;
  margin-left: 12px;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  vertical-align: middle;
  font-family: 'Inter', sans-serif;
}
.finger-tag.f-r { background: var(--intermed); }
.finger-tag.f-l { background: var(--error); }

/* finger number above falling notes */
.fn-finger {
  display: block;
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 2px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.fn-finger.f-r { color: #c7e3ff; }
.fn-finger.f-l { color: #ffc7b5; }
.falling-note .fn-note { font-size: 11px; font-weight: 600; }

/* =========================================================================
   Mobile adjustments
   ========================================================================= */
@media (max-width: 720px) {
  header { padding: 14px 20px; flex-wrap: wrap; gap: 10px; }
  .container { padding: 20px 16px 40px; }
  .hero { padding: 36px 20px 30px; }
  .hero h2 { font-size: 28px; }
  .stat { min-width: 110px; padding: 14px 18px; }
  .stat .num { font-size: 28px; }
  .tracks { grid-template-columns: 1fr; }
  .lesson-prompt .big-note { font-size: 48px; }
}

/* =========================================================================
   Play-Along difficulty selector
   ========================================================================= */
.difficulty-bar {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 14px 0 6px;
}
.diff-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 18px;
  min-width: 170px;
  background: linear-gradient(180deg, #16161e 0%, #0c0c12 100%);
  border: 1px solid #2a2a36;
  border-radius: 10px;
  color: var(--ivory, #f5ecd9);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.diff-btn:hover {
  transform: translateY(-2px);
  border-color: var(--brass, #c9a55a);
}
.diff-btn.active {
  border-color: var(--brass, #c9a55a);
  box-shadow: 0 0 0 2px rgba(201, 165, 90, 0.35), 0 8px 24px rgba(0,0,0,0.4);
  background: linear-gradient(180deg, #1f1a10 0%, #12100a 100%);
}
.diff-btn .diff-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--brass, #c9a55a);
}
.diff-btn .diff-desc {
  font-size: 12px;
  color: #9a968b;
  line-height: 1.3;
}
.falling-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #6b6862;
  font-size: 14px;
  font-style: italic;
  pointer-events: none;
}
