:root {
  --bg: #14171C;
  --surface: #1E2229;
  --spotlight: #E8A33D;
  --spotlight-dim: #B87E2C;
  --text: #F2EFE9;
  --text-dim: #9BA0A8;
  --danger: #E2543F;
  --radius: 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', sans-serif;
  overflow: hidden;
}

.stage {
  position: relative;
  width: 100%;
  height: 100dvh;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen.hidden { display: none; }

/* ---------- محتوای متنی مرکزی ---------- */
.content {
  max-width: 420px;
  width: 100%;
  padding: 32px 28px;
  text-align: center;
}

.eyebrow {
  color: var(--spotlight);
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 18px;
}

h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.5;
  margin: 0 0 14px;
}

.sub {
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.9;
  margin: 0 0 32px;
}

/* ---------- دکمه‌ها ---------- */
.btn-primary {
  background: var(--spotlight);
  color: #1A1300;
  border: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 17px;
  padding: 16px 40px;
  border-radius: 999px;
  cursor: pointer;
  width: 100%;
  max-width: 280px;
}

.btn-primary:active { background: var(--spotlight-dim); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1.5px solid rgba(242,239,233,0.3);
  font-family: inherit;
  font-weight: 600;
  font-size: 16px;
  padding: 14px 28px;
  border-radius: 999px;
  cursor: pointer;
}

/* ---------- صفحه ضبط ---------- */
#screen-record:not(.hidden), #screen-preview:not(.hidden) {
  display: block;
}

video#preview, video#playback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.scrim-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 24px 24px 60px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.65), transparent);
}

.question {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  text-align: center;
}

.scrim-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 40px 24px calc(36px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.timer {
  color: #fff;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  min-height: 20px;
  opacity: 0.9;
}

.rec-btn {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.rec-dot {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--danger);
  transition: border-radius 0.2s, width 0.2s, height 0.2s;
}

.rec-btn.recording .rec-dot {
  border-radius: 8px;
  width: 30px;
  height: 30px;
  animation: pulse 1.4s ease-in-out infinite;
}

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

.hint {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0;
}

.preview-actions {
  align-items: center;
}
.preview-buttons-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 14px;
}
.preview-buttons-row .btn-primary { width: auto; }

.btn-sound {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 6px 14px;
  cursor: pointer;
  opacity: 0.85;
}

/* ---------- اسپینر ---------- */
.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(232,163,61,0.25);
  border-top-color: var(--spotlight);
  margin: 0 auto 20px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- تیک تشکر ---------- */
.check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--spotlight);
  color: #1A1300;
  font-size: 30px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

@media (prefers-reduced-motion: reduce) {
  .rec-btn.recording .rec-dot { animation: none; }
  .spinner { animation-duration: 1.6s; }
}
