/* ==========================================================================
   ALTROEGO GUITAR ACADEMY - DESIGN SYSTEM
   chitarra.altroego.it
   Stile editoriale & neo-brutalist coerente con altroego.it (Paper & Ink)
   ========================================================================== */

:root {
  /* Palette Altroego Ufficiale (Paper, Ink, Blue, Acid, Coral, Lavender) */
  --paper: #f4ead7;
  --paper-card: #fffaf0;
  --paper-card-alt: #ebe6ff;
  --ink: #15130f;
  --muted: #695f53;
  --blue: #3454e8;
  --acid: #d4ff4f;
  --coral: #ff694c;
  --lavender: #cbbcff;
  --line: #15130f;

  /* Tipografia */
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Ombre dure neo-brutalist (Niente bagliori neon) */
  --shadow-xs: 2px 2px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --shadow-md: 5px 5px 0 var(--ink);
  --shadow-lg: 7px 7px 0 var(--ink);
  --shadow-blue: 5px 5px 0 var(--blue);
  --shadow-acid: 5px 5px 0 var(--acid);
  --shadow-coral: 5px 5px 0 var(--coral);

  --transition-smooth: all 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 31px, rgba(52, 84, 232, 0.085) 32px),
    linear-gradient(90deg, transparent 0, transparent 7.5vw, rgba(255, 105, 76, 0.08) 7.55vw, transparent 7.65vw);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  color: var(--ink);
  background: var(--acid);
}

/* ==========================================================================
   UTILITY & SCHEDE CARD (PAPER STYLE)
   ========================================================================== */
.glass {
  background: var(--paper-card);
  border: 2px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   APP HEADER & BRAND
   ========================================================================== */
.app-header {
  position: sticky;
  top: 14px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 12px auto;
  padding: 12px 24px;
  background: rgba(244, 234, 215, 0.95);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  color: var(--ink);
}

.accent-text {
  color: var(--blue);
}

.user-quick-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  border: 1.5px solid var(--ink);
  background: var(--paper-card);
  box-shadow: var(--shadow-xs);
  transform: rotate(-1deg);
}

.streak-pill {
  background: var(--acid);
  color: var(--ink);
}

.level-pill {
  background: var(--lavender);
  color: var(--ink);
}

/* ==========================================================================
   NAVIGAZIONE PRINCIPALE
   ========================================================================== */
.nav-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 8px 14px;
  max-width: 680px;
  margin: 14px auto 0;
  background: rgba(244, 234, 215, 0.9);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.nav-btn:hover {
  background: var(--lavender);
  border-color: var(--ink);
}

.nav-btn.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--ink);
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px);
}

/* ==========================================================================
   CONTENUTO PRINCIPALE & VISTE
   ========================================================================== */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.view-section {
  display: none;
}

.view-section.active-view {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   CATALOGO ESERCIZI
   ========================================================================== */
.catalog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.search-container {
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 10px 20px;
  box-shadow: var(--shadow-sm);
}

.search-container input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 500;
  outline: none;
}

.search-container input::placeholder {
  color: var(--muted);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--paper-card);
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.chip:hover {
  background: var(--lavender);
  transform: translateY(-1px);
}

.chip.active {
  background: var(--acid);
  box-shadow: var(--shadow-xs);
  transform: translateY(-2px) rotate(-1deg);
}

.exercises-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.exercise-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.exercise-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--ink);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.master-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: var(--acid);
  border: 1.5px solid var(--ink);
  padding: 4px 10px;
  border-radius: 999px;
  transform: rotate(-1.5deg);
}

.difficulty-dots {
  color: var(--coral);
  font-size: 0.9rem;
  letter-spacing: 2px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.22rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.15;
  margin-bottom: 6px;
  color: var(--ink);
}

.card-source {
  font-size: 0.82rem;
  color: var(--blue);
  font-family: var(--font-mono);
  font-weight: 600;
  margin-bottom: 12px;
}

.card-desc {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 18px;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1.5px dashed var(--ink);
}

.card-metrics {
  display: flex;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.btn-play-exercise {
  padding: 8px 18px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-play-exercise:hover {
  background: var(--acid);
  color: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   PRACTICE ROOM (SALA DI ALLENAMENTO)
   ========================================================================== */
.practice-room-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Banner Routine Attiva */
.routine-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--coral);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

.routine-banner-name {
  font-family: var(--font-heading);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.1rem;
  color: var(--acid);
}

.routine-banner-time {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
}

.btn-stop-routine {
  background: var(--paper-card);
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}

/* Dettagli Esercizio Corrente */
.practice-header-box {
  padding: 24px 28px;
}

.practice-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.practice-title {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 6px;
  color: var(--ink);
}

.practice-source {
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.practice-desc {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
  margin-bottom: 18px;
}

.pro-tips-box {
  background: var(--lavender);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: var(--shadow-xs);
}

.pro-tips-title {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-bottom: 8px;
}

.pro-tips-list {
  list-style: none;
  font-size: 0.92rem;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Mount Tastiera SVG */
.fretboard-card {
  padding: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fretboard-card h4 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

#fretboard-mount {
  min-width: 700px;
}

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

/* Visualizzatore Tabulatura */
.tab-card {
  padding: 20px;
}

.tab-viewer-container {
  display: flex;
  background: #fffaf0;
  border: 2px solid var(--ink);
  border-radius: 14px;
  overflow-x: auto;
  box-shadow: var(--shadow-xs);
}

.tab-strings-labels {
  display: flex;
  flex-direction: column;
  padding: 8px 14px;
  border-right: 2px solid var(--ink);
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  user-select: none;
}

.tab-string-name, .tab-label-header, .tab-label-footer {
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-label-header, .tab-label-footer {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
}

.tab-notes-track {
  display: flex;
  padding: 8px;
  gap: 3px;
}

.tab-note-col {
  display: flex;
  flex-direction: column;
  width: 40px;
  align-items: center;
  padding: 0 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.tab-note-col:hover {
  background: rgba(52, 84, 232, 0.08);
}

.tab-note-col.active-note {
  background: var(--acid);
  border: 1.5px solid var(--ink);
  box-shadow: var(--shadow-xs);
}

.tab-pick-indicator {
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--blue);
}

.tab-string-cell {
  height: 26px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--muted);
}

.tab-string-cell.has-fret {
  color: var(--ink);
  font-weight: 700;
}

.tab-note-annotation {
  height: 26px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--coral);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 38px;
}

/* ==========================================================================
   METRONOMO & PRACTICE CONTROL DECK
   ========================================================================== */
.control-deck-card {
  padding: 26px;
}

.deck-main-row {
  display: grid;
  grid-template-columns: 1.2fr 2fr 1.2fr;
  gap: 24px;
  align-items: center;
}

@media (max-width: 860px) {
  .deck-main-row {
    grid-template-columns: 1fr;
  }
}

/* Colonna Play / Beat */
.deck-play-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.btn-big-play {
  width: 100%;
  padding: 18px 24px;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--blue);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-big-play:hover {
  background: var(--acid);
  color: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

.btn-big-play.is-running {
  background: var(--coral);
  color: #fff;
}

.beat-indicator-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.beat-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  transition: transform 0.05s ease-out, background 0.05s ease-out;
}

.beat-dot.flash {
  background: var(--acid);
  transform: scale(1.4);
}

.beat-dot.flash.accent {
  background: var(--coral);
  transform: scale(1.6);
}

/* Colonna BPM */
.deck-bpm-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.bpm-number-box {
  display: flex;
  align-items: center;
  gap: 20px;
}

.btn-stepper {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--paper-card);
  border: 2px solid var(--ink);
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-stepper:hover {
  background: var(--acid);
  transform: translate(-1px, -1px);
}

.bpm-digits {
  font-family: var(--font-mono);
  font-size: 3.4rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}

.bpm-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.bpm-slider {
  width: 100%;
  max-width: 360px;
  accent-color: var(--blue);
  cursor: pointer;
}

.btn-tap-tempo {
  background: var(--paper);
  border: 1.5px solid var(--ink);
  color: var(--ink);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: var(--transition-smooth);
}

.btn-tap-tempo:hover {
  background: var(--lavender);
  transform: translate(-1px, -1px);
}

/* Colonna Strumenti & Timer */
.deck-tools-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-tool {
  padding: 10px 16px;
  background: var(--paper-card);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-tool:hover {
  background: var(--lavender);
  transform: translate(-1px, -1px);
}

.btn-audition.is-auditioning {
  background: var(--coral);
  color: #fff;
}

.timer-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-family: var(--font-mono);
}

.timer-digits {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
}

/* Moduli Avanzati (Speed Ladder, Gap) */
.deck-advanced-row {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1.5px dashed var(--ink);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.advanced-toggle-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 700;
}

.speed-ladder-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.speed-ladder-inputs input {
  width: 56px;
  padding: 4px 6px;
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  color: var(--ink);
  font-weight: 700;
  text-align: center;
}

.sound-select-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
}

.sound-select-box select {
  padding: 6px 14px;
  background: var(--paper-card);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

/* ==========================================================================
   ROUTINES (WORKOUTS GUIDATI)
   ========================================================================== */
.routines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.routine-card {
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.routine-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.routine-icon {
  font-size: 2rem;
}

.routine-duration {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink);
  font-weight: 700;
  background: var(--acid);
  border: 1.5px solid var(--ink);
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow-xs);
  transform: rotate(1deg);
}

.routine-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.15;
  margin-bottom: 6px;
  color: var(--ink);
}

.routine-master {
  font-size: 0.85rem;
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 12px;
}

.routine-desc {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.routine-blocks-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
}

.block-chip {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
}

.btn-start-routine {
  padding: 14px;
  background: var(--blue);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-start-routine:hover {
  background: var(--acid);
  color: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   PROGRESS DASHBOARD & SKILL TREE
   ========================================================================== */
.progress-dashboard {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}

.stat-box {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  color: var(--ink);
}

.stat-rank {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--blue);
}

.skill-tree-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.skill-node {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skill-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.skill-icon {
  font-size: 1.8rem;
}

.skill-title-box h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink);
}

.skill-rank {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  font-family: var(--font-mono);
}

.skill-bar-track {
  height: 10px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 999px;
  transition: width 0.4s ease-out;
}

.skill-xp-text {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-weight: 600;
  text-align: right;
}

/* Cronologia Sessioni */
.recent-sessions-card {
  padding: 24px;
}

.sessions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.sessions-header h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  text-transform: uppercase;
}

.session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 12px;
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
}

.session-left strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.session-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
  font-family: var(--font-mono);
}

.session-note {
  font-size: 0.85rem;
  color: var(--ink);
  font-style: italic;
  margin-top: 4px;
}

.session-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.session-bpm {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--blue);
  font-size: 1.15rem;
}

.btn-copy-obsidian {
  padding: 6px 14px;
  background: var(--acid);
  border: 1.5px solid var(--ink);
  color: var(--ink);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-copy-obsidian:hover {
  background: var(--blue);
  color: #fff;
  transform: translate(-1px, -1px);
}

.data-backup-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

/* ==========================================================================
   MODALE REGISTRAZIONE SESSIONE
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(21, 19, 15, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  padding: 28px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--paper-card);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-weight: 800;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 1.6rem;
  font-weight: 700;
  cursor: pointer;
}

.modal-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-form-group label {
  font-size: 0.85rem;
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-form-group input,
.modal-form-group select,
.modal-form-group textarea {
  padding: 10px 14px;
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
}

.modal-form-group input:focus,
.modal-form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: var(--shadow-xs);
}

.btn-submit-modal {
  padding: 14px;
  background: var(--blue);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 8px;
  transition: var(--transition-smooth);
}

.btn-submit-modal:hover {
  background: var(--acid);
  color: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   TOAST NOTIFICHE
   ========================================================================== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  background: var(--paper-card);
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease-out;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   VISTA TEORIA & LABORATORIO ARMONICO (THEORY LAB)
   ========================================================================== */
.theory-lab-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.theory-controls-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.theory-controls-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
}

.theory-control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theory-control-group label,
.scale-selector-row label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.root-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.root-chip {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid var(--ink);
  background: var(--paper-card);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-xs);
  color: var(--ink);
}

.root-chip:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-sm);
  background: #fff;
}

.root-chip.active {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow-sm);
  transform: translate(-2px, -2px);
}

.toggle-pills {
  display: inline-flex;
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.toggle-pill {
  padding: 8px 16px;
  border: none;
  background: transparent;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  transition: var(--transition-smooth);
}

.toggle-pill.active {
  background: var(--acid);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.scale-selector-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1.5px dashed rgba(21, 19, 15, 0.2);
}

.theory-select {
  flex: 1;
  min-width: 240px;
  padding: 10px 14px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  outline: none;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}

.theory-select:focus {
  border-color: var(--blue);
}

.scale-info-card {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scale-info-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.scale-info-header h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
}

.scale-formula-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--paper-card-alt);
  border: 1.5px solid var(--ink);
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow-xs);
  color: var(--ink);
}

.scale-mood-desc {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.5;
}

.scale-examples-box {
  font-size: 0.88rem;
  color: var(--muted);
}

.scale-examples-box strong {
  color: var(--blue);
  font-weight: 700;
}

.interval-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.leg-pill {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-heading);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
}

.caged-card {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.caged-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.caged-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
}

.caged-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.caged-btn {
  padding: 8px 16px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--paper-card);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: var(--transition-smooth);
  color: var(--ink);
}

.caged-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-sm);
  background: #fff;
}

.caged-btn.active {
  background: var(--acid);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-sm);
}

.caged-details {
  padding: 14px 18px;
  background: var(--paper-card-alt);
  border: 2px solid var(--ink);
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink);
}

.nashville-card {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nashville-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
}

.nashville-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.nashville-chord-card {
  padding: 12px 10px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nashville-chord-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--blue);
}

.deg-num {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--blue);
}

.chord-name {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.chord-func {
  font-size: 0.7rem;
  color: var(--muted);
}

.progression-examples {
  padding: 16px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prog-item {
  font-size: 0.88rem;
  line-height: 1.4;
}

.prog-item strong {
  color: var(--ink);
}

.prog-item code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--paper-card);
  border: 1px solid var(--ink);
  padding: 2px 6px;
  border-radius: 4px;
}

.quiz-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.quiz-score-box {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  padding: 6px 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--acid);
  box-shadow: var(--shadow-xs);
  color: var(--ink);
}

.quiz-prompt {
  font-size: 1.15rem;
  font-family: var(--font-heading);
  font-weight: 700;
  padding: 16px 20px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
}

.quiz-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.quiz-option-btn {
  flex: 1;
  min-width: 120px;
  padding: 12px 18px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--paper-card);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: var(--transition-smooth);
  color: var(--ink);
}

.quiz-option-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-sm);
  background: #fff;
}

.quiz-feedback {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 10px;
  min-height: 24px;
}

.quiz-feedback.correct {
  background: rgba(212, 255, 79, 0.4);
  border: 1.5px solid var(--ink);
  color: var(--ink);
}

.quiz-feedback.wrong {
  background: rgba(255, 105, 76, 0.2);
  border: 1.5px solid var(--coral);
  color: #c0392b;
}
