/* Vrava — tema escuro e discreto */
:root {
  --bg: #0b0d10;
  --surface: #14171c;
  --surface-2: #1b1f26;
  --border: #262b33;
  --text: #d7dce3;
  --text-dim: #8a919c;
  --accent: #c94f44;
  --accent-soft: rgba(201, 79, 68, 0.18);
  --ok: #4f9e6b;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100%;
}

body {
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(11, 13, 16, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

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

.brand h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: background 0.3s;
}

body.recording .brand-dot {
  background: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rec-timer {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--accent);
}

/* ---------- Botões ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
}

.btn:hover { background: var(--surface-2); }

.btn.ghost {
  background: transparent;
  color: var(--text-dim);
}

.btn.ghost:hover { color: var(--text); }

.btn.danger:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Gerenciador ---------- */
main {
  max-width: 680px;
  margin: 0 auto;
  padding: 18px 16px;
}

.manager-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.manager-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.count {
  font-size: 13px;
  color: var(--text-dim);
}

.rec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rec-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.rec-item.playing {
  border-color: var(--accent);
}

.rec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rec-name {
  font-weight: 600;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.rec-name-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 4px 8px;
}

.rec-meta {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.rec-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.play-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.play-btn:hover { border-color: var(--text-dim); }

.rec-item.playing .play-btn {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.empty {
  text-align: center;
  color: var(--text-dim);
  padding: 56px 20px;
}

.empty .hint {
  font-size: 13px;
  max-width: 320px;
  margin: 8px auto 0;
}

/* ---------- Botão flutuante ---------- */
.fab {
  position: fixed;
  right: 20px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  z-index: 20;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.fab-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  transition: border-radius 0.25s, transform 0.25s;
}

body.recording .fab {
  border-color: var(--accent);
  background: var(--accent-soft);
}

body.recording .fab-icon {
  border-radius: 4px;
  transform: scale(0.85);
  animation: pulse 1.6s ease-in-out infinite;
}

/* ---------- Tela escura ---------- */
.dim-overlay[hidden] { display: none; }

.dim-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}

.dim-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5a2320;
  animation: pulse 2.4s ease-in-out infinite;
}

.dim-timer {
  color: #3a3f46;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.dim-hint {
  color: #23272d;
  font-size: 12px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(100px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  z-index: 60;
  max-width: 86vw;
  text-align: center;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
