:root {
  color-scheme: light;
  font-family: "Jolligram Inter UI", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fff8ed;
  color: #19151f;
  font-synthesis: none;
}

/*
 * No double-tap zoom on this page; scrolling and pinch-zoom stay available.
 * Declared on every element rather than inherited from <html>: iOS 18 Safari
 * ignored the inherited value and smart-zoomed (1.04x, with a page jump) on a
 * double tap in the empty space of the send panel. Quick double taps on the
 * cards, buttons, and preview link also need double-tap-guard.js.
 */
* {
  box-sizing: border-box;
  touch-action: manipulation;
}

/* The page scrolls naturally when its content is taller than the screen, but
   never bounces or scrolls sideways. */
html {
  min-height: 100%;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: clip;
  overscroll-behavior-y: none;
  background:
    radial-gradient(circle at 15% 5%, rgb(255 196 223 / 0.55), transparent 34rem),
    radial-gradient(circle at 85% 20%, rgb(174 229 255 / 0.65), transparent 30rem),
    #fff8ed;
}

button, a, input { font: inherit; }

[hidden] { display: none !important; }

.creator-shell {
  /* Sized so the card and both actions fit an iPhone 12-class screen with
     Safari's toolbars showing; smaller screens scroll naturally. */
  --creator-card-width: clamp(8rem, calc((100vh - 26.5rem) * 0.5625), 11rem);
  --creator-card-width: clamp(8rem, calc((100svh - 26.5rem) * 0.5625), 11rem);
  width: min(100%, 30rem);
  margin: 0 auto;
  padding:
    max(0.5rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  text-align: center;
}

.creator-header { display: flex; justify-content: center; margin-bottom: 0.25rem; }

.creator-brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  gap: 0.45rem;
  color: inherit;
  font-size: 0.95rem;
  text-decoration: none;
}

.creator-brand img { width: 1.5rem; height: 1.5rem; }

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 6vw, 1.9rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.creator-intro { margin: 0.25rem 0 0.75rem; color: #5b5166; }

.creator-form { display: grid; gap: 0.75rem; }

.creator-choices { margin: 0; padding: 0; border: 0; min-width: 0; }

.creator-choice-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, var(--creator-card-width));
  justify-content: center;
  gap: 0.9rem;
}

.creator-choice { position: relative; display: block; cursor: pointer; }

.creator-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.creator-choice-card {
  display: grid;
  gap: 0.55rem;
  padding: 0.55rem 0.55rem 0.7rem;
  border: 2px solid transparent;
  border-radius: 1.25rem;
  background: rgb(255 255 255 / 0.75);
  box-shadow: 0 0.5rem 1.5rem rgb(79 52 101 / 0.12);
  transition: border-color 160ms ease, transform 160ms ease;
}

.creator-choice input:checked + .creator-choice-card { border-color: #6f5cff; }

.creator-choice input:focus-visible + .creator-choice-card {
  outline: 3px solid #6f5cff;
  outline-offset: 3px;
}

/* Black stencil lines over a rainbow wash read as the colored card the
   recipient will uncover; white stays white. */
.creator-thumb {
  display: block;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 0.85rem;
  background: linear-gradient(160deg, #ff7ab6, #ffb86b 30%, #8fd99a 55%, #6fc3ff 78%, #a58bff);
}

.creator-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  mix-blend-mode: screen;
}

.creator-choice-name { font-size: 0.95rem; overflow-wrap: anywhere; }

/*
 * Share, Copy link, the confirmation, the link, and the preview, each as wide
 * as the content on purpose: iOS 18 Safari can still smart-zoom a quick double
 * tap to fit the tapped element (1.6x on a half-width button), and that zoom
 * is a no-op only when the element already spans the content width.
 */
.creator-send {
  display: grid;
  gap: 0.5rem;
  width: 100%;
}

.creator-button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: #201827;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}

.creator-button--secondary {
  border: 2px solid #201827;
  background: transparent;
  color: #201827;
}

.creator-button:disabled { cursor: default; opacity: 0.45; }

/* Safari zooms the page when a focused text field is under 16px. */
.creator-link input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid rgb(25 21 31 / 0.18);
  border-radius: 0.75rem;
  background: rgb(255 255 255 / 0.85);
  color: #3a3045;
  font-size: max(16px, 1rem);
  text-overflow: ellipsis;
}

.creator-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  color: #5b5166;
  font-size: 0.9rem;
  text-underline-offset: 0.2em;
}

.creator-status { min-height: 1.4em; margin: 0; color: #3a3045; font-size: 0.9rem; line-height: 1.4; }

.creator-empty { color: #5b5166; }

.creator-button:focus-visible,
.creator-brand:focus-visible,
.creator-preview:focus-visible,
.creator-link input:focus-visible {
  outline: 3px solid #6f5cff;
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .creator-choice-card { transition: none; }
}
