:root {
  color-scheme: light;
  --ink: #163b32;
  --muted: #53685f;
  --green: #1d5947;
  --green-dark: #123f32;
  --red: #b3202a;
  --red-dark: #8f1620;
  --cream: #faf7ef;
  --line: #dbe2d9;
  --gold: #a76426;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #6e1420;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #a3232f 0, transparent 60%),
    linear-gradient(180deg, #7a1522 0, #4a1020 45%, #123f32 100%);
  background-attachment: fixed;
}

.symbols {
  position: absolute;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-repeat: repeat;
  animation: 24s linear infinite;
}

body::before {
  background-image: radial-gradient(circle, #fff 0 2px, transparent 2.6px),
    radial-gradient(circle, #ffffffcc 0 1.5px, transparent 2px);
  background-size: 140px 140px, 90px 90px;
  background-position: 0 0, 40px 50px;
  animation-name: snowfall-near;
}

body::after {
  background-image: radial-gradient(circle, #fff 0 3.5px, transparent 4.2px),
    radial-gradient(circle, #ffffff99 0 1px, transparent 1.6px);
  background-size: 230px 230px, 60px 60px;
  background-position: 90px 30px, 10px 20px;
  animation-name: snowfall-far;
  animation-duration: 38s;
}

@keyframes snowfall-near {
  to {
    background-position: 0 140px, 40px 140px;
  }
}

@keyframes snowfall-far {
  to {
    background-position: 90px 260px, 10px 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    animation: none;
  }
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

.page {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, 760px);
  margin: 0 auto;
  padding: 2.5rem 0 1.5rem;
}

.hero {
  text-align: center;
  margin-bottom: 2rem;
  color: #fff;
}

.hero-art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.reindeer {
  width: 64px;
  height: 64px;
}

.flipped {
  transform: scaleX(-1);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 96px;
  height: 96px;
  background: #fffaf0;
  border: 3px solid #f2d9a6;
  border-radius: 50%;
  box-shadow: 0 8px 24px #0004;
}

.brand-mark svg {
  width: 78px;
  height: 78px;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: #ffd98a;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 9vw, 4.4rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  text-shadow: 0 3px 14px #0006;
}

.intro {
  max-width: 470px;
  margin: 0.85rem auto 0;
  color: #fbe9e4;
  line-height: 1.65;
}

.hero-links {
  margin: 0.7rem 0 0;
  font-weight: 700;
}

.hero-links a {
  color: #fff;
  text-underline-offset: 3px;
  margin: 0 0.4rem;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 2.4rem 2rem 2rem;
  background: #fffefb;
  border: 1px solid #f0d9d4;
  border-radius: 22px;
  box-shadow: 0 16px 50px #0005;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 10px;
  background: repeating-linear-gradient(-45deg, var(--red) 0 10px, #fff 10px 20px);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.step {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: #fbe4e4;
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 700;
}

h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.optional {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}

label,
legend {
  font-size: 0.9rem;
  font-weight: 600;
}

.hint,
.empty {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.hint {
  margin: 0.4rem 0 0.8rem;
}

.empty {
  margin: 0.8rem 0;
}

textarea {
  display: block;
  width: 100%;
  min-height: 165px;
  resize: vertical;
  border: 1px solid #b8c6b9;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: #fff;
}

textarea::placeholder {
  color: #7d897f;
  font-weight: 300;
  opacity: 1;
}

textarea[aria-invalid="true"] {
  border-color: #aa342b;
}

.status {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.exclusions {
  margin-top: 1.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}

.people-picker {
  margin: 1rem 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.people-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.person-option {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.person-option:has(input:checked) {
  border-color: var(--green);
  background: #edf4e9;
}

.person-option input {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--green);
}

.rules {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--line);
}

h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.rule-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
}

select {
  min-width: 0;
  max-width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid #b8c6b9;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.check-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1.3rem;
  font-weight: 600;
}

.check-option input {
  width: 17px;
  height: 17px;
  margin: 0.15rem 0 0;
  accent-color: var(--green);
}

.hint-inline {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}

.full-actions {
  margin-bottom: 1rem;
}

.small {
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
}

.hidden-recipient {
  color: var(--muted);
  letter-spacing: 0.06em;
}

.selection-actions,
.draw-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}

.primary {
  background: var(--red);
  color: #fff;
  padding: 0.85rem 1.6rem;
  box-shadow: 0 4px 12px #b3202a44;
}

.primary:hover {
  background: var(--red-dark);
}

.secondary {
  background: #edf2e9;
  border-color: #ccd9c9;
  color: var(--green-dark);
}

.secondary:hover:not(:disabled) {
  background: #e1ebdb;
}

.text-button {
  background: transparent;
  color: var(--muted);
}

.text-button:hover:not(:disabled) {
  color: var(--ink);
  background: #f1f3ec;
}

.groups-list {
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
}

.group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.group-warning {
  display: block;
  color: #8b2e25;
  font-size: 0.8rem;
  margin-top: 0.3rem;
}

.group .button {
  flex-shrink: 0;
}

.draw-actions {
  padding-top: 1.3rem;
  margin-top: 1.3rem;
  border-top: 1px solid var(--line);
}

.privacy,
footer {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.privacy {
  margin: 1rem 0 0;
}

footer {
  text-align: center;
  margin-top: 1.4rem;
  color: #fbe9e4;
}

footer p {
  margin: 0.4rem 0 0;
}

.footer-art {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}

.footer-art .reindeer {
  width: 44px;
  height: 44px;
}

.results .eyebrow {
  color: var(--red);
}

.site-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.2rem;
  margin-top: 0.9rem;
  font-size: 0.85rem;
}

footer a {
  color: #ffe3b3;
  text-underline-offset: 3px;
}

footer a:hover,
footer a[aria-current="page"] {
  color: #fff;
}

.page-header {
  margin-bottom: 1.6rem;
  text-align: center;
  color: #fff;
}

.page-title {
  font-size: clamp(2.2rem, 7vw, 3.2rem);
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: #ffe3b3;
  font-size: 0.9rem;
  text-underline-offset: 3px;
}

.legal {
  line-height: 1.7;
}

.legal:focus {
  outline: none;
}

.legal h2 {
  margin: 1.8rem 0 0.5rem;
  color: var(--red);
}

.legal > :first-child {
  margin-top: 0;
}

.ad-slot {
  position: relative;
  z-index: 1;
  margin: 1.5rem auto 0;
  padding: 0.6rem 1rem 1rem;
  border-radius: 14px;
  text-align: center;
  background: rgba(255, 255, 255, 0.92);
  overflow: hidden;
}

.ad-label {
  margin: 0 0 0.4rem;
  color: var(--muted, #5b6b5f);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.adsbygoogle {
  display: block;
  min-height: 90px;
}

.link-button {
  padding: 0;
  border: 0;
  color: #ffe3b3;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  cursor: pointer;
}

.link-button:hover {
  color: #fff;
}

.legal p,
.legal li,
.legal dd {
  font-size: 0.95rem;
}

.legal dt {
  font-weight: 700;
  margin-top: 0.8rem;
}

.legal dd {
  margin: 0.2rem 0 0;
}

.legal a {
  color: var(--red-dark);
  text-underline-offset: 3px;
}

.contact-form label {
  display: block;
  margin: 1rem 0 0.4rem;
}

.contact-form input[type="text"] {
  display: block;
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid #b8c6b9;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
}

.contact-form .draw-actions {
  margin-top: 1rem;
}

.snow-ground {
  position: relative;
  z-index: 1;
  height: 70px;
  margin-top: 1rem;
  background: radial-gradient(circle at 50% 100%, #fff 0 36px, transparent 37px) 0 100% / 110px 70px repeat-x,
    linear-gradient(#fff, #fff) 0 100% / 100% 16px no-repeat;
}

.message {
  padding: 0.9rem 1rem;
  border-radius: 10px;
  font-size: 0.86rem;
  line-height: 1.6;
}

.error {
  background: #fbece7;
  border: 1px solid #e7b9ac;
  color: #8b2e25;
}

.notice {
  margin: 1.2rem 0 0;
  background: #f5f1e5;
  color: #695635;
}

.results {
  margin-top: 1.3rem;
}

.results-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: left;
}

th,
td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

th {
  font-size: 0.8rem;
  color: var(--muted);
  background: #f2f5ed;
}

td:last-child {
  font-weight: 600;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  padding: 0.7rem;
  background: #fff;
  color: var(--ink);
  z-index: 1;
}

.skip-link:focus {
  top: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 520px) {
  .page {
    padding-top: 1.8rem;
  }

  .card {
    padding: 1.25rem;
    border-radius: 16px;
  }

  .selection-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .group {
    gap: 0.4rem;
    padding-right: 0.4rem;
  }
}
