:root {
  --bg0: #0a0f1a;
  --bg1: #0d1526;
  --accent: #06b6d4;
  --accent-soft: rgba(6, 182, 212, 0.15);
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --text: #e5edf5;
  --muted: #8aa0b8;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(160deg, var(--bg0), var(--bg1));
  color: var(--text);
  min-height: 100vh;
  padding: 16px 16px 80px;
  -webkit-tap-highlight-color: transparent;
}

.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(600px 300px at 80% -10%, rgba(6, 182, 212, 0.14), transparent 60%),
    radial-gradient(500px 300px at 10% 110%, rgba(6, 182, 212, 0.08), transparent 60%);
}

.glass {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.topbar {
  position: sticky; top: 12px; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; margin-bottom: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { color: var(--accent); font-size: 26px; text-shadow: 0 0 18px var(--accent); }
.brand h1 { font-size: 18px; font-weight: 800; letter-spacing: 0.2px; }
.sub { font-size: 11px; color: var(--muted); }
.sessao-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chip-avaliado {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 99px; padding: 6px 13px;
  font-size: 13px; font-weight: 600; color: var(--text);
  max-width: 150px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.ava-ico { font-size: 14px; }
.badge {
  background: var(--accent-soft); color: var(--accent);
  border-radius: 99px; padding: 2px 10px; font-weight: 700; font-size: 12px;
}

main { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

.card { padding: 20px; }
.card h2 { font-size: 15px; font-weight: 700; margin-bottom: 14px; color: var(--text); }

label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
input, select {
  width: 100%; margin-top: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px; padding: 11px 12px;
  color: var(--text); font-size: 15px; font-family: inherit;
  outline: none; transition: border-color 0.15s;
}
input:focus, select:focus { border-color: var(--accent); }
input::placeholder { color: #50657c; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn {
  border: none; border-radius: 12px; padding: 12px 16px;
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform 0.08s, filter 0.15s, opacity 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, #06b6d4, #0891b2); color: #04121a; width: 100%; }
.btn.primary.big { padding: 15px; font-size: 16px; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent-soft); }
.btn.full { width: 100%; }
.btn.record {
  width: 100%; padding: 26px 16px; font-size: 17px;
  background: rgba(6, 182, 212, 0.12); color: var(--accent);
  border: 2px solid var(--accent-soft); border-radius: 18px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn.record.recording { border-color: var(--red); color: var(--red); background: rgba(239, 68, 68, 0.1); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.35); } 50% { box-shadow: 0 0 0 12px rgba(239,68,68,0); } }
.rec-ico { font-size: 26px; }

.timer { text-align: center; font-size: 24px; font-weight: 700; color: var(--red); margin-top: 10px; font-variant-numeric: tabular-nums; }
.timer.quase { color: var(--yellow); }

#waveform {
  width: 100%; height: 70px; margin-top: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px; display: block;
}

.feedback { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.feedback.ok { background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.3); color: #86efac; }
.feedback.no { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.3); color: #fcd34d; }
.feedback.err { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }

.dobras-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.dobra-chip {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px; padding: 9px 12px; font-size: 13px;
}
.dobra-chip .code { color: var(--accent); font-weight: 700; font-size: 11px; margin-right: 8px; }
.dobra-chip .val { font-weight: 700; font-variant-numeric: tabular-nums; }
.dobra-chip .mm { color: var(--muted); font-size: 11px; margin-left: 2px; }

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

.resultado { margin-top: 16px; padding: 18px; border-radius: 14px; background: rgba(6, 182, 212, 0.07); border: 1px solid var(--accent-soft); text-align: center; }
.gauge-val { font-size: 44px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.gauge-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.kpi {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px; padding: 10px 8px;
}
.kpi-v { display: block; font-size: 19px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi-l { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.detalhes { margin-top: 12px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.detalhes b { color: var(--text); }
.aviso { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); color: #fcd34d; font-size: 12.5px; line-height: 1.5; }

details.somatotipo { margin-top: 18px; }
details.somatotipo summary { cursor: pointer; color: var(--accent); font-size: 13.5px; font-weight: 700; padding: 8px 0; }
.resultado.mini { background: rgba(34, 197, 94, 0.06); border-color: rgba(34, 197, 94, 0.25); }

.hint { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.5; }
.hint em { color: var(--text); font-style: normal; }

.foot { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; text-align: center; font-size: 10.5px; color: #44586e; padding: 10px; background: linear-gradient(transparent, var(--bg0) 70%); }
