.rec-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.rec-toggle-dot {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(245, 241, 235, 0.72);
  transition: transform 0.2s ease, background 0.2s ease;
}

.rec-toggle.on {
  background: rgba(255, 95, 61, 0.24);
  border-color: rgba(255, 95, 61, 0.56);
}

.rec-toggle.on .rec-toggle-dot {
  transform: translateX(20px);
  background: var(--accent);
}

.recording-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(8px + var(--safe-top)) 8px calc(8px + var(--safe-bottom));
  background:
    radial-gradient(circle at top, rgba(255, 95, 61, 0.12), transparent 36%),
    radial-gradient(circle at bottom, rgba(255, 154, 61, 0.08), transparent 36%),
    #05060a;
}

.recording-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.035), transparent 28%),
    radial-gradient(circle at 18% 50%, rgba(255, 95, 61, 0.08), transparent 26%),
    radial-gradient(circle at 82% 50%, rgba(255, 154, 61, 0.08), transparent 26%);
  pointer-events: none;
}

.recording-stage-backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 8, 12, 0.25), rgba(7, 8, 12, 0.8)),
    radial-gradient(circle at center, rgba(255, 95, 61, 0.08), transparent 42%);
  pointer-events: none;
}

.recording-stage-shell {
  position: relative;
  width: min(100vw - 16px, calc((100dvh - 16px - var(--safe-top) - var(--safe-bottom)) * 9 / 16));
  height: min(100dvh - 16px - var(--safe-top) - var(--safe-bottom), calc((100vw - 16px) * 16 / 9));
  max-width: 100%;
  max-height: 100%;
  border-radius: 30px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.52);
}

.recording-stage-shell::before {
  content: "";
  position: absolute;
  inset: -16px;
  z-index: 0;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    radial-gradient(circle at top, rgba(255, 95, 61, 0.16), transparent 40%);
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.36);
  pointer-events: none;
}

.recording-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.recording-topbar,
.recording-round-hud,
.recording-bottom-hud {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  pointer-events: none;
}

.recording-topbar {
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + var(--safe-top)) 14px 0;
}

.recording-topbar .overlay-icon-btn,
.recording-topbar-right,
.recording-topic-pill,
.rec-live-pill {
  pointer-events: auto;
}

.recording-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rec-live-pill,
.recording-topic-pill,
.round-mode-pill,
.overlay-icon-btn,
.interaction-hint {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 10, 14, 0.54);
  color: #fff;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.rec-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: rec-pill-pulse 1.6s ease-in-out infinite;
}

.rec-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff4b4b;
  box-shadow: 0 0 0 8px rgba(255, 75, 75, 0.16);
  animation: rec-dot-pulse 1.2s ease-in-out infinite;
}

.recording-topic-pill,
.round-mode-pill,
.overlay-icon-btn {
  min-height: 42px;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 700;
}

.recording-topic-pill {
  max-width: min(42vw, 280px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recording-round-hud {
  top: calc(72px + var(--safe-top));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
}

.round-mode-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.round-progress-track {
  width: min(72%, 280px);
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.round-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.24s ease;
}

.round-caption {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.32);
}

.recording-bottom-hud {
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 18px calc(28px + var(--safe-bottom));
}

.interaction-hint {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.interaction-subhint {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.82rem;
  text-align: center;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.tap-zone {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  z-index: 2;
  background: transparent;
  border: 0;
  padding: 0;
}

.tap-zone-top {
  top: 0;
}

.tap-zone-bottom {
  bottom: 0;
}

.tap-flash {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.tap-flash-top {
  top: 0;
  background: linear-gradient(180deg, rgba(255, 95, 61, 0.4), rgba(255, 95, 61, 0.08));
}

.tap-flash-bottom {
  bottom: 0;
  background: linear-gradient(0deg, rgba(255, 95, 61, 0.4), rgba(255, 95, 61, 0.08));
}

.recording-screen.tap-top .tap-flash-top,
.recording-screen.tap-bottom .tap-flash-bottom {
  opacity: 1;
}

.recording-stage-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
  z-index: 3;
}

.recording-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 8, 12, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.recording-overlay-card {
  width: min(100%, 320px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 20px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 12, 16, 0.84);
  text-align: center;
}

.recording-overlay-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid rgba(255, 95, 61, 0.18);
  border-top-color: var(--accent);
  animation: rec-spin 0.85s linear infinite;
}

.recording-overlay-title {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1;
}

.recording-overlay-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

@keyframes rec-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rec-dot-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.88);
    opacity: 0.62;
  }
}

@keyframes rec-pill-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(255, 95, 61, 0);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(255, 95, 61, 0.05);
  }
}

@media (max-width: 900px) {
  .recording-screen {
    padding: 0;
  }

  .recording-stage-shell {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }

  .recording-stage-shell::before {
    display: none;
  }

  .recording-topbar {
    padding-left: 12px;
    padding-right: 12px;
  }

  .recording-topbar-right {
    gap: 8px;
  }

  .recording-topic-pill {
    max-width: 34vw;
  }

  .recording-round-hud {
    top: calc(72px + var(--safe-top));
    gap: 10px;
  }

  .round-progress-track {
    width: min(76%, 240px);
  }

  .recording-bottom-hud {
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: calc(22px + var(--safe-bottom));
  }
}

@media (min-width: 901px) {
  .recording-screen {
    padding: 18px 24px;
  }

  .recording-stage-shell {
    width: min(100vw - 48px, calc((100dvh - 36px - var(--safe-top) - var(--safe-bottom)) * 9 / 16));
    height: min(100dvh - 36px - var(--safe-top) - var(--safe-bottom), calc((100vw - 48px) * 16 / 9));
  }

  .recording-topbar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .recording-bottom-hud {
    padding-left: 18px;
    padding-right: 18px;
  }
}
