:root {
  --bg: #12382a;
  --bg-deep: #0b2a1f;
  --paper: #fffaf2;
  --ink: #2b2118;
  --muted: #7a6a58;
  --line: #e6d8c3;
  --red: #a32222;
  --red-dark: #7f1717;
  --green: #1f5a3a;
  --gold: #d9a441;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  background: radial-gradient(ellipse at top, #1d5540 0%, var(--bg) 45%, var(--bg-deep) 100%) fixed;
}

/* Snow: two layers of dots drifting down. Pure CSS, sits behind the cards. */
.snow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 20px 30px, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 110px 80px, #fff 50%, transparent 51%),
    radial-gradient(3px 3px at 170px 140px, rgba(255, 255, 255, 0.8) 50%, transparent 51%),
    radial-gradient(2px 2px at 60px 190px, rgba(255, 255, 255, 0.7) 50%, transparent 51%),
    radial-gradient(3px 3px at 230px 40px, rgba(255, 255, 255, 0.6) 50%, transparent 51%);
  background-size: 260px 260px;
  opacity: 0.55;
  animation: snow 22s linear infinite;
}

@keyframes snow {
  to {
    background-position: 0 260px, 0 260px, 0 520px, 0 260px, 0 520px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .snow {
    animation: none;
  }
}

.wrap {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.wrap.wide {
  max-width: 760px;
}

.top {
  text-align: center;
  padding: 4px 0 18px;
}

.langs {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin: 0 0 10px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.lang {
  min-width: 40px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 245, 225, 0.85);
  text-decoration: none;
  border: 1px solid rgba(255, 245, 225, 0.3);
}

a.lang:hover {
  background: rgba(255, 255, 255, 0.12);
}

.lang.on {
  background: var(--gold);
  border-color: var(--gold);
  color: #3a2a08;
}

.brand {
  color: #fff5e1;
  text-decoration: none;
  font-size: 30px;
  font-weight: bold;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.tree {
  display: inline-block;
}

/* ---------- Angus cows ---------- */

.farm {
  display: block;
  width: 100%;
  max-width: 330px;
  height: auto;
  margin: 6px auto -6px;
  overflow: visible;
}

.cow-fill,
.cow-far,
.cow-muzzle {
  stroke: #fff5e1;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.cow-fill {
  fill: #151515;
}

.cow-far {
  fill: #2b2b2b;
}

.cow-muzzle {
  fill: #3d3434;
  stroke-width: 0;
}

.cow-line {
  fill: none;
  stroke: #151515;
  stroke-width: 3;
  stroke-linecap: round;
}

.tuft {
  stroke-width: 3.5;
}

.cow-ear {
  fill: #e9a3a3;
}

.cow-blush {
  fill: #f29a9a;
  opacity: 0.55;
}

.hat {
  fill: #c62828;
  stroke: #fff5e1;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.hat-trim {
  fill: #fff5e1;
}

.fir-fill {
  fill: #2f6b45;
  stroke: #fff5e1;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.fir-snow {
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.snow-hill {
  fill: #fffaf2;
}

.flake {
  fill: #fff;
  opacity: 0.8;
}

.bubble {
  fill: #fff5e1;
}

.moo text {
  font: 700 11px system-ui, -apple-system, "Segoe UI", sans-serif;
  fill: var(--red-dark);
}

.tail {
  transform-box: fill-box;
  transform-origin: 80% 0;
  animation: swish 3.2s ease-in-out infinite;
}

.calf .tail {
  animation-duration: 2.4s;
  animation-delay: -1s;
}

@keyframes swish {
  0%,
  60%,
  100% {
    transform: rotate(0deg);
  }
  75% {
    transform: rotate(14deg);
  }
  88% {
    transform: rotate(-6deg);
  }
}

.moo {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: moo 6s ease-in-out infinite;
}

@keyframes moo {
  0%,
  8%,
  100% {
    opacity: 0;
    transform: scale(0.6);
  }
  14%,
  46% {
    opacity: 1;
    transform: scale(1);
  }
  54% {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* The calf peeking over the top edge of a card. */
.card.hero {
  position: relative;
  margin-top: 46px;
}

.peek {
  position: absolute;
  top: -50px;
  right: 22px;
  width: 78px;
  height: auto;
  pointer-events: none;
}

.peek .ear-l,
.peek .ear-r {
  transform-box: fill-box;
  animation: flick 4.5s ease-in-out infinite;
}

.peek .ear-l {
  transform-origin: 100% 50%;
}

.peek .ear-r {
  transform-origin: 0% 50%;
  animation-delay: -2.2s;
}

@keyframes flick {
  0%,
  80%,
  100% {
    transform: rotate(0deg);
  }
  86% {
    transform: rotate(-14deg);
  }
  92% {
    transform: rotate(6deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tail,
  .peek .ear-l,
  .peek .ear-r {
    animation: none;
  }

  .moo {
    animation: none;
    opacity: 1;
  }
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 20px;
  margin: 0 0 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.card.hero {
  border-top: 6px solid var(--red);
}

.card.small {
  padding: 14px 20px;
  font-size: 16px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 10px;
  text-wrap: balance;
}

h1 {
  font-size: 28px;
  color: var(--red-dark);
}

h2 {
  font-size: 21px;
  color: var(--green);
}

h3 {
  font-size: 18px;
}

p {
  margin: 0 0 12px;
}

.muted,
.hint {
  color: var(--muted);
  font-size: 15px;
}

.hint {
  font-weight: normal;
}

.opt {
  color: var(--muted);
  font-weight: normal;
  font-size: 15px;
}

.count {
  display: inline-block;
  min-width: 30px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--gold);
  color: #3a2a08;
  font-size: 16px;
  text-align: center;
  vertical-align: middle;
  font-family: system-ui, sans-serif;
}

.names {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.names li {
  background: #f3ecdf;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 14px;
  overflow-wrap: anywhere;
}

.stack {
  display: grid;
  gap: 14px;
}

label {
  display: block;
  font-weight: bold;
  font-size: 16px;
}

label input,
label textarea,
label .hint {
  display: block;
  margin-top: 5px;
}

input,
textarea {
  width: 100%;
  font: inherit;
  font-size: 17px;
  font-weight: normal;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #cdbda6;
  border-radius: 10px;
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

input[readonly] {
  background: #f3ecdf;
  color: var(--muted);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn {
  display: inline-block;
  width: fit-content;
  font: inherit;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  background: var(--red);
  border: 0;
  border-radius: 999px;
  padding: 12px 24px;
  cursor: pointer;
  text-decoration: none;
  list-style: none;
}

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

.btn[disabled] {
  background: #b9ab98;
  cursor: not-allowed;
}

.btn.ghost {
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--green);
}

.btn.ghost:hover {
  background: #eaf3ec;
}

.btn.danger {
  background: #fff;
  color: var(--red-dark);
  border: 1.5px solid var(--red);
}

.btn.danger:hover {
  background: #fbeaea;
}

.btn.tiny {
  font-size: 14px;
  padding: 6px 12px;
}

.wrap > form > .btn.ghost {
  color: #fff5e1;
  border-color: rgba(255, 245, 225, 0.6);
}

.wrap > form > .btn.ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

summary {
  cursor: pointer;
}

.card.small summary {
  color: var(--green);
  font-weight: bold;
}

.card.small[open] summary {
  margin-bottom: 12px;
}

.reveal summary::-webkit-details-marker {
  display: none;
}

.reveal[open] summary {
  display: none;
}

.result {
  text-align: center;
  padding: 8px 0 0;
  animation: pop 0.5s ease-out;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
}

.receiver {
  font-size: 40px;
  font-weight: bold;
  color: var(--green);
  line-height: 1.15;
  margin: 0 0 16px;
  overflow-wrap: anywhere;
}

.wishes {
  background: #f3ecdf;
  border-radius: 12px;
  padding: 12px 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: left;
  margin: 0 0 14px;
}

.psst {
  margin: 0;
}

.notice {
  border-radius: 12px;
  padding: 11px 14px;
  background: #e5f2e8;
  border: 1px solid #b7d8bf;
  color: #17452c;
  font-size: 16px;
}

.notice.err {
  background: #fbeaea;
  border-color: #eab9b9;
  color: var(--red-dark);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

.tablewrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

th,
td {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-family: system-ui, sans-serif;
}

td.right {
  text-align: right;
}

td .muted {
  overflow-wrap: anywhere;
}

.badge {
  display: inline-block;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #efe6d6;
  color: var(--muted);
  white-space: nowrap;
}

.badge.ok {
  background: #e5f2e8;
  color: #17452c;
}

.badge.err {
  background: #fbeaea;
  color: var(--red-dark);
}

.foot {
  text-align: center;
  color: rgba(255, 245, 225, 0.75);
  font-size: 14px;
  padding: 10px 0 0;
}
