:root {
  --bg: #0f1220;
  --card: #1a1f33;
  --accent: #5b8cff;
  --record: #ff4d5e;
  --text: #e7eaf6;
  --muted: #8b93b0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #232a45, var(--bg));
  color: var(--text);
}

.card {
  width: min(440px, 92vw);
  background: var(--card);
  border: 1px solid #2a3150;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

h1 {
  margin: 0 0 20px;
  font-size: 1.4rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
  font-size: 0.85rem;
  color: var(--muted);
}

select {
  appearance: none;
  background: #11152a;
  color: var(--text);
  border: 1px solid #2a3150;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
}

.meter {
  height: 8px;
  background: #11152a;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 20px;
}

.meter__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--record));
  transition: width 0.06s linear;
}

.timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.timer__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--record);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0.2; }
}

.controls {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: #2a3150;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: transform 0.05s ease, opacity 0.2s ease, background 0.2s ease;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn--mic { background: var(--accent); }
.btn--record { background: var(--record); }
.btn--record.is-recording { animation: pulse 1.2s infinite; }

.btn--download {
  display: block;
  background: var(--accent);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 94, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(255, 77, 94, 0); }
}

.status {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.2em;
}

.recordings {
  margin-top: 20px;
}

.recordings__title {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.recording {
  background: #11152a;
  border: 1px solid #2a3150;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recording__name {
  font-size: 0.82rem;
  color: var(--text);
  word-break: break-all;
}

.recording audio { width: 100%; }

.recording__actions {
  display: flex;
  gap: 10px;
}

.btn--small {
  flex: 1;
  padding: 9px 12px;
  font-size: 0.85rem;
}

.btn--ghost {
  background: transparent;
  border: 1px solid #2a3150;
  color: var(--muted);
  flex: 0 0 auto;
}

.hidden { display: none; }
