:root {
  color-scheme: light;
  --cream: #fff8e9;
  --snow: #fffdf7;
  --ink: #232a28;
  --muted: #5e635c;
  --pine: #203a34;
  --pine-dark: #102823;
  --red: #a92c40;
  --gold: #f7cf78;
  --border: #ded0b6;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  background: var(--pine-dark);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 18%, #fff8e9 1px, transparent 2px) 0 0 / 67px 83px,
    radial-gradient(circle at 72% 42%, #f7cf78a3 1px, transparent 2px) 0 0 / 107px 101px,
    radial-gradient(ellipse at 50% 0, #315a48, var(--pine-dark) 55%);
}
.stage { width: min(100% - 2rem, 69rem); margin-inline: auto; padding-block: 1.5rem; }
.stage[data-surface="participant"] { max-width: 49rem; }
.card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 1.35rem;
  padding: clamp(1.1rem, 4vw, 2rem);
  box-shadow: 0 16px 40px #07161166;
  position: relative;
}
h1, h2, p { margin-block: 0; }
.card h2 { font-size: clamp(1.4rem, 4vw, 1.85rem); margin: .3rem 0 .75rem; }
.card p + p { margin-top: .45rem; }
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 14rem;
  padding: 2.4rem clamp(1.1rem, 4vw, 2.5rem) 2.1rem;
  margin-bottom: 1.4rem;
  border: 1px solid #edc774ad;
  border-bottom: .45rem solid #e9e9cd;
  border-radius: 1.4rem;
  background: linear-gradient(114deg, #762238, #3e2338 51%, #213c3c);
  color: var(--snow);
  box-shadow: 0 16px 38px #05171277;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -24px 0 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 38%, #fff8e975 1px, transparent 2px) 0 0 / 69px 61px,
    radial-gradient(circle at 65% 80%, #f7cf7880 2px, transparent 3px) 0 0 / 83px 89px;
  animation: snowfall 10s linear infinite;
}
@keyframes snowfall { to { transform: translateY(24px); } }
.hero.compact { min-height: 9rem; }
.hero-copy { z-index: 1; }
.hero h1 {
  margin: .4rem 0;
  font-family: Georgia, "Apple SD Gothic Neo", serif;
  font-size: clamp(1.9rem, 5.6vw, 3.15rem);
  letter-spacing: -.06em;
  line-height: 1.08;
  word-break: keep-all;
}
.hero-subtitle { color: #ffedda; }
.eyebrow {
  font-weight: 800;
  letter-spacing: .15em;
  font-size: .7rem;
  color: #8e3343;
}
.hero .eyebrow { color: var(--gold); }
.santa-art { width: min(44%, 20rem); height: auto; }
.hero.compact .santa-art { width: min(27%, 12rem); }
.lights {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1.5rem;
  border-top: 2px solid #edc7747a;
  background:
    radial-gradient(ellipse at 50% 27%, #f7cf78 0 14%, transparent 17%) 0 0 / 94px 25px,
    radial-gradient(ellipse at 50% 31%, #91e3a8 0 14%, transparent 18%) 31px 0 / 94px 25px,
    radial-gradient(ellipse at 50% 17%, #ff8493 0 14%, transparent 18%) 62px 0 / 94px 25px;
  filter: drop-shadow(0 0 7px #fbd48d);
}
.ticket {
  max-width: 37rem;
  margin-inline: auto;
  border-top: 6px solid transparent;
  background: linear-gradient(var(--cream), var(--cream)) padding-box,
    repeating-linear-gradient(-45deg, var(--red) 0 10px, var(--snow) 10px 20px, #3a7160 20px 30px, var(--snow) 30px 40px) border-box;
}
.stack { display: grid; gap: 1rem; margin-top: 1.1rem; }
.inline, .actions, .toolbar, .event-actions { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }
.add-form { margin-block: 1rem; align-items: end; }
.field { display: grid; gap: .35rem; min-width: 0; }
.field-label { font-weight: 750; font-size: .92rem; }
input, select, button { font: inherit; }
input, select {
  width: 100%;
  min-height: 2.6rem;
  color: var(--ink);
  background: var(--snow);
  border: 1px solid #96886d;
  border-radius: .62rem;
  padding: .45rem .7rem;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: .48rem .9rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  background-color: var(--red);
  color: #fff;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.button[hidden] { display: none; }
.button:hover { filter: brightness(.9); }
.button:disabled { opacity: .65; cursor: wait; }
.button.secondary { background: var(--snow); border-color: #85938a; color: var(--pine); }
.button.warning { color: #8c132c; border-color: #b46972; }
.button.danger { background-color: #841c31; }
.hint { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.notice {
  color: #532033;
  background: #fff0d9;
  border: 1px solid #e7b465;
  border-radius: .65rem;
  padding: .7rem 1rem;
  margin: 0 auto 1rem;
  overflow-wrap: anywhere;
}
.stage[data-surface="participant"] .notice { max-width: 37rem; }
.waiting, .result { text-align: center; }
.waiting .button { margin-top: 1rem; }
.tree { width: min(72%, 15rem); margin: 0 auto .35rem; }
.recipient { color: var(--red); font-size: clamp(1.65rem, 6vw, 2.6rem); font-weight: 850; overflow-wrap: anywhere; }
.gender { font-size: 1.1rem; }
.gift { width: 7.5rem; height: 6.4rem; position: relative; margin: 0 auto .7rem; }
.gift-lid, .gift-base {
  position: absolute;
  left: 0;
  border-radius: .25rem;
  background: linear-gradient(90deg, #a92c40 0 42%, var(--gold) 42% 58%, #bd3b54 58%);
  box-shadow: 0 7px 16px #992a4333;
}
.gift-base { inset: auto .45rem .25rem; height: 3.1rem; }
.gift-lid { width: 100%; height: 1rem; top: 2.25rem; transform: translate(1rem, -1.4rem) rotate(15deg); animation: unwrap .65s ease-out; }
.sparkles { top: 1.5rem; left: .5rem; position: absolute; color: #99560d; animation: sparkle .8s ease-out; }
@keyframes unwrap { from { transform: none; } }
@keyframes sparkle { from { opacity: 0; transform: scale(.8); } }
.toolbar { justify-content: space-between; }
.toolbar h2 { margin: 0; }
.link-row { overflow-wrap: anywhere; }
.shared { color: #18544b; }
.badge { display: inline-block; padding: .25rem .55rem; background: #eee4d0; border-radius: 100px; white-space: nowrap; font-size: .82rem; }
.badge.joined { background: #d8eadb; color: #234937; }
.roster-scroll { overflow-x: auto; margin-block: 1rem; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .65rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.entry-label { min-width: 5rem; overflow-wrap: anywhere; }
.gender-form { flex-wrap: nowrap; }
.gender-form input { min-width: 4rem; }
.gender-form .button, .actions .button { white-space: nowrap; }
.event-actions { margin-top: 1rem; }
.danger-zone { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.confirmation {
  width: min(100% - 2rem, 30rem);
  padding: 1.4rem;
  border: 2px solid #d69467;
  background: var(--cream);
  color: var(--ink);
  border-radius: 1rem;
}
.confirmation p { margin-block: .7rem 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.confirmation::backdrop { background: #071611bb; }
.footer { text-align: center; margin-top: 1.35rem; color: #f0d9af; font-size: .68rem; font-weight: 750; letter-spacing: .18em; }
:focus-visible { outline: 3px solid #136189; outline-offset: 3px; }
.hero :focus-visible { outline-color: var(--gold); }
@media (max-width: 34rem) {
  .hero { flex-direction: column-reverse; text-align: center; min-height: 0; padding-top: 1.6rem; }
  .santa-art { width: min(65%, 14rem); }
  .hero.compact { flex-direction: row; text-align: left; }
  .hero-subtitle { font-size: .9rem; }
  .roster-scroll table, .roster-scroll tbody { display: block; }
  .roster-scroll thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .roster-scroll tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-bottom: 1px solid var(--border); }
  .roster-scroll th, .roster-scroll td { border: 0; }
  .entry-gender { grid-column: 1 / -1; }
  .entry-gender::before { content: "성별"; display: block; font-size: .78rem; font-weight: 750; margin-bottom: .35rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hero::before, .gift-lid, .sparkles { animation: none; }
}
