:root {
  color-scheme: light;
  --plum: #39203d;
  --plum-deep: #2a1730;
  --berry: #99356f;
  --rose: #e78ac7;
  --rose-soft: #f0b3d7;
  --cream: #fff5e8;
  --cream-muted: #f6e6d2;
  --ink: #2b1a2f;
  --muted: #7f6377;
  --line: rgba(231, 138, 199, 0.62);
  font-family: Avenir, "Trebuchet MS", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 9%, rgba(246, 230, 210, 0.95) 0 3px, transparent 4px),
    radial-gradient(circle at 18% 18%, rgba(231, 138, 199, 0.9) 0 7px, transparent 8px),
    radial-gradient(circle at 80% 12%, rgba(246, 230, 210, 0.75) 0 5px, transparent 6px),
    radial-gradient(circle at 92% 28%, rgba(240, 179, 215, 0.9) 0 9px, transparent 10px),
    radial-gradient(circle at 74% 84%, rgba(246, 230, 210, 0.9) 0 4px, transparent 5px),
    linear-gradient(135deg, #8c326e 0%, #a43b73 52%, #8f2f69 100%);
  color: var(--ink);
}

body::before,
body::after {
  position: fixed;
  z-index: 0;
  color: var(--cream);
  font-size: clamp(4rem, 13vw, 8rem);
  line-height: 1;
  opacity: 0.95;
  pointer-events: none;
}

body::before {
  content: "✦";
  left: 7vw;
  bottom: 6vh;
}

body::after {
  content: "✦";
  right: 7vw;
  bottom: 5vh;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--rose);
  color: var(--plum-deep);
  padding: 0 20px;
  font-weight: 900;
  cursor: pointer;
}

button:hover {
  background: var(--rose-soft);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(255, 245, 232, 0.8);
  outline-offset: 2px;
}

input,
textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 245, 232, 0.96);
  color: var(--ink);
  padding: 13px 14px;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

label {
  display: grid;
  gap: 8px;
  color: var(--cream);
  font-size: 0.9rem;
  font-weight: 800;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0;
}

.invite-card {
  position: relative;
  min-height: calc(100vh - 56px);
  overflow: hidden;
  border: 5px solid var(--cream);
  border-radius: 999px 999px 48px 48px;
  background: var(--plum);
  box-shadow: 0 28px 90px rgba(45, 14, 47, 0.45);
}

.invite-card::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 4px solid var(--cream);
  border-radius: 999px 999px 42px 42px;
  pointer-events: none;
}

.sparkles {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 245, 232, 0.75) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(231, 138, 199, 0.75) 0 5px, transparent 6px);
  background-position: 0 0, 35px 27px;
  background-size: 54px 54px, 86px 86px;
  mask-image: linear-gradient(to bottom, black 0 24%, transparent 45%);
  opacity: 0.72;
}

.card-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 28px;
  width: min(920px, calc(100% - 64px));
  margin: 0 auto;
  padding: 86px 0 52px;
}

.hero {
  color: var(--cream);
  text-align: center;
}

.overline {
  margin: 0 0 38px;
  font-size: clamp(1.35rem, 4vw, 2.55rem);
  color: white;
}

.hero h1 {
  margin: 0;
  color: var(--rose);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.5rem, 9vw, 7.1rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0;
}

.rule {
  width: min(760px, 100%);
  height: 5px;
  margin: 36px auto 34px;
  border-radius: 999px;
  background: var(--cream);
  box-shadow:
    -2px 0 0 3px var(--cream),
    2px 0 0 3px var(--cream);
}

.tagline,
.subtagline {
  margin: 0;
  color: white;
  font-size: clamp(1.65rem, 4vw, 2.55rem);
  line-height: 1.35;
}

.panel {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 26px;
  border: 4px solid var(--rose);
  border-radius: 8px;
  background: rgba(57, 32, 61, 0.92);
  color: var(--cream);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel h2,
.panel h3 {
  margin: 0;
}

.panel h2 {
  color: white;
  font-size: clamp(1.65rem, 4vw, 2.2rem);
  line-height: 1.12;
}

.event-form,
.unlock-form,
.lock-form,
.delivery {
  display: grid;
  gap: 18px;
}

.unlock-form,
.lock-form {
  margin-top: 22px;
}

.lock-error {
  min-height: 1.4em;
  margin: 14px 0 0;
  color: var(--rose-soft);
  font-weight: 800;
}

.guest-greeting {
  margin: 10px 0 0;
  color: var(--cream-muted);
  line-height: 1.45;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.actions {
  display: flex;
  gap: 10px;
}

.secondary-button {
  border: 2px solid var(--rose);
  background: transparent;
  color: var(--cream);
}

.secondary-button:hover {
  background: rgba(231, 138, 199, 0.16);
  color: white;
}

.helper-text {
  margin: 0 0 20px;
  color: var(--cream-muted);
  line-height: 1.5;
}

.link-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 15px;
  border: 2px solid rgba(231, 138, 199, 0.58);
  border-radius: 8px;
  background: rgba(255, 245, 232, 0.08);
}

.message-fallback {
  display: none;
  grid-column: 1 / -1;
  min-height: 106px;
  color: var(--ink);
}

.message-fallback.visible {
  display: block;
}

.guest-name {
  display: block;
  color: white;
  font-size: 1.08rem;
}

.code-name {
  display: inline-block;
  width: fit-content;
  margin: 7px 0 2px;
  border: 1px solid rgba(255, 245, 232, 0.58);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--cream);
  background: rgba(231, 138, 199, 0.14);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
}

.guest-instruction {
  display: block;
  margin-top: 3px;
  color: var(--cream-muted);
  font-size: 0.84rem;
}

.reveal-result {
  margin: 22px 0;
}

.guest-notes {
  margin: 18px 0 22px;
  border: 2px solid rgba(231, 138, 199, 0.58);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 245, 232, 0.08);
  color: var(--cream-muted);
}

.guest-notes h3 {
  margin: 0 0 10px;
  color: white;
  font-size: 1rem;
}

.guest-notes ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
}

.assignment-card,
.error-card {
  border-radius: 8px;
  padding: 20px;
}

.assignment-card {
  border: 2px solid var(--rose);
  background: rgba(255, 245, 232, 0.96);
  color: var(--ink);
  text-align: center;
}

.assignment-card span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assignment-card strong {
  display: block;
  margin-top: 10px;
  color: var(--berry);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 8vw, 4.4rem);
  font-weight: 400;
  line-height: 1.05;
}

.assignment-options {
  display: grid;
  gap: 8px;
  margin: 18px auto 0;
  padding: 0;
  list-style: none;
}

.assignment-options li {
  border: 1px solid rgba(153, 53, 111, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(231, 138, 199, 0.12);
  color: var(--ink);
  font-weight: 800;
}

.assignment-card em {
  display: inline-block;
  margin-top: 14px;
  border: 1px solid rgba(153, 53, 111, 0.28);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--berry);
  background: rgba(231, 138, 199, 0.16);
  font-style: normal;
  font-weight: 800;
}

.assignment-card p {
  margin: 14px 0 0;
  color: var(--muted);
}

.error-card {
  border: 2px solid var(--rose);
  background: rgba(255, 245, 232, 0.96);
  color: #6e1e43;
}

.hidden {
  display: none;
}

@media (max-width: 780px) {
  body::before,
  body::after {
    font-size: 3rem;
  }

  .app-shell {
    width: min(100% - 18px, 1180px);
    padding: 14px 0;
  }

  .invite-card {
    min-height: calc(100vh - 28px);
    border-width: 3px;
    border-radius: 220px 220px 30px 30px;
  }

  .invite-card::before {
    inset: 9px;
    border-width: 3px;
    border-radius: 210px 210px 26px 26px;
  }

  .card-inner {
    width: calc(100% - 32px);
    padding: 60px 0 34px;
  }

  .overline {
    margin-bottom: 22px;
  }

  .rule {
    margin: 26px auto 24px;
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 20px;
    border-width: 3px;
  }

  .panel-header,
  .actions {
    flex-direction: column;
  }

  .link-list li {
    grid-template-columns: 1fr;
  }

  .link-list button,
  .actions button,
  .panel-header button {
    width: 100%;
  }
}
