/* =========================================================================
   Pickwick Advent - cozy Christmas theme
   ========================================================================= */

:root {
  --night-0: #081120;
  --night-1: #0e1d33;
  --night-2: #1a2d4d;

  --red: #c8323a;
  --red-deep: #7c121a;
  --green: #1f5b3a;
  --green-deep: #123d27;
  --gold: #e6b450;
  --gold-soft: #f4d78e;
  --gold-deep: #b78423;
  --cream: #fbf3e2;
  --ink: #3b2416;

  --font-display: "Mountains of Christmas", Georgia, serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-family: var(--font-sans);
  line-height: 1.5;
  color: var(--cream);
  background-color: var(--night-1);
  background-image:
    radial-gradient(ellipse 70% 45% at 50% 62%, rgba(255, 176, 92, .15), transparent 70%),
    linear-gradient(180deg, var(--night-0) 0%, var(--night-1) 38%, var(--night-2) 76%, #2a3f66 100%);
  background-attachment: fixed;
}

body:has(dialog[open]) { overflow: hidden; }

button { font: inherit; }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Night sky ---------- */

.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.stars { position: absolute; inset: 0; }
.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 4px rgba(255, 255, 255, .8);
  animation: star-twinkle var(--d, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.moon {
  position: absolute;
  top: 110px;
  right: 17vw;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  box-shadow: inset -16px 8px 0 0 #fbf0c9;
  filter: drop-shadow(0 0 22px rgba(251, 240, 201, .45));
  transform: rotate(-12deg);
}

#snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 40;
  pointer-events: none;
}

/* ---------- String lights ---------- */

.lights {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 96px;
  z-index: 20;
  pointer-events: none;
  overflow: visible;
}
.lights .wire { fill: none; stroke: #173323; stroke-width: 2.2; }
.lights .hook { fill: #173323; }
.bulb { filter: drop-shadow(0 0 4px currentColor) drop-shadow(0 0 10px currentColor); }
.bulb-glass {
  fill: currentColor;
  animation: twinkle var(--t, 2.8s) ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
.bulb-cap { fill: #2b3a30; }
.bulb-shine { fill: #fff; opacity: .55; }

/* ---------- Hanging ornaments ---------- */

.ornaments {
  position: absolute;
  top: 0;
  width: 0;
  height: 0;
  z-index: 18;
  pointer-events: none;
}
.ornaments--left { left: 0; }
.ornaments--right { right: 0; }

.ornament {
  position: absolute;
  top: 0;
  left: var(--x);
  width: 0;
  transform-origin: 0 0;
  animation: swing var(--dur, 6s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.ornament::before {
  content: "";
  position: absolute;
  top: 0;
  left: -.75px;
  width: 1.5px;
  height: calc(var(--len) + 3px);
  background: linear-gradient(#e7cf96, #b39054);
}
.ornament svg {
  position: absolute;
  top: var(--len);
  left: calc(var(--size) / -2);
  width: var(--size);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45));
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 10;
  padding: 150px 16px 0;
  text-align: center;
}

.mistletoe {
  position: absolute;
  top: 0;
  left: 50%;
  width: 104px;
  margin-left: -52px;
  transform-origin: 50% 0;
  animation: sway 7s ease-in-out infinite;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35));
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  margin: 0;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.kicker svg { width: 28px; height: 22px; }
.kicker .flip { transform: scaleX(-1); }

.title {
  margin: .08em 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.9rem, 8.5vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: .01em;
  color: var(--gold-soft);
  background: linear-gradient(180deg, #fff6d6 0%, var(--gold-soft) 35%, var(--gold) 72%, #c98d2a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 rgba(70, 30, 0, .55)) drop-shadow(0 0 22px rgba(246, 200, 100, .35));
}

.subtitle {
  max-width: 34rem;
  margin: .6rem auto 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.02rem, 2.2vw, 1.22rem);
  color: rgba(251, 243, 226, .88);
  text-wrap: balance;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin: 18px 0 0;
  padding: 6px 18px 6px 8px;
  border-radius: 999px;
  border: 1px solid rgba(246, 215, 142, .35);
  background: rgba(255, 245, 225, .08);
  box-shadow: 0 0 30px rgba(255, 190, 100, .12);
  font-weight: 700;
  text-align: left;
  color: var(--cream);
}
.mug { flex: none; width: 40px; height: 40px; overflow: visible; }
.steam path {
  opacity: 0;
  animation: steam 3.2s ease-in-out infinite;
}
.steam path:nth-child(2) { animation-delay: -1.1s; }
.steam path:nth-child(3) { animation-delay: -2.2s; }

/* ---------- The house: main house with a west and an east wing ---------- */

.board-wrap {
  position: relative;
  z-index: 10;
  flex: 1 0 auto;
  width: 100%;
  max-width: 1240px;
  margin: 34px auto 0;
  /* room for the eaves and the candy-cane hooks */
  padding: 0 clamp(18px, 4.8vw, 46px);
}

/* the house is the size reference for everything on it */
.house { container: house / inline-size; }

/* Every window is --cell wide. Each part of the house is exactly as wide as its windows,
   gaps and side padding, so wing + main house + wing add up to the full width. */
.house-row {
  --wing-cols: 2;
  --wing-rows: 3;
  --main-cols: 4;
  --main-rows: 5;
  --gap: clamp(9px, 1.9cqi, 22px);
  --pad-w: clamp(10px, 2.4cqi, 30px);
  --pad-m: clamp(14px, 3.4cqi, 40px);
  --cols-all: calc(2 * var(--wing-cols) + var(--main-cols));
  --cell: calc((100cqi - 1px - 4 * var(--pad-w) - 2 * var(--pad-m) - (var(--cols-all) - 3) * var(--gap)) / var(--cols-all));
  --row-h: calc(var(--cell) * .92);
  --wing-w: calc(var(--wing-cols) * var(--cell) + (var(--wing-cols) - 1) * var(--gap) + 2 * var(--pad-w));
  --main-w: calc(var(--main-cols) * var(--cell) + (var(--main-cols) - 1) * var(--gap) + 2 * var(--pad-m));
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
/* narrow screens: slimmer wings, 3-column main house */
@container house (max-width: 640px) {
  .house-row { --wing-cols: 1; --wing-rows: 5; --main-cols: 3; --main-rows: 6; }
}

.bldg {
  position: relative;
  flex: none;
}
.bldg--main { z-index: 2; width: var(--main-w); }
.bldg--wing { z-index: 1; width: var(--wing-w); }

/* roofs: wider than the walls so the eaves overhang; the bottom 30 units of each drawing
   (the icing drips) hang over the top of the wall */
.roof {
  position: relative;
  z-index: 2;
  display: block;
  width: 108%;
  height: auto;
  aspect-ratio: 1000 / 250;
  margin: 0 -4% -3.24%;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 6px 6px rgba(20, 5, 0, .35));
}
.roof--wing {
  width: 112%;
  aspect-ratio: 520 / 160;
  margin: 0 -6% -6.46%;
}
.peppermint {
  transform-box: fill-box;
  transform-origin: center;
  animation: spin 30s linear infinite;
}

.wall {
  --stripe-red: #d3333b;
  --stripe-white: #fdf3e8;
  position: relative;
  z-index: 1;
  padding: calc(var(--eave) + clamp(10px, 1.8cqi, 20px)) var(--pad) clamp(18px, 3.2cqi, 36px);
  border-radius: 0 0 14px 14px;
  background-color: var(--stripe-white);
  background-image:
    linear-gradient(180deg, rgba(70, 0, 10, .38), rgba(70, 0, 10, 0) 80px),
    linear-gradient(90deg, rgba(90, 10, 20, .22), transparent 6%, transparent 94%, rgba(90, 10, 20, .22)),
    linear-gradient(180deg, transparent 75%, rgba(90, 10, 20, .16)),
    repeating-linear-gradient(-45deg,
      var(--stripe-red) 0 24px, var(--stripe-white) 24px 31px,
      var(--stripe-red) 31px 34px, var(--stripe-white) 34px 48px);
}
.bldg--main .wall {
  --pad: var(--pad-m);
  --eave: calc(var(--main-w) * .0324);
  box-shadow:
    0 0 28px rgba(40, 0, 8, .45),
    0 28px 60px rgba(0, 0, 0, .45),
    0 0 110px rgba(255, 170, 80, .2);
}
.bldg--wing .wall {
  --pad: var(--pad-w);
  --eave: calc(var(--wing-w) * .0646);
  box-shadow: 0 24px 50px rgba(0, 0, 0, .45), 0 0 80px rgba(255, 170, 80, .14);
}
/* the wings sit a little further back: slightly darker, in the main house's shadow */
.bldg--wing .wall::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.bldg--west .wall { border-radius: 0 0 0 14px; }
.bldg--east .wall { border-radius: 0 0 14px 0; }
.bldg--west .wall::before { background: linear-gradient(270deg, rgba(40, 0, 8, .4), rgba(40, 0, 8, .12) 30%, rgba(40, 0, 8, .08)); }
.bldg--east .wall::before { background: linear-gradient(90deg, rgba(40, 0, 8, .4), rgba(40, 0, 8, .12) 30%, rgba(40, 0, 8, .08)); }

/* snow drift the whole house stands in */
.house-row::after {
  content: "";
  position: absolute;
  left: -2.5%;
  right: -2.5%;
  bottom: -18px;
  z-index: 3;
  height: 30px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 30' preserveAspectRatio='none'%3E%3Cpath fill='%23fff' d='M0 30V20C6 12 18 10 30 13C44 5 64 6 76 12C92 6 108 6 120 12C136 4 158 5 170 12C186 6 204 7 214 12C230 4 250 5 262 12C278 6 296 6 308 12C322 5 342 5 352 12C366 6 384 8 392 14C398 16 400 20 400 22V30Z'/%3E%3Cpath fill='%23dbe7f4' d='M0 30V26Q200 17 400 26V30Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  filter: drop-shadow(0 -2px 3px rgba(60, 0, 10, .25));
  pointer-events: none;
}

/* candy canes on the corners, hooks curling out under the eaves */
.cane {
  --cw: clamp(8px, 2cqi, 24px);
  --cane-red: #d12f38;
  --cane-white: #fff8f0;
  position: absolute;
  top: calc(var(--eave) * .4 + var(--cw) * 1.4);
  bottom: -12px;
  left: 0;
  z-index: 2;
  width: var(--cw);
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(90, 0, 10, .28), rgba(255, 255, 255, .55) 32%, rgba(255, 255, 255, 0) 58%, rgba(90, 0, 10, .32)),
    repeating-linear-gradient(150deg,
      var(--cane-red) 0 calc(var(--cw) * .5), var(--cane-white) calc(var(--cw) * .5) calc(var(--cw) * .75),
      var(--cane-red) calc(var(--cw) * .75) calc(var(--cw) * .85), var(--cane-white) calc(var(--cw) * .85) calc(var(--cw) * 1.1));
  filter: drop-shadow(3px 4px 3px rgba(60, 0, 10, .35));
  pointer-events: none;
}
.cane::before {
  /* the hook: the top half of a striped ring */
  content: "";
  position: absolute;
  left: calc(var(--cw) * -1.8);
  top: calc(var(--cw) * -1.4);
  width: calc(var(--cw) * 2.8);
  height: calc(var(--cw) * 2.8);
  border-radius: 50%;
  background:
    radial-gradient(closest-side, transparent 52%, rgba(255, 255, 255, .55) 68%, transparent 84%),
    repeating-conic-gradient(var(--cane-red) 0 14deg, var(--cane-white) 14deg 26deg);
  -webkit-mask: radial-gradient(closest-side, transparent calc(28.6% - .5px), #000 28.6%, #000 calc(100% - .5px), transparent 100%);
          mask: radial-gradient(closest-side, transparent calc(28.6% - .5px), #000 28.6%, #000 calc(100% - .5px), transparent 100%);
  clip-path: inset(0 0 50% 0);
}
.cane::after {
  /* rounded tip of the hook */
  content: "";
  position: absolute;
  left: calc(var(--cw) * -1.8);
  top: calc(var(--cw) * -.5);
  width: var(--cw);
  height: var(--cw);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #fff, var(--cane-white) 45%, #f0c9c3);
}
.cane--r {
  left: auto;
  right: 0;
  transform: scaleX(-1);
}
/* the main house's canes stand on the corners where the wings join */
.bldg--main .cane--l { left: calc(var(--cw) * -.5); }
.bldg--main .cane--r { right: calc(var(--cw) * -.5); }

/* ---------- Window grid ---------- */

.doors {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows), var(--row-h));
  grid-auto-rows: var(--row-h);
  grid-auto-flow: row dense;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bldg--wing .doors { --cols: var(--wing-cols); --rows: var(--wing-rows); }
.bldg--main .doors { --cols: var(--main-cols); --rows: var(--main-rows); }

/* each window: an icing frame around a dark "hole" */
.slot {
  --frame: clamp(3px, .55cqi, 6px);
  --shape: 12px;
  position: relative;
  border-radius: var(--shape);
  background: #3a140e;
  box-shadow:
    0 0 0 var(--frame) #fffaf2,
    0 0 0 calc(var(--frame) + 1.5px) rgba(140, 20, 30, .3),
    0 6px 12px calc(var(--frame) - 1px) rgba(70, 0, 10, .35),
    inset 0 3px 8px rgba(0, 0, 0, .65);
}
/* snowy window sill */
.slot::after {
  content: "";
  position: absolute;
  left: calc(var(--frame) * -2);
  right: calc(var(--frame) * -2);
  top: calc(100% + var(--frame) - 2px);
  height: clamp(5px, .85cqi, 9px);
  border-radius: 99px;
  background: linear-gradient(#fff, #dfe9f5);
  box-shadow: 0 2px 3px rgba(60, 0, 10, .3);
  pointer-events: none;
}
.slot--wide { grid-column: span 2; }
.slot--open { z-index: 2; }
.slot--today { z-index: 3; }

/* bottom of the main house: tall window, front door, tall window */
.slot--tall,
.slot--grand {
  /* arched top: --arch-y is how far down the arch reaches */
  --shape: 50% 50% 10px 10px / var(--arch-y) var(--arch-y) 10px 10px;
  grid-row: 4 / span 2;
}
.slot--tall { --arch-y: 25%; }
.slot--tall-l { grid-column: 1; }
.slot--tall-r { grid-column: 4; }
.slot--grand {
  --arch-y: 26%;
  grid-column: 2 / span 2;
}
/* the front door has a doorstep instead of a sill */
.slot--grand::after {
  left: -16%;
  right: -16%;
  top: calc(100% + var(--frame));
  height: clamp(9px, 1.4cqi, 15px);
  border-radius: 4px;
  background: linear-gradient(#fff, #f2d9d3);
  box-shadow: 0 3px 0 #c9918b, 0 6px 8px rgba(40, 0, 5, .3);
}

@container house (max-width: 640px) {
  .bldg--wing .slot--wide { grid-column: span 1; }
  .slot--tall { grid-row: 5 / span 2; }
  .slot--tall-r { grid-column: 3; }
  .slot--grand { grid-column: 2; grid-row: 5 / span 2; }
}

.door {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: none;
  color: inherit;
  cursor: pointer;
  perspective: 900px;
  container: door / size;
  -webkit-tap-highlight-color: transparent;
}
.door:focus-visible {
  outline: 3px solid var(--gold-soft);
  outline-offset: 3px;
}

/* what's behind the door */
.door-inside {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 42%, #fff4c8 0%, #f2c46a 42%, #a8641f 100%);
  box-shadow: inset 0 0 18px rgba(80, 30, 0, .6);
  opacity: 0;
  transition: opacity .25s;
}
.door.is-open .door-inside { opacity: 1; }
.thumb {
  /* the cut-out tea-bag label, propped up inside the window */
  position: absolute;
  top: 11%;
  left: 11%;
  width: 78%;
  height: 78%;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(70, 30, 0, .5));
  transform: rotate(-3deg);
}
.slot:nth-child(even) .thumb { transform: rotate(2.5deg); }
.door-inside.no-thumb::after {
  content: "";
  position: absolute;
  inset: 25%;
  background: #8a4a14;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9h13v5a6 6 0 0 1-6 6H10a6 6 0 0 1-6-6Z'/%3E%3Cpath d='M17 11h1.5a2.5 2.5 0 0 1 0 5H17' fill='none' stroke='black' stroke-width='1.8'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9h13v5a6 6 0 0 1-6 6H10a6 6 0 0 1-6-6Z'/%3E%3Cpath d='M17 11h1.5a2.5 2.5 0 0 1 0 5H17' fill='none' stroke='black' stroke-width='1.8'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .55;
}

/* the door leaf (or two leaves for double doors) */
.leaf {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  transform-style: preserve-3d;
  transform-origin: left center;
  transition: transform .95s cubic-bezier(.3, .75, .25, 1);
}
.door--double .leaf { width: 50%; }
.door--double .leaf--r { left: 50%; transform-origin: right center; }

.leaf-front,
.leaf-back {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.leaf-front {
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .35);
}
.leaf-back {
  transform: rotateY(180deg);
  background:
    repeating-linear-gradient(90deg, rgba(150, 110, 60, .08) 0 2px, transparent 2px 7px),
    linear-gradient(90deg, #e3d0a8, #f6ead0);
  box-shadow: inset 0 0 0 2px rgba(120, 80, 30, .3);
}
.door--double .leaf--l .leaf-front,
.door--double .leaf--l .leaf-back { border-radius: 10px 3px 3px 10px; }
.door--double .leaf--r .leaf-front,
.door--double .leaf--r .leaf-back { border-radius: 3px 10px 10px 3px; }

/* the artwork spans the whole door, each leaf shows its half */
.face {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--door-bg);
}
.door--double .face { width: 200%; }
.door--double .leaf--r .face { left: -100%; }
.face::after {
  /* inner edge + bevel, drawn on the face so it frames the whole door */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  box-shadow:
    inset 0 0 0 2px var(--door-edge, rgba(255, 255, 255, .3)),
    inset 0 2px 0 3px rgba(255, 255, 255, .08),
    inset 0 -5px 0 rgba(0, 0, 0, .18);
  pointer-events: none;
}

/* door knob */
.leaf-front::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 6%;
  width: max(6px, 6.5cqmin);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6d5, var(--gold) 50%, var(--gold-deep));
  box-shadow: 0 1px 2px rgba(0, 0, 0, .45);
  transform: translateY(-50%);
}
.door--double .leaf-front::after { top: 87%; }
.door--grand .leaf-front::after { top: 73%; }
.door--double .leaf--r .leaf-front::after { right: auto; left: 6%; }

.num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: clamp(18px, 44cqmin, 90px);
  line-height: 1;
  color: var(--door-fg);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .22);
}
.door--double .num { left: 0; right: 0; }

.deco {
  position: absolute;
  width: 21cqmin;
  height: 21cqmin;
  color: var(--door-deco);
  opacity: .9;
}
.deco--a { top: 8cqmin; left: 8cqmin; }
.deco--b { right: 8cqmin; bottom: 8cqmin; width: 15cqmin; height: 15cqmin; transform: rotate(14deg); }
.door--double .deco--a { left: 5%; }
.door--double .deco--b { right: 5%; }

/* --- door styles --- */
.door--red {
  --door-bg: linear-gradient(160deg, #cf3a42, #9a1a22);
  --door-edge: rgba(230, 180, 80, .9);
  --door-fg: var(--gold-soft);
  --door-deco: var(--gold);
}
.door--green {
  --door-bg: linear-gradient(160deg, #2e7f50, #164a2e);
  --door-edge: rgba(220, 240, 225, .55);
  --door-fg: var(--cream);
  --door-deco: #f4fbf6;
}
.door--cream {
  --door-bg:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .8), transparent 60%),
    linear-gradient(160deg, #fffaf0, #eddcb9);
  --door-edge: rgba(185, 140, 80, .7);
  --door-fg: #b3202a;
  --door-deco: #2f7d4f;
}
.door--navy {
  --door-bg:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, .75) 0 1px, transparent 1.6px) 0 0 / 18px 18px,
    radial-gradient(circle at 70% 60%, rgba(255, 236, 190, .6) 0 1px, transparent 1.6px) 0 0 / 23px 23px,
    linear-gradient(160deg, #26457a, #13254a);
  --door-edge: rgba(230, 180, 80, .7);
  --door-fg: var(--gold-soft);
  --door-deco: var(--gold);
}
.door--gift {
  --door-bg:
    linear-gradient(90deg, transparent calc(50% - 7%), #c8323a calc(50% - 7%) calc(50% + 7%), transparent calc(50% + 7%)),
    linear-gradient(0deg, transparent calc(50% - 8%), #c8323a calc(50% - 8%) calc(50% + 8%), transparent calc(50% + 8%)),
    radial-gradient(circle, rgba(255, 255, 255, .5) 1px, transparent 1.5px) 0 0 / 9px 9px,
    linear-gradient(160deg, #3c8f5c, #1f5b3a);
  --door-edge: rgba(255, 240, 210, .55);
}
.door--tartan {
  --door-bg:
    repeating-linear-gradient(0deg, rgba(14, 60, 34, .6) 0 9px, transparent 9px 22px, rgba(255, 226, 150, .28) 22px 24px, transparent 24px 34px),
    repeating-linear-gradient(90deg, rgba(14, 60, 34, .6) 0 9px, transparent 9px 22px, rgba(255, 226, 150, .28) 22px 24px, transparent 24px 34px),
    #a81f28;
  --door-edge: rgba(255, 226, 150, .55);
}
.door--mint {
  --door-bg: repeating-linear-gradient(135deg, #f3fff7 0 11px, #2f9a62 11px 22px);
  --door-edge: rgba(20, 90, 50, .45);
}
/* number "tag" for the busy patterns */
.door--gift .num span,
.door--tartan .num span,
.door--mint .num span {
  display: grid;
  place-items: center;
  width: 1.75em;
  aspect-ratio: 1;
  border-radius: 50%;
  font-size: .58em;
  color: var(--red-deep);
  background: radial-gradient(circle at 35% 30%, #fffdf7, #f3e3c2);
  box-shadow: 0 3px 6px rgba(0, 0, 0, .3), inset 0 0 0 2px var(--gold);
  text-shadow: none;
}

/* Real windows: warm room light behind curtains, two casements with glazing bars,
   frost in the corners and the number in snow spray on the glass. */
.door--window {
  --sash: #fffaf2;
  --sash-w: max(3px, 5cqmin);
  --bar: max(2px, 3.6cqmin);
  --door-bg:
    /* scalloped valance */
    radial-gradient(circle at 50% 0, #a51d26 0 58%, #7c121a 62%, transparent 64%) 0 0 / max(12px, 16cqmin) max(8px, 10cqmin) repeat-x,
    /* curtains, tied back */
    radial-gradient(ellipse 25% 70% at 0 16%, #c8323a 0 84%, #8e1820 95%, transparent 100%),
    radial-gradient(ellipse 25% 70% at 100% 16%, #c8323a 0 84%, #8e1820 95%, transparent 100%),
    /* warm lamp light low in the room, dimmer higher up */
    radial-gradient(ellipse 70% 55% at 50% 100%, #ffe7a6 0%, #f6b552 45%, rgba(246, 181, 82, 0) 100%),
    linear-gradient(180deg, #7a2c12 0%, #b4521c 45%, #e08a34 100%);
  --door-edge: transparent;
  --door-fg: #fff;
  --door-deco: #fff;
  --frost: 48% 14%;
}
/* each casement: white sash, glazing bar, frost in the bottom corners */
.door--window .leaf-front::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  --bars: linear-gradient(transparent calc(50% - var(--bar) / 2), var(--sash) 0 calc(50% + var(--bar) / 2), transparent 0);
  background:
    radial-gradient(ellipse var(--frost) at 0 100%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0)),
    radial-gradient(ellipse var(--frost) at 100% 100%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0)),
    var(--bars);
  box-shadow:
    inset 0 0 0 var(--sash-w) var(--sash),
    inset 0 0 0 calc(var(--sash-w) + 1.5px) rgba(150, 80, 30, .3);
  pointer-events: none;
}
/* wide windows: an extra upright bar in each casement */
@container door (min-aspect-ratio: 8 / 5) {
  .door--window .leaf-front::before {
    --bars:
      linear-gradient(90deg, transparent calc(50% - var(--bar) / 2), var(--sash) 0 calc(50% + var(--bar) / 2), transparent 0),
      linear-gradient(transparent calc(50% - var(--bar) / 2), var(--sash) 0 calc(50% + var(--bar) / 2), transparent 0);
  }
}
/* tall windows: three rows of panes */
@container door (max-aspect-ratio: 3 / 4) {
  .door--window .leaf-front::before {
    --bars:
      linear-gradient(transparent calc(36% - var(--bar) / 2), var(--sash) 0 calc(36% + var(--bar) / 2), transparent 0),
      linear-gradient(transparent calc(68% - var(--bar) / 2), var(--sash) 0 calc(68% + var(--bar) / 2), transparent 0);
  }
}
/* opened casements show their glass */
.door--window .leaf-back {
  background: linear-gradient(160deg, rgba(225, 240, 255, .55), rgba(255, 255, 255, .14) 55%, rgba(205, 228, 255, .38));
  box-shadow:
    inset 0 0 0 var(--sash-w) var(--sash),
    inset 0 0 0 calc(var(--sash-w) + 1.5px) rgba(150, 80, 30, .3);
}
/* a little latch where the casements meet */
.door--window .leaf-front::after {
  top: 50%;
  z-index: 2;
  width: max(4px, 4cqmin);
}
.door--double.door--window .leaf--l .leaf-front::after { right: calc(var(--sash-w) * .15); }
.door--double.door--window .leaf--r .leaf-front::after { left: calc(var(--sash-w) * .15); }
/* the number sits in a frosty patch of snow spray on the glass */
.door--window .num { z-index: 2; }
.door--window .num span {
  display: grid;
  place-items: center;
  width: 1.85em;
  aspect-ratio: 1;
  border-radius: 50%;
  font-size: .64em;
  color: #a51d26;
  background: radial-gradient(closest-side, #fff 0 58%, rgba(255, 255, 255, .75) 72%, rgba(255, 255, 255, 0) 100%);
  text-shadow: none;
}
/* snow-spray stars and flakes only where there is room (wide windows) */
.door--window .deco { display: none; }
@container door (min-aspect-ratio: 8 / 5) {
  .door--window .deco { display: block; z-index: 2; width: 26cqmin; height: 26cqmin; filter: drop-shadow(0 0 3px rgba(255, 255, 255, .9)); }
  .door--window .deco--a { top: 18%; left: 22%; }
  .door--window .deco--b { right: 22%; bottom: 20%; width: 20cqmin; height: 20cqmin; }
}
/* tall windows: a wreath hangs on the glass, the number below it */
.slot--tall .door--window .deco--a {
  display: block;
  z-index: 2;
  top: calc(36% - 31cqmin);
  left: 50%;
  width: 62cqmin;
  height: 62cqmin;
  opacity: 1;
  transform: translateX(-50%);
  filter: drop-shadow(0 3px 3px rgba(80, 20, 0, .4));
}
.slot--tall .door--window .num { top: 40%; }

/* What stands in the room behind the glass. It is drawn on the face, so each casement
   carries its half when the window opens, behind the glazing bars and the frost. */
.door--window .face::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--glass-art, none);
  pointer-events: none;
}
/* The casements meet in a sash bar down the middle, so small things stand in the middle
   of one casement (about 25% / 75%), not in the centre. Lighter frost where things stand. */
.door--window[class*="glass--"] { --frost: 30% 9%; }
/* pillar candles on a tray in one casement, a taper in the other; the number moves up */
.glass--candles {
  --glass-art:
    url("../img/glass-candles.svg") 8% 96% / auto 30% no-repeat,
    url("../img/glass-candle.svg") 81% 97% / auto 42% no-repeat;
}
.glass--candles .num { top: -28%; }
/* two paper stars hanging from the curtain rail; the number moves down */
.glass--star {
  --glass-art:
    url("../img/glass-star.svg") 13% 0 / auto 54% no-repeat,
    url("../img/glass-star.svg") 83% 0 / auto 42% no-repeat;
}
.glass--star .num { top: 32%; }
/* tall windows: a taper candle in each casement, under the wreath */
.glass--candle {
  --glass-art:
    url("../img/glass-candle.svg") 16% 98% / auto 24% no-repeat,
    url("../img/glass-candle.svg") 84% 98% / auto 24% no-repeat;
}
.slot--tall .glass--candle .num { top: 28%; }
/* Scandinavian candle bridge across the middle, the number up on the left pane */
.glass--bridge { --glass-art: url("../img/glass-bridge.svg") 50% 93% / auto 62% no-repeat; }
.glass--bridge .num { top: -34%; right: 50%; }
/* a little tree on one side, presents on the other */
.glass--tree {
  --glass-art:
    url("../img/glass-tree.svg") 13% 97% / auto 84% no-repeat,
    url("../img/glass-presents.svg") 87% 95% / auto 36% no-repeat;
}
/* the cat, a candle and fairy lights */
.glass--cat {
  --glass-art:
    url("../img/glass-garland.svg") 50% 1% / 100% auto no-repeat,
    url("../img/glass-cat.svg") 15% 97% / auto 62% no-repeat,
    url("../img/glass-candle.svg") 85% 97% / auto 64% no-repeat;
}
.door--window.glass--bridge .deco,
.door--window.glass--tree .deco,
.door--window.glass--cat .deco { display: none; }

/* arched doors and windows: each leaf gets its half of the arch */
.slot--tall .leaf--l .leaf-front,
.slot--tall .leaf--r .leaf-back,
.slot--grand .leaf--l .leaf-front,
.slot--grand .leaf--r .leaf-back { border-radius: 100% 3px 3px 10px / var(--arch-y) 3px 3px 10px; }
.slot--tall .leaf--r .leaf-front,
.slot--tall .leaf--l .leaf-back,
.slot--grand .leaf--r .leaf-front,
.slot--grand .leaf--l .leaf-back { border-radius: 3px 100% 10px 3px / 3px var(--arch-y) 10px 3px; }
.slot--tall .face::after,
.slot--grand .face::after { border-radius: 50% 50% 10px 10px / var(--arch-y) var(--arch-y) 10px 10px; }

/* Christmas Eve: the chocolate front door */
.door--grand {
  --door-bg:
    radial-gradient(ellipse at 50% 30%, rgba(255, 210, 150, .28), transparent 62%),
    repeating-linear-gradient(90deg, rgba(255, 220, 180, .14) 0 2px, transparent 2px calc(25% - 3px), rgba(20, 5, 0, .35) calc(25% - 3px) 25%),
    repeating-linear-gradient(180deg, rgba(255, 220, 180, .14) 0 2px, transparent 2px calc(16.66% - 3px), rgba(20, 5, 0, .35) calc(16.66% - 3px) 16.66%),
    linear-gradient(160deg, #84482a, #4a2414);
  --door-edge: var(--gold);
  --door-fg: var(--gold-soft);
  --door-deco: var(--gold);
}
.door--grand .face::before {
  content: "";
  position: absolute;
  inset: 6cqmin;
  border: 2px dashed rgba(246, 215, 142, .7);
  border-radius: 50% 50% 8px 8px / 26% 26% 8px 8px;
}
.door--grand .num {
  top: 4%;
  font-size: clamp(30px, 34cqmin, 110px);
}
.door--grand .deco--a {
  top: 9cqmin;
  left: 50%;
  width: 28cqmin;
  height: 28cqmin;
  opacity: 1;
  transform: translateX(-50%);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35));
}
.door--grand .deco--b { display: none; }
.grand-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10cqmin;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(12px, 9cqmin, 28px);
  color: var(--gold-soft);
}

/* --- states --- */
.door.is-open .leaf--l { transform: rotateY(-108deg); }
.door.is-open .leaf--r { transform: rotateY(108deg); }

@media (hover: hover) {
  .door:not(.is-locked):not(.is-open):hover .leaf--l { transform: rotateY(-16deg); }
  .door:not(.is-locked):not(.is-open):hover .leaf--r { transform: rotateY(16deg); }
}

.door::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
}
.door.is-waiting:not(.is-open)::after {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(246, 215, 142, .55), 0 0 16px 3px rgba(246, 200, 90, .35);
}
.door.is-today:not(.is-open)::after {
  opacity: 1;
  animation: glow 2.2s ease-in-out infinite;
}

.today-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  z-index: 4;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #4a2a0a;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity .3s;
}
.door.is-today:not(.is-open) .today-badge { opacity: 1; }

.door.wiggle { animation: wiggle .5s ease-in-out; }

.no-anim .leaf,
.no-anim .door-inside { transition: none !important; }

.spark {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 6;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 8px currentColor;
  animation: spark .9s ease-out forwards;
}

/* ---------- Under the board ---------- */

.board-base {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: calc(-1 * clamp(16px, 3vw, 34px)) 6px 0;
  pointer-events: none;
}

.base-group {
  display: flex;
  align-items: flex-end;
  gap: clamp(0px, .5vw, 8px);
}

/* piles of presents in the snow */
.presents {
  flex: none;
  width: clamp(70px, 8.5vw, 124px);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .35));
}

.gingerbread {
  flex: none;
  width: clamp(62px, 10vw, 104px);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .4));
}
.gingerbread--left { animation: bob 3.4s ease-in-out infinite; }
.gingerbread--wave { transform: rotate(5deg); }
.gb-wave-arm {
  transform-origin: 64px 50px;
  animation: wave 1.8s ease-in-out infinite;
}

.progress {
  margin: 0 0 8px;
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid rgba(246, 215, 142, .35);
  background: rgba(14, 29, 51, .78);
  font-size: .95rem;
  font-weight: 700;
  text-align: center;
  pointer-events: auto;
}

/* ---------- Village ---------- */

.village {
  position: relative;
  z-index: 5;
  height: clamp(200px, 24vw, 340px);
  margin-top: -30px;
  pointer-events: none;
}
.village > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tree-star { filter: drop-shadow(0 0 6px #ffd76a) drop-shadow(0 0 14px rgba(255, 215, 106, .6)); }
.tree-lights circle {
  filter: drop-shadow(0 0 3px currentColor);
  animation: twinkle 2.6s ease-in-out infinite;
}
.tree-lights circle:nth-child(3n) { animation-delay: -.9s; }
.tree-lights circle:nth-child(3n + 1) { animation-delay: -1.7s; }
.tree-lights circle:nth-child(4n) { animation-duration: 3.4s; }
.smoke { filter: blur(1.5px); }
.smoke circle {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: smoke 6s ease-out infinite;
}
.smoke circle:nth-child(2) { animation-delay: -2s; }
.smoke circle:nth-child(3) { animation-delay: -4s; }

/* reindeer walking through the snow, left to right */
.herd {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(4px, .8vw, 12px);
  height: 0;
}
.herd-line {
  position: absolute;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: flex-end;
  gap: clamp(10px, 2vw, 30px);
  width: max-content;
  animation: herd-walk 110s linear infinite;
  animation-delay: -38s;
}
.reindeer {
  --w: clamp(84px, 8vw, 128px);
  display: block;
  width: var(--w);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 5px 4px rgba(20, 40, 70, .3));
}
.reindeer--calf { width: calc(var(--w) * .64); }
.rd-leg { animation: rd-step 1.1s ease-in-out infinite alternate; }
.rd-leg--fn { transform-origin: 100px 80px; }
.rd-leg--ff { transform-origin: 94px 80px; animation-delay: -1.1s; }
.rd-leg--bn { transform-origin: 51px 76px; animation-delay: -1.1s; }
.rd-leg--bf { transform-origin: 58px 76px; }
.rd-body { animation: rd-bob .55s ease-in-out infinite alternate; }
.rd-head {
  transform-origin: 114px 34px;
  animation: rd-nod 2.2s ease-in-out infinite;
}
/* the calf takes quicker little steps */
.reindeer--calf .rd-leg { animation-duration: .8s; }
.reindeer--calf .rd-leg--ff,
.reindeer--calf .rd-leg--bn { animation-delay: -.8s; }
.reindeer--calf .rd-body { animation-duration: .4s; }
.reindeer--calf .rd-head { animation-duration: 1.6s; }
.reindeer--grey .rd-leg { animation-delay: -.4s; }
.reindeer--grey .rd-leg--ff,
.reindeer--grey .rd-leg--bn { animation-delay: -1.5s; }

/* distant reindeer on the hills: hazier, slower */
.far-herd { filter: saturate(.6) brightness(1.06) contrast(.9); }
.far-walk { animation: far-walk 320s linear infinite; animation-delay: -150s; }
.far-calf .rd-leg { animation-duration: .8s; }
.far-calf .rd-leg--ff,
.far-calf .rd-leg--bn { animation-delay: -.8s; }
.rd-graze {
  transform-origin: 100px 64px;
  animation: rd-graze 11s ease-in-out infinite;
  animation-delay: var(--graze-delay, 0s);
}

.credit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  margin: 0;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
  color: #6a7f9c;
}

/* ---------- Dialog ---------- */

.dialog {
  width: min(520px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
  color: var(--ink);
}
.dialog[open] { animation: pop .45s cubic-bezier(.2, .8, .2, 1.1); }
.dialog::backdrop {
  background: rgba(5, 10, 22, .72);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.dialog-card {
  position: relative;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 36px clamp(18px, 4vw, 30px) 26px;
  border-radius: 22px;
  text-align: center;
  background:
    radial-gradient(circle at 15% 0%, #fffdf6, transparent 60%),
    linear-gradient(180deg, #fbf3e2, #f1e0bf);
  box-shadow: inset 0 0 0 3px rgba(201, 141, 42, .45), 0 30px 70px rgba(0, 0, 0, .55);
}
.dialog-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  border-radius: 22px 22px 0 0;
  background: repeating-linear-gradient(135deg, #c8323a 0 12px, #fff8ee 12px 24px);
}

.dialog-holly {
  position: absolute;
  top: 18px;
  left: 14px;
  width: 50px;
  height: 40px;
  transform: rotate(-14deg);
}

.dialog-close {
  position: absolute;
  top: 20px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff8ea;
  background: linear-gradient(180deg, #d8434a, #a51d26);
  box-shadow: 0 3px 0 #6e0f16;
}
.dialog-close svg { width: 18px; height: 18px; }
.dialog-close:hover { filter: brightness(1.08); }
.dialog-close:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 2px; }

.dialog-kicker,
.dialog-title { padding: 0 44px; }
.dialog-kicker {
  margin: 0;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #a51d26;
}
.dialog-title {
  margin: .05em 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 6vw, 2.3rem);
  line-height: 1.1;
  color: var(--green-deep);
}

.label-frame {
  /* the cut-out label itself, taped onto the card */
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 28px auto 20px;
  filter: drop-shadow(0 10px 12px rgba(60, 30, 10, .28)) drop-shadow(0 1px 1px rgba(60, 30, 10, .3));
  transform: rotate(-1.6deg);
}
.label-frame:has(.label-missing:not([hidden])) {
  /* no picture: show a plain paper card instead */
  padding: 12px;
  border-radius: 8px;
  background: #fffdf7;
}
.label-frame::before {
  /* candy-stripe washi tape */
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 92px;
  height: 24px;
  background: repeating-linear-gradient(45deg, rgba(200, 50, 58, .78) 0 8px, rgba(255, 255, 255, .8) 8px 16px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
  transform: translateX(-50%) rotate(3deg);
}
.label-frame img {
  display: block;
  max-width: 100%;
  max-height: min(42vh, 360px);
  width: auto;
  height: auto;
  margin: 0 auto;
}
.label-frame img[hidden] { display: none; }
.label-missing {
  min-width: min(260px, 70vw);
  padding: 40px 16px;
  font-size: .9rem;
  color: #8a6a4a;
}

.guess { display: block; text-align: left; }
.guess span {
  display: block;
  margin-bottom: 6px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8a5a2a;
}
.guess em { font-style: normal; font-weight: 600; letter-spacing: .02em; text-transform: none; opacity: .8; }
.guess textarea {
  display: block;
  width: 100%;
  min-height: 60px;
  padding: 10px 12px;
  border: 2px dashed #d5b98a;
  border-radius: 12px;
  resize: vertical;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, .6);
}
.guess textarea::placeholder { color: #b39b7a; }
.guess textarea:focus {
  outline: none;
  border-style: solid;
  border-color: var(--gold-deep);
  background: #fff;
}

.btn-reveal {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  margin-top: 18px;
  padding: 12px 26px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff8ea;
  background: linear-gradient(180deg, #d8434a, #a51d26);
  box-shadow: 0 4px 0 #6e0f16, 0 10px 18px rgba(120, 20, 20, .3);
  transition: transform .15s, box-shadow .15s;
}
.btn-reveal svg { width: 18px; height: 18px; }
.btn-reveal:hover { transform: translateY(-1px); }
.btn-reveal:active { transform: translateY(3px); box-shadow: 0 1px 0 #6e0f16; }
.btn-reveal:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 3px; }
.btn-reveal[aria-expanded="true"] {
  background: linear-gradient(180deg, #3a8a5c, #1f5b3a);
  box-shadow: 0 4px 0 #0f3020, 0 10px 18px rgba(20, 70, 40, .3);
}

.answer {
  position: relative;
  margin-top: 18px;
  padding: 16px 18px 18px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, .08), transparent 50%),
    linear-gradient(180deg, #23573a, #163c28);
  box-shadow: inset 0 0 0 2px rgba(246, 215, 142, .35);
  color: var(--cream);
  animation: reveal .45s ease-out;
}
.answer[hidden] { display: none; }
.answer-label {
  margin: 0;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.answer-text {
  margin: .25em 0 0;
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 3.6vw, 1.45rem);
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}
.answer-note {
  margin: .6em 0 0;
  font-size: .92rem;
  font-style: italic;
  color: rgba(251, 243, 226, .82);
}

/* ---------- Toast + test badge ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border: 2px solid var(--gold);
  border-radius: 999px;
  background: #7c121a;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  font-weight: 700;
  text-align: center;
  color: var(--cream);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 30px);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1.2), opacity .25s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.test-badge {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 12px;
  border-radius: 10px;
  background: rgba(10, 18, 32, .88);
  border: 1px dashed var(--gold);
  font-size: .8rem;
  font-weight: 700;
  color: var(--gold-soft);
}
.test-badge[hidden] { display: none; }
.test-badge button {
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 800;
  color: var(--ink);
  background: var(--gold-soft);
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .moon { display: none; }
  .ornament--extra { display: none; }
  .site-header { padding-top: 136px; }
  .mistletoe { width: 92px; margin-left: -46px; }
  .board-wrap { margin-top: 34px; }
}

@media (max-width: 480px) {
  .ornament { --len: 40px !important; --size: 32px !important; }
  .ornaments--left .ornament { left: 18px; }
  .ornaments--right .ornament { left: -18px; }
  .kicker { font-size: .72rem; letter-spacing: .16em; }
  .status { font-size: .9rem; }
  .board-wrap { padding: 0 22px; }
  .progress { font-size: .85rem; padding: 6px 12px; }
  .presents { display: none; }
}

/* ---------- Animations ---------- */

@keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes swing { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes star-twinkle {
  0%, 100% { opacity: .9; transform: scale(1); }
  50% { opacity: .25; transform: scale(.7); }
}
@keyframes steam {
  0% { opacity: 0; transform: translateY(6px); }
  40% { opacity: .8; }
  100% { opacity: 0; transform: translateY(-7px); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 3px var(--gold), 0 0 14px 2px rgba(246, 200, 90, .55); }
  50% { box-shadow: 0 0 0 3px #fff1c2, 0 0 30px 10px rgba(246, 200, 90, .85); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-4deg); }
  40% { transform: rotate(4deg); }
  60% { transform: rotate(-3deg); }
  80% { transform: rotate(2deg); }
}
@keyframes bob {
  0%, 100% { transform: rotate(-6deg) translateY(0); }
  50% { transform: rotate(-3deg) translateY(-4px); }
}
@keyframes wave {
  0%, 100% { transform: rotate(-58deg); }
  50% { transform: rotate(-24deg); }
}
@keyframes pop {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes spark {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.2); }
}
@keyframes herd-walk {
  from { transform: translateX(-105%); }
  to { transform: translateX(100vw); }
}
@keyframes far-walk {
  from { transform: translateX(1520px); }
  to { transform: translateX(-200px); }
}
/* head down in the snow most of the time, now and then a look around */
@keyframes rd-graze {
  0%, 100% { transform: rotate(80deg); }
  30% { transform: rotate(74deg); }
  45% { transform: rotate(82deg); }
  58%, 72% { transform: rotate(12deg); }
  86% { transform: rotate(80deg); }
}
@keyframes rd-step {
  from { transform: rotate(-13deg); }
  to { transform: rotate(13deg); }
}
@keyframes rd-bob {
  from { transform: translateY(0); }
  to { transform: translateY(-1.5px); }
}
@keyframes rd-nod {
  0%, 100% { transform: rotate(0); }
  50% { transform: rotate(4deg); }
}
@keyframes smoke {
  0% { opacity: 0; transform: translate(0, 10px) scale(.6); }
  25% { opacity: .55; }
  100% { opacity: 0; transform: translate(16px, -36px) scale(1.7); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  /* the reindeer just stand in the snow */
  .herd-line,
  .reindeer *,
  .far-walk,
  .far-rd * { animation: none !important; }
  .herd-line { transform: translateX(6vw); }
  .far-walk { transform: translateX(900px); }
  .rd-graze { transform: rotate(80deg); }
}
