:root {
  color-scheme: light;
  --pink: #ff7dad;
  --pink-soft: #ffe3ee;
  --blue: #69bff5;
  --blue-soft: #e0f4ff;
  --mint: #96dcc7;
  --gold: #f6bc4e;
  --ink: #332231;
  --muted: #735766;
  --paper: #fffafc;
  --white: #ffffff;
  --shadow: 0 18px 44px rgba(91, 52, 78, 0.18);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 227, 238, 0.92), rgba(224, 244, 255, 0.78)),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

button {
  border: 0;
  font: inherit;
}

button:focus-visible,
.answer:focus-visible,
.name-field input:focus-visible {
  outline: 3px solid rgba(246, 188, 78, 0.8);
  outline-offset: 3px;
}

.party-page {
  overflow: hidden;
}

.hero {
  position: relative;
  min-height: 86svh;
  display: grid;
  align-items: start;
  isolation: isolate;
  padding: 24px 18px 34px;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 250, 252, 0.78) 70%),
    linear-gradient(90deg, rgba(255, 125, 173, 0.2), rgba(105, 191, 245, 0.18));
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.hero__content {
  width: min(100%, 560px);
  padding-top: 86px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #8a3d63;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-block-start: 0;
}

h1 {
  margin-bottom: 10px;
  max-width: 9ch;
  font-size: clamp(3.45rem, 5.2rem, 5.2rem);
  line-height: 0.9;
  letter-spacing: 0;
  color: var(--ink);
  text-wrap: balance;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 2.7rem, 2.7rem);
  line-height: 1;
  letter-spacing: 0;
  text-wrap: balance;
}

.quiz h1 {
  max-width: none;
  margin-bottom: 12px;
  font-size: clamp(2rem, 2.7rem, 2.7rem);
  line-height: 1;
}

.hero__lead {
  max-width: 25rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.5;
  font-weight: 650;
}

.hero__ticker {
  position: absolute;
  right: 14px;
  top: 18px;
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px;
  font-weight: 900;
  color: var(--white);
}

.hero__ticker span {
  min-width: 44px;
  padding: 9px 10px;
  border-radius: 999px;
  text-align: center;
  box-shadow: 0 10px 26px rgba(92, 54, 78, 0.14);
}

.hero__ticker span:nth-child(1) {
  background: var(--blue);
}

.hero__ticker span:nth-child(2) {
  background: var(--gold);
  color: #4a3213;
}

.hero__ticker span:nth-child(3) {
  background: var(--pink);
}

.invite,
.participant,
.quiz,
.reveal {
  padding: 28px 18px;
}

.invite,
.participant {
  min-height: 72svh;
  display: grid;
  align-content: center;
  gap: 24px;
  background:
    linear-gradient(135deg, rgba(150, 220, 199, 0.28), rgba(255, 255, 255, 0)),
    var(--paper);
}

.invite__copy {
  max-width: 36rem;
}

.invite p:not(.eyebrow),
.name-form p:not(.eyebrow),
.quiz__question,
.reveal p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.name-form {
  width: min(100%, 560px);
  max-width: calc(100vw - 36px);
  padding: 22px;
  border: 1px solid rgba(255, 125, 173, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.name-field {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  color: var(--ink);
  font-weight: 800;
}

.name-field input {
  width: 100%;
  min-height: 56px;
  padding: 0 14px;
  border: 2px solid rgba(115, 87, 102, 0.16);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

.name-field input::placeholder {
  color: rgba(115, 87, 102, 0.58);
}

.form-error,
.reveal__notice {
  min-height: 1.5em;
  margin: 12px 0 0;
  font-weight: 760;
}

.primary-action,
.secondary-action {
  min-height: 58px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.primary-action {
  width: min(100%, 360px);
  background: linear-gradient(90deg, var(--pink), var(--blue));
  color: var(--white);
  box-shadow: var(--shadow);
}

.secondary-action {
  width: 100%;
  margin-top: 16px;
  background: var(--ink);
  color: var(--white);
}

.primary-action:active,
.secondary-action:active,
.answer:active {
  transform: translateY(1px);
}

.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  box-shadow: none;
}

.quiz {
  min-height: 100svh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(224, 244, 255, 0.72), rgba(255, 227, 238, 0.75)),
    var(--white);
}

.quiz__shell {
  width: min(100%, 560px);
  max-width: calc(100vw - 36px);
  padding: 22px;
  border: 1px solid rgba(105, 191, 245, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.quiz__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.quiz__counter {
  flex: 0 0 auto;
  min-width: 58px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #1c5f87;
  font-weight: 800;
  text-align: center;
}

.progress {
  height: 10px;
  margin: 2px 0 24px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--pink-soft);
}

.progress span {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--gold), var(--blue));
  transition: width 240ms ease;
}

.quiz__question {
  min-height: 3.1em;
  margin-bottom: 18px;
}

.answers {
  display: grid;
  gap: 10px;
}

.answer {
  width: 100%;
  min-height: 54px;
  padding: 13px 14px;
  border: 2px solid rgba(115, 87, 102, 0.14);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font-weight: 760;
  text-align: left;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.answer[aria-pressed="true"] {
  border-color: var(--pink);
  background: linear-gradient(90deg, rgba(255, 125, 173, 0.13), rgba(105, 191, 245, 0.14));
}

.answer.is-correct {
  border-color: var(--mint);
  background: rgba(150, 220, 199, 0.22);
}

.answer.is-wrong {
  border-color: var(--pink);
  background: rgba(255, 125, 173, 0.16);
}

.quiz__feedback {
  min-height: 1.55em;
  margin: 14px 0 0;
  font-weight: 760;
}

.reveal {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.96), rgba(255, 227, 238, 0.86) 55%, rgba(224, 244, 255, 0.92)),
    var(--paper);
  text-align: center;
}

.fireworks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.reveal__content {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  max-width: calc(100vw - 36px);
  display: grid;
  justify-items: center;
}

.reveal h2 {
  color: #d93d83;
  font-size: 2.35rem;
}

.princess {
  width: min(86vw, 410px);
  max-height: 58svh;
  object-fit: contain;
  margin-top: 12px;
  filter: drop-shadow(0 24px 30px rgba(127, 63, 93, 0.22));
  transform: translateY(18px) scale(0.94);
  opacity: 0;
}

.reveal.is-visible .princess {
  animation: princess-pop 720ms cubic-bezier(0.2, 0.9, 0.2, 1.15) forwards;
}

@keyframes princess-pop {
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@media (min-width: 740px) {
  .hero,
  .invite,
  .participant,
  .quiz,
  .reveal {
    padding-inline: max(42px, calc((100vw - 980px) / 2));
  }

  .hero {
    min-height: 90svh;
    align-items: center;
  }

  .hero__content {
    padding-top: 18svh;
  }

  h1 {
    max-width: 10ch;
  }

  .reveal h2 {
    font-size: 4.4rem;
  }

  .invite {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 54svh;
  }

  .participant {
    min-height: 62svh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
