/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.3rem; border-radius: 999px; font-weight: 600; font-size: .92rem;
  border: 1px solid var(--border); cursor: pointer; transition: all .18s ease;
  background: var(--surface-glass); color: var(--text-primary);
}
.btn:hover { background: var(--surface-elevated); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #9d1420);
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 20px -6px rgba(225,29,46,0.55);
}
.btn-primary:hover { box-shadow: 0 8px 26px -6px rgba(225,29,46,0.7); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-sm { padding: .45rem .9rem; font-size: .8rem; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; }

/* ---------- Glass surfaces ---------- */
.glass {
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 10px 30px -18px rgba(0,0,0,.6);
}
.glass-elevated { background: var(--surface-elevated); }
.glass-glow { box-shadow: 0 0 0 1px var(--accent-soft), 0 12px 40px -16px rgba(225,29,46,.35); }

.card {
  padding: 1.25rem;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: rgba(225,29,46,0.35); }
.card-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 24px -6px var(--accent-soft); }

.eyebrow { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-hover); font-weight: 700; margin-bottom: .4rem; }
.badge {
  display: inline-flex; align-items: center; padding: .2rem .6rem; border-radius: 999px;
  font-size: .7rem; font-weight: 600; background: var(--surface-elevated); color: var(--text-secondary);
  border: 1px solid var(--border);
}
.badge-beginner { color: #7dd88f; border-color: rgba(125,216,143,.3); background: rgba(125,216,143,.08); }
.badge-intermediate { color: #f2c063; border-color: rgba(242,192,99,.3); background: rgba(242,192,99,.08); }
.badge-advanced { color: #ff8a8a; border-color: rgba(255,138,138,.3); background: rgba(255,138,138,.08); }

/* ---------- Hero ---------- */
.hero {
  position: relative; padding: 3rem 1.5rem; border-radius: var(--radius-lg);
  overflow: hidden; isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: -40%; z-index: -1;
  background: radial-gradient(circle at 30% 20%, rgba(225,29,46,.35), transparent 55%),
              radial-gradient(circle at 80% 80%, rgba(225,29,46,.18), transparent 50%);
  filter: blur(40px);
}
.hero-kicker { color: var(--accent-hover); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; }
.hero-cta { display: flex; gap: .75rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* ---------- Picker rows (root/quality selectors) ---------- */
.picker-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.pill {
  padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-glass); color: var(--text-secondary); font-size: .88rem;
  cursor: pointer; transition: all .15s ease; font-weight: 600;
}
.pill:hover { color: var(--text-primary); border-color: rgba(225,29,46,.4); }
.pill.active {
  background: linear-gradient(135deg, var(--accent), #9d1420); color: #fff; border-color: transparent;
  box-shadow: 0 0 16px -2px var(--accent-soft);
}

/* ---------- Chord diagram ---------- */
.chord-diagram { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.chord-diagram svg { width: 100%; max-width: 220px; height: auto; }
.diagram-fret-label { fill: var(--text-secondary); font-size: 11px; font-family: var(--font-mono); }
.diagram-note-open { fill: var(--text-secondary); }
.diagram-note-muted { stroke: var(--text-secondary); }
.diagram-dot { fill: var(--accent); filter: drop-shadow(0 0 6px var(--accent-soft)); }
.diagram-dot-root { fill: #fff; stroke: var(--accent); stroke-width: 2; filter: drop-shadow(0 0 8px var(--accent)); }
.diagram-barre { fill: var(--accent); opacity: .85; filter: drop-shadow(0 0 6px var(--accent-soft)); }

/* ---------- Fretboard ---------- */
.fretboard-wrap { overflow-x: auto; padding-bottom: .5rem; -webkit-overflow-scrolling: touch; }
.fretboard {
  --fret-w: 52px;
  display: inline-block;
  background: linear-gradient(180deg, #1a1113, #100a0b);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem .75rem .5rem;
}
.fretboard-row { display: flex; }
.fretboard-cell {
  width: var(--fret-w); height: 40px; display: flex; align-items: center; justify-content: center;
  position: relative; border-right: 1px solid rgba(255,255,255,.08); border-bottom: 1px solid rgba(255,255,255,.05);
}
.fretboard-cell:first-child { border-right: 3px solid rgba(255,255,255,.35); }
.fret-note {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 700; color: transparent; transition: all .15s ease;
}
.fret-note.in-set { background: var(--surface-elevated); color: var(--text-primary); border: 1px solid var(--border); }
.fret-note.is-root { background: var(--accent); color: #fff; box-shadow: 0 0 14px var(--accent-soft); }
.fret-numbers { display: flex; margin-top: .35rem; }
.fret-number { width: var(--fret-w); text-align: center; font-size: .68rem; color: var(--text-secondary); font-family: var(--font-mono); }

/* ---------- Tab renderer ---------- */
.tab-block { font-family: var(--font-mono); font-size: .82rem; line-height: 1.9; overflow-x: auto; white-space: pre; padding: 1rem; }
.tab-string-label { color: var(--accent-hover); font-weight: 700; }

/* ---------- Quiz ---------- */
.quiz-option {
  width: 100%; text-align: left; padding: .9rem 1.1rem; border-radius: var(--radius-md);
  background: var(--surface-glass); border: 1px solid var(--border); color: var(--text-primary);
  cursor: pointer; font-size: .95rem; transition: all .15s ease;
}
.quiz-option:hover { border-color: rgba(225,29,46,.4); }
.quiz-option.correct { border-color: var(--success); background: rgba(34,197,94,.1); }
.quiz-option.incorrect { border-color: var(--danger); background: rgba(239,68,68,.1); }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-secondary); }
.favorite-btn { background: none; border: none; cursor: pointer; color: var(--text-secondary); font-size: 1.2rem; line-height: 1; }
.favorite-btn.active { color: var(--accent); }
.search-input {
  width: 100%; padding: .85rem 1.1rem; border-radius: var(--radius-md);
  background: var(--surface-glass); border: 1px solid var(--border); color: var(--text-primary); font-size: .95rem;
}
.search-input:focus { border-color: var(--accent); }
.progress-bar { height: 6px; border-radius: 4px; background: var(--surface-elevated); overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #ff5a5a); }

.install-banner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.5rem; }

/* ---------- Upgrade v2: deeper glow system ---------- */
.glass {
  position: relative;
}
.glass::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,0) 40%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: .8;
}
.card:hover {
  border-color: rgba(225,29,46,0.5);
  box-shadow: 0 16px 44px -18px rgba(225,29,46,.45), 0 0 0 1px rgba(225,29,46,.18);
}
.card-selected {
  box-shadow: 0 0 0 1px var(--accent), 0 0 32px -4px var(--accent-soft), 0 0 60px -20px rgba(225,29,46,.5);
}
.pill.active {
  box-shadow: 0 0 22px -2px var(--accent-soft), 0 0 0 1px rgba(255,255,255,.15) inset;
}
.pill:active, .btn:active { transform: scale(.97); }

.brand-mark {
  overflow: hidden;
  position: relative;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-mark.glow-ring::after {
  content: "";
  position: absolute; inset: -3px;
  border-radius: inherit;
  box-shadow: 0 0 18px 2px var(--accent-soft);
  pointer-events: none;
}

.fret-note.in-set { transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.fret-note.in-set:hover { transform: scale(1.12); }
.fret-note.is-root { box-shadow: 0 0 0 3px rgba(225,29,46,.25), 0 0 18px 2px var(--accent-soft); }

.diagram-dot-root { animation: rootGlow 2.4s ease-in-out infinite; }
@keyframes rootGlow {
  0%, 100% { filter: drop-shadow(0 0 6px var(--accent)); }
  50% { filter: drop-shadow(0 0 14px var(--accent)); }
}

.hero::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(circle at 15% 90%, rgba(225,29,46,.14), transparent 45%);
  filter: blur(30px);
}

.section-head h2, main.page h1 { position: relative; }

/* Ambient glow orbs behind the whole app, purely decorative */
.ambient-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
}
.ambient-glow span {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .35;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  animation: float 18s ease-in-out infinite;
}
.ambient-glow span:nth-child(1) { width: 380px; height: 380px; top: -120px; left: -80px; animation-duration: 22s; }
.ambient-glow span:nth-child(2) { width: 300px; height: 300px; bottom: -100px; right: -60px; animation-duration: 26s; animation-delay: -6s; }
.ambient-glow span:nth-child(3) { width: 240px; height: 240px; top: 40%; left: 60%; animation-duration: 20s; animation-delay: -12s; opacity: .2; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.08); }
  66% { transform: translate(-20px, 25px) scale(.95); }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-glow span, .diagram-dot-root { animation: none !important; }
}

/* ---------- Chord audio play button ---------- */
.play-chord-btn {
  display: inline-flex; align-items: center; gap: .45rem;
}
.play-chord-btn .wave-icon { display: none; align-items: center; gap: 2px; height: 14px; }
.play-chord-btn.is-playing .play-icon { display: none; }
.play-chord-btn.is-playing .wave-icon { display: inline-flex; }
.wave-bar {
  width: 3px; height: 100%; background: currentColor; border-radius: 2px;
  animation: waveBounce 0.9s ease-in-out infinite;
}
.wave-bar:nth-child(1) { animation-delay: 0s; }
.wave-bar:nth-child(2) { animation-delay: .15s; }
.wave-bar:nth-child(3) { animation-delay: .3s; }
@keyframes waveBounce {
  0%, 100% { transform: scaleY(.35); }
  50% { transform: scaleY(1); }
}
.play-chord-btn.is-playing {
  box-shadow: 0 0 22px -2px var(--accent-soft), 0 0 0 1px rgba(255,255,255,.15) inset;
}
.play-chord-btn.btn-icon { width: 40px; height: 40px; border-radius: 50%; padding: 0; justify-content: center; }
.play-chord-btn.btn-icon .wave-icon { height: 12px; }

@media (prefers-reduced-motion: reduce) {
  .wave-bar { animation: none !important; transform: scaleY(.7); }
}

/* ---------- Glow-border banner (16:9) ---------- */
.glow-banner {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 2px;
  overflow: hidden;
  isolation: isolate;
}
.glow-banner::before {
  content: "";
  position: absolute;
  inset: -60%;
  z-index: 0;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--accent) 40deg,
    #ff8a8a 70deg,
    var(--accent) 100deg,
    transparent 160deg,
    transparent 360deg
  );
  animation: glowBannerSpin 5s linear infinite;
}
@keyframes glowBannerSpin {
  to { transform: rotate(360deg); }
}
.glow-banner-inner {
  position: relative;
  z-index: 1;
  border-radius: calc(var(--radius-lg) - 2px);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0a0a0d;
}
.glow-banner-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.glow-banner-caption {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .glow-banner::before { animation: none; }
}
