/* NameDraw — festive night-green page, warm paper cards. */

/* ---------- Fonts (self-hosted Fraunces, SIL OFL) ---------- */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../assets/fonts/fraunces-latin-full-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../assets/fonts/fraunces-latin-ext-full-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url(../assets/fonts/fraunces-latin-full-italic.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --night-1: #0d281f;
  --night-2: #12382b;
  --on-night: #f7efe1;
  --on-night-muted: #b9cbc1;
  --on-night-line: rgba(247, 239, 225, 0.14);
  --gold: #f2c14e;
  --red: #c0262f;
  --red-hover: #a51e27;

  --paper: #fffaf1;
  --paper-2: #f5ecdb;
  --ink: #1f2a24;
  --ink-2: #56635c;
  --ink-3: #7c8781;
  --line: #ebdfca;
  --line-strong: #d7c7a9;
  --field: #ffffff;
  --tab-on: #ffffff;
  --red-ink: #b3202a;
  --success: #24744b;
  --success-bg: #e2f2e7;
  --danger: #b3202a;
  --focus: #e3a52a;
  --focus-ring: rgba(227, 165, 42, 0.28);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2356635c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  --radius-lg: 22px;
  --shadow-card: 0 24px 48px -24px rgba(0, 0, 0, 0.55), 0 4px 14px -6px rgba(0, 0, 0, 0.25);
  --font-display: 'Fraunces', ui-serif, Georgia, 'Times New Roman', serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --card-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #142a21;
    --paper-2: #1c382d;
    --ink: #f3ece0;
    --ink-2: #bccbc2;
    --ink-3: #8b9d94;
    --line: #29463a;
    --line-strong: #3a5c4d;
    --field: #0f2219;
    --tab-on: #2b4d3f;
    --red-ink: #ff9b9b;
    --success: #79d6a0;
    --success-bg: rgba(121, 214, 160, 0.13);
    --danger: #ff9e9e;
    --focus-ring: rgba(242, 193, 78, 0.3);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bccbc2' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --shadow-card: 0 24px 48px -24px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --card-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  color-scheme: dark;
  background: var(--night-1);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  font: 400 1rem/1.55 var(--font-body);
  color: var(--on-night);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 520px at 50% -8%, rgba(242, 193, 78, 0.1), transparent 62%),
    radial-gradient(800px 640px at 100% 0%, #1b4a39 0%, transparent 62%),
    linear-gradient(180deg, var(--night-2) 0%, var(--night-1) 55%, #0a2019 100%);
}
.nowrap { white-space: nowrap; }
h1, h2, h3, p { overflow-wrap: break-word; }
img, svg { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: middle; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Atmosphere ---------- */
.snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.lights {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 46px;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.lights svg { display: block; }
.lights-wire { fill: none; stroke: #47685a; stroke-width: 1.8; }
.bulb {
  filter: drop-shadow(0 0 5px var(--glow));
  animation: twinkle 3s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ---------- Layout ---------- */
.wrap {
  width: min(100% - 32px, 760px);
  margin-inline: auto;
  position: relative;
  z-index: 2;
}
.wrap-narrow { width: min(100% - 32px, 560px); }
main { padding-bottom: 3rem; }
.site-header {
  position: relative;
  z-index: 2;
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: 54px 0 6px;
  display: flex;
}
.site-header-center { justify-content: center; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  color: var(--on-night);
  text-decoration: none;
  border-radius: 10px;
  padding: 2px 4px 2px 0;
}
.brand-mark { width: 28px; height: 28px; }
.site-footer {
  color: var(--on-night-muted);
  font-size: 0.875rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--on-night-line);
}
.site-footer p { margin: 0; display: flex; gap: 0.5rem; align-items: flex-start; }
.site-footer .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--gold); }

/* ---------- Type ---------- */
.eyebrow {
  margin: 0 0 0.6rem;
  font: 650 0.78rem/1.3 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  overflow-wrap: anywhere;
}
.hero-title {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.65rem, 9.5vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.025em;
  font-variation-settings: 'SOFT' 60;
}
.hero-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--gold);
  font-variation-settings: 'SOFT' 100, 'WONK' 1;
}
.page-title {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 6.5vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  font-variation-settings: 'SOFT' 50;
}
.lede-on-night {
  margin: 0 0 1rem;
  max-width: 36em;
  font-size: 1.075rem;
  color: var(--on-night-muted);
}
.section-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.65rem;
  letter-spacing: -0.01em;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.55rem 1.15rem;
  border: 1.5px solid var(--btn-border);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 650 0.975rem/1.2 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 1.15em; height: 1.15em; }
.btn-primary {
  --btn-bg: var(--red);
  --btn-fg: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 20px -10px rgba(192, 38, 47, 0.9);
}
.btn-primary:hover { --btn-bg: var(--red-hover); }
.btn-ghost { --btn-border: var(--line-strong); }
.btn-ghost:hover { --btn-bg: var(--paper-2); }
.btn-quiet { --btn-fg: var(--ink-2); }
.btn-quiet:hover { --btn-bg: var(--paper-2); --btn-fg: var(--ink); }
.btn-danger { --btn-bg: #b3202a; --btn-fg: #fff; }
.btn-danger:hover { --btn-bg: #8f1820; }
.btn-on-night { --btn-fg: var(--on-night); --btn-border: rgba(247, 239, 225, 0.3); }
.btn-on-night:hover { --btn-bg: rgba(247, 239, 225, 0.08); --btn-border: rgba(247, 239, 225, 0.5); }
.btn-quiet-on-night { --btn-fg: var(--on-night-muted); }
.btn-quiet-on-night:hover { --btn-fg: var(--on-night); --btn-bg: rgba(247, 239, 225, 0.07); }
.btn-danger-on-night { --btn-fg: #ffb8b8; }
.btn-danger-on-night:hover { --btn-bg: rgba(255, 120, 120, 0.1); --btn-border: rgba(255, 150, 150, 0.55); }
.btn-lg { min-height: 54px; padding: 0.8rem 1.6rem; font-size: 1.075rem; }
.btn-sm { min-height: 38px; padding: 0.4rem 0.85rem; font-size: 0.9rem; }
.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn .icon { width: 20px; height: 20px; }
.link-on-night {
  appearance: none;
  border: 0;
  background: none;
  padding: 0.35rem;
  color: var(--on-night-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-on-night:hover { color: var(--on-night); }

/* ---------- Cards ---------- */
.card {
  margin: 0 0 1.25rem;
  padding: clamp(1.15rem, 4.2vw, 1.75rem);
  border-radius: var(--radius-lg);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-card);
  color-scheme: var(--card-scheme);
}
.card a:not(.btn) { color: var(--red-ink); }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  flex-wrap: wrap;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.card-title .optional { margin-left: 0; }
.step-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--gold);
  color: #3b2a00;
  font: 750 0.9rem/1 var(--font-body);
}
.help { margin: 0.5rem 0 1rem; font-size: 0.925rem; color: var(--ink-2); }
.count-pill {
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 650;
  white-space: nowrap;
}
.count-pill.is-done { background: var(--success-bg); color: var(--success); }

/* ---------- Forms ---------- */
.field { margin-top: 1.1rem; }
.label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 650;
  font-size: 0.95rem;
}
.optional {
  margin-left: 0.2rem;
  font: 500 0.8rem/1 var(--font-body);
  color: var(--ink-3);
  letter-spacing: 0;
}
.input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--ink-3); opacity: 1; }
.input:hover { border-color: var(--ink-3); }
.input:focus, .input:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 4px var(--focus-ring);
}
.input[aria-invalid='true'] { border-color: var(--danger); }
textarea.input { min-height: 90px; resize: vertical; line-height: 1.45; }
input[type='date'].input { appearance: none; -webkit-appearance: none; }
input[type='date']::-webkit-date-and-time-value { text-align: left; }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.4rem;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 16px;
  text-overflow: ellipsis;
  cursor: pointer;
}
.field-error { margin: 0.4rem 0 0; font-size: 0.875rem; font-weight: 550; color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.925rem;
  color: var(--ink-2);
  cursor: pointer;
}
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--red); }

.page-head { margin: 0.75rem 0 1.5rem; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding: 0.25rem 0;
  color: var(--on-night-muted);
  font-weight: 650;
  font-size: 0.925rem;
  text-decoration: none;
  border-radius: 8px;
}
.back-link:hover { color: var(--on-night); }
.back-link .icon { width: 18px; height: 18px; }
.notice-on-night {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(242, 193, 78, 0.32);
  border-radius: 14px;
  background: rgba(242, 193, 78, 0.1);
  color: #f7e4b6;
  font-size: 0.925rem;
  text-align: left;
}
.notice-on-night .icon { width: 18px; height: 18px; margin-top: 0.15rem; color: var(--gold); }

/* Editor: people */
.people { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.6rem; }
.person-main { display: flex; align-items: center; gap: 0.5rem; }
.person-main .input { flex: 1; min-width: 0; }
.person > .field-error { margin-left: calc(36px + 0.5rem); }
.avatar {
  --hue: 150;
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: hsl(var(--hue) 70% 90%);
  color: hsl(var(--hue) 50% 26%);
  font: 750 0.95rem/1 var(--font-body);
  user-select: none;
}
.avatar.is-empty { background: var(--paper-2); color: var(--ink-3); }
@media (prefers-color-scheme: dark) {
  .avatar { background: hsl(var(--hue) 32% 26%); color: hsl(var(--hue) 75% 86%); }
}
.wish-toggle[aria-expanded='true'] { background: var(--paper-2); color: var(--ink); }
.wish-toggle.has-wish { color: var(--red-ink); }
.wish-toggle.has-wish::after {
  content: '';
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px var(--paper);
}
.wish-box {
  margin: 0.5rem 0 0.25rem calc(36px + 0.5rem);
  padding: 0.85rem;
  border-radius: 14px;
  background: var(--paper-2);
}
.wish-box .label { font-size: 0.875rem; }
.wish-box textarea.input { min-height: 70px; }
.wish-box .help { margin: 0.45rem 0 0; font-size: 0.85rem; }

/* Editor: exclusions */
.rules { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.75rem; }
.rules:empty { display: none; }
.rules-empty { font-style: italic; }
.rule { padding: 0.85rem; border-radius: 16px; background: var(--paper-2); }
.rule-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'a remove' 'word word' 'b b';
  gap: 0.45rem 0.6rem;
  align-items: center;
}
.rule-main > select:first-child { grid-area: a; }
.rule-main > select:nth-of-type(2) { grid-area: b; }
.rule-main > .icon-btn { grid-area: remove; }
.rule-word { grid-area: word; font-size: 0.875rem; font-weight: 650; color: var(--ink-2); padding-left: 0.2rem; }
@media (min-width: 560px) {
  .rule-main {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
    grid-template-areas: 'a word b remove';
  }
  .rule-word { padding: 0; }
}
.rule .icon-btn:hover { background: var(--paper); }
.rule .check { margin-top: 0.65rem; }
.rule .field-error { margin-top: 0.5rem; }

.form-error {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  border: 1.5px solid #f0b4b0;
  border-radius: 16px;
  background: #fff0ee;
  color: #6e1118;
  outline: none;
}
.form-error-icon {
  width: 24px;
  height: 24px;
  padding: 3px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  stroke-width: 3;
}
@media (prefers-color-scheme: dark) {
  .form-error { background: rgba(255, 110, 110, 0.12); border-color: rgba(255, 140, 140, 0.4); color: #ffd3d3; }
}
.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
@media (max-width: 559px) {
  .submit-row .btn { width: 100%; }
}

/* ---------- Home ---------- */
.hero { padding: clamp(1rem, 5vw, 2.75rem) 0 clamp(1.5rem, 5vw, 2.5rem); }
.hero-row { display: grid; align-items: center; gap: 1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.hero-art { display: none; }
.hero-art .gift-art { animation: gift-bob 4s ease-in-out infinite; }
@media (min-width: 640px) {
  .hero-row { grid-template-columns: minmax(0, 1fr) 190px; gap: 2rem; }
  .hero-art { display: block; margin-top: -2.5rem; }
}
.how, .faq { margin: 2.75rem 0; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  padding: 1.25rem;
  border: 1px solid var(--on-night-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-bottom: 0.75rem;
  border-radius: 50%;
  background: var(--gold);
  color: #3b2a00;
  font: 700 1.05rem/1 var(--font-display);
}
.step h3 { margin: 0 0 0.35rem; font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
.step p { margin: 0; color: var(--on-night-muted); font-size: 0.95rem; }
.faq-item { border-top: 1px solid var(--on-night-line); }
.faq-item:last-child { border-bottom: 1px solid var(--on-night-line); }
.faq-item summary {
  position: relative;
  padding: 1rem 2.25rem 1rem 0;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
  border-radius: 8px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0.3rem;
  top: 50%;
  translate: 0 -50%;
  font: 400 1.6rem/1 var(--font-body);
  color: var(--gold);
  transition: rotate 0.2s;
}
.faq-item[open] summary::after { rotate: 45deg; }
.faq-item p { margin: 0 0 1.1rem; max-width: 42em; color: var(--on-night-muted); }

.draw-list { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.draw-list li + li { border-top: 1px solid var(--line); }
.draw-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 -0.6rem;
  padding: 0.8rem 0.6rem;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}
.card a.draw-item { color: inherit; }
.draw-item:hover { background: var(--paper-2); }
.draw-item-icon { width: 34px; height: 34px; flex: none; }
.draw-item-text { display: grid; flex: 1; min-width: 0; }
.draw-item-name { font-weight: 650; overflow-wrap: anywhere; }
.draw-item-meta { font-size: 0.875rem; color: var(--ink-2); }
.draw-item-arrow { width: 20px; height: 20px; color: var(--ink-3); }
.your-draws .help { margin-bottom: 0; }

/* ---------- Dashboard ---------- */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.85rem 0 0; padding: 0; }
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(247, 239, 225, 0.16);
  border-radius: 999px;
  background: rgba(247, 239, 225, 0.08);
  color: var(--on-night);
  font-size: 0.9rem;
  font-weight: 550;
}
.chips .icon { width: 16px; height: 16px; color: var(--gold); }
.banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: 16px;
}
.banner > .icon { width: 22px; height: 22px; margin-top: 0.1rem; }
.banner-success {
  border: 1px solid rgba(242, 193, 78, 0.38);
  background: linear-gradient(135deg, rgba(242, 193, 78, 0.2), rgba(242, 193, 78, 0.07));
  color: var(--on-night);
}
.banner-success > .icon { color: var(--gold); }
.progress {
  height: 8px;
  margin: 0.9rem 0 0;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
}
.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2e8a5a, #4cb07a);
  transition: width 0.45s ease;
}
.send-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.send-row {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}
.send-row:last-child { border-bottom: 1px solid var(--line); }
.send-who { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.send-name { flex: 1; min-width: 0; font-weight: 650; overflow-wrap: anywhere; }
.sent-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.7rem;
  border: 0;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  font: 650 0.8rem/1 var(--font-body);
  white-space: nowrap;
  cursor: pointer;
}
.sent-toggle .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.send-row.is-sent .sent-toggle { background: var(--success-bg); color: var(--success); }
.send-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-left: calc(36px + 0.7rem);
}
@media (max-width: 479px) {
  .send-actions .btn:not(.btn-primary) { width: 40px; padding: 0; }
  .send-actions .btn:not(.btn-primary) span {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}
@media (min-width: 720px) {
  .send-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .send-actions { padding-left: 0; justify-content: flex-end; }
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 1rem 0 1.15rem;
  padding: 4px;
  border-radius: 999px;
  background: var(--paper-2);
}
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.45rem 0.75rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: 650 0.95rem/1.2 var(--font-body);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.tab .icon { width: 18px; height: 18px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected='true'] {
  background: var(--tab-on);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 6px 14px -8px rgba(0, 0, 0, 0.35);
}
.tab-panel > .help:first-child { margin-top: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem 1rem; }
.panel-head .help { margin: 0; }
@media (max-width: 559px) { .panel-head { flex-direction: column; } }
.link-field {
  margin-top: 0.85rem;
  min-height: 44px;
  background: var(--paper-2);
  color: var(--ink-2);
  font: 500 0.875rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-overflow: ellipsis;
}
.share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.75rem; }
.share-actions .btn-primary, .send-actions .btn-primary { order: -1; }
@media (max-width: 479px) {
  .share-actions .btn { flex: 1 1 0; }
  .share-actions .btn-primary { flex-basis: 100%; }
}
.panel-head .count-pill { display: inline-flex; align-items: center; gap: 0.3rem; }
.panel-head .count-pill .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.trust-note {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-top: 1.1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 0.9rem;
}
.trust-note > .icon { width: 18px; height: 18px; margin-top: 0.15rem; color: var(--red-ink); }
.trust-note p { margin: 0; }
.trust-note strong { color: var(--ink); }
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--red-ink);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.customize { margin-top: 1.1rem; }
.customize summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  color: var(--ink-2);
  font-weight: 650;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  border-radius: 8px;
}
.customize summary::-webkit-details-marker { display: none; }
.customize summary:hover { color: var(--ink); }
.customize summary .icon { width: 18px; height: 18px; }
.customize-body { margin-top: 0.6rem; }
.customize-body .help { margin: 0.5rem 0; }
.card code {
  padding: 0.08rem 0.35rem;
  border-radius: 6px;
  background: var(--paper-2);
  font: 600 0.85em/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.card-split { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; align-items: center; }
.card-split > .btn { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 640px) {
  .card-split { grid-template-columns: auto minmax(0, 1fr) auto; }
  .card-split > .btn { grid-column: auto; }
}
.split-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--paper-2);
  color: var(--red-ink);
}
.split-icon .icon { width: 26px; height: 26px; }
.split-text p { margin: 0.25rem 0 0; color: var(--ink-2); font-size: 0.95rem; }
.manage { margin: 2rem 0 0; }
.manage-title {
  margin: 0 0 0.75rem;
  font: 650 0.78rem/1.3 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-night-muted);
}
.manage-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---------- Pass the phone ---------- */
.name-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem;
  margin: 1rem 0;
  padding: 0;
}
.name-tile {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 62px;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 16px;
  background: var(--field);
  color: var(--ink);
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.name-tile:hover { border-color: var(--focus); box-shadow: 0 8px 18px -12px rgba(0, 0, 0, 0.5); }
.name-tile:active { transform: translateY(1px); }
.name-tile-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.name-tile.is-seen { border-style: dashed; background: var(--paper-2); color: var(--ink-2); }
.name-tile-check { display: inline-flex; color: var(--success); }
.name-tile.is-mine { border-color: var(--gold); }
.name-tile-tag {
  flex: none;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.picker { margin: 1.5rem 0 0; text-align: left; }
.picker .name-grid { margin: 0; }
.name-tile-check .icon { width: 20px; height: 20px; stroke-width: 2.6; }

/* ---------- Reveal ---------- */
.invite { padding: 0.75rem 0 1rem; text-align: center; }
.invite-head .chips { justify-content: center; }
.invite .lede-on-night { margin-inline: auto; }
.invite-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.5rem, 11vw, 3.7rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  font-variation-settings: 'SOFT' 80;
}
.invite-head .notice-on-night { max-width: 30rem; margin-inline: auto; }
.note {
  max-width: 30rem;
  margin: 1.5rem auto 0;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(247, 239, 225, 0.16);
  border-radius: 18px;
  background: rgba(247, 239, 225, 0.07);
  text-align: left;
}
.note figcaption {
  margin-bottom: 0.35rem;
  font: 650 0.74rem/1.3 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.note blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: anywhere;
  font-variation-settings: 'SOFT' 100;
}
.gift-stage { display: grid; justify-items: center; margin-top: 1.25rem; }
.gift {
  width: min(76vw, 290px);
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.gift-art { display: block; width: 100%; height: auto; overflow: visible; }
.gift .gift-art {
  transform-origin: 50% 92%;
  animation: gift-bob 3.2s ease-in-out infinite, gift-wiggle 5.5s ease-in-out 1.2s infinite;
}
.gift-lid, .gift-box {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: transform 0.35s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.gift:hover .gift-lid, .gift:focus-visible .gift-lid { transform: translateY(-8px) rotate(-2.5deg); }
.gift-glow { opacity: 0; transform-box: fill-box; transform-origin: center; }
.gift-sparkles path { transform-box: fill-box; transform-origin: center; animation: sparkle 2.4s ease-in-out infinite; }
.gift-sparkles path:nth-child(2) { animation-delay: 0.6s; }
.gift-sparkles path:nth-child(3) { animation-delay: 1.2s; }
.gift-sparkles path:nth-child(4) { animation-delay: 1.8s; }
@keyframes gift-bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}
@keyframes gift-wiggle {
  0%, 80%, 100% { rotate: 0deg; }
  83% { rotate: -5deg; }
  86% { rotate: 5deg; }
  89% { rotate: -3deg; }
  92% { rotate: 2deg; }
}
@keyframes sparkle {
  0%, 100% { opacity: 0.2; transform: scale(0.55); }
  50% { opacity: 1; transform: scale(1); }
}
.is-opening .gift .gift-art { animation: none; }
.is-opening .gift-lid {
  transform: translate(22px, -150px) rotate(30deg);
  opacity: 0;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.25, 1), opacity 0.4s 0.3s;
}
.is-opening .gift-box {
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.45s 0.25s, opacity 0.4s 0.3s;
}
.is-opening .gift-glow { animation: glow-burst 0.8s ease-out forwards; }
.is-opening .gift-shadow, .is-opening .gift-sparkles { opacity: 0; transition: opacity 0.3s; }
@keyframes glow-burst {
  0% { opacity: 0; transform: scale(0.3); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.35); }
}
.gift-hint {
  margin: 1rem 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-variation-settings: 'SOFT' 100;
}
.gift-fine { max-width: 26rem; margin: 0; color: var(--on-night-muted); font-size: 0.9rem; }

.reveal-result { display: grid; justify-items: center; gap: 1.25rem; margin-top: 1.75rem; }
.tag-wrap {
  position: relative;
  max-width: calc(100% - 2.75rem);
  margin-left: 2.75rem;
  transform: rotate(-3deg);
  transform-origin: 27px 50%;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.45));
}
.tag {
  position: relative;
  min-width: min(250px, 100%);
  padding: 1.35rem 1.8rem 1.5rem 3.4rem;
  background: linear-gradient(170deg, #fffaf0 0%, #f6e7c8 100%);
  color: #2a1f14;
  text-align: left;
  clip-path: polygon(1.65rem 0, 100% 0, 100% 100%, 1.65rem 100%, 0 50%);
}
.tag-hole {
  position: absolute;
  left: 20px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--night-1);
  box-shadow: 0 0 0 3px #e3c27c, inset 0 2px 3px rgba(0, 0, 0, 0.5);
}
.tag-string {
  position: absolute;
  left: -43px;
  top: calc(50% - 34px);
  width: 80px;
  height: 60px;
  overflow: visible;
  pointer-events: none;
}
.tag-title { margin: 0; outline: none; }
.tag-label {
  display: block;
  margin: 0 0 0.4rem;
  font: 700 0.74rem/1.3 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a6a3c;
}
.tag-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(2.5rem, 12vw, 3.9rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: #b3202a;
  overflow-wrap: anywhere;
  font-variation-settings: 'SOFT' 100, 'WONK' 1;
}
.reveal-result.is-in .tag-wrap { animation: tag-swing 1.1s cubic-bezier(0.3, 1.6, 0.45, 1) both; }
.reveal-result.is-in > :not(.tag-wrap) { animation: fade-up 0.5s ease-out 0.35s both; }
@keyframes tag-swing {
  0% { opacity: 0; transform: translateY(-40px) rotate(-22deg); }
  45% { opacity: 1; }
  100% { transform: translateY(0) rotate(-3deg); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.wishlist {
  width: 100%;
  max-width: 30rem;
  padding: 1rem 1.2rem;
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-card);
  color-scheme: var(--card-scheme);
}
.wishlist h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}
.wishlist h3 .icon { width: 20px; height: 20px; color: var(--red-ink); }
.wishlist p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.wishlist a { color: var(--red-ink); font-weight: 600; }
.hush { margin: 0; color: var(--on-night-muted); }
.invite-foot { margin: 3rem 0 0; color: var(--on-night-muted); font-size: 0.925rem; }
.invite-foot a { color: var(--gold); font-weight: 600; }
.invite-broken { padding-top: 2rem; }
.invite-broken .lede-on-night { margin-bottom: 1.5rem; }
.empty { padding: 2rem 0; }
.empty .btn { margin-top: 0.5rem; }

/* ---------- Dialogs & toasts ---------- */
.dialog {
  width: min(100% - 32px, 440px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.65);
  color-scheme: var(--card-scheme);
}
.dialog[open] { animation: dialog-in 0.2s ease-out; }
.dialog::backdrop { background: rgba(4, 18, 12, 0.66); backdrop-filter: blur(3px); }
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.dialog-body { padding: 1.5rem; }
.dialog-title {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.2;
}
.dialog p { margin: 0 0 0.6rem; color: var(--ink-2); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.6rem; margin-top: 1.25rem; }
.match-list { list-style: none; max-height: 55dvh; margin: 0.25rem 0 0; padding: 0; overflow: auto; }
.match-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.6rem;
  align-items: center;
  padding: 0.6rem 0;
  border-top: 1px solid var(--line);
}
.match-giver, .match-receiver { font-weight: 650; overflow-wrap: anywhere; }
.match-receiver { color: var(--red-ink); }
.match-arrow { width: 18px; height: 18px; color: var(--ink-3); }
.copy-fallback {
  width: 100%;
  padding: 0.7rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  font: 0.85rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}
.toasts {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 70;
  display: grid;
  gap: 0.5rem;
  width: min(100% - 32px, 420px);
  translate: -50% 0;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: #fffaf1;
  color: #1f2a24;
  box-shadow: 0 16px 32px -12px rgba(0, 0, 0, 0.6);
  font-weight: 650;
  font-size: 0.95rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.is-in { opacity: 1; transform: none; }
.toast .icon { width: 20px; height: 20px; color: #24744b; stroke-width: 2.6; }
.toast-error { background: #7d1219; color: #fff; }
.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 60;
  pointer-events: none;
}

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