:root {
  --bg: #14010f;
  --bg-2: #2a0a1c;
  --card: rgba(255, 236, 244, 0.07);
  --stroke: rgba(255, 196, 214, 0.18);
  --text: #fff5f9;
  --muted: #f3b8cc;
  --pink: #ff4d8d;
  --pink-hot: #ff2d6f;
  --gold: #ffd56a;
  --mint: #7dffc3;
  --red: #ff7b7b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --font: "Outfit", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  touch-action: manipulation;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

.glow {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  filter: blur(50px);
  opacity: 0.55;
}

.glow-a {
  width: 280px;
  height: 280px;
  top: -80px;
  right: -60px;
  background: radial-gradient(circle, #ff4d8d 0%, transparent 70%);
}

.glow-b {
  width: 320px;
  height: 320px;
  bottom: 8%;
  left: -120px;
  background: radial-gradient(circle, #7b2cff 0%, transparent 70%);
}

.app {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) 18px
    calc(40px + env(safe-area-inset-bottom));
}

.hero {
  text-align: center;
  margin-bottom: 22px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 77, 141, 0.16);
  border: 1px solid rgba(255, 77, 141, 0.35);
  color: #ffc2d6;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 8vw, 2.6rem);
}

.lede {
  margin: 12px auto 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.45;
}

[hidden] {
  display: none !important;
}

.survey {
  display: grid;
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

label,
.q {
  display: block;
  margin: 0;
  font-weight: 650;
  font-size: 1.08rem;
}

.hint {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

input,
textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(255, 196, 214, 0.22);
  background: rgba(10, 0, 8, 0.4);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 14px;
  font: inherit;
  font-size: 16px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 88px;
}

input:focus,
textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 77, 141, 0.18);
}

input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  color-scheme: dark;
  min-height: 50px;
}

input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  min-height: 1.2em;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.8;
  filter: invert(0.8);
}

.chips {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.chip,
.star,
.num {
  appearance: none;
  border: 1px solid rgba(255, 196, 214, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  min-height: 48px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.chip {
  padding: 0 4px;
  font-size: 12px;
}

.chip-please {
  letter-spacing: -0.02em;
}

.chip:active,
.star:active,
.num:active,
.submit:active {
  transform: scale(0.96);
}

.chip[aria-checked="true"],
.num[aria-checked="true"] {
  background: linear-gradient(180deg, #ff6ea4, var(--pink-hot));
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(255, 45, 111, 0.35);
}

.chip[data-value="never"][aria-checked="true"] {
  background: #4a1a28;
  box-shadow: none;
}

.chip[data-value="PLEASE"][aria-checked="true"] {
  animation: pulse 0.8s ease;
}

.scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.num {
  border-radius: 16px;
}

.scale-readout {
  margin: 10px 0 0;
  text-align: center;
  color: var(--gold);
  font-weight: 600;
  min-height: 1.2em;
}

.stars {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.star {
  flex: 1;
  font-size: 1.45rem;
  border-radius: 18px;
  line-height: 1;
}

.star[aria-checked="true"],
.star.is-on {
  background: rgba(255, 213, 106, 0.16);
  border-color: var(--gold);
  color: var(--gold);
}

.submit {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff7eb3, var(--pink-hot));
  color: white;
  font: inherit;
  font-size: 1.08rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(255, 45, 111, 0.35);
}

.submit[disabled] {
  opacity: 0.6;
  cursor: wait;
}

.submit.ghost {
  margin-top: 16px;
  background: transparent;
  border: 1px solid var(--stroke);
  box-shadow: none;
}

.ghost-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}

.link-generator h2 {
  font-size: 1.4rem;
  margin: 0 0 4px;
}

.link-gen-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 213, 106, 0.15);
  border: 1px solid rgba(255, 213, 106, 0.3);
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.link-gen-fields {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.field-group label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.link-gen-result {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--stroke);
}

.copy-box {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.copy-box input {
  font-size: 0.85rem;
  padding: 10px 12px;
  color: var(--muted);
}

.copy-btn {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: linear-gradient(180deg, #ff7eb3, var(--pink-hot));
  color: white;
  font: inherit;
  font-weight: 650;
  font-size: 0.88rem;
  padding: 0 16px;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease;
}

.copy-btn:active {
  transform: scale(0.95);
}

.footer-link {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.75;
  transition: opacity 0.15s ease;
}

.footer-link:hover {
  opacity: 1;
  color: var(--pink);
}

.legal,
.form-error {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin: 8px 4px 0;
}

.form-error {
  color: var(--red);
}

.thanks {
  text-align: center;
  padding: 48px 8px 12px;
}

.thanks-emoji {
  font-size: 64px;
  margin: 0;
  animation: pop 0.5s ease;
}

.thanks h2 {
  font-size: 2rem;
  margin-top: 8px;
}

.thanks-copy {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.scorecard {
  margin: 28px 0 0;
  padding: 22px 18px 18px;
  text-align: center;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 77, 141, 0.14), rgba(255, 213, 106, 0.06)),
    rgba(18, 2, 12, 0.72);
  border: 1px solid rgba(255, 213, 106, 0.28);
  box-shadow: var(--shadow);
}

.scorecard-kicker,
.scorecard-word-label,
.scorecard-hint {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  color: #ffc2d6;
}

.scorecard-meta {
  margin: 10px 0 4px;
  color: var(--text);
  font-weight: 600;
}

.scorecard-word {
  margin: 6px 0 4px;
  font-family: var(--display);
  font-size: clamp(2.2rem, 10vw, 3.1rem);
  font-style: italic;
  line-height: 1.05;
  color: var(--gold);
  word-break: break-word;
}

.scorecard-word-label {
  margin-bottom: 18px;
}

.scorecard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.scorecard-grid div {
  padding: 12px 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
}

.scorecard-grid dt {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.scorecard-grid dd {
  margin: 6px 0 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.scorecard-hint {
  margin: 14px 0 0;
  letter-spacing: 0.08em;
}

#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
