:root {
  --pine-950: #052e1c;
  --pine-900: #0b3d2e;
  --pine-800: #14503a;
  --pine-700: #1f5b3e;
  --pine-100: #dcefe3;
  --pine-50: #f1f8f4;
  --red-700: #b91c1c;
  --red-800: #991b1b;
  --red-50: #fef2f2;
  --gold-200: #f5e18a;
  --gold-300: #efcc52;
  --gold-400: #e6b52c;
  --gold-500: #d4a017;
  --gold-700: #936110;
  --gold-50: #fdf9e7;
  --cream-50: #fefcf6;
  --cream-100: #fdf8ec;
  --cream-200: #f8edcf;
  --ink: #10271e;
  --muted: #5d7468;
  --line: #dfe9e3;
  --white: #ffffff;
  --shadow: 0 20px 55px -28px rgba(5, 46, 28, 0.45);
  --shadow-soft: 0 12px 34px -24px rgba(5, 46, 28, 0.4);
  --radius: 24px;
  --radius-small: 14px;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia,
    serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--cream-50);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--gold-400);
  outline-offset: 3px;
}

::selection {
  background: var(--gold-200);
  color: var(--pine-950);
}

[hidden] {
  display: none !important;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.muted {
  color: var(--muted);
}

.text-link {
  color: var(--pine-700);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.text-link:hover {
  color: var(--red-700);
}

.text-link-light {
  color: rgba(254, 252, 246, 0.8);
}

.text-link-light:hover {
  color: var(--gold-200);
}

.eyebrow {
  color: var(--gold-700);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.eyebrow-light {
  color: var(--gold-300);
}

.lede {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.button-row-center {
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease,
    color 180ms ease, box-shadow 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.btn-primary {
  background: var(--red-700);
  color: var(--white);
  box-shadow: 0 12px 24px -14px rgba(153, 27, 27, 0.7);
}

.btn-primary:hover {
  background: var(--red-800);
}

.btn-gold {
  background: var(--gold-400);
  color: var(--pine-950);
  box-shadow: 0 12px 28px -14px rgba(147, 97, 16, 0.72);
}

.btn-gold:hover {
  background: var(--gold-300);
}

.btn-outline {
  border-color: var(--line);
  background: var(--white);
  color: var(--pine-900);
}

.btn-outline:hover {
  border-color: var(--gold-400);
  background: var(--gold-50);
}

.btn-danger {
  border-color: #fecaca;
  background: var(--red-50);
  color: var(--red-800);
}

.btn-danger:hover {
  background: #fee2e2;
}

.btn-ghost-dark {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream-50);
}

.btn-ghost-dark:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.25);
  background: transparent;
  color: var(--cream-50);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-large {
  min-height: 52px;
  padding: 0.9rem 1.7rem;
  font-size: 0.95rem;
}

.btn-small {
  min-height: 38px;
  padding: 0.5rem 0.95rem;
  font-size: 0.78rem;
}

.btn-icon {
  min-width: 44px;
  padding: 0.55rem 0.8rem;
  font-size: 0.75rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  padding: 0.35rem 0.7rem;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill-gold {
  border-color: var(--gold-300);
  background: var(--gold-50);
  color: var(--gold-700);
}

.pill-small {
  font-size: 0.6rem;
}

/* Header */
.site-header {
  position: relative;
  z-index: 20;
}

.site-header-dark {
  color: var(--cream-50);
}

.site-header-light {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--gold-400);
  color: var(--pine-950);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.6);
}

.brand-mark.large {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  font-size: 2rem;
}

.brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.15;
}

.brand small {
  display: block;
  margin-top: 0.15rem;
  color: inherit;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  opacity: 0.58;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 10% -10%, rgba(212, 160, 23, 0.22), transparent 48%),
    radial-gradient(ellipse at 95% 0%, rgba(185, 28, 28, 0.24), transparent 44%),
    radial-gradient(ellipse at 50% 110%, rgba(38, 114, 76, 0.36), transparent 56%),
    linear-gradient(180deg, #052e1c 0%, #0b3d2e 50%, #0f4a36 100%);
  color: var(--cream-50);
  padding-bottom: 1.2rem;
}

.hero-grid {
  position: relative;
  z-index: 10;
  display: grid;
  gap: 3rem;
  align-items: center;
  padding-block: 4rem 4.5rem;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    padding-block: 5rem 6rem;
  }
}

.hero-copy h1 {
  max-width: 12ch;
  margin-top: 1.4rem;
  font-size: clamp(3rem, 8vw, 5.2rem);
  font-weight: 600;
}

.display-italic {
  display: block;
  color: var(--gold-200);
  font-style: italic;
  text-shadow: 0 0 40px rgba(239, 204, 82, 0.18);
}

.hero-lede {
  max-width: 60ch;
  margin-top: 1.4rem;
  color: rgba(254, 252, 246, 0.74);
  font-size: 1.02rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero-card-wrap {
  position: relative;
  width: min(100%, 390px);
  margin-inline: auto;
}

.hero-card {
  position: relative;
  z-index: 2;
  transform: rotate(2deg);
  border: 1px solid rgba(245, 225, 138, 0.35);
  border-radius: 32px;
  background: var(--cream-50);
  padding: 1.4rem;
  color: var(--pine-950);
  box-shadow: 0 40px 100px -32px rgba(0, 0, 0, 0.78);
}

.hero-card-top,
.hero-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.hero-card-top .pill {
  border-color: var(--pine-100);
  background: var(--pine-50);
  color: var(--pine-700);
}

.mini-label {
  color: var(--red-700);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.invite-frame {
  margin-top: 1.4rem;
  border: 1px dashed rgba(212, 160, 23, 0.65);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
  padding: 2rem 1.2rem;
  text-align: center;
}

.invite-frame p {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.invite-number {
  margin-block: 0.45rem;
  color: var(--pine-950);
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
}

.invite-frame span {
  color: var(--muted);
  font-size: 0.82rem;
}

.hero-card-bottom {
  margin-top: 1.4rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.hero-mini-card {
  position: absolute;
  z-index: 3;
  bottom: -1.5rem;
  left: -1.2rem;
  transform: rotate(-5deg);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  padding: 0.7rem 1rem;
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.7);
}

.hero-mini-card span {
  display: block;
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-mini-card strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--pine-900);
  font-size: 0.72rem;
}

.hero-bauble {
  position: absolute;
  z-index: 1;
  display: block;
  border-radius: 50%;
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.8);
}

.hero-bauble::after {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 14px;
  height: 14px;
  transform: translateX(-50%);
  border: 4px solid var(--gold-400);
  border-radius: 50%;
}

.hero-bauble-red {
  top: -1.2rem;
  right: -1.8rem;
  width: 70px;
  height: 70px;
  background: radial-gradient(circle at 30% 25%, #f87171, #991b1b 65%, #450a0a);
}

.hero-bauble-gold {
  bottom: 2rem;
  right: -2.4rem;
  width: 42px;
  height: 42px;
  background: radial-gradient(circle at 30% 25%, #f5e18a, #d4a017 65%, #684116);
}

.hero-divider {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--gold-300);
}

.hero-divider span:first-child,
.hero-divider span:last-child {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(245, 225, 138, 0.45));
}

.hero-divider span:last-child {
  background: linear-gradient(90deg, rgba(245, 225, 138, 0.45), transparent);
}

.divider-star {
  font-size: 0.8rem;
}

/* Snow and stars */
.snow-layer,
.reveal-stars,
.hero-stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.snowflake {
  position: absolute;
  top: -8vh;
  border-radius: 50%;
  background: #fff;
  animation-name: snowfall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}

.hero-stars::before,
.hero-stars::after,
.reveal-stars::before,
.reveal-stars::after {
  content: "✦";
  position: absolute;
  color: var(--gold-300);
  opacity: 0.45;
  animation: twinkle 3.6s ease-in-out infinite;
}

.hero-stars::before {
  top: 12%;
  left: 8%;
}

.hero-stars::after {
  top: 22%;
  right: 12%;
  animation-delay: 1.2s;
}

.reveal-stars::before {
  top: 18%;
  left: 10%;
}

.reveal-stars::after {
  bottom: 20%;
  right: 9%;
  animation-delay: 1.5s;
}

@keyframes snowfall {
  from {
    transform: translate3d(0, -10vh, 0) rotate(0);
  }
  to {
    transform: translate3d(var(--drift, 20px), 112vh, 0) rotate(360deg);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(0.85);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.2);
  }
}

/* Sections */
.section {
  padding-block: 5rem;
}

.section-cream {
  background:
    radial-gradient(rgba(11, 61, 46, 0.045) 1px, transparent 1px),
    radial-gradient(rgba(185, 28, 28, 0.035) 1px, transparent 1px),
    var(--cream-100);
  background-position: 0 0, 12px 12px;
  background-size: 24px 24px;
}

.section-white {
  background: var(--white);
}

.section-heading {
  max-width: 620px;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.section-heading h2 {
  margin-top: 0.5rem;
  font-size: clamp(2.1rem, 5vw, 3.2rem);
}

.section-heading p {
  margin-top: 0.9rem;
  color: var(--muted);
}

.steps-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 760px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding: 1.6rem;
  box-shadow: var(--shadow-soft);
}

.step-number {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  color: #e7eee9;
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
}

.step-card h3 {
  position: relative;
  margin-top: 3rem;
  font-size: 1.45rem;
}

.step-card p {
  position: relative;
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.access-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.access-card h2 {
  margin-top: 0.45rem;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
}

.access-card > p:not(.eyebrow):not(.helper-text):not(.form-error) {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Forms */
.field {
  display: block;
}

.field-label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--pine-700);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  padding: 0.75rem 1rem;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input::placeholder {
  color: #9aac9f;
}

.input:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 4px rgba(230, 181, 44, 0.18);
}

.access-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

@media (min-width: 620px) {
  .access-form {
    flex-direction: row;
    align-items: end;
  }

  .access-form .field {
    flex: 1;
  }
}

.form-error {
  margin-top: 0.6rem;
  color: var(--red-800);
  font-size: 0.8rem;
  font-weight: 600;
}

.helper-text {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.6;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--cream-100);
}

.site-footer-dark {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(5, 46, 28, 0.55);
  color: rgba(254, 252, 246, 0.55);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-block: 1.5rem;
  font-size: 0.72rem;
}

@media (min-width: 700px) {
  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* Organizer */
.page-landing {
  padding-bottom: 5.5rem;
}

.page-organizer {
  background: var(--cream-50);
}

.organizer-main {
  padding-block: 2.2rem 4rem;
}

.organizer-intro {
  display: grid;
  gap: 1.2rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

@media (min-width: 840px) {
  .organizer-intro {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.organizer-intro h1 {
  margin-top: 0.4rem;
  font-size: clamp(2.6rem, 6vw, 4rem);
}

.organizer-intro .lede {
  max-width: 60ch;
  margin-top: 0.8rem;
}

.intro-note {
  border: 1px solid var(--gold-200);
  border-radius: 20px;
  background: var(--gold-50);
  padding: 1.1rem 1.2rem;
}

.intro-note strong {
  display: block;
  color: var(--gold-700);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro-note p {
  margin-top: 0.45rem;
  color: #6b5418;
  font-size: 0.8rem;
}

.banner {
  margin-bottom: 1.25rem;
  border-radius: 16px;
  padding: 0.9rem 1.05rem;
  font-size: 0.82rem;
  font-weight: 500;
}

.banner-warning {
  border: 1px solid var(--gold-300);
  background: var(--gold-50);
  color: #664f12;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding: 1.4rem;
  box-shadow: var(--shadow-soft);
}

.organizer-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 980px) {
  .organizer-grid {
    grid-template-columns: 0.92fr 1.08fr;
    align-items: start;
  }
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

.card-heading h2 {
  margin-top: 0.2rem;
  font-size: 1.9rem;
}

.count-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--pine-50);
  padding: 0.35rem 0.7rem;
  color: var(--pine-700);
  font-size: 0.66rem;
  font-weight: 800;
  white-space: nowrap;
}

.add-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

@media (min-width: 560px) {
  .add-form {
    flex-direction: row;
    align-items: end;
  }

  .add-form .field {
    flex: 1;
  }
}

.empty-state {
  margin-top: 1.1rem;
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 1.8rem 1rem;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto;
  place-items: center;
  border-radius: 15px;
  background: var(--pine-950);
  color: var(--gold-300);
  font-size: 1.2rem;
}

.empty-state h3 {
  margin-top: 0.7rem;
  font-size: 1.3rem;
}

.empty-state p {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.empty-state .btn {
  margin-top: 1rem;
}

.participant-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 1rem;
}

.participant-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid var(--pine-50);
  border-radius: 14px;
  background: var(--cream-50);
  padding: 0.55rem 0.65rem;
}

.number-badge {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--pine-950);
  color: var(--gold-200);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
}

.participant-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--pine-950);
  font-size: 0.88rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  gap: 0.25rem;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--pine-700);
  font-size: 0.75rem;
}

.icon-button:hover {
  background: var(--pine-100);
}

.icon-button.danger {
  color: var(--red-700);
}

.icon-button.danger:hover {
  background: var(--red-50);
}

.draw-card {
  min-height: 100%;
}

.draw-illustration {
  display: grid;
  height: 130px;
  place-items: center;
  margin-top: 0.4rem;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 30%, rgba(239, 204, 82, 0.2), transparent 60%),
    var(--pine-50);
}

.css-gift {
  position: relative;
  display: block;
  width: 84px;
  height: 68px;
  border-radius: 10px;
  background: linear-gradient(145deg, #ef4444, #991b1b);
  box-shadow: 0 18px 30px -18px rgba(5, 46, 28, 0.7);
}

.css-gift::before {
  content: "";
  position: absolute;
  left: -6px;
  right: -6px;
  top: -12px;
  height: 22px;
  border-radius: 8px;
  background: linear-gradient(145deg, #f87171, #b91c1c);
}

.css-gift::after {
  content: "";
  position: absolute;
  top: -12px;
  bottom: 0;
  left: 50%;
  width: 14px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #b98211, #f5e18a, #b98211);
}

.draw-idle h3,
.draw-animation h3 {
  margin-top: 0.8rem;
  font-size: 1.8rem;
}

.draw-idle p {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.draw-idle .btn {
  width: 100%;
  margin-top: 1.1rem;
}

.draw-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
}

.countdown {
  color: var(--gold-500);
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  animation: pop 0.8s ease-in-out infinite;
}

.shuffle-label {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shuffle-display {
  margin-top: 1rem;
  border: 1px solid var(--gold-200);
  border-radius: 18px;
  background: var(--pine-950);
  padding: 0.9rem 2.4rem;
  color: var(--gold-200);
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
}

@keyframes pop {
  0%,
  100% {
    transform: scale(0.9);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.12);
    opacity: 1;
  }
}

.completion-banner {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.5rem;
  border: 1px solid var(--pine-100);
  border-radius: 18px;
  background: var(--pine-50);
  padding: 1rem;
}

.completion-star {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 12px;
  background: var(--pine-950);
  color: var(--gold-300);
}

.completion-banner h3 {
  font-size: 1.4rem;
}

.completion-banner p {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.assignment-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
}

.assignment-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.assignment-table th {
  background: var(--pine-50);
  padding: 0.65rem 0.75rem;
  color: var(--pine-700);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.assignment-table td {
  border-top: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
  vertical-align: middle;
}

.assignment-table .actions-column {
  width: 170px;
}

.assignment-gift {
  display: inline-grid;
  min-width: 42px;
  place-items: center;
  border-radius: 10px;
  background: var(--pine-950);
  padding: 0.3rem 0.5rem;
  color: var(--gold-200);
  font-family: var(--font-display);
  font-weight: 700;
}

.link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.link-actions .btn {
  min-height: 32px;
  padding: 0.35rem 0.55rem;
  font-size: 0.66rem;
}

.reset-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
}

@media (min-width: 760px) {
  .reset-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.reset-card h2 {
  margin-top: 0.2rem;
  font-size: 1.7rem;
}

.reset-card p {
  margin-top: 0.3rem;
  font-size: 0.82rem;
}

.corrupt-panel {
  max-width: 720px;
  margin: 2rem auto;
}

.corrupt-panel h2 {
  font-size: 1.8rem;
}

.corrupt-panel p {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.corrupt-panel .button-row {
  margin-top: 1.2rem;
}

/* Dialog and toast */
.app-dialog {
  width: min(500px, calc(100% - 2rem));
  max-width: none;
  border: 0;
  border-radius: 24px;
  background: var(--cream-50);
  padding: 0;
  color: var(--ink);
  box-shadow: 0 40px 100px -30px rgba(5, 46, 28, 0.7);
}

.app-dialog::backdrop {
  background: rgba(5, 46, 28, 0.68);
  backdrop-filter: blur(4px);
}

.dialog-card {
  padding: 1.5rem;
}

.dialog-title {
  font-size: 1.75rem;
}

.dialog-description {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.dialog-field {
  margin-top: 1rem;
}

.dialog-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  margin-top: 1.4rem;
}

@media (min-width: 520px) {
  .dialog-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
}

.toast-stack {
  position: fixed;
  z-index: 100;
  bottom: 1rem;
  left: 50%;
  display: flex;
  width: min(92vw, 430px);
  transform: translateX(-50%);
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 15px 30px -18px rgba(5, 46, 28, 0.6);
  animation: toast-in 200ms ease-out;
}

.toast-success {
  border-color: var(--pine-100);
  background: var(--pine-950);
  color: var(--cream-50);
}

.toast-error {
  border-color: #fecaca;
  background: var(--red-700);
  color: var(--white);
}

.toast-out {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Confetti */
.confetti-layer,
.confetti-container {
  position: absolute;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  pointer-events: none;
}

.confetti-container {
  position: fixed;
}

.confetti-piece {
  position: absolute;
  top: -10px;
  left: var(--x);
  width: 7px;
  height: 12px;
  border-radius: 2px;
  background: var(--color);
  animation: confetti-fall var(--duration) ease-out var(--delay) forwards;
}

@keyframes confetti-fall {
  to {
    transform: translate3d(var(--drift), 105vh, 0) rotate(var(--rotate));
    opacity: 0.1;
  }
}

/* Reveal page */
.page-reveal {
  position: relative;
  background:
    radial-gradient(ellipse at 20% -10%, rgba(212, 160, 23, 0.2), transparent 48%),
    radial-gradient(ellipse at 90% 0%, rgba(185, 28, 28, 0.25), transparent 45%),
    linear-gradient(180deg, #052e1c 0%, #0b3d2e 50%, #0f4a36 100%);
  color: var(--cream-50);
}

.reveal-main {
  position: relative;
  z-index: 10;
  display: flex;
  min-height: calc(100vh - 160px);
  align-items: center;
  justify-content: center;
  padding-block: 2.5rem;
}

.reveal-card {
  width: min(100%, 560px);
  border: 1px solid rgba(245, 225, 138, 0.22);
  border-radius: 28px;
  background: rgba(254, 252, 246, 0.97);
  padding: 1.5rem;
  color: var(--pine-950);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.75);
  text-align: center;
}

@media (min-width: 640px) {
  .reveal-card {
    padding: 2.2rem;
  }
}

.reveal-card h1 {
  margin-top: 0.4rem;
  font-size: clamp(2.2rem, 7vw, 3.2rem);
}

.reveal-card .lede {
  margin-top: 0.7rem;
  font-size: 0.92rem;
}

.reveal-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 0.8rem;
  place-items: center;
  border-radius: 18px;
  background: var(--red-50);
  color: var(--red-700);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
}

.gift-scene {
  position: relative;
  width: min(290px, 78vw);
  height: 300px;
  margin: 0.5rem auto 0;
  display: grid;
  place-items: center;
}

.gift-aura {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 204, 82, 0.35), transparent 68%);
  filter: blur(5px);
  animation: aura 3.4s ease-in-out infinite;
}

.gift-box {
  position: relative;
  width: 195px;
  height: 150px;
  margin-top: 70px;
  border-radius: 18px;
  background: linear-gradient(145deg, #b91c1c, #7f1d1d);
  box-shadow: inset 0 -16px 30px rgba(69, 10, 10, 0.35),
    0 28px 60px -24px rgba(5, 46, 28, 0.65);
  transition: transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gift-lid {
  position: absolute;
  left: -12px;
  right: -12px;
  top: -34px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(145deg, #ef4444, #b91c1c);
  box-shadow: inset 0 -8px 14px rgba(69, 10, 10, 0.28),
    0 14px 30px -16px rgba(69, 10, 10, 0.7);
  transform-origin: 20% 100%;
  transition: transform 800ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gift-ribbon-v {
  position: absolute;
  top: -34px;
  bottom: 0;
  left: 50%;
  width: 28px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #b98211, #f5e18a, #b98211);
}

.gift-ribbon-h {
  position: absolute;
  left: 0;
  right: 0;
  top: 74px;
  height: 24px;
  background: linear-gradient(180deg, #b98211, #f5e18a, #b98211);
}

.gift-bow {
  position: absolute;
  left: 50%;
  top: -62px;
  width: 80px;
  height: 50px;
  transform: translateX(-50%);
  transition: transform 700ms ease, opacity 500ms ease;
}

.gift-bow::before,
.gift-bow::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 42px;
  height: 32px;
  border: 8px solid var(--gold-400);
  border-radius: 50% 50% 45% 55%;
}

.gift-bow::before {
  left: 0;
  transform: rotate(-18deg);
}

.gift-bow::after {
  right: 0;
  transform: rotate(18deg) scaleX(-1);
}

.gift-scene.is-open .gift-lid {
  transform: translateY(-150px) rotate(-14deg);
}

.gift-scene.is-open .gift-bow {
  transform: translate(-50%, -170px) rotate(18deg);
  opacity: 0;
}

.gift-scene.is-open .gift-box {
  transform: translateY(10px) scale(1.02);
}

.gift-number {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  display: grid;
  width: 154px;
  height: 154px;
  place-items: center;
  border: 2px solid rgba(239, 204, 82, 0.7);
  border-radius: 50%;
  background: linear-gradient(145deg, #0b3d2e, #052e1c);
  box-shadow: 0 0 0 8px rgba(239, 204, 82, 0.08),
    0 0 70px rgba(239, 204, 82, 0.4);
  color: var(--gold-200);
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%, -35%) scale(0.4);
  transition: opacity 500ms ease 450ms,
    transform 700ms cubic-bezier(0.2, 1.2, 0.3, 1) 450ms;
}

.gift-scene.is-open .gift-number {
  opacity: 1;
  transform: translate(-50%, -73%) scale(1);
}

@keyframes aura {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(0.95);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

.result-panel {
  margin-top: 0.4rem;
  animation: result-in 500ms ease-out;
}

.result-greeting {
  color: var(--red-700);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.5rem);
  font-weight: 700;
}

.result-label {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.result-number {
  color: var(--pine-950);
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 16vw, 7rem);
  font-weight: 700;
  line-height: 1;
}

.result-find {
  color: var(--pine-800);
  font-size: 1rem;
  font-weight: 600;
}

.result-secret {
  max-width: 34ch;
  margin: 0.9rem auto 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.result-panel .button-row {
  margin-top: 1.2rem;
}

.result-panel .btn-outline-light {
  border-color: var(--line);
  color: var(--pine-800);
}

.result-panel .btn-outline-light:hover {
  background: var(--pine-50);
}

.result-panel .btn-ghost-dark {
  border-color: var(--line);
  background: var(--white);
  color: var(--pine-800);
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal-footnote {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.page-not-found {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: var(--pine-950);
  color: var(--cream-50);
}

.not-found-main {
  display: grid;
  place-items: center;
  padding-block: 3rem;
}

.not-found-card {
  width: min(100%, 520px);
  border: 1px solid rgba(245, 225, 138, 0.25);
  border-radius: 28px;
  background: var(--cream-50);
  padding: 2rem;
  color: var(--pine-950);
  text-align: center;
}

.not-found-card .brand-mark {
  margin-inline: auto;
}

.not-found-card h1 {
  margin-top: 0.6rem;
  font-size: clamp(2rem, 7vw, 3rem);
}

.not-found-card .btn {
  margin-top: 1.3rem;
}

/* Print */
.print-area {
  display: none;
}

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }

  .site-header,
  .site-footer,
  .organizer-intro,
  .banner,
  .card,
  .toast-stack,
  .app-dialog,
  .confetti-layer {
    display: none !important;
  }

  .print-area {
    display: block !important;
    padding: 0;
  }

  .print-area h1 {
    margin-bottom: 0.3rem;
    font-size: 1.6rem;
  }

  .print-area p {
    margin-bottom: 1rem;
    color: #333;
    font-size: 0.8rem;
  }

  .print-area table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
  }

  .print-area th,
  .print-area td {
    border: 1px solid #999;
    padding: 0.35rem;
    text-align: left;
    overflow-wrap: anywhere;
  }

  .print-area th {
    background: #f0f0f0;
  }

  @page {
    size: A4;
    margin: 11mm;
  }
}

/* Music control */
.music-toggle {
  position: fixed;
  z-index: 70;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 46px;
  border: 1px solid rgba(245, 225, 138, 0.42);
  border-radius: 999px;
  background: rgba(5, 46, 28, 0.9);
  padding: 0.55rem 0.9rem;
  color: var(--cream-50);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: 0 14px 35px -16px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  touch-action: manipulation;
}

.music-toggle:hover {
  background: var(--pine-900);
}

.music-toggle.is-playing {
  border-color: var(--gold-300);
  background: var(--gold-400);
  color: var(--pine-950);
}

.music-note {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.95rem;
  line-height: 1;
}

.music-toggle.is-playing .music-note {
  background: rgba(5, 46, 28, 0.12);
  animation: musicPulse 1.2s ease-in-out infinite;
}

@keyframes musicPulse {
  0%,
  100% {
    transform: scale(0.92);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Mobile-first refinements */
@media (max-width: 680px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    font-size: 15px;
  }

  .container {
    width: min(100% - 1.25rem, 1120px);
  }

  .header-actions .text-link,
  .header-actions .pill,
  .brand small {
    display: none;
  }

  .header-inner {
    padding-block: 0.8rem;
  }

  .brand {
    gap: 0.55rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 1.15rem;
  }

  .brand strong {
    font-size: 0.95rem;
  }

  .hero {
    padding-bottom: 0.5rem;
  }

  .hero-grid {
    gap: 2.2rem;
    padding-block: 2.6rem 3.4rem;
  }

  .hero-copy h1 {
    margin-top: 0.9rem;
    font-size: clamp(2.7rem, 12vw, 4rem);
  }

  .hero-lede {
    margin-top: 1rem;
    font-size: 0.94rem;
  }

  .hero-actions {
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 1.5rem;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-card-wrap {
    width: min(100%, 330px);
    margin-top: 0.4rem;
  }

  .hero-bauble {
    display: none;
  }

  .hero-mini-card {
    left: 0.3rem;
    bottom: -1.1rem;
  }

  .section {
    padding-block: 3rem;
  }

  .section-heading {
    margin-bottom: 1.8rem;
  }

  .access-card,
  .card {
    padding: 1.1rem;
    border-radius: 20px;
  }

  .access-form {
    gap: 0.6rem;
  }

  .access-form .btn {
    width: 100%;
  }

  .steps-grid {
    gap: 0.75rem;
  }

  .step-card {
    padding: 1.2rem;
  }

  .step-card h3 {
    margin-top: 2.5rem;
  }

  .organizer-main {
    padding-block: 1.5rem 5.5rem;
  }

  .organizer-intro {
    gap: 0.9rem;
    margin-bottom: 1.1rem;
  }

  .organizer-intro h1 {
    font-size: 2.45rem;
  }

  .intro-note {
    padding: 0.9rem 1rem;
  }

  .card-heading {
    margin-bottom: 0.85rem;
  }

  .card-heading h2 {
    font-size: 1.65rem;
  }

  .add-form {
    gap: 0.55rem;
  }

  .add-form .btn {
    width: 100%;
  }

  .participant-row {
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .number-badge {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 0.85rem;
  }

  .participant-name {
    font-size: 0.84rem;
  }

  .row-actions {
    gap: 0.1rem;
  }

  .icon-button {
    width: 34px;
    font-size: 0.66rem;
  }

  .draw-illustration {
    height: 112px;
  }

  .draw-idle h3 {
    font-size: 1.55rem;
  }

  .assignment-tools {
    flex-direction: column;
  }

  .assignment-tools .btn {
    width: 100%;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .assignment-table {
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.82rem;
  }

  .assignment-table thead {
    display: none;
  }

  .assignment-table tbody,
  .assignment-table tr,
  .assignment-table td {
    display: block;
    width: 100%;
  }

  .assignment-table tr {
    overflow: hidden;
    margin-bottom: 0.65rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--cream-50);
  }

  .assignment-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    border-top: 1px solid var(--pine-50);
    padding: 0.65rem 0.8rem;
    text-align: right;
  }

  .assignment-table td:first-child {
    border-top: 0;
    font-size: 0.95rem;
    font-weight: 700;
  }

  .assignment-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-align: left;
    text-transform: uppercase;
  }

  .assignment-table .link-actions {
    flex: 1;
    justify-content: flex-end;
  }

  .assignment-table .link-actions .btn {
    flex: 1;
    min-height: 38px;
  }

  .reset-card {
    padding: 1.1rem;
  }

  .reset-card .button-row {
    flex-direction: column;
  }

  .reset-card .button-row .btn {
    width: 100%;
  }

  .reveal-main {
    min-height: calc(100vh - 140px);
    padding-block: 1.4rem 3rem;
  }

  .reveal-card {
    border-radius: 22px;
    padding: 1.2rem;
  }

  .reveal-card h1 {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .gift-scene {
    width: min(270px, 80vw);
    height: 285px;
  }

  .gift-box {
    transform: scale(0.92);
  }

  .result-number {
    font-size: clamp(4rem, 20vw, 6rem);
  }

  .result-panel .button-row {
    flex-direction: column;
  }

  .result-panel .button-row .btn {
    width: 100%;
  }

  .toast-stack {
    bottom: calc(5rem + env(safe-area-inset-bottom));
  }

  .music-toggle {
    right: max(0.75rem, env(safe-area-inset-right));
    left: auto;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    width: 48px;
    height: 48px;
    min-height: 48px;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    transform: none;
  }

  .music-toggle #music-label {
    display: none;
  }

  .music-note {
    width: 30px;
    height: 30px;
    font-size: 1.1rem;
  }
}

@media (max-width: 380px) {
  .hero-card-wrap {
    width: min(100%, 300px);
  }

  .invite-number {
    font-size: 4rem;
  }

  .hero-copy h1 {
    font-size: 2.5rem;
  }

  .brand strong {
    font-size: 0.86rem;
  }

  .assignment-table td {
    padding: 0.6rem 0.65rem;
  }
}

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