:root {
  --bg: #1d1d22;
  --card: #2a2a31;
  --fg: #f2f2f4;
  --muted: #a0a0aa;
  --accent: #c8a24b;       /* Lucky Bag gold-ish */
  --rec: #e2493b;
  --ok: #4caf72;
  --radius: 16px;
  --border: #3a3a43;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
}

header h1 {
  font-size: 1.4rem;
  margin: 0;
  letter-spacing: .5px;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

h2 { margin: 0 0 1rem; font-size: 1.1rem; }

label {
  display: block;
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

input, textarea {
  width: 100%;
  margin-top: .35rem;
  padding: .7rem .8rem;
  background: #1f1f25;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
}

textarea { resize: vertical; }

details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: .9rem;
  margin: .5rem 0;
}

.record-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.record-btn {
  display: flex;
  align-items: center;
  gap: .8rem;
  background: var(--accent);
  color: #1d1d22;
  border: none;
  border-radius: 999px;
  padding: 1.1rem 2rem;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .1s ease, background .2s ease;
}
.record-btn:active { transform: scale(.97); }
.record-btn.recording { background: var(--rec); color: #fff; }

.rec-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #1d1d22;
}
.record-btn.recording .rec-icon {
  background: #fff;
  border-radius: 3px;
  animation: pulse 1.2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.timer {
  font-variant-numeric: tabular-nums;
  font-size: 2rem;
  font-weight: 600;
  color: var(--rec);
}

.btn {
  display: inline-block;
  width: 100%;
  margin-top: .6rem;
  padding: .85rem 1rem;
  background: var(--accent);
  color: #1d1d22;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.btn.secondary { background: transparent; color: var(--fg); border: 1px solid var(--border); }
.icon-btn { background: none; border: none; font-size: 1.4rem; cursor: pointer; }

.actions { display: flex; flex-direction: column; gap: .2rem; margin-bottom: .8rem; }

.preview {
  white-space: pre-wrap;
  word-break: break-word;
  background: #1a1a1f;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  font-size: .8rem;
  max-height: 40vh;
  overflow: auto;
  color: #d8d8de;
}

.muted { color: var(--muted); font-size: .85rem; }

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.banner {
  position: fixed;
  left: 1rem; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom));
  background: var(--rec);
  color: #fff;
  padding: .9rem 1rem;
  border-radius: 12px;
  font-size: .9rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.banner.ok { background: var(--ok); }

.hidden { display: none !important; }
