:root {
  --bg: #000000;
  --panel: #0d0d0e;
  --panel-2: #141416;
  --line: #232327;
  --ink: #ffffff;
  --ink-soft: #9a9aa2;
  --ink-dim: #6b6b73;
  --accent: #e42722;        /* vermelho Sabin */
  --accent-ink: #b71d19;
  --accent-soft: rgba(228, 39, 34, .16);
  --warn-bg: rgba(228, 39, 34, .10);
  --warn-line: rgba(228, 39, 34, .35);
  --warn-ink: #ff8a86;
  --err-ink: #ff6b66;
  --ok: #02be88;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 20px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---- Barra de marca ---- */
.topbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: max(22px, env(safe-area-inset-top)) 20px 0;
  flex: 0 0 auto;
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-symbol { height: 30px; width: auto; display: block; }
.brand-word { height: 21px; width: auto; display: block; }
.site-name {
  font-size: 11.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-dim);
  font-weight: 600;
}

/* ---- Tela / cartão ---- */
.screen {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px max(28px, env(safe-area-inset-bottom));
}
.card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 26px 34px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}
.kicker {
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 12px;
}
.titulo {
  font-size: 23px;
  line-height: 1.25;
  margin: 0 0 6px;
  font-weight: 680;
  letter-spacing: -.01em;
  color: var(--ink);
}
.autor { color: var(--ink-soft); margin: 0 0 8px; font-size: 15.5px; }
.hint { color: var(--ink-soft); font-size: 14px; margin: 14px 0 0; }
.empty { margin: 20px 0 0; color: var(--ink-soft); }
.empty-icon { font-size: 42px; margin-bottom: 8px; filter: grayscale(.2); }
.warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border: 1px solid var(--warn-line);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  margin: 0 0 18px;
}

/* ---- Player ---- */
.audio-label {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 18px 0 18px;
}
.play {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-size: 38px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 6px auto 22px;
  box-shadow: 0 12px 34px rgba(228, 39, 34, .45);
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
}
.play:hover { transform: translateY(-1px); box-shadow: 0 16px 40px rgba(228, 39, 34, .55); }
.play:active { transform: scale(.96); }
.play.playing { background: var(--accent-ink); }
.play-icon { transform: translateX(3px); }
.play.playing .play-icon { transform: none; }
.seek {
  width: 100%;
  accent-color: var(--accent);
  height: 6px;
  cursor: pointer;
}
.seek:disabled { opacity: .4; }
.times {
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 8px;
}

/* ---- Gravador ---- */
.controls { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 18px 0 0; }
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  padding: 14px 22px;
  border-radius: 14px;
  cursor: pointer;
  min-height: 54px;
  min-width: 128px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: transform .1s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { border-color: #3a3a40; background: #1b1b1e; }
.btn:active { transform: scale(.98); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 10px 26px rgba(228, 39, 34, .4);
}
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn .dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.timer {
  font-variant-numeric: tabular-nums;
  font-size: 38px;
  font-weight: 680;
  margin: 16px 0 4px;
  letter-spacing: .02em;
  color: var(--ink);
}
.meter {
  height: 10px;
  background: #1c1c1f;
  border-radius: 99px;
  overflow: hidden;
  margin: 8px auto 0;
  max-width: 240px;
}
.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #ff6a66);
  transition: width .06s linear;
}
.preview { width: 100%; margin: 16px 0 0; }
.progress { height: 8px; background: #1c1c1f; border-radius: 99px; overflow: hidden; margin: 18px 0 0; }
.progress-bar { height: 100%; width: 0%; background: var(--accent); transition: width .15s ease; }
.status { min-height: 20px; font-size: 14.5px; margin: 16px 0 0; color: var(--ink-soft); }
.status.err { color: var(--err-ink); }
.status.ok { color: var(--ok); }
.done { margin: 8px 0 0; }
.done a.btn { margin-top: 14px; }

code { background: #1c1c1f; border-radius: 5px; padding: 1px 5px; font-size: .88em; color: #d8d8de; }
a { color: var(--ink); }
.card a:not(.btn) { color: #ff8d89; }
:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media (max-width: 420px) {
  .card { padding: 26px 18px 30px; }
  .titulo { font-size: 21px; }
  .btn { flex: 1; }
}
