/* ==========================================================
   components.css — Sidebar, Topbar, Bottom Nav, Piano, Notes
   ========================================================== */

/* ---------- Sidebar (desktop) ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, rgba(10, 10, 20, 0.85), rgba(8, 8, 16, 0.85));
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 30;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 18px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--rose));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #1a0f00;
  font-weight: 800;
  box-shadow: 0 8px 18px -6px rgba(245, 176, 66, 0.55);
  position: relative;
  overflow: hidden;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -50%;
  background: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, 0.4) 50%, transparent 60%);
  animation: shine 4s ease-in-out infinite;
}

@keyframes shine {
  0%, 100% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(100%);
  }
}

.brand-title {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--glass);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(245, 176, 66, 0.16), rgba(108, 99, 255, 0.1));
  border-color: rgba(245, 176, 66, 0.28);
  color: var(--text);
  box-shadow: inset 0 0 12px rgba(245, 176, 66, 0.08);
}

.nav-ico {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border-radius: 8px;
  background: var(--glass);
  color: var(--text-2);
  transition: all 0.2s;
}

.nav-item.active .nav-ico {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #1a0f00;
  box-shadow: 0 4px 10px -2px rgba(245, 176, 66, 0.5);
}

.sidebar-foot {
  padding-top: 14px;
  border-top: 1px solid var(--glass-border);
}

.level-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 12px;
}

.level-card-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.level-card-name {
  font-family: "Playfair Display", serif;
  font-size: 18px;
  font-weight: 700;
  margin: 4px 0 8px;
  background: linear-gradient(135deg, var(--accent), var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.level-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.level-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--rose));
  border-radius: 999px;
  transition: width 0.6s var(--ease);
}

.level-card-xp {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
  font-family: "JetBrains Mono", monospace;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  min-height: var(--topbar-h);
  background: rgba(8, 8, 16, 0.75);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  padding-top: calc(12px + var(--safe-top));
}

.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  font-size: 18px;
}

.topbar-title {
  flex: 1;
  min-width: 0;
}

.topbar-page {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.topbar-sub {
  font-size: 12px;
  color: var(--text-3);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.streak-pill,
.xp-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  background: var(--glass-2);
  border: 1px solid var(--glass-border);
  font-size: 13px;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
}

.streak-flame {
  color: var(--accent);
  font-size: 12px;
}

/* ---------- Bottom Nav (mobile) ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 25;
  display: none;
  align-items: center;
  justify-content: space-around;
  height: calc(var(--bottomnav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(8, 8, 16, 0.85);
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.bnav-item.active {
  color: var(--accent);
}

.bnav-ico {
  font-size: 20px;
  line-height: 1;
}

.bnav-pitch .bnav-ico {
  font-size: 22px;
}

.bnav-label {
  font-size: 10px;
  letter-spacing: 0.04em;
}

.bnav-item.active .bnav-ico {
  filter: drop-shadow(0 0 6px rgba(245, 176, 66, 0.6));
}

/* ---------- Footer ---------- */
.footer {
  padding: 18px 16px;
  padding-bottom: calc(18px + var(--safe-bottom));
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  border-top: 1px solid var(--glass-border);
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.footer-brand {
  font-family: "Playfair Display", serif;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.dev-link {
  color: var(--accent-2);
  font-weight: 600;
  border-bottom: 1px dashed rgba(245, 176, 66, 0.4);
  transition: color 0.2s, border-color 0.2s;
}

.dev-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ==========================================================
   Note Buttons (Sa Re Ga Ma Pa Dha Ni Sa)
   ========================================================== */
.notes-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.note-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 70px;
  padding: 10px 4px;
  border-radius: var(--r-md);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s var(--ease), box-shadow 0.2s, background 0.2s, border-color 0.2s;
  overflow: hidden;
  color: var(--text);
}

.note-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--note-color, var(--accent));
  opacity: 0.18;
  transition: opacity 0.25s;
}

.note-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.2));
  pointer-events: none;
}

.note-btn .note-sym {
  font-family: "Playfair Display", serif;
  font-size: 22px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.note-btn .note-en {
  font-size: 10px;
  color: var(--text-3);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.06em;
  position: relative;
  z-index: 1;
}

.note-btn.active {
  transform: translateY(2px) scale(0.98);
  background: var(--note-color, var(--accent));
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08), 0 10px 26px -6px var(--note-color, var(--accent));
}

.note-btn.active::before {
  opacity: 1;
}

.note-btn.active .note-sym {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.note-btn.active .note-en {
  color: rgba(255, 255, 255, 0.8);
}

.note-btn:active {
  transform: scale(0.96);
}

.note-btn[data-note="Sa"]  { --note-color: var(--sa); }
.note-btn[data-note="Re"]  { --note-color: var(--re); }
.note-btn[data-note="Ga"]  { --note-color: var(--ga); }
.note-btn[data-note="Ma"]  { --note-color: var(--ma); }
.note-btn[data-note="Pa"]  { --note-color: var(--pa); }
.note-btn[data-note="Dha"] { --note-color: var(--dha); }
.note-btn[data-note="Ni"]  { --note-color: var(--ni); }
.note-btn[data-note="SA"]  { --note-color: var(--accent); }

/* ==========================================================
   Piano Keyboard
   ========================================================== */
.piano-wrap {
  position: relative;
  background: linear-gradient(180deg, #0a0a16, #060610);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 14px 12px 16px;
  overflow: hidden;
}

.piano-wrap::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
}

.piano-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}

.piano {
  display: flex;
  position: relative;
  height: 170px;
  user-select: none;
  min-width: 100%;
}

.piano-key {
  position: relative;
  flex: 1 0 38px;
  min-width: 38px;
  background: linear-gradient(180deg, #f4f4f7 0%, #d9d9e3 100%);
  border: 1px solid #1a1a2c;
  border-radius: 0 0 6px 6px;
  margin-right: 1px;
  cursor: pointer;
  transition: background 0.1s, transform 0.05s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 8px;
  scroll-snap-align: start;
  color: #2a2a40;
}

.piano-key:last-child {
  margin-right: 0;
}

.piano-key.black {
  position: absolute;
  flex: 0 0 26px;
  min-width: 26px;
  height: 60%;
  background: linear-gradient(180deg, #16161e, #05050b);
  border: 1px solid #05050b;
  border-radius: 0 0 5px 5px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 -4px 6px rgba(255, 255, 255, 0.05);
}

.piano-key.black .key-label,
.piano-key.black .key-note {
  color: rgba(255, 255, 255, 0.8);
}

.piano-key .key-label {
  font-size: 10px;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  pointer-events: none;
}

.piano-key .key-note {
  font-family: "Playfair Display", serif;
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
  pointer-events: none;
}

.piano-key.c {
  background: linear-gradient(180deg, #ffffff 0%, #e8e8f0 100%);
}

.piano-key.indian {
  background: linear-gradient(180deg, #fff7e6 0%, #ffe0a3 100%);
  border-color: #b07b1a;
  box-shadow: inset 0 0 0 1px rgba(245, 176, 66, 0.3);
}

.piano-key.indian .key-note {
  color: #8a5a00;
}

.piano-key.indian .key-label {
  color: #6e4a00;
}

.piano-key.active {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  border-color: #fff;
  box-shadow: 0 0 18px rgba(245, 176, 66, 0.6), inset 0 0 0 2px rgba(255, 255, 255, 0.3);
  transform: translateY(1px);
  color: #1a0f00;
}

.piano-key.active .key-label,
.piano-key.active .key-note {
  color: #1a0f00;
}

.piano-key.black.active {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  box-shadow: 0 0 18px rgba(245, 176, 66, 0.7);
}

.piano-target {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  z-index: 4;
  pointer-events: none;
  transition: left 0.3s var(--ease);
}

/* ==========================================================
   Pitch Trainer
   ========================================================== */
.pitch-stage {
  position: relative;
  background: linear-gradient(180deg, rgba(15, 15, 30, 0.7), rgba(8, 8, 16, 0.6));
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 20px;
  overflow: hidden;
}

.pitch-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(800px 300px at 50% 0%, rgba(108, 99, 255, 0.18), transparent 70%);
  pointer-events: none;
}

.target-note-display {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 12px 0 4px;
}

.target-note-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}

.target-note-name {
  font-family: "Playfair Display", serif;
  font-size: clamp(56px, 14vw, 96px);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--rose), var(--indigo));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 6px 0 2px;
  animation: gradient 6s linear infinite;
}

.detected-display {
  position: relative;
  z-index: 1;
  text-align: center;
  margin: 14px 0 10px;
}

.detected-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}

.detected-name {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(40px, 10vw, 72px);
  font-weight: 700;
  line-height: 1;
  margin: 4px 0;
  color: var(--text);
  transition: color 0.2s, transform 0.15s;
}

.detected-name.too-low {
  color: var(--sky);
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.5);
}

.detected-name.perfect {
  color: var(--success);
  text-shadow: 0 0 22px rgba(52, 211, 153, 0.6);
  animation: pulsePerfect 0.8s ease-in-out infinite;
}

.detected-name.too-high {
  color: var(--rose);
  text-shadow: 0 0 18px rgba(251, 113, 133, 0.5);
}

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

.detected-freq {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--text-3);
}

.feedback-indicator {
  position: relative;
  z-index: 1;
  text-align: center;
  margin: 12px 0 4px;
  font-family: "Playfair Display", serif;
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: color 0.25s;
}

.feedback-indicator.too-low { color: var(--sky); }
.feedback-indicator.perfect { color: var(--success); }
.feedback-indicator.too-high { color: var(--rose); }
.feedback-indicator.silent { color: var(--text-4); }

/* Pitch meter */
.pitch-meter {
  position: relative;
  height: 64px;
  margin: 14px 0 4px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  overflow: hidden;
}

.pitch-meter-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-50%);
}

.pitch-meter-target {
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 2px;
  left: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.pitch-meter-center {
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 60px;
  left: calc(50% - 30px);
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px dashed rgba(52, 211, 153, 0.4);
}

.pitch-meter-needle {
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 4px;
  left: 50%;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--rose));
  box-shadow: 0 0 14px rgba(245, 176, 66, 0.7);
  transition: left 0.07s linear, background 0.2s;
  transform: translateX(-50%);
}

.pitch-meter-cents {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-3);
  font-family: "JetBrains Mono", monospace;
}

.pitch-meter-scale {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  font-size: 10px;
  color: var(--text-4);
  font-family: "JetBrains Mono", monospace;
  pointer-events: none;
}

/* Waveform canvas */
.waveform-wrap {
  position: relative;
  height: 110px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-top: 12px;
}

.waveform-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Pitch stats grid */
.pitch-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.stat-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.stat-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 20px;
  font-weight: 700;
}

.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }
.stat-value.danger { color: var(--danger); }

/* Mic controls */
.mic-controls {
  position: sticky;
  bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 10px);
  z-index: 15;
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  background: rgba(15, 15, 30, 0.9);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--r-xl);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
}

.mic-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 18px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #1a0f00;
  font-weight: 700;
  font-size: 15px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.mic-btn:hover {
  box-shadow: 0 12px 26px -8px rgba(245, 176, 66, 0.6);
}

.mic-btn:active {
  transform: scale(0.97);
}

.mic-btn.live {
  background: linear-gradient(135deg, var(--rose), #b91c1c);
  color: #fff;
  animation: livePulse 1.6s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(251, 113, 133, 0); }
}

.mic-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r-full);
  background: var(--glass-2);
  border: 1px solid var(--glass-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}

.mic-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--text-4);
  flex-shrink: 0;
}

.mic-dot.live {
  background: var(--rose);
  box-shadow: 0 0 8px var(--rose);
  animation: blink 1s ease-in-out infinite;
}

.mic-dot.error {
  background: var(--danger);
}

@keyframes blink {
  50% { opacity: 0.4; }
}

/* ==========================================================
   Exercise list / cards
   ========================================================== */
.exercise-card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.exercise-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.exercise-card:hover:not(.locked) {
  transform: translateY(-3px);
  border-color: var(--glass-border-strong);
  box-shadow: var(--shadow-md);
}

.exercise-card.locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.exercise-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.exercise-name {
  font-family: "Playfair Display", serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.exercise-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-3);
  flex-wrap: wrap;
}

.exercise-notes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.mini-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 13px;
  background: var(--note-color, var(--accent));
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  box-shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.4);
}

.mini-note.Sa, .mini-note.SA { --note-color: var(--sa); }
.mini-note.Re { --note-color: var(--re); }
.mini-note.Ga { --note-color: var(--ga); }
.mini-note.Ma { --note-color: var(--ma); }
.mini-note.Pa { --note-color: var(--pa); }
.mini-note.Dha { --note-color: var(--dha); }
.mini-note.Ni { --note-color: var(--ni); }

.exercise-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* ==========================================================
   Rhythm / Metronome
   ========================================================== */
.metronome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 24px 16px;
  background: linear-gradient(180deg, rgba(15, 15, 30, 0.6), rgba(8, 8, 16, 0.6));
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
}

.bpm-display {
  font-family: "Playfair Display", serif;
  font-size: clamp(64px, 16vw, 110px);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  transition: transform 0.1s var(--ease);
}

.bpm-display.beat {
  transform: scale(1.08);
}

.bpm-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-3);
  text-transform: uppercase;
}

.beat-dots {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.beat-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--glass-2);
  border: 1px solid var(--glass-border);
  transition: transform 0.08s, background 0.15s, box-shadow 0.15s;
}

.beat-dot.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  transform: scale(1.3);
  box-shadow: 0 0 18px rgba(245, 176, 66, 0.7);
}

.beat-dot.accent {
  background: var(--glass);
}

.beat-dot.accent.active {
  background: linear-gradient(135deg, var(--rose), #b91c1c);
  box-shadow: 0 0 18px rgba(251, 113, 133, 0.7);
}

.time-sig-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.time-pill {
  padding: 8px 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.time-pill.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-color: rgba(255, 255, 255, 0.3);
  color: #1a0f00;
}

.tap-pad {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 80px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(245, 176, 66, 0.08), rgba(245, 176, 66, 0.02));
  border: 1.5px dashed rgba(245, 176, 66, 0.3);
  color: var(--accent-2);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.tap-pad:active {
  transform: scale(0.98);
  background: rgba(245, 176, 66, 0.15);
}

/* ==========================================================
   Tanpura
   ========================================================== */
.tanpura-card {
  position: relative;
  padding: 24px;
  background: linear-gradient(180deg, rgba(245, 176, 66, 0.06), rgba(108, 99, 255, 0.04));
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  text-align: center;
}

.tanpura-card::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle at 50% 50%, rgba(245, 176, 66, 0.15), transparent 50%);
  animation: floatPulse 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes floatPulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.15); opacity: 0.7; }
}

.tanpura-icon {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, var(--accent), var(--accent-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Playfair Display", serif;
  font-size: 50px;
  color: #1a0f00;
  font-weight: 800;
  margin: 0 auto 12px;
  box-shadow: 0 14px 40px -8px rgba(245, 176, 66, 0.5);
  z-index: 1;
}

.tanpura-icon.live {
  animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% { box-shadow: 0 14px 40px -8px rgba(245, 176, 66, 0.5); }
  50% { box-shadow: 0 14px 50px -4px rgba(245, 176, 66, 0.85); }
}

/* ==========================================================
   Charts (progress)
   ========================================================== */
.chart-card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 16px;
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  height: 140px;
  padding: 8px 0;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.bar {
  width: 100%;
  max-width: 24px;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  border-radius: 6px 6px 2px 2px;
  transition: height 0.6s var(--ease);
  min-height: 4px;
  box-shadow: 0 0 10px rgba(245, 176, 66, 0.3);
}

.bar.empty {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.bar-label {
  font-size: 9px;
  color: var(--text-4);
  font-family: "JetBrains Mono", monospace;
  text-align: center;
}

/* ==========================================================
   Achievement card
   ========================================================== */
.achievement {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.achievement.unlocked {
  background: linear-gradient(160deg, rgba(245, 176, 66, 0.12), rgba(167, 139, 250, 0.08));
  border-color: rgba(245, 176, 66, 0.3);
}

.achievement.unlocked:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.achievement.locked {
  opacity: 0.5;
  filter: grayscale(0.5);
}

.achievement-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: linear-gradient(135deg, var(--accent), var(--rose));
  color: #1a0f00;
  box-shadow: 0 8px 18px -6px rgba(245, 176, 66, 0.5);
}

.achievement.locked .achievement-icon {
  background: var(--glass-2);
  color: var(--text-4);
  box-shadow: none;
}

.achievement-name {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 14px;
}

.achievement-desc {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.3;
}

/* ==========================================================
   Daily Challenge banner
   ========================================================== */
.challenge-hero {
  position: relative;
  background: linear-gradient(135deg, rgba(245, 176, 66, 0.18), rgba(167, 139, 250, 0.12), rgba(56, 189, 248, 0.08));
  border: 1px solid rgba(245, 176, 66, 0.3);
  border-radius: var(--r-xl);
  padding: 24px;
  overflow: hidden;
}

.challenge-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px 200px at 100% 0%, rgba(245, 176, 66, 0.3), transparent 60%);
  pointer-events: none;
}

.challenge-hero h2 {
  font-family: "Playfair Display", serif;
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.challenge-hero .accent {
  background: linear-gradient(135deg, var(--accent), var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================
   Profile
   ========================================================== */
.profile-hero {
  position: relative;
  text-align: center;
  padding: 32px 20px;
  background: linear-gradient(180deg, rgba(245, 176, 66, 0.1), rgba(108, 99, 255, 0.06));
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--accent), var(--rose), var(--indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Playfair Display", serif;
  font-size: 38px;
  font-weight: 800;
  color: #1a0f00;
  border: 3px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 40px -10px rgba(245, 176, 66, 0.5);
  position: relative;
  overflow: hidden;
}

.avatar::after {
  content: "";
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent 70%, rgba(255, 255, 255, 0.4) 90%, transparent);
  animation: spin 3s linear infinite;
}

/* ==========================================================
   Streak widget
   ========================================================== */
.streak-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  max-width: 280px;
  margin: 0 auto;
}

.streak-day {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-4);
  font-weight: 600;
}

.streak-day.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-color: rgba(255, 255, 255, 0.3);
  color: #1a0f00;
  box-shadow: 0 4px 12px -2px rgba(245, 176, 66, 0.4);
}

.streak-day.today {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================
   Breathing / warmup timer
   ========================================================== */
.breath-circle {
  position: relative;
  width: min(260px, 70vw);
  height: min(260px, 70vw);
  margin: 16px auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(108, 99, 255, 0.25), transparent 70%);
  border: 2px solid var(--indigo);
  transition: transform 4s var(--ease);
  box-shadow: 0 0 60px rgba(108, 99, 255, 0.3);
}

.breath-circle.inhale {
  transform: scale(1.2);
}

.breath-circle.exhale {
  transform: scale(0.85);
}

.breath-circle.hold {
  transform: scale(1.05);
}

.breath-text {
  font-family: "Playfair Display", serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.breath-count {
  position: absolute;
  bottom: -42px;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: var(--text-3);
}

/* ==========================================================
   Action button (big)
   ========================================================== */
.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 28px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #1a0f00;
  font-family: "Playfair Display", serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  box-shadow: 0 16px 36px -10px rgba(245, 176, 66, 0.6);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.action-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, 0.3) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.action-btn:hover::after {
  transform: translateX(100%);
}

.action-btn:hover {
  box-shadow: 0 20px 44px -10px rgba(245, 176, 66, 0.75);
}

.action-btn:active {
  transform: scale(0.98);
}

.action-btn.secondary {
  background: var(--glass-2);
  color: var(--text);
  box-shadow: none;
}

.action-btn.secondary:hover {
  background: var(--glass-3);
}

/* Note playhead animation when playing */
.note-playhead {
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
  border-radius: 999px;
  z-index: 5;
  pointer-events: none;
  transition: left 0.18s var(--ease);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-3);
  font-size: 13px;
}

.empty-state .emoji {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
  filter: grayscale(0.2);
}

/* Tab bar (within pages) */
.tab-row {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  min-height: 36px;
}

.tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #1a0f00;
}

/* Practice speed selector */
.speed-row {
  display: flex;
  gap: 6px;
}

.speed-pill {
  flex: 1;
  padding: 10px 8px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  color: var(--text-3);
}

.speed-pill.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #1a0f00;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Section dividers */
.divider {
  height: 1px;
  background: var(--glass-border);
  margin: 4px 0;
}
