.create-page {
  --create-shell: min(100%, 1180px);
  --create-page-top: #1c2833;
  --create-card-surface: color-mix(in srgb, var(--bg-surface) 78%, transparent);
  --create-card-surface-strong: color-mix(in srgb, var(--bg-surface-raised) 88%, transparent);
  --create-card-border: color-mix(in srgb, var(--text-primary) 14%, transparent);
  --create-card-border-hover: color-mix(in srgb, var(--text-primary) 32%, transparent);
  --create-option-shadow: 0 18px 44px rgba(0, 0, 0, 0.20), 0 2px 8px rgba(0, 0, 0, 0.18);
  --create-label-bg: color-mix(in srgb, var(--bg-tooltip) 72%, transparent);
  --create-photo-scrim: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg-tooltip) 76%, transparent));
  --create-account-photo-overlay: linear-gradient(180deg, rgba(16, 22, 30, 0.06), rgba(16, 22, 30, 0.76));
  --create-account-scrim: color-mix(in srgb, var(--bg-tooltip) 78%, transparent);
  --create-error-text: var(--error-text);
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% -18%, var(--primary-subtle), transparent 34%),
    linear-gradient(180deg, var(--create-page-top) 0%, var(--bg-page) 100%);
  color: var(--text-primary);
}

.create-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    var(--create-account-photo-overlay),
    url("/static/img/chars/step_6_hair_color_1_blonde_desktop.jpg") center 28% / cover no-repeat;
  opacity: 0;
  filter: blur(22px) saturate(0.86);
  transform: scale(1.06);
  transition: opacity 240ms ease;
  pointer-events: none;
}

.create-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% -8%, var(--primary-glow), transparent 36%),
    var(--create-account-scrim);
  opacity: 0;
  transition: opacity 240ms ease;
  pointer-events: none;
}

.create-account-mode::before,
.create-account-mode::after {
  opacity: 1;
}

.create-app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  padding: 28px clamp(16px, 2.4vw, 40px) 40px;
}

.create-header {
  position: relative;
  z-index: 5;
  min-height: 44px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: var(--create-shell);
  margin: 0 auto;
}

.create-back {
  width: max-content;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--primary-color-hover);
  font-size: 13px;
  font-weight: 700;
  transition: color var(--transition-normal), opacity var(--transition-normal);
}

.create-back:hover,
.create-back:focus-visible {
  color: var(--primary-color-hover);
  outline: none;
}

.create-back svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.create-logo {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.create-logo-img {
  width: clamp(132px, 9vw, 158px);
  height: auto;
}

.create-logo-img--light-bg {
  display: none;
}

.create-screen {
  display: none;
  width: var(--create-shell);
  margin: 0 auto;
}

.create-screen--active {
  display: block;
}

.create-intro-head {
  margin: 26px auto 30px;
  text-align: center;
}

.create-intro-head h1,
.create-step-head h1 {
  color: var(--text-primary);
  font-size: clamp(25px, 2.2vw, 36px);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -0.01em;
}

.create-intro-head p {
  margin-top: 11px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 700;
}

.create-intro-stage {
  position: relative;
  width: min(100%, 760px);
  margin: 0 auto;
}

.create-video-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  margin: 0 auto;
}

.create-intro-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--bg-tooltip) 52%, transparent), transparent 58%),
    color-mix(in srgb, var(--bg-tooltip) 16%, transparent);
  pointer-events: none;
}

.create-video-card,
.create-option-card {
  position: relative;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--create-card-border);
  border-radius: 8px;
  background: var(--create-card-surface);
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
  touch-action: manipulation;
  transition:
    border-color var(--transition-normal),
    box-shadow var(--transition-normal),
    filter var(--transition-normal),
    background var(--transition-normal);
}

.create-video-card {
  aspect-ratio: 0.72;
  min-height: 0;
  box-shadow: var(--shadow-2);
}

.create-video-card img,
.create-video-card video,
.create-option-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.create-option-card img {
  opacity: 0;
  transition: opacity 320ms ease;
}

.create-option-card img.is-loaded {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .create-option-card img {
    transition: none;
  }
}

.create-video-card img,
.create-video-card video {
  position: absolute;
  inset: 0;
}

.create-video-card video {
  opacity: 0;
  transition: opacity 180ms ease;
}

.create-video-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 15, 20, 0.02), rgba(10, 15, 20, 0.34)),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.create-video-card--playing video {
  opacity: 1;
}

.create-option-card:hover {
  border-color: var(--create-card-border-hover);
  filter: brightness(1.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14), 0 0 0 1px var(--create-card-border-hover);
  outline: none;
}

.create-option-card:focus-visible {
  border-color: var(--create-card-border-hover);
  box-shadow: 0 0 0 3px var(--primary-subtle), var(--shadow-2);
  outline: none;
}

.create-video-card:focus-visible {
  border-color: var(--create-card-border-hover);
  box-shadow: 0 0 0 3px var(--primary-subtle), var(--shadow-2);
  outline: none;
}

.create-intro-action {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  pointer-events: none;
  /* scrim behind the floating CTA so it reads as an overlay, not as a
     button pasted over someone's face */
  background: radial-gradient(ellipse 46% 22% at 50% 50%, rgba(0, 0, 0, 0.45), transparent 72%);
}

.create-intro-action .create-primary-btn {
  pointer-events: auto;
  padding: 16px 36px;
  font-size: 16px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.42);
}

.create-primary-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: 0;
  border-radius: var(--radius-button);
  background: var(--grad-primary);
  color: var(--text-on-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  font: 800 15px var(--font);
  letter-spacing: 0;
  cursor: pointer;
  transition:
    box-shadow var(--transition-normal),
    filter var(--transition-normal),
    transform var(--transition-fast);
}

.create-primary-btn:hover,
.create-primary-btn:focus-visible {
  filter: brightness(1.04);
  box-shadow: var(--shadow-pink);
  transform: translateY(-1px);
  outline: none;
}

.create-primary-btn:active {
  transform: none;
}

.create-intro-action .create-primary-btn:hover,
.create-intro-action .create-primary-btn:focus-visible {
  transform: none;
}

.create-primary-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.create-progress {
  width: var(--create-shell);
  height: 10px;
  margin: 24px auto 24px;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--text-primary) 10%, transparent);
  overflow: hidden;
}

.create-progress span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--grad-primary);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.create-step-head {
  margin-bottom: 24px;
  text-align: center;
}

.create-options {
  --create-option-columns: 4;
  display: grid;
  grid-template-columns: repeat(var(--create-option-columns), minmax(0, 1fr));
  gap: 18px;
  width: min(100%, calc(var(--create-option-columns) * 250px + (var(--create-option-columns) - 1) * 18px));
  margin: 0 auto;
}

.create-options--committing .create-option-card,
.create-options--committing .create-text-option {
  pointer-events: none;
}

.create-options--committing .create-option-card:not(.create-option-card--selected),
.create-options--committing .create-text-option:not(.create-text-option--selected) {
  filter: saturate(0.72) brightness(0.84);
  opacity: 0.46;
  transition:
    filter 420ms ease,
    opacity 420ms ease;
}

.create-option-card {
  aspect-ratio: 0.72;
  border-width: 1px;
  border-color: var(--create-card-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.10);
}

.create-option-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: var(--create-photo-scrim);
  pointer-events: none;
  z-index: 1;
}

.create-option-label {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--text-primary) 18%, transparent);
  border-radius: var(--radius-button);
  background: var(--create-label-bg);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.create-option-card--selected {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-subtle), var(--shadow-pink);
  transition:
    border-color 360ms ease,
    box-shadow 420ms ease,
    opacity 360ms ease;
}

.create-options--committing .create-option-card--selected {
  animation: create-card-press-confirm 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.create-option-card--selected .create-option-label {
  border-color: color-mix(in srgb, var(--text-on-primary) 24%, transparent);
  background: var(--grad-primary);
  color: var(--text-on-primary);
}

.create-options--choice,
.create-options--story,
.create-options--name,
.create-options--complete,
.create-options--account {
  width: min(100%, 640px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.create-text-option {
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid var(--create-card-border);
  border-radius: 8px;
  background: var(--create-card-surface);
  color: var(--text-primary);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 360ms ease,
    background-color 360ms ease,
    box-shadow 420ms ease,
    opacity 360ms ease;
}

.create-text-option:hover,
.create-text-option:focus-visible {
  border-color: var(--create-card-border-hover);
  background: var(--create-card-surface-strong);
  outline: none;
}

.create-text-option--selected {
  border-color: var(--primary-border);
  background: var(--grad-primary);
  box-shadow: var(--shadow-pink);
}

.create-options--committing .create-text-option--selected {
  animation: create-text-press-confirm 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.create-text-option__label {
  display: block;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
}

.create-text-option--selected .create-text-option__label {
  color: var(--text-on-primary);
}

.create-text-option__description {
  display: block;
  margin-top: 12px;
  color: color-mix(in srgb, var(--text-primary) 68%, transparent);
  font-size: 13px;
  font-style: italic;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
}

.create-text-option--selected .create-text-option__description {
  color: color-mix(in srgb, var(--text-on-primary) 82%, transparent);
}

@keyframes create-card-press-confirm {
  0% {
    filter: brightness(1) saturate(1);
    transform: scale(1);
  }

  38% {
    filter: brightness(0.94) saturate(0.96);
    transform: scale(0.955);
  }

  100% {
    filter: brightness(1) saturate(1);
    transform: scale(1);
  }
}

@keyframes create-text-press-confirm {
  0% {
    filter: brightness(1);
    transform: scale(1);
  }

  38% {
    filter: brightness(0.96);
    transform: scale(0.975);
  }

  100% {
    filter: brightness(1);
    transform: scale(1);
  }
}

.create-name-panel {
  width: min(100%, 380px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.create-name-preview {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--primary-border);
  border-radius: 8px;
  background: var(--create-card-surface);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.create-name-preview img {
  width: 100%;
  aspect-ratio: 0.62;
  object-fit: cover;
  filter: blur(12px) saturate(0.92);
  transform: scale(1.03);
}

.create-name-preview--final img {
  filter: none;
  transform: none;
}

.create-name-preview span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 28px;
  display: grid;
  place-items: center;
  background: var(--grad-primary);
  color: var(--text-on-primary);
  font-size: 13px;
  font-weight: 900;
}

.create-name-field {
  display: grid;
  gap: 8px;
}

.create-name-field span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.create-name-field input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-normal);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
}

.create-name-field input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(237, 55, 186, 0.16);
}

.create-primary-btn--wide {
  width: 100%;
}

.create-account-mode .create-app {
  padding-top: 30px;
}

.create-account-mode .create-header {
  grid-template-columns: 1fr auto 1fr;
}

.create-account-mode .create-back,
.create-account-mode .create-progress,
.create-account-mode .create-step-head {
  display: none;
}

.create-account-mode .create-logo {
  margin-top: 2px;
}

.create-account-mode .create-logo-img {
  width: 158px;
}

.create-options--account {
  margin-top: 34px;
  align-items: center;
  gap: 28px;
}

.create-account-panel {
  width: min(100%, 390px);
  padding: 36px 22px 32px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-modal) 82%, transparent);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.create-account-panel h1 {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.create-account-panel p {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}

.create-account-form {
  margin-top: 28px;
  display: grid;
  gap: 18px;
}

.create-account-field {
  display: grid;
  gap: 8px;
}

.create-account-field > span:first-child {
  color: color-mix(in srgb, var(--text-primary) 86%, transparent);
  font-size: 12px;
  font-weight: 800;
}

.create-account-field input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-normal);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}

.create-account-field input::placeholder {
  color: color-mix(in srgb, var(--text-secondary) 80%, transparent);
}

.create-account-field input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(237, 55, 186, 0.16);
}

.create-account-field--invalid input {
  border-color: var(--error-border);
  box-shadow: 0 0 0 3px var(--error-soft);
}

.create-account-field-error {
  min-height: 14px;
  color: var(--create-error-text);
  font-size: 11px;
  font-weight: 800;
}

.create-account-field-error:empty {
  display: none;
}

.create-account-password {
  position: relative;
  display: block;
}

.create-account-password input {
  padding-right: 46px;
}

.create-account-password button {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--text-primary) 86%, transparent);
  cursor: pointer;
}

.create-account-password svg,
.create-account-form .create-primary-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.create-account-form .create-primary-btn {
  margin-top: 12px;
}

.create-account-form .create-primary-btn svg {
  fill: currentColor;
  stroke: none;
}

.create-account-error {
  min-height: 0;
  color: var(--create-error-text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.create-account-error:empty {
  display: none;
}

.create-account-signin {
  color: color-mix(in srgb, var(--text-primary) 80%, transparent);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.create-account-signin a {
  margin-left: 8px;
  color: var(--primary-color-active);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.create-account-signin a:hover,
.create-account-signin a:focus-visible {
  color: var(--primary-color);
  outline: none;
}

@media (max-width: 1280px) {
  .create-intro-stage {
    width: min(100%, 680px);
  }
}

@media (max-width: 960px) {
  .create-app {
    padding: 20px 14px 28px;
  }

  .create-header {
    grid-template-columns: 44px 1fr 44px;
  }

  .create-back span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .create-logo {
    justify-self: center;
    font-size: 24px;
  }

  .create-intro-head {
    margin-top: 18px;
  }

  .create-intro-stage {
    width: min(100%, 560px);
  }

  .create-video-card {
    min-height: 0;
  }

  .create-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 560px);
  }

  .create-option-card {
    aspect-ratio: 0.62;
  }
}

@media (max-width: 560px) {
  .create-intro-head h1,
  .create-step-head h1 {
    font-size: 22px;
  }

  .create-video-row {
    gap: 8px;
  }

  .create-video-card {
    aspect-ratio: 0.82;
  }

  .create-intro-action .create-primary-btn {
    padding: 13px 24px;
    font-size: 14px;
  }

  .create-options {
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 390px);
  }

  .create-options--choice,
  .create-options--story,
  .create-options--name,
  .create-options--complete,
  .create-options--account {
    width: min(100%, 360px);
  }

  .create-option-label {
    font-size: 11px;
  }

  /* Keep the name/preview step fully on screen: cap the portrait height so the
     name field and the Ready/Chat button stay visible without scrolling. */
  .create-name-panel {
    gap: 16px;
  }

  .create-name-preview img {
    aspect-ratio: auto;
    height: min(46vh, 360px);
  }
}

@media (max-width: 360px) {
  .create-options {
    grid-template-columns: 1fr;
    width: min(100%, 330px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .create-video-card video {
    display: none;
  }

  .create-progress span,
  .create-video-card video {
    transition: none;
  }
}
