:root {
  color-scheme: dark;
  --bg: #090b14;
  --bg-soft: #101523;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.14);
  --stroke: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --pink: #ff4db8;
  --blue: #5e7bff;
  --cyan: #47f6b4;
  --danger: #ff5d8f;
  --spotify: #1ed760;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255, 77, 184, 0.12), transparent 35%),
    radial-gradient(circle at top right, rgba(94, 123, 255, 0.16), transparent 36%),
    linear-gradient(180deg, #07080d 0%, #090b14 40%, #0d1120 100%);
  color: var(--text);
  font-family: "Avenir Next", "Avenir", "SF Pro Display", "Segoe UI", sans-serif;
}

body {
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: 18px 14px calc(24px + var(--safe-bottom));
}

.stage-glow {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(84px);
  pointer-events: none;
  opacity: 0.9;
}

.stage-glow-a {
  width: 240px;
  height: 240px;
  background: rgba(255, 77, 184, 0.34);
  top: 20px;
  left: -80px;
}

.stage-glow-b {
  width: 260px;
  height: 260px;
  background: rgba(94, 123, 255, 0.32);
  top: 140px;
  right: -110px;
}

.stage-glow-c {
  width: 220px;
  height: 220px;
  background: rgba(71, 246, 180, 0.16);
  bottom: 80px;
  left: 40px;
}

.phone-frame {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  min-height: calc(100vh - 32px);
  margin: 0 auto;
  background: rgba(7, 10, 18, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 38px;
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.screen {
  display: none;
  min-height: calc(100vh - 32px);
  padding: calc(18px + var(--safe-top)) 18px 20px;
}

.screen.active {
  display: block;
}

.camera-screen {
  padding: 0;
}

.hero,
.screen-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.screen-header {
  margin-bottom: 18px;
}

.screen-header.compact {
  margin-bottom: 10px;
}

.logo-mark {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--pink), var(--blue));
  box-shadow: 0 18px 36px rgba(255, 77, 184, 0.35);
  flex-shrink: 0;
}

.logo-icon {
  font-size: 2rem;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 2.3rem;
  line-height: 0.95;
  font-weight: 900;
}

h2 {
  font-size: 1.8rem;
  line-height: 1;
  font-weight: 900;
}

h3 {
  font-size: 1.1rem;
  font-weight: 800;
}

.eyebrow,
.card-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.68);
}

.hero-copy,
.support-copy,
.muted {
  color: var(--muted);
}

.muted.strong {
  color: rgba(255, 255, 255, 0.82);
}

.stack {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.glass-card,
.result-card,
.recap-card,
.dialog-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.glass-card,
.dialog-card {
  padding: 18px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.glow-button,
.social-button,
.feedback-button,
.pill-button,
.circle-button,
.segment,
.text-link,
.play-badge,
.back-link {
  border: 0;
  cursor: pointer;
}

.glow-button {
  width: 100%;
  padding: 18px;
  border-radius: 24px;
  color: var(--text);
  text-align: left;
  display: grid;
  gap: 4px;
}

.glow-button.primary {
  background: linear-gradient(135deg, var(--pink), var(--blue));
  box-shadow: 0 20px 42px rgba(255, 77, 184, 0.28);
}

.glow-button.secondary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
}

.glow-button:disabled {
  opacity: 0.45;
  box-shadow: none;
}

.button-title {
  font-size: 1rem;
  font-weight: 800;
}

.button-copy {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.82);
}

.pill-button {
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.pill-button.spotify {
  background: rgba(30, 215, 96, 0.18);
  border: 1px solid rgba(30, 215, 96, 0.28);
}

.clip-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 82%;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}

.clip-card {
  min-height: 188px;
  padding: 14px;
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(39, 33, 60, 0.95), rgba(13, 16, 28, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  align-content: end;
  gap: 8px;
  scroll-snap-align: start;
}

.clip-card::before {
  content: "▶";
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(104, 184, 255, 0.16);
  color: var(--cyan);
  font-weight: 900;
  margin-bottom: auto;
}

.stepper {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 12px;
}

.circle-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 1.5rem;
}

.stepper-value {
  display: grid;
  place-items: center;
  gap: 2px;
}

.stepper-value strong {
  font-size: 2rem;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 4px;
  gap: 4px;
}

.segment {
  padding: 14px 10px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segment.active {
  background: linear-gradient(135deg, rgba(255, 77, 184, 0.2), rgba(94, 123, 255, 0.24));
  color: var(--text);
}

.playlist-list {
  display: grid;
  gap: 10px;
}

.playlist-item {
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.playlist-item.active {
  border-color: rgba(104, 184, 255, 0.6);
  background: linear-gradient(135deg, rgba(94, 123, 255, 0.2), rgba(255, 77, 184, 0.16));
}

.playlist-item strong,
.playlist-item span {
  display: block;
}

.playlist-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.camera-layer {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 14%, rgba(94, 123, 255, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(7, 10, 18, 0.24), rgba(7, 10, 18, 0.76));
}

#camera-preview,
.camera-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-fallback {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(160deg, rgba(255, 77, 184, 0.14), rgba(94, 123, 255, 0.12)),
    linear-gradient(180deg, #0c1020, #06080f);
}

.camera-fallback-copy {
  display: grid;
  gap: 8px;
  padding: 18px;
  max-width: 260px;
  text-align: center;
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.game-overlay {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 32px);
  padding: calc(18px + var(--safe-top)) 18px calc(22px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.24), rgba(0, 0, 0, 0.12) 30%, rgba(0, 0, 0, 0.72));
}

.top-hud {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.timer-badge {
  min-width: 86px;
  padding: 12px;
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-align: center;
}

.timer-badge strong {
  display: block;
  font-size: 2.4rem;
  line-height: 0.9;
  color: var(--cyan);
}

.timer-badge span {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.game-center {
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
}

.sing-call {
  font-size: clamp(2.1rem, 8vw, 3.6rem);
  text-shadow: 0 0 24px rgba(255, 77, 184, 0.6);
}

.waveform {
  width: min(100%, 280px);
  height: 60px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
}

.waveform span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--blue), var(--pink));
  transition: height 220ms ease;
}

.feedback-row,
.share-grid {
  display: grid;
  gap: 10px;
}

.feedback-row {
  grid-template-columns: repeat(3, 1fr);
}

.feedback-button,
.social-button {
  padding: 16px 12px;
  border-radius: 20px;
  color: var(--text);
  font-weight: 800;
}

.feedback-button.success {
  background: rgba(71, 246, 180, 0.92);
  color: #05120d;
}

.feedback-button.danger {
  background: rgba(255, 93, 143, 0.92);
}

.feedback-button.info {
  background: rgba(104, 184, 255, 0.92);
  color: #051225;
}

.hidden {
  display: none !important;
}

.result-card {
  overflow: hidden;
}

.result-freeze {
  min-height: 310px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  background: linear-gradient(160deg, rgba(255, 77, 184, 0.32), rgba(6, 8, 15, 0.88));
}

.freeze-caption {
  justify-self: start;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.78rem;
  font-weight: 800;
}

.freeze-emoji {
  justify-self: center;
  font-size: 5rem;
}

.result-copy {
  padding: 18px;
  display: grid;
  gap: 8px;
}

.crowd-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.crowd-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 700;
}

.recap-card {
  padding: 14px;
}

.recap-video {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 77, 184, 0.12), transparent 25%),
    linear-gradient(160deg, #1b1936 0%, #090b14 100%);
  display: grid;
  place-items: center;
}

.recap-caption,
.recap-watermark {
  position: absolute;
  left: 16px;
  right: 16px;
}

.recap-caption {
  top: 16px;
  padding: 10px 14px;
  border-radius: 16px;
  width: fit-content;
  max-width: calc(100% - 32px);
  background: rgba(0, 0, 0, 0.32);
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.recap-watermark {
  bottom: 16px;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.72);
}

.play-badge {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
  font-size: 1.5rem;
}

.recap-meta {
  display: grid;
  gap: 6px;
  padding: 14px 4px 4px;
}

.share-grid {
  grid-template-columns: repeat(2, 1fr);
}

.social-button.tikTok {
  background: linear-gradient(135deg, #25f4ee, #101523);
  color: #071014;
}

.social-button.instagram {
  background: linear-gradient(135deg, #ff4db8, #5e7bff);
}

.text-link,
.back-link {
  background: transparent;
  color: var(--muted);
  padding: 0;
}

dialog {
  width: min(92vw, 420px);
  border: 0;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}

.howto-list {
  margin: 14px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  color: var(--muted);
}

@media (min-width: 700px) {
  .app-shell {
    padding-top: 28px;
    padding-bottom: 28px;
  }

  .phone-frame,
  .screen,
  .game-overlay {
    min-height: 860px;
  }
}
