/* ==========================================================================
   aprender-notas.css — estilos da aplicação principal (módulos Clássico,
   Clássico com Metrônomo, Escala Cromática, Figuras e Pausas, Compassos,
   menu lateral, tour e estatísticas).
   Conteúdo original do <style> do index.html, sem alterações de regras.
   As fontes (Fraunces, Inter, IBM Plex Mono, Noto Music) são carregadas por
   <link> no <head> do HTML. Os estilos do Solfejo ficam em
   /solfejo/css/solfejo.css, todos limitados a #solfejoModePanel.
   ========================================================================== */
:root{
  --bg-deep:#0F211D;
  --bg-board:#1B4332;
  --board-edge:#123026;
  --chalk:#F1EAD9;
  --chalk-dim:#C9C0AC;
  --gold:#E3B23C;
  --mint:#6FCF97;
  --coral:#EB6B56;
  --text:#F4EFE3;
  --text-dim:#A9BDB2;
}

*{box-sizing:border-box;}

body{
  margin:0;
  min-height:100vh;
  background:
    radial-gradient(1200px 700px at 50% -10%, #21503f 0%, var(--bg-deep) 60%);
  color:var(--text);
  font-family:'Inter',sans-serif;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:32px 16px 40px;
  accent-color: var(--gold);
}

.wrap{ width:100%; max-width:760px; position:relative; }

.burger-btn{
  position:fixed; top:18px; right:18px; width:44px; height:44px; border-radius:14px;
  background:var(--board-edge); border:1px solid rgba(241,234,217,0.14);
  color:var(--chalk); cursor:pointer;
  display:flex; align-items:center; justify-content:center; flex-direction:column; gap:4px;
  z-index:60; transition:all .15s ease; box-shadow:0 6px 18px rgba(0,0,0,0.35);
}
.burger-btn:hover{ border-color:var(--gold); }
.burger-btn span{ width:19px; height:2px; background:var(--chalk); border-radius:2px; transition:transform .2s ease, opacity .2s ease; }
.burger-btn:hover span{ background:var(--gold); }
.burger-btn.open span:nth-child(1){ transform:translateY(6px) rotate(45deg); }
.burger-btn.open span:nth-child(2){ opacity:0; }
.burger-btn.open span:nth-child(3){ transform:translateY(-6px) rotate(-45deg); }

/* ===================== MENU (drawer) ===================== */
.backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,0.55); backdrop-filter:blur(2px);
  opacity:0; pointer-events:none; transition:opacity .2s ease; z-index:70;
}
.backdrop.show{ opacity:1; pointer-events:auto; }
.drawer{
  position:fixed; top:0; right:0; height:100%; width:min(380px, 90vw);
  background:var(--bg-deep); border-left:1px solid rgba(241,234,217,0.1);
  box-shadow:-30px 0 60px -20px rgba(0,0,0,0.6);
  transform:translateX(100%); transition:transform .25s ease; z-index:80;
  display:flex; flex-direction:column;
}
.drawer.show{ transform:translateX(0); }
.drawer-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:20px 18px 14px; border-bottom:1px solid rgba(241,234,217,0.08); flex:0 0 auto;
}
.drawer-head h2{ font-family:'Fraunces',serif; font-size:18px; margin:0; }
.drawer-close{
  width:34px; height:34px; border-radius:9px; border:1px solid rgba(241,234,217,0.14);
  background:transparent; color:var(--chalk-dim); cursor:pointer; font-size:16px;
}
.drawer-close:hover{ color:var(--chalk); border-color:rgba(227,178,60,0.4); }
.drawer-body{ flex:1; overflow-y:auto; padding:6px 0 30px; }
.drawer-section{ padding:16px 18px 6px; }
.drawer-section-title{
  font-family:'IBM Plex Mono',monospace; font-size:10.5px; letter-spacing:0.14em; text-transform:uppercase;
  color:var(--gold); margin-bottom:10px;
}
.mode-list{ display:flex; flex-direction:column; gap:4px; }
button.tab.mode-row{
  display:flex; align-items:flex-start; gap:12px; width:100%; text-align:left;
  padding:12px 10px; border-radius:12px; border:1px solid transparent;
  background:transparent; color:var(--chalk); cursor:pointer; font-weight:400;
  white-space:normal; height:auto;
}
button.tab.mode-row:hover{ background:rgba(241,234,217,0.05); }
button.tab.mode-row.active{ background:rgba(227,178,60,0.12); border-color:rgba(227,178,60,0.35); color:var(--chalk); }
.mode-row .dot{ width:8px; height:8px; border-radius:50%; margin-top:6px; flex:0 0 auto; background:rgba(241,234,217,0.25); }
.mode-row.active .dot{ background:var(--gold); }
.mode-row-text{ display:block; }
.mode-row-text b{ font-family:'Fraunces',serif; font-size:15px; font-weight:600; display:block; }
.mode-row-text span{ font-size:12px; color:var(--text-dim); line-height:1.4; font-family:'Inter',sans-serif; letter-spacing:0; text-transform:none; }

.collapse{ border-bottom:1px solid rgba(241,234,217,0.06); }
.collapse.hidden{ display:none; }
.drawer-section.hidden{ display:none; }
.collapse-trigger{
  width:100%; display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px; background:none; border:none; color:var(--chalk); cursor:pointer;
  font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:0.1em; text-transform:uppercase;
}
.collapse-trigger .chev{ color:var(--text-dim); transition:transform .2s ease; }
.collapse-trigger.open .chev{ transform:rotate(180deg); }
.collapse-panel{ max-height:0; overflow:hidden; transition:max-height .3s ease; padding:0 18px; }
.collapse-panel.open{ max-height:2400px; padding-bottom:16px; }
.collapse-panel .settings{ display:block; background:none; border:none; padding:0; box-shadow:none; }
.collapse-panel .setting{ margin-bottom:16px; }
.collapse-panel .setting:last-child{ margin-bottom:0; }

header{ text-align:center; margin-bottom:22px; }
@media (max-width:600px){ header{ margin-top:60px; } }
.eyebrow{
  font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:0.18em;
  text-transform:uppercase; color:var(--gold); margin-bottom:8px;
}
h1{
  font-family:'Fraunces',serif; font-weight:700; font-size:clamp(28px,6vw,42px);
  margin:0; letter-spacing:-0.01em;
}
.subtitle{ color:var(--text-dim); font-size:14px; margin-top:8px; }

.settings{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(190px, 1fr));
  gap:16px 22px; background:var(--board-edge); border:1px solid rgba(241,234,217,0.08);
  border-radius:14px; padding:18px 22px; margin-bottom:24px;
}
.setting{ display:flex; flex-direction:column; gap:8px; }
.setting.wide{ grid-column:1 / -1; }
.setting.corner-bottom-left{ grid-column:1; }
.setting.hidden{ display:none; }
.setting-label{
  font-family:'IBM Plex Mono',monospace; font-size:10px; letter-spacing:0.14em;
  text-transform:uppercase; color:var(--text-dim);
}
.setting-label b{ color:var(--gold); font-weight:600; }
.bpm-input{
  width:48px; background:rgba(241,234,217,0.06); border:1px solid rgba(241,234,217,0.18);
  border-radius:6px; color:var(--gold); font-family:'IBM Plex Mono',monospace;
  font-size:12px; font-weight:600; text-align:center; padding:3px 2px;
  letter-spacing:normal; text-transform:none; -moz-appearance:textfield;
}
.bpm-input::-webkit-outer-spin-button, .bpm-input::-webkit-inner-spin-button{
  -webkit-appearance:none; margin:0;
}
.bpm-input:focus{ outline:none; border-color:var(--gold); }

.tabgroup{
  display:flex; flex-wrap:wrap; background:rgba(0,0,0,0.18); border-radius:9px;
  padding:4px; gap:2px; border:1px solid rgba(241,234,217,0.06);
}
.tab{
  font-family:'IBM Plex Mono',monospace; font-size:12px; letter-spacing:0.02em;
  padding:8px 12px; border-radius:6px; background:transparent; border:none;
  color:var(--text-dim); cursor:pointer; transition:all .15s ease;
  white-space:nowrap; flex:1 1 auto; text-align:center;
}
.tab:hover{ color:var(--chalk); }
.tab.active{ background:var(--gold); color:#1B2A1A; font-weight:600; }

input[type="range"]{ width:100%; height:6px; margin-top:4px; }

.keymap-grid{ display:flex; flex-wrap:wrap; gap:8px; }
.key-chip{
  display:flex; flex-direction:column; align-items:center; gap:3px;
  background:rgba(0,0,0,0.18); border:1px solid rgba(241,234,217,0.1);
  border-radius:8px; padding:7px 10px; min-width:46px; cursor:pointer;
  color:var(--chalk); font-family:'IBM Plex Mono',monospace; transition:all .15s ease;
}
.key-chip:hover{ border-color:rgba(227,178,60,0.4); }
.key-chip-note{ font-size:12px; font-weight:600; }
.key-chip-key{ font-size:12px; color:var(--gold); font-weight:600; }
.key-chip.listening{ border-color:var(--coral); background:rgba(235,107,86,0.12); }
.key-chip.listening .key-chip-key{ color:var(--coral); }
.keymap-hint{ font-size:11px; color:var(--text-dim); margin-top:2px; }

.board{
  position:relative;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.03), transparent 60%),
    var(--bg-board);
  border:10px solid #7a5230;
  border-image: linear-gradient(155deg,#8a6238,#5f3f22) 1;
  border-radius:6px;
  box-shadow: 0 24px 50px -20px rgba(0,0,0,0.6), inset 0 0 60px rgba(0,0,0,0.25);
  padding:34px 12px 26px;
  overflow:hidden;
}
.board::before{
  content:""; position:absolute; inset:0;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.015) 0px, transparent 1px, transparent 3px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.015) 0px, transparent 1px, transparent 3px);
  pointer-events:none;
}
.staff-wrap{ position:relative; display:flex; justify-content:center; }
svg#staff{ width:100%; max-width:640px; height:auto; overflow:visible; }

.staff-line{ stroke:var(--chalk); stroke-width:2.2; opacity:0.92; }
.ledger-line{ stroke:var(--chalk-dim); stroke-width:2.2; }
.notehead{ fill:var(--gold); transition: fill .2s ease; cursor:default; }
.notehead.pending{ fill:var(--chalk-dim); opacity:0.5; }
.notehead.correct{ fill:var(--mint); }
.notehead.wrong{ fill:var(--coral); }
.stem{ stroke:var(--gold); stroke-width:2; transition: stroke .2s ease; }
.stem.pending{ stroke:var(--chalk-dim); opacity:0.5; }
.stem.correct{ stroke:var(--mint); }
.stem.wrong{ stroke:var(--coral); }
.clef{ fill:var(--chalk); opacity:0.95; }

.wrong-ring{
  fill:none; stroke:var(--coral); stroke-width:2.5; opacity:0.9;
  transform-box: fill-box; transform-origin:center; animation: pulseRing 0.7s ease-out 2;
}
@keyframes pulseRing{ 0%{ transform:scale(0.85); opacity:0.9; } 100%{ transform:scale(2.1); opacity:0; } }
.wrong-label{ font-family:'IBM Plex Mono',monospace; font-size:16px; font-weight:700; fill:var(--coral); }
.wrong-connector{ stroke:var(--coral); stroke-width:1.4; stroke-dasharray:3,3; opacity:0.75; }

.stats{ display:flex; justify-content:center; gap:28px; margin-top:18px; font-family:'IBM Plex Mono',monospace; }
.stats.hidden{ display:none; }
.stat{ text-align:center; }
.stat .num{ font-size:22px; font-weight:600; color:var(--chalk); }
.stat .label{ font-size:10px; letter-spacing:0.12em; text-transform:uppercase; color:var(--text-dim); margin-top:2px; }

.feedback{
  text-align:center; min-height:38px; margin-top:14px;
  font-family:'IBM Plex Mono',monospace; font-size:13px; letter-spacing:0.03em;
}
.feedback span{ display:inline-block; padding:7px 16px; border-radius:8px; }
.feedback.correct span{ color:var(--mint); background:rgba(111,207,151,0.14); }
.feedback.wrong span{ color:var(--coral); background:rgba(235,107,86,0.16); font-size:15px; font-weight:700; }
.feedback.info span{ color:var(--chalk-dim); background:rgba(241,234,217,0.06); }

.answers-label{ text-align:center; font-size:12px; color:var(--text-dim); margin-top:22px; margin-bottom:-8px; font-family:'IBM Plex Mono',monospace; }
.answers-label.hidden{ display:none; }

.answers{ display:grid; grid-template-columns:repeat(7,1fr); gap:10px; margin-top:26px; }
.note-btn{
  font-family:'Fraunces',serif; font-weight:600; font-size:18px; padding:16px 4px 10px;
  border-radius:10px; border:1px solid rgba(241,234,217,0.14);
  background:linear-gradient(180deg, rgba(241,234,217,0.06), rgba(241,234,217,0.02));
  color:var(--chalk); cursor:pointer;
  transition: transform .1s ease, background .15s ease, border-color .15s ease;
  display:flex; flex-direction:column; align-items:center; gap:4px;
}
.note-btn .kbd{ font-family:'IBM Plex Mono',monospace; font-size:10px; font-weight:500; color:var(--text-dim); }
.note-btn:hover{ background:rgba(227,178,60,0.14); border-color:rgba(227,178,60,0.4); }
.note-btn:active{ transform:scale(0.94); }
.note-btn.selected{ background:var(--gold); color:#1B2A1A; border-color:var(--gold); }
.note-btn.selected .kbd{ color:#1B2A1A; }
.note-btn.correct-flash{ background:var(--mint); color:#0F211D; border-color:var(--mint); }
.note-btn.correct-flash .kbd{ color:#0F211D; }
.note-btn.wrong-flash{ background:var(--coral); color:#0F211D; border-color:var(--coral); }
.note-btn.wrong-flash .kbd{ color:#0F211D; }

.hint-row{ display:flex; justify-content:center; margin-top:18px; }

.site-footer{
  width:100%; margin-top:14px; padding-top:20px; /* créditos perto do conteúdo, mais visíveis */
  border-top:1px solid rgba(241,234,217,0.1);
  display:flex; flex-direction:column; align-items:flex-end; gap:14px;
  font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--text-dim);
  text-align:right;
}
.site-footer-links{ display:flex; align-items:center; gap:16px; }
.site-footer-links a{
  display:flex; align-items:center; justify-content:center;
  width:34px; height:34px; border-radius:50%;
  border:1px solid rgba(241,234,217,0.16);
  color:var(--text-dim); transition:all .15s ease;
}
.site-footer-links a:hover{ color:var(--gold); border-color:var(--gold); background:rgba(227,178,60,0.14); }
.site-footer-links svg{ width:17px; height:17px; fill:currentColor; }
.site-footer-name{ letter-spacing:0.04em; }
/* logos oficiais coloridas (Instagram e LinkedIn) */
.site-footer-links a:has(.brand-logo){ width:24px; height:24px; border:0; border-radius:6px; background:none; }
.site-footer-links a:has(.brand-logo):hover{ background:none; transform:translateY(-2px); filter:brightness(1.08); }
.site-footer-links svg.brand-logo{ width:24px; height:24px; display:block; }

.metronome-bar{
  display:flex; flex-direction:column; align-items:center; gap:12px;
  margin-bottom:18px;
}
.metronome-bar.hidden{ display:none; }
.classic-mode-bar{
  display:flex; flex-direction:column; align-items:center; gap:12px;
  margin-bottom:18px;
}
.classic-mode-bar.hidden{ display:none; }
#metronomeStartBtn.running{ background:var(--coral); color:#2A1414; border-color:var(--coral); }
#metronomeStartBtn:not(.running){ animation:startPulse 1.6s ease-in-out infinite; }
@keyframes startPulse{
  0%{ box-shadow:0 0 0 0 rgba(227,178,60,0.55); }
  70%{ box-shadow:0 0 0 14px rgba(227,178,60,0); }
  100%{ box-shadow:0 0 0 0 rgba(227,178,60,0); }
}
.metronome-pulse-wrap{ display:flex; align-items:center; gap:10px; }
.metronome-pulse-wrap.hidden{ display:none; }
.metronome-pulse{
  width:16px; height:16px; border-radius:50%; background:var(--gold);
  box-shadow:0 0 0 0 rgba(227,178,60,0.6); flex-shrink:0;
}
.metronome-pulse.beat{ animation:metronomeBeat 0.28s ease-out; }
@keyframes metronomeBeat{
  0%{ transform:scale(1); box-shadow:0 0 0 0 rgba(227,178,60,0.65); }
  40%{ transform:scale(1.5); box-shadow:0 0 0 10px rgba(227,178,60,0); }
  100%{ transform:scale(1); box-shadow:0 0 0 0 rgba(227,178,60,0); }
}
.metronome-pulse-label{
  font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:0.1em;
  text-transform:uppercase; color:var(--text-dim);
}
.cursor-toggle-row{
  display:flex; align-items:center; gap:10px; background:rgba(0,0,0,0.18);
  border:1px solid rgba(241,234,217,0.1); border-radius:10px; padding:11px 14px;
  cursor:pointer; width:min(420px,100%);
}
.cursor-toggle-row input[type="checkbox"]{ width:18px; height:18px; accent-color:var(--gold); cursor:pointer; flex-shrink:0; }
.cursor-toggle-row .cursor-toggle-text{ display:flex; flex-direction:column; gap:2px; text-align:left; }
.cursor-toggle-row .cursor-toggle-text b{ font-family:'Fraunces',serif; font-size:14px; color:var(--chalk); font-weight:600; }
.cursor-toggle-row .cursor-toggle-text span{ font-size:11.5px; color:var(--text-dim); }
.cursor-toggle-row.disabled{ opacity:0.5; pointer-events:none; }
.cursor-needle{ stroke:var(--gold-2, var(--gold)); stroke-width:3; opacity:0.9; filter:drop-shadow(0 0 4px rgba(227,178,60,0.65)); }
.answers.awaiting-start{ pointer-events:none; opacity:0.45; }
.hint-btn{
  font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:0.08em; text-transform:uppercase;
  color:var(--text-dim); background:none; border:1px solid rgba(241,234,217,0.14);
  padding:8px 16px; border-radius:20px; cursor:pointer; transition:all .15s ease;
}
.hint-btn:hover{ color:var(--gold); border-color:var(--gold); }
.hint-btn.hidden{ display:none; }

.reset-stats-btn{
  display:block; margin:10px auto 0; background:none; border:none;
  color:var(--text-dim); opacity:0.7; cursor:pointer;
  font-family:'IBM Plex Mono',monospace; font-size:10px; letter-spacing:0.08em; text-transform:uppercase;
  padding:4px 8px; transition:all .15s ease;
}
.reset-stats-btn:hover{ color:var(--coral); opacity:1; }
.reset-stats-btn.hidden{ display:none; }

.modal-overlay{
  position:fixed; inset:0; background:rgba(6,14,11,0.72);
  display:flex; align-items:center; justify-content:center;
  z-index:100; padding:20px; backdrop-filter: blur(2px);
}
.modal-overlay.hidden{ display:none; }
.onboarding-card{
  width:100%; max-width:440px; background:var(--board-edge);
  border:1px solid rgba(241,234,217,0.14); border-radius:18px;
  padding:32px 28px; text-align:center;
  box-shadow:0 30px 60px -20px rgba(0,0,0,0.6);
}
.onboarding-eyebrow{
  font-family:'IBM Plex Mono',monospace; font-size:10px; letter-spacing:0.14em;
  text-transform:uppercase; color:var(--text-dim); margin-bottom:8px;
}
.onboarding-title{
  font-family:'Fraunces',serif; font-weight:700; font-size:24px; margin:0 0 12px;
}
.onboarding-text{ color:var(--text-dim); font-size:14px; line-height:1.6; margin:0 0 22px; }
.onboarding-actions{ display:flex; gap:10px; justify-content:center; }
.onboarding-btn{
  font-family:'IBM Plex Mono',monospace; font-size:12px; letter-spacing:0.06em; text-transform:uppercase;
  padding:12px 18px; border-radius:12px; cursor:pointer; transition:all .15s ease; flex:1;
}
.onboarding-btn.ghost{ background:none; border:1px solid rgba(241,234,217,0.18); color:var(--text-dim); }
.onboarding-btn.ghost:hover{ border-color:var(--gold); color:var(--chalk); }
.onboarding-btn.solid{ background:var(--gold); border:none; color:#1B2A1A; font-weight:600; }
.onboarding-btn.solid:hover{ opacity:0.9; }
.onboarding-dots{ display:flex; justify-content:center; gap:6px; margin-bottom:22px; }
.onboarding-dot{ width:6px; height:6px; border-radius:50%; background:rgba(241,234,217,0.22); }
.onboarding-dot.active{ background:var(--gold); width:16px; border-radius:3px; }

.tour-spotlight{
  position:fixed; z-index:200; border-radius:14px;
  box-shadow:0 0 0 9999px rgba(6,14,11,0.8);
  transition:top .35s ease, left .35s ease, width .35s ease, height .35s ease, opacity .2s ease;
  pointer-events:none;
}
.tour-spotlight.hidden{ opacity:0; }
.tour-tooltip{
  position:fixed; z-index:201; width:min(300px, calc(100vw - 32px));
  background:var(--board-edge); border:1px solid rgba(241,234,217,0.16);
  border-radius:14px; padding:18px 20px;
  box-shadow:0 20px 45px -10px rgba(0,0,0,0.65);
  transition:top .35s ease, left .35s ease, opacity .2s ease;
}
.tour-tooltip.hidden{ display:none; }
.tour-progress{
  font-family:'IBM Plex Mono',monospace; font-size:10px; letter-spacing:0.1em;
  text-transform:uppercase; color:var(--text-dim); margin-bottom:6px;
}
.tour-tooltip-title{ font-family:'Fraunces',serif; font-weight:700; font-size:16px; margin:0 0 8px; }
.tour-tooltip-text{ font-size:13px; color:var(--text-dim); line-height:1.55; margin:0 0 16px; }
.tour-tooltip-actions{ display:flex; justify-content:space-between; align-items:center; gap:10px; }
.tour-tooltip-actions .onboarding-btn{ flex:none; padding:9px 16px; font-size:11px; }

.board.hidden{ display:none; }
.hint-row.hidden{ display:none; }
.answers.hidden{ display:none; }
.chroma-mode-panel.hidden{ display:none; }

.duration-ex-icon{
  width:100px; height:100px; margin:6px auto 18px; opacity:0.95;
}
.duration-ex-icon svg{ width:100%; height:100%; }
.duration-answers{
  display:grid; grid-template-columns:repeat(2, 1fr); gap:10px; margin:10px 0 16px;
}
.duration-answers button{
  padding:12px 8px; border-radius:10px; border:1px solid rgba(241,234,217,0.18);
  background:rgba(241,234,217,0.05); color:var(--chalk); font-family:'IBM Plex Mono',monospace;
  font-size:12.5px; cursor:pointer; transition:all 0.15s ease; line-height:1.3;
}
.duration-answers button:hover{ border-color:var(--gold); background:rgba(227,178,60,0.14); }
.duration-answers button.correct-flash{ background:var(--mint); color:#0F211D; border-color:var(--mint); }
.duration-answers button.wrong-flash{ background:var(--coral); color:#0F211D; border-color:var(--coral); }
.duration-answers button.disabled{ pointer-events:none; opacity:0.6; }

.compass-staff{ position:relative; padding:16px 16px; min-height:96px; }
.compass-stafflines{
  position:absolute; left:18px; right:18px; top:50%; transform:translateY(-50%);
  height:60px; pointer-events:none; z-index:0;
}
.compass-stafflines .cline{
  position:absolute; left:0; right:0; height:2px; background:var(--chalk); opacity:0.85; border-radius:1px;
}
.compass-stafflines .cline:nth-child(1){ top:0; }
.compass-stafflines .cline:nth-child(2){ top:15px; }
.compass-stafflines .cline:nth-child(3){ top:30px; }
.compass-stafflines .cline:nth-child(4){ top:45px; }
.compass-stafflines .cline:nth-child(5){ top:60px; }
.compass-staff-content{
  position:relative; z-index:1;
  display:flex; align-items:center; justify-content:center; gap:4px; flex-wrap:nowrap;
  min-height:130px; overflow-x:auto; padding:0 4px;
}
.compass-bar{ width:3px; height:74px; background:var(--chalk-dim); border-radius:2px; flex:0 0 auto; }
.compass-measure{ display:flex; align-items:center; gap:3px; flex:0 0 auto; }
.compass-icon{ width:38px; height:38px; flex:0 0 auto; }
.compass-icon svg{ width:100%; height:100%; }

.compass-answers-wrap{ display:flex; justify-content:center; margin-top:8px; }
.compass-answers-single{ width:100%; max-width:340px; }
.compass-btn-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.compass-btn{
  font-family:'Fraunces',serif; font-weight:600; font-size:16px;
  padding:14px 4px; border-radius:10px; border:1px solid rgba(241,234,217,0.14);
  background:linear-gradient(180deg, rgba(241,234,217,0.06), rgba(241,234,217,0.02));
  color:var(--chalk); cursor:pointer; transition: transform .1s ease, background .15s ease, border-color .15s ease;
}
.compass-btn:hover{ background:rgba(227,178,60,0.14); border-color:rgba(227,178,60,0.4); }
.compass-btn:active{ transform:scale(0.96); }
.compass-btn.correct-flash{ background:var(--mint); color:#0F211D; border-color:var(--mint); }
.compass-btn.wrong-flash{ background:var(--coral); color:#0F211D; border-color:var(--coral); }
.compass-btn.disabled{ pointer-events:none; opacity:0.6; }

@media (max-width:480px){
  .compass-answers-wrap{ grid-template-columns:1fr; }
}
body.mobile-mode .compass-answers-wrap{ grid-template-columns:1fr; }
body.mobile-mode .compass-icon{ width:32px; height:32px; }
body.mobile-mode .compass-bar{ height:60px; }
@media (max-width:480px){
  .duration-answers{ grid-template-columns:repeat(2, 1fr); }
}
.modal-card{
  background:var(--bg-board); border:1px solid rgba(241,234,217,0.12); border-radius:16px;
  width:100%; max-width:680px; max-height:88vh; display:flex; flex-direction:column;
  box-shadow:0 30px 70px -20px rgba(0,0,0,0.6);
}
.modal-header{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding:16px 16px 0 20px; }
.modal-tabs{
  display:flex; flex-wrap:wrap; gap:2px; background:rgba(0,0,0,0.18);
  border-radius:9px; padding:4px; border:1px solid rgba(241,234,217,0.06);
}
.modal-close{ background:none; border:none; color:var(--text-dim); font-size:18px; cursor:pointer; padding:6px 10px; flex-shrink:0; }
.modal-close:hover{ color:var(--coral); }
.modal-body{ padding:18px 22px 24px; overflow-y:auto; }
.pane{ display:none; }
.pane.active{ display:block; }
.pane-title{ font-family:'Fraunces',serif; font-weight:600; font-size:19px; margin:0 0 8px; color:var(--chalk); }
.pane-text{ font-size:13.5px; color:var(--text-dim); line-height:1.55; margin:0 0 16px; }

.launch-btn{
  display:block; width:100%; margin-top:6px; font-family:'IBM Plex Mono',monospace;
  font-size:13px; letter-spacing:0.06em; text-transform:uppercase; font-weight:600;
  color:#1B2A1A; background:var(--gold); border:none; padding:13px 18px; border-radius:12px; cursor:pointer;
}
.launch-btn:hover{ opacity:0.9; }

.chroma-row{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
#chromaExAnswers{ justify-content:center; }
.chroma-chip{
  font-family:'IBM Plex Mono',monospace; font-size:13px; font-weight:600;
  background:rgba(0,0,0,0.2); border:1px solid rgba(241,234,217,0.1);
  color:var(--chalk); border-radius:8px; padding:10px 6px; min-width:52px;
  cursor:pointer; text-align:center; transition:all .15s ease; line-height:1.35;
}
.chroma-chip.sharp{ color:var(--gold); }
.chroma-chip:hover{ border-color:var(--gold); background:rgba(227,178,60,0.14); }
.chroma-chip.correct-flash{ background:var(--mint); color:#0F211D; border-color:var(--mint); }
.chroma-chip.wrong-flash{ background:var(--coral); color:#0F211D; border-color:var(--coral); }
.chroma-chip.disabled{ pointer-events:none; opacity:0.6; }

.chroma-exercise-divider{ height:1px; background:rgba(241,234,217,0.12); margin:24px 0 18px; }
.chroma-ex-question{
  text-align:center; font-family:'Fraunces',serif; font-weight:600;
  font-size:clamp(20px, 4.4vw, 28px);
  color:var(--chalk); margin:10px auto 22px; line-height:1.55; max-width:520px;
  letter-spacing:0.01em;
}
.chroma-ex-question .accent{ color:var(--gold); font-weight:700; }

.clef-ref-block{ margin-bottom:22px; }
.clef-ref-title{
  font-family:'IBM Plex Mono',monospace; font-size:12px; letter-spacing:0.08em;
  text-transform:uppercase; color:var(--gold); margin-bottom:6px;
}
.mini-staff-wrap{ background:rgba(0,0,0,0.15); border-radius:10px; padding:10px 6px; }
.mini-staff-wrap svg{ width:100%; height:auto; display:block; }
.mini-label{ font-family:'IBM Plex Mono',monospace; font-size:11px; font-weight:600; fill:var(--chalk); }
.mini-note{ fill:var(--gold); }

.durations-table{ display:flex; flex-direction:column; gap:8px; }
.duration-row{
  display:grid; grid-template-columns:56px 1fr 56px 1fr; align-items:center; gap:8px;
  background:rgba(0,0,0,0.16); border-radius:9px; padding:8px 10px;
}
.duration-row svg{ width:100%; height:44px; display:block; }
.duration-name{ font-size:12.5px; color:var(--chalk); }
.duration-name small{ display:block; color:var(--text-dim); font-size:10px; }
.duration-header{
  display:grid; grid-template-columns:56px 1fr 56px 1fr; gap:8px;
  font-family:'IBM Plex Mono',monospace; font-size:10px; letter-spacing:0.1em;
  text-transform:uppercase; color:var(--text-dim); padding:0 10px 4px;
}

@media (max-width:480px){
  .answers{ grid-template-columns:repeat(4,1fr); }
  .note-btn{ font-size:15px; padding:13px 2px 8px; }
  .settings{ grid-template-columns:1fr 1fr; }
  .duration-row, .duration-header{ grid-template-columns:40px 1fr 40px 1fr; }
}

/* ===================== MODO MOBILE (toggle manual) ===================== */
body.mobile-mode{ padding:28px 12px; align-items:flex-start; }
body.mobile-mode .wrap{ max-width:420px; margin:0 auto; }
body.mobile-mode header{ margin-top:64px; margin-bottom:16px; }
body.mobile-mode .eyebrow{ font-size:10px; }
body.mobile-mode h1{ font-size:25px; }
body.mobile-mode .subtitle{ font-size:12.5px; }

body.mobile-mode input[type="range"]{ height:8px; }
body.mobile-mode input[type="range"]::-webkit-slider-thumb{ width:22px; height:22px; }

body.mobile-mode #keymapSetting{ display:none; }
body.mobile-mode .note-btn .kbd{ display:none; }

body.mobile-mode .wrap{ display:flex; flex-direction:column; }
body.mobile-mode .board{ padding:26px 4px 22px; border-radius:16px; border-width:7px; }
body.mobile-mode .stats{ gap:18px; order:3; }
body.mobile-mode #resetClassicStatsBtn{ order:3; }
body.mobile-mode .stat .num{ font-size:19px; }

body.mobile-mode .answers-label{ order:1; }
body.mobile-mode .answers{
  grid-template-columns:repeat(4,1fr); gap:8px; margin-top:18px; order:1;
}
body.mobile-mode .feedback{ order:2; }
body.mobile-mode #mainHintRow{ order:4; }
body.mobile-mode .site-footer{ order:5; }
body.mobile-mode .note-btn{ font-size:16px; padding:15px 2px; }
body.mobile-mode .chroma-row{ justify-content:center; }
body.mobile-mode .chroma-chip{ flex:1 1 26%; min-width:0; padding:13px 4px; }
body.mobile-mode .duration-answers{ grid-template-columns:repeat(2,1fr); }
body.mobile-mode .hint-btn{ padding:12px 18px; font-size:11.5px; }

body.mobile-mode .modal-overlay{ align-items:flex-end; padding:0; backdrop-filter:blur(3px); }
body.mobile-mode .modal-card{
  max-width:100%; width:100%; max-height:90vh; border-radius:22px 22px 0 0;
}
body.mobile-mode .modal-tabs{ flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; }
body.mobile-mode .modal-tabs .tab{ flex:0 0 auto; }
body.mobile-mode .modal-body{ padding:16px 16px 90px; }
body.mobile-mode .duration-row, body.mobile-mode .duration-header{ grid-template-columns:40px 1fr 40px 1fr; }

@media (prefers-reduced-motion: reduce){ *{ transition:none !important; animation:none !important; } }

/* ===================== INTEGRAÇÃO ===================== */
/* Estatísticas com 4 indicadores (Acertos, Sequência, Tentativas, Maior sequência):
   em telas estreitas os indicadores podem quebrar de linha em vez de vazar. */
.stats{ flex-wrap:wrap; row-gap:10px; }

/* Módulo Solfejo: painel próprio, visível só no modo "solfejo".
   A largura máxima de 900px é a mesma do projeto Solfejo original (a partitura
   é distribuída conforme a largura disponível). */
.solfejo-panel{ display:contents; } /* filhos participam do .wrap; o painel de reprodução
                                        fica no fluxo normal da página, logo abaixo da partitura */
.solfejo-panel.hidden{ display:none; }
body.mode-solfejo .wrap,
body.mobile-mode.mode-solfejo .wrap{ max-width:900px; }
/* mesmas margens laterais do protótipo do Solfejo (16px) também no celular:
   a distribuição da partitura foi medida e testada com essa largura */
body.mobile-mode.mode-solfejo{ padding-left:16px; padding-right:16px; }

/* rodapé com créditos logo abaixo dos controles de reprodução */
body.mode-solfejo .site-footer{ margin-top:14px; }
