/* Palco: as cores e fontes do pitch. Palco escuro à esquerda (onde se grava), resultado claro à direita. */
:root {
  --ink: #1a1530;
  --ink-2: #4a4458;
  --muted: #6b6480;
  --paper: #f5efe6;
  --card: #fffdf8;
  --line: #e4dccd;
  --gold: #f2b544;
  --violet: #5a3fd0;
  --violet-soft: #ece7fb;
  --good: #1f7a4d;
  --bad: #b4471f;
  --stage: #1a1530;
  --stage-fg: #f5efe6;
  --stage-muted: #c9c0d8;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f5efe6; --ink-2: #d9d1e6; --muted: #a79fbc; --paper: #120f22; --card: #1c1834; --line: #2e2948;
    --violet: #9d88ff; --violet-soft: #2a2350; --good: #5fd39a; --bad: #ff9a6e; --stage: #0b0917; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #f5efe6; --ink-2: #d9d1e6; --muted: #a79fbc; --paper: #120f22; --card: #1c1834; --line: #2e2948;
  --violet: #9d88ff; --violet-soft: #2a2350; --good: #5fd39a; --bad: #ff9a6e; --stage: #0b0917; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 40px;
}
h1, h2, .logo, .score, .time { font-family: var(--display); }
h1, h2 { text-wrap: balance; margin: 0; }
.eyebrow { margin: 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--gold); }

.top { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.logo { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.evo { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.evo b { display: block; color: var(--good); font-size: 15px; }
#spark { width: 120px; height: 32px; }

.grid { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: minmax(0, 1fr); } }

/* Palco de gravação */
.stage { background: var(--stage); color: var(--stage-fg); border-radius: 22px; padding: 28px 24px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 16px; }
@media (max-width: 860px) { .stage { position: static; } }
.stage h1 { font-size: 26px; line-height: 1.15; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 13px; color: var(--stage-muted); background: transparent; border: 1px solid #4a4458; border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.chip[aria-checked="true"] { color: #1a1530; background: var(--gold); border-color: var(--gold); font-weight: 700; }
.chip:disabled { opacity: .5; cursor: default; }

.recorder { display: grid; justify-items: center; gap: 12px; padding: 18px 0 6px; }
.rec { width: 112px; height: 112px; border-radius: 50%; border: 3px solid var(--gold); background: transparent; cursor: pointer; display: grid; place-items: center; transition: transform .15s; }
.rec:hover { transform: scale(1.04); }
.rec .dot { width: 56px; height: 56px; border-radius: 50%; background: #e5484d; transition: all .2s; }
.rec.on .dot { width: 38px; height: 38px; border-radius: 8px; }
.rec.on { animation: pulse 1.6s infinite; }
.rec:disabled { opacity: .4; cursor: default; animation: none; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(242,181,68,.45); } 50% { box-shadow: 0 0 0 14px rgba(242,181,68,0); } }
.clock { display: flex; align-items: baseline; gap: 8px; }
.time { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; }
.clock .of { color: var(--stage-muted); font-variant-numeric: tabular-nums; }
.clock.over .time { color: var(--gold); }
.meter { display: flex; gap: 3px; height: 28px; align-items: center; }
.meter i { width: 4px; border-radius: 2px; background: var(--stage-muted); opacity: .35; height: 4px; transition: height .08s; }
.hint { margin: 0; text-align: center; color: var(--stage-muted); font-size: 13px; max-width: 30ch; }

.alt { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; border-top: 1px solid #2e2948; padding-top: 16px; font-size: 13px; color: var(--stage-muted); }
.upload { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }
.quality { display: flex; gap: 8px; align-items: center; }
.quality select { font: inherit; color: var(--stage-fg); background: #2e2948; border: 0; border-radius: 8px; padding: 4px 6px; }

.progress { display: grid; gap: 6px; font-size: 13px; color: var(--stage-muted); }
.progress .bar { height: 6px; background: #2e2948; border-radius: 3px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.progress.busy .bar i { width: 35% !important; animation: slide 1.2s infinite ease-in-out; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.error { margin: 0; color: #ffb59a; font-size: 13px; }

/* Resultado */
.result { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 28px; display: grid; gap: 18px; min-width: 0; }
.result-head { display: flex; justify-content: space-between; align-items: center; }
.result .eyebrow { color: var(--violet); }
.badge { font-size: 12px; font-weight: 700; color: var(--violet); background: var(--violet-soft); border-radius: 999px; padding: 3px 10px; }
.score-row { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.score { font-size: 84px; font-weight: 800; line-height: .9; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.score small { font-size: 22px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.parts { display: grid; grid-template-columns: repeat(3, minmax(84px, 1fr)); gap: 10px; flex: 1; min-width: 0; }
.part { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; }
.part span { font-size: 12px; color: var(--muted); }
.part b { font: 700 26px var(--display); font-variant-numeric: tabular-nums; }
.part.off b { font-size: 15px; color: var(--muted); font-weight: 500; padding-top: 8px; }
.source { margin: -6px 0 0; font-size: 13px; color: var(--muted); }

.feedback { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 560px) { .feedback { grid-template-columns: minmax(0, 1fr); } }
.feedback h2, .tip h2, .section { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feedback ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.feedback li { padding-left: 26px; position: relative; }
.feedback li::before { position: absolute; left: 0; top: 1px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--card); }
.good li::before { content: "✓"; background: var(--good); }
.fix li::before { content: "!"; background: var(--bad); }
.tip { background: var(--violet-soft); border-radius: 14px; padding: 14px 16px; }
.tip p { margin: 0; }
.section { margin-top: 6px; }

.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
@media (max-width: 560px) { .metrics { grid-template-columns: minmax(0, 1fr); } }
.metric { display: grid; gap: 4px; }
.metric .row { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.metric .row b { font-variant-numeric: tabular-nums; }
.metric .track { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.metric .track i { display: block; height: 100%; border-radius: 3px; background: var(--violet); }
.metric .track i.low { background: var(--bad); }
.metric small { color: var(--muted); font-size: 12px; }

.legend { margin: -4px 0 0; font-size: 12px; color: var(--muted); display: flex; gap: 12px; }
.transcript { margin: 0; line-height: 1.75; max-width: 70ch; color: var(--ink-2); }
mark.filler { background: color-mix(in srgb, var(--gold) 45%, transparent); color: var(--ink); border-radius: 4px; padding: 0 3px; }
mark.filler.acoustic { font-style: italic; cursor: help; }
.mention { text-decoration: underline dotted var(--muted); text-underline-offset: 3px; cursor: help; }
.pause { color: var(--violet); font-weight: 700; font-size: 12px; white-space: nowrap; }
.pause.plateia, .pause.efeito { color: var(--good); }
.pause.branco { color: var(--bad); }
.again { justify-self: start; font: 700 15px var(--body); color: #1a1530; background: var(--gold); border: 0; border-radius: 999px; padding: 10px 20px; cursor: pointer; }

button:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.hint.privacy { margin: 4px auto 0; max-width: 46ch; font-size: 12px; }
