/* Escala · guitarra
   Direção: palco e amplificador. Fundo de tolex escuro, texto creme, âmbar de válvula
   como cor de ação, verde de "afinado", vermelho de "gravando/erro". */

:root {
  color-scheme: dark;
  --bg: #14110f;
  --surface: #1c1815;
  --surface-2: #25201c;
  --surface-3: #2f2924;
  --line: #3b342d;
  --line-2: #4c443b;
  --text: #f0e9dd;
  --text-2: #bfb4a3;
  --text-3: #968b7b;
  --amber: #f2a93b;
  --amber-2: #ffc46b;
  --amber-ink: #1b1205;
  --amber-glow: rgb(242 169 59 / .16);
  --red: #ef5b5b;
  --red-bg: rgb(239 91 91 / .14);
  --green: #4cc982;
  --green-bg: rgb(76 201 130 / .14);
  --blue: #7cb1ff;

  --g-iniciante: #f2a93b;
  --g-avancado: #ff7a52;
  --g-profissional: #c9a2ff;

  --tab-ink: #efe7da;
  --tab-line: #7a6f62;

  --f-display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --f-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --r-1: 6px;
  --r-2: 10px;
  --r-3: 16px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --largura: 1180px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f6f1e8;
    --surface: #fffaf2;
    --surface-2: #f0e8db;
    --surface-3: #e6dccc;
    --line: #dccfbc;
    --line-2: #c7b8a2;
    --text: #1e1915;
    --text-2: #4f463c;
    --text-3: #6e6457;
    --amber: #b86b00;
    --amber-2: #94560a;
    --amber-ink: #fffaf2;
    --amber-glow: rgb(184 107 0 / .12);
    --red: #c2363a;
    --red-bg: rgb(194 54 58 / .1);
    --green: #1d8a4f;
    --green-bg: rgb(29 138 79 / .1);
    --blue: #2563c9;
    --g-iniciante: #b86b00;
    --g-avancado: #c84a22;
    --g-profissional: #7a4fc4;
    --tab-ink: #1e1915;
    --tab-line: #9a8d7c;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--f-body);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--amber-2); text-underline-offset: 3px; }
a:hover { color: var(--amber); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0 0 var(--sp-3); }
.icone { width: 1.25em; height: 1.25em; flex: none; }
.oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pular { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--amber); color: var(--amber-ink); padding: 8px 14px; border-radius: var(--r-1); }
.pular:focus { left: 8px; }
.noscript { padding: 24px; }

/* ---------- topo ---------- */
.topo {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--sp-5);
  padding: var(--sp-3) max(var(--sp-4), env(safe-area-inset-left));
  padding-top: max(var(--sp-3), env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.marca { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font: 800 1.6rem/1 var(--f-display); letter-spacing: .02em; text-transform: uppercase; }
.marca:hover { color: var(--text); }
.marca-icone { width: 22px; height: 22px; color: var(--amber); transform: rotate(-12deg); }
.nav { display: flex; gap: 2px; }
.nav a { padding: 8px 12px; border-radius: var(--r-1); color: var(--text-2); text-decoration: none; font-weight: 500; min-height: 40px; display: flex; align-items: center; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--amber); }
.status { margin-left: auto; display: flex; align-items: center; gap: var(--sp-4); font: 600 .95rem/1 var(--f-mono); }
.status .st { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.status .st strong { color: var(--text); font-weight: 600; }
.status .st-fogo .icone { color: var(--red); }
.status .st-fogo.ativo .icone { color: var(--amber); }
.status .st-xp .icone { color: var(--amber); }

@media (max-width: 720px) {
  .topo { gap: var(--sp-3); flex-wrap: wrap; }
  .nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    justify-content: space-around;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 8px max(6px, env(safe-area-inset-bottom));
  }
  .nav a { flex: 1; justify-content: center; font-size: .9rem; }
  .nav a[aria-current="page"] { box-shadow: inset 0 2px 0 var(--amber); }
  main { padding-bottom: 84px; }
}

/* ---------- layout ---------- */
main { outline: none; }
.pagina { max-width: var(--largura); margin: 0 auto; padding: var(--sp-6) var(--sp-4) var(--sp-8); }
.pagina-estreita { max-width: 760px; }
.migalha { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .9rem; color: var(--text-3); margin-bottom: var(--sp-4); }
.migalha a { color: var(--text-2); text-decoration: none; }
.migalha a:hover { color: var(--text); text-decoration: underline; }
.rotulo { font: 600 .78rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.titulo-xl { font: 800 clamp(2.4rem, 6vw, 4.2rem)/.95 var(--f-display); text-transform: uppercase; letter-spacing: .01em; }
.titulo-l { font: 800 clamp(1.9rem, 4vw, 2.7rem)/1 var(--f-display); text-transform: uppercase; }
.titulo-m { font: 700 1.35rem/1.2 var(--f-body); }
.sub { color: var(--text-2); max-width: 62ch; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--r-2);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s;
}
.btn:hover { background: var(--surface-3); border-color: var(--text-3); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primario { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn-primario:hover { background: var(--amber-2); border-color: var(--amber-2); color: var(--amber-ink); }
.btn-perigo { border-color: var(--red); color: var(--red); background: transparent; }
.btn-ok { background: var(--green); border-color: var(--green); color: #07150d; }
.btn-fantasma { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-fantasma:hover { background: var(--surface-2); border-color: transparent; }
.btn-grande { min-height: 56px; font-size: 1.05rem; padding: 14px 24px; }
.btn-icone { width: 44px; padding: 0; }
.btn-gravando { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- formulários ---------- */
.campo { display: grid; gap: 6px; margin-bottom: var(--sp-4); }
.campo label { font-weight: 600; font-size: .95rem; }
.campo input, .campo select {
  min-height: 46px; padding: 10px 14px; border-radius: var(--r-2);
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text);
}
.campo input:focus { border-color: var(--amber); outline: none; box-shadow: 0 0 0 3px var(--amber-glow); }
.campo .ajuda { font-size: .85rem; color: var(--text-3); }
.erro-form { color: var(--red); background: var(--red-bg); padding: 10px 14px; border-radius: var(--r-2); margin-bottom: var(--sp-4); }

/* ---------- entrar ---------- */
.entrar { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.entrar-arte {
  position: relative; overflow: hidden; padding: var(--sp-7);
  display: flex; flex-direction: column; justify-content: flex-end; gap: var(--sp-4);
  background:
    repeating-linear-gradient(0deg, transparent 0 46px, var(--line) 46px 48px),
    linear-gradient(160deg, var(--surface-2), var(--bg) 70%);
  border-right: 1px solid var(--line);
}
.entrar-arte .trastes { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(6, 1fr); pointer-events: none; opacity: .5; }
.entrar-arte .trastes span { border-right: 3px solid var(--line-2); }
.entrar-arte h1 { position: relative; font: 800 clamp(3rem, 8vw, 6.5rem)/.85 var(--f-display); text-transform: uppercase; }
.entrar-arte h1 em { font-style: normal; color: var(--amber); }
.entrar-arte p { position: relative; color: var(--text-2); max-width: 40ch; font-size: 1.05rem; }
.entrar-form { display: flex; align-items: center; justify-content: center; padding: var(--sp-6) var(--sp-4); }
.entrar-form form { width: min(400px, 100%); }
.abas { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); margin-bottom: var(--sp-5); }
.abas button { flex: 1; min-height: 40px; border: 0; border-radius: var(--r-1); background: transparent; color: var(--text-2); font-weight: 600; cursor: pointer; }
.abas button[aria-selected="true"] { background: var(--surface-3); color: var(--text); }
@media (max-width: 820px) {
  .entrar { grid-template-columns: 1fr; }
  .entrar-arte { min-height: 34vh; padding: var(--sp-5) var(--sp-4); border-right: 0; border-bottom: 1px solid var(--line); }
}

/* ---------- mapa ---------- */
.mapa-topo { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-5); align-items: end; margin-bottom: var(--sp-7); }
.continuar {
  display: grid; gap: 4px; padding: var(--sp-4) var(--sp-5); min-width: 280px;
  border-radius: var(--r-3); background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--text);
  transition: border-color .15s var(--ease), transform .15s var(--ease);
}
.continuar:hover { border-color: var(--amber); color: var(--text); transform: translateY(-2px); }
.continuar strong { font: 800 1.6rem/1.05 var(--f-display); text-transform: uppercase; }
.continuar .vai { display: flex; align-items: center; gap: 6px; color: var(--amber); font-weight: 600; margin-top: 6px; }
.resumo-num { display: flex; gap: var(--sp-5); margin-top: var(--sp-4); flex-wrap: wrap; }
.resumo-num div { display: grid; }
.resumo-num b { font: 600 1.6rem/1.1 var(--f-mono); }
.resumo-num span { font-size: .85rem; color: var(--text-3); }

.grupo { margin-bottom: var(--sp-8); --g: var(--g-iniciante); }
.grupo[data-grupo="avancado"] { --g: var(--g-avancado); }
.grupo[data-grupo="profissional"] { --g: var(--g-profissional); }
.grupo-cab { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2) var(--sp-5); align-items: end; margin-bottom: var(--sp-5); padding-bottom: var(--sp-4); border-bottom: 1px solid var(--line); }
.grupo-cab .num { font: 800 4.5rem/.8 var(--f-display); color: var(--g); grid-row: span 2; }
.grupo-cab h2 { font: 800 2rem/1 var(--f-display); text-transform: uppercase; }
.grupo-cab p { color: var(--text-2); margin: 0; max-width: 70ch; }
.barra { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.barra > i { display: block; height: 100%; background: var(--g, var(--amber)); border-radius: inherit; transition: width .6s var(--ease); }
.grupo-cab .barra { grid-column: 2; margin-top: 6px; max-width: 360px; }

.niveis { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-3); }
.nivel-card {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 2px var(--sp-3);
  padding: var(--sp-4); min-height: 132px; height: 100%;
  border-radius: var(--r-3); background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--text);
  transition: border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease);
}
a.nivel-card:hover { border-color: var(--g); transform: translateY(-2px); color: var(--text); }
.nivel-card .n { font: 800 2.6rem/.85 var(--f-display); color: var(--text-3); grid-row: span 3; min-width: 1.6ch; }
.nivel-card h3 { font: 600 1.05rem/1.25 var(--f-body); }
.nivel-card p { margin: 0; font-size: .9rem; color: var(--text-2); line-height: 1.45; }
.nivel-card .pontos { display: flex; gap: 4px; margin-top: 8px; align-self: end; }
.nivel-card .pontos i { width: 18px; height: 5px; border-radius: 2px; background: var(--surface-3); }
.nivel-card .pontos i.ok { background: var(--g); }
.nivel-card .selo { position: absolute; top: 12px; right: 12px; color: var(--text-3); }
.nivel-card.feito .n { color: var(--g); }
.nivel-card.feito .selo { color: var(--g); }
.nivel-card.atual { border-color: var(--g); background: linear-gradient(180deg, color-mix(in srgb, var(--g) 10%, var(--surface)), var(--surface)); }
.nivel-card.atual .n { color: var(--g); }
.nivel-card.atual::after { content: 'Você está aqui'; position: absolute; top: 12px; right: 12px; font: 600 .7rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--g); }
.nivel-card.bloqueado { opacity: .55; }
.nivel-card.bloqueado h3, .nivel-card.bloqueado p { color: var(--text-3); }
.nivel-card.chefe { border-style: dashed; }

/* ---------- conteúdo em markdown ---------- */
.md { max-width: 70ch; }
.md h2, .md h3 { margin: var(--sp-5) 0 var(--sp-2); font: 700 1.15rem/1.3 var(--f-body); }
.md ul, .md ol { padding-left: 1.3em; margin: 0 0 var(--sp-3); }
.md li { margin-bottom: 4px; }
.md strong { color: var(--text); font-weight: 600; }
.md code { font: .92em var(--f-mono); background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.md pre {
  font: .9rem/1.45 var(--f-mono); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-2); padding: var(--sp-3) var(--sp-4); overflow-x: auto; margin: 0 0 var(--sp-4);
}
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; width: 100%; margin: 0 0 var(--sp-4); font-size: .95rem; display: block; overflow-x: auto; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.md th { color: var(--text-2); font-weight: 600; }
.md blockquote { margin: 0 0 var(--sp-3); padding: var(--sp-2) var(--sp-4); border-left: 3px solid var(--amber); color: var(--text-2); }

/* ---------- página de nível ---------- */
.nivel-cab { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-6); --g: var(--g-iniciante); }
.nivel-cab[data-grupo="avancado"], .ex-cab[data-grupo="avancado"] { --g: var(--g-avancado); }
.nivel-cab[data-grupo="profissional"], .ex-cab[data-grupo="profissional"] { --g: var(--g-profissional); }
.nivel-cab .linha { display: flex; align-items: baseline; gap: var(--sp-4); flex-wrap: wrap; }
.nivel-cab .num { font: 800 clamp(4rem, 10vw, 7rem)/.8 var(--f-display); color: var(--g); }
.meta { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); color: var(--text-2); font-size: .92rem; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.colunas { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-7); align-items: start; }
@media (max-width: 960px) { .colunas { grid-template-columns: 1fr; gap: var(--sp-6); } }
.lateral { position: sticky; top: 88px; display: grid; gap: var(--sp-4); }
.caixa { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: var(--sp-4) var(--sp-5); }
.caixa h2 { font: 600 .8rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: var(--sp-3); }
.musicas { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.musicas li { display: grid; }
.musicas b { font-weight: 600; }
.musicas span { font-size: .88rem; color: var(--text-3); }

.exercicios { list-style: none; padding: 0; margin: var(--sp-5) 0 0; display: grid; gap: var(--sp-3); }
.ex-card {
  display: grid; grid-template-columns: 52px 1fr auto; gap: var(--sp-4); align-items: center;
  padding: var(--sp-4); border-radius: var(--r-3); background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--text);
  transition: border-color .15s var(--ease), transform .15s var(--ease);
}
a.ex-card:hover { border-color: var(--amber); color: var(--text); transform: translateX(3px); }
.ex-card .id { font: 800 1.7rem/1 var(--f-display); color: var(--text-3); text-align: center; }
.ex-card h3 { font: 600 1.05rem/1.3 var(--f-body); }
.ex-card .meta { font-size: .85rem; margin-top: 4px; }
.ex-card .estado { display: flex; align-items: center; gap: 6px; font: 600 .85rem/1 var(--f-mono); color: var(--text-3); }
.ex-card.passou { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.ex-card.passou .id, .ex-card.passou .estado { color: var(--green); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font: 600 .72rem/1.5 var(--f-mono); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-3); color: var(--text-2); }
.tag-ok { background: var(--green-bg); color: var(--green); }
.tag-mic { background: var(--amber-glow); color: var(--amber-2); }

/* ---------- exercício ---------- */
.ex-cab { margin-bottom: var(--sp-5); --g: var(--g-iniciante); }
.ex-cab .linha { display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.ex-cab .id { font: 800 2.4rem/1 var(--f-display); color: var(--g); }
.objetivo { font-size: 1.08rem; color: var(--text); max-width: 70ch; border-left: 3px solid var(--g, var(--amber)); padding-left: var(--sp-4); margin: var(--sp-4) 0 var(--sp-5); }
.secao { margin: var(--sp-6) 0; }
.secao > h2 { font: 800 1.5rem/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; margin-bottom: var(--sp-3); }
.passos { counter-reset: p; list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-3); max-width: 70ch; }
.passos li { counter-increment: p; display: grid; grid-template-columns: 32px 1fr; gap: var(--sp-3); }
.passos li::before { content: counter(p); font: 600 .9rem/32px var(--f-mono); text-align: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); }
.passos li .md p:last-child { margin-bottom: 0; }
.erros { padding-left: 1.2em; max-width: 70ch; color: var(--text-2); }
.criterio { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--r-2); background: var(--green-bg); border: 1px solid color-mix(in srgb, var(--green) 35%, transparent); }
.criterio .icone { color: var(--green); margin-top: 3px; }
.criterio .md p:last-child { margin: 0; }

/* tablatura */
.tab-bloco { margin: var(--sp-4) 0 var(--sp-5); border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); overflow: hidden; }
.tab-barra { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tab-barra .nome { font-weight: 600; margin-right: auto; padding-left: 4px; }
.tab-barra .vel { display: flex; align-items: center; gap: 6px; font: 500 .85rem var(--f-mono); color: var(--text-2); }
.tab-barra input[type=range] { width: 110px; accent-color: var(--amber); }
.tab-render { padding: var(--sp-3) var(--sp-2); min-height: 120px; overflow-x: auto; position: relative; }
.tab-render .at-cursor-bar { background: var(--amber-glow); }
.tab-render .at-cursor-beat { background: var(--amber); width: 3px; }
.tab-render .at-highlight * { fill: var(--amber) !important; stroke: var(--amber) !important; }
.tab-legenda { padding: 0 var(--sp-4) var(--sp-3); font-size: .9rem; color: var(--text-2); }
.tab-oculta { display: grid; place-items: center; gap: var(--sp-3); padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--text-2); }
.tab-carregando { color: var(--text-3); padding: var(--sp-5); font-size: .9rem; }

/* console de prática (o "pedal") */
.console {
  position: sticky; top: 88px;
  border-radius: var(--r-3); border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: 0 1px 0 rgb(255 255 255 / .04) inset, 0 18px 40px -24px rgb(0 0 0 / .6);
  overflow: hidden;
}
.console-sec { padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line); }
.console-sec:last-child { border-bottom: 0; }
.console h2 { font: 600 .78rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: var(--sp-3); }
.bpm { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: var(--sp-2); }
.bpm-num { text-align: center; }
.bpm-num b { display: block; font: 600 3rem/1 var(--f-mono); letter-spacing: -.02em; }
.bpm-num span { font: 500 .78rem/1 var(--f-mono); color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.escada { margin-top: var(--sp-3); }
.escada .barra { height: 8px; }
.escada .legenda { display: flex; justify-content: space-between; font: 500 .78rem var(--f-mono); color: var(--text-3); margin-top: 6px; }
.limpas { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: var(--sp-3); font-size: .9rem; color: var(--text-2); }
.limpas i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); }
.limpas i.ok { background: var(--green); border-color: var(--green); }
.chaves { display: grid; gap: var(--sp-2); }
.chave {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--sp-3);
  min-height: 48px; padding: 8px 12px; border-radius: var(--r-2);
  background: var(--surface); border: 1px solid var(--line); cursor: pointer; text-align: left;
}
.chave:hover { border-color: var(--line-2); }
.chave .led { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); box-shadow: none; transition: background .15s, box-shadow .15s; }
.chave[aria-pressed="true"] .led { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.chave[aria-pressed="true"].verde .led { background: var(--green); box-shadow: 0 0 10px var(--green); }
.chave small { color: var(--text-3); font-size: .8rem; }
.chave select { background: transparent; border: 0; color: var(--text-2); font-size: .85rem; max-width: 110px; }
.modo { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); }
.modo button { min-height: 40px; border: 0; border-radius: var(--r-1); background: transparent; color: var(--text-2); font-weight: 600; font-size: .9rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.modo button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.acoes { display: grid; gap: var(--sp-2); }
.acoes-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.medidor { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: var(--sp-2); }
.medidor i { display: block; height: 100%; width: 0; background: var(--green); transition: width .08s linear; }
.ao-vivo { font: 500 .9rem/1.45 var(--f-mono); color: var(--text-2); min-height: 1.45em; margin-top: var(--sp-2); }
.resultado { margin-top: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-2); border: 1px solid var(--line); background: var(--surface); font-size: .92rem; }
.resultado.limpo { border-color: color-mix(in srgb, var(--green) 50%, transparent); background: var(--green-bg); }
.resultado.sujo { border-color: color-mix(in srgb, var(--red) 50%, transparent); background: var(--red-bg); }
.resultado .md p:last-child { margin: 0; }
.resultado .md { font-size: .9rem; }
.passou-banner {
  display: grid; gap: 4px; text-align: center; padding: var(--sp-5) var(--sp-4);
  background: radial-gradient(120% 100% at 50% 0%, var(--amber-glow), transparent 70%);
}
.passou-banner b { font: 800 2rem/1 var(--f-display); text-transform: uppercase; color: var(--amber); }
.contagem { font: 800 4rem/1 var(--f-display); text-align: center; color: var(--amber); }
.batida { display: flex; justify-content: center; gap: 8px; margin: var(--sp-2) 0; }
.batida i { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-3); transition: background .05s; }
.batida i.on { background: var(--amber); }
.batida i.on.um { background: var(--red); }

/* afinador */
.afinador { display: grid; gap: var(--sp-5); justify-items: center; text-align: center; padding: var(--sp-5) 0; }
.afinador .nota { font: 800 clamp(5rem, 18vw, 9rem)/.85 var(--f-display); }
.afinador .nota.ok { color: var(--green); }
.afinador .freq { font: 500 1rem var(--f-mono); color: var(--text-3); }
.ponteiro { position: relative; width: min(420px, 100%); height: 64px; }
.ponteiro .escala { position: absolute; inset: 28px 0 auto; height: 2px; background: var(--line-2); }
.ponteiro .centro { position: absolute; left: 50%; top: 10px; width: 2px; height: 40px; margin-left: -1px; background: var(--green); }
.ponteiro .agulha { position: absolute; left: 50%; top: 4px; width: 4px; height: 52px; margin-left: -2px; border-radius: 2px; background: var(--amber); transition: transform .08s linear; }
.ponteiro .marcas { position: absolute; inset: 46px 0 0; display: flex; justify-content: space-between; font: 500 .75rem var(--f-mono); color: var(--text-3); }
.cordas { display: grid; grid-template-columns: repeat(6, minmax(44px, 1fr)); gap: var(--sp-2); width: min(460px, 100%); }
.corda { min-height: 56px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; font: 700 1.1rem var(--f-mono); cursor: pointer; }
.corda small { display: block; font: 500 .7rem var(--f-mono); color: var(--text-3); }
.corda.ok { border-color: var(--green); color: var(--green); background: var(--green-bg); }
.corda.alvo { border-color: var(--amber); }

/* ranking e perfil */
.tabela { width: 100%; border-collapse: collapse; }
.tabela th, .tabela td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.tabela th { font: 600 .78rem/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.tabela td.num, .tabela th.num { text-align: right; font-family: var(--f-mono); }
.tabela tr.eu td { background: var(--amber-glow); }
.pos { font: 800 1.5rem/1 var(--f-display); color: var(--text-3); width: 48px; }
.tabela tr:nth-child(1) .pos { color: var(--amber); }
.conquistas { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--sp-3); }
.conquista { display: grid; grid-template-columns: 40px 1fr; gap: var(--sp-3); align-items: center; padding: var(--sp-3); border-radius: var(--r-2); background: var(--surface); border: 1px solid var(--line); }
.conquista .icone { width: 28px; height: 28px; color: var(--text-3); justify-self: center; }
.conquista b { display: block; font-weight: 600; font-size: .95rem; }
.conquista span { font-size: .82rem; color: var(--text-3); line-height: 1.35; display: block; }
.conquista.tem { border-color: color-mix(in srgb, var(--amber) 50%, var(--line)); }
.conquista.tem .icone { color: var(--amber); }
.conquista:not(.tem) { opacity: .6; }
.gravacoes { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
.gravacoes li { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2) var(--sp-3); align-items: center; padding: var(--sp-3); border-radius: var(--r-2); background: var(--surface); border: 1px solid var(--line); }
.gravacoes audio { grid-column: 1 / -1; width: 100%; height: 40px; }
.vazio { color: var(--text-3); padding: var(--sp-4) 0; }

/* toasts */
.toast-area { position: fixed; z-index: 50; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); }
@media (max-width: 720px) { .toast-area { bottom: calc(90px + env(safe-area-inset-bottom)); } }
.toast { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--r-2); background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: 0 12px 30px -12px rgb(0 0 0 / .6); animation: entra .25s var(--ease); }
.toast .icone { color: var(--amber); width: 24px; height: 24px; }
.toast b { display: block; }
.toast.erro .icone { color: var(--red); }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } }

.carregando { padding: var(--sp-8) var(--sp-4); text-align: center; color: var(--text-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
