:root {
  --fir-deep: oklch(0.25 0.07 152);
  --fir: oklch(0.36 0.095 150);
  --fir-lit: oklch(0.47 0.12 148);
  --red: oklch(0.55 0.205 27);
  --red-deep: oklch(0.40 0.16 25);
  --gold: oklch(0.84 0.15 86);
  --gold-deep: oklch(0.66 0.13 72);
  --snow: oklch(0.985 0.008 150);
  --ink: oklch(0.24 0.05 150);
  --ink-soft: oklch(0.40 0.05 150);

  --display: 'Shrikhand', 'Georgia', serif;
  --body: 'Bricolage Grotesque', system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --z-bg: 0;
  --z-main: 1;
  --z-confetti: 3;

  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--body);
  color: var(--snow);
  background: var(--fir-deep);
  overflow-x: hidden;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: var(--z-bg); pointer-events: none;
  background: radial-gradient(120% 70% at 50% 42%, var(--fir-lit) 0%, var(--fir) 45%, var(--fir-deep) 100%);
}

#snow, #confetti {
  position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
#snow { z-index: var(--z-bg); }
#confetti { z-index: var(--z-confetti); }

/* Out-of-focus lights drifting behind everything. */
.bokeh { position: fixed; inset: 0; z-index: var(--z-bg); pointer-events: none; overflow: hidden; }
.bokeh i {
  position: absolute; border-radius: 50%; filter: blur(14px); opacity: 0.35;
  animation: drift 18s ease-in-out infinite alternate;
}
.bokeh i:nth-child(1) { width: 90px; height: 90px; left: 6%; top: 18%; background: var(--gold); }
.bokeh i:nth-child(2) { width: 60px; height: 60px; left: 78%; top: 12%; background: var(--red); animation-delay: -4s; }
.bokeh i:nth-child(3) { width: 120px; height: 120px; left: 70%; top: 58%; background: var(--gold); opacity: 0.2; animation-delay: -9s; }
.bokeh i:nth-child(4) { width: 50px; height: 50px; left: 14%; top: 66%; background: var(--red); animation-delay: -2s; }
.bokeh i:nth-child(5) { width: 40px; height: 40px; left: 48%; top: 8%; background: var(--snow); opacity: 0.2; animation-delay: -12s; }
.bokeh i:nth-child(6) { width: 70px; height: 70px; left: 88%; top: 38%; background: var(--fir-lit); opacity: 0.5; animation-delay: -6s; }
.bokeh i:nth-child(7) { width: 80px; height: 80px; left: -4%; top: 44%; background: var(--fir-lit); opacity: 0.5; animation-delay: -15s; }
@keyframes drift { to { transform: translate3d(18px, -26px, 0) scale(1.12); } }

/* String of lights along the top edge. */
.lights {
  position: absolute; top: env(safe-area-inset-top); left: 0; width: 100%; height: 70px;
  z-index: var(--z-main); pointer-events: none; overflow: visible;
}
.bulb { animation: twinkle 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0; }
@keyframes twinkle { 50% { opacity: 0.45; } }

main { position: relative; z-index: var(--z-main); }

/* ——— Stage: the one thing to do today ——— */
.stage {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: calc(env(safe-area-inset-top) + 54px) 20px calc(env(safe-area-inset-bottom) + 22px);
  max-width: 560px; margin: 0 auto;
}
.head { text-align: center; }
.date {
  margin: 0; font-weight: 650; font-size: 0.95rem; letter-spacing: 0.02em; color: var(--gold);
}
h1 {
  margin: 0.1em 0 0; font-family: var(--display); font-weight: 400;
  font-size: clamp(3.2rem, 17vw, 5.6rem); line-height: 1; letter-spacing: -0.01em;
  color: var(--snow);
  text-shadow: 0 3px 0 var(--red-deep), 0 10px 30px oklch(0.15 0.06 150 / 0.6);
  text-wrap: balance;
}
.sub { margin: 0.55em 0 0; font-size: 1rem; line-height: 1.45; color: oklch(0.93 0.03 150); min-height: 1.45em; text-wrap: balance; }

.scene {
  position: relative; display: grid; place-items: center;
  min-height: 360px; padding-top: 24px;
}
.plinth { position: relative; display: grid; place-items: end center; width: 100%; }
.gift {
  position: relative; width: min(84vw, 350px, 46dvh); height: auto; overflow: visible;
  filter: drop-shadow(0 18px 18px oklch(0.15 0.06 150 / 0.45));
  margin-bottom: 18px;
}
.gift g { transform-box: fill-box; transform-origin: 50% 100%; }
#g-bow { transform-origin: 50% 70%; }
#g-lid { transform-origin: 50% 100%; }
#g-ribbon-v { transform-origin: 50% 0%; }

.mound {
  position: absolute; bottom: 0; left: 50%; width: min(116vw, 500px); height: 80px;
  transform: translateX(-50%);
  background: radial-gradient(60% 100% at 50% 100%, var(--snow) 0%, oklch(0.93 0.02 220) 55%, transparent 72%);
  border-radius: 50% 50% 0 0;
  mask: linear-gradient(#000 55%, transparent);
  -webkit-mask: linear-gradient(#000 55%, transparent);
}
.glow {
  position: absolute; left: 50%; bottom: 40px; width: 360px; height: 360px; translate: -50% 0;
  background: radial-gradient(closest-side, oklch(0.90 0.14 88 / 0.55), oklch(0.84 0.15 86 / 0.12) 60%, transparent);
  opacity: 0.35; pointer-events: none;
}
.rays {
  position: absolute; left: 50%; bottom: 90px; width: 640px; height: 640px; translate: -50% 50%;
  background: repeating-conic-gradient(from 0deg, oklch(0.92 0.13 90 / 0.5) 0deg 7deg, transparent 7deg 22deg);
  mask: radial-gradient(closest-side, #000 18%, transparent 70%);
  -webkit-mask: radial-gradient(closest-side, #000 18%, transparent 70%);
  opacity: 0; scale: 0.2; pointer-events: none;
}
.rays.on { animation: spin 40s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }

/* The gift tag that comes out of the box. */
.tag {
  position: absolute; left: 50%; bottom: 46px; translate: -50% 0;
  width: min(80vw, 320px);
  padding: 34px 20px 24px;
  background: var(--snow); color: var(--ink);
  border-radius: 14px;
  clip-path: polygon(14% 0, 86% 0, 100% 9%, 100% 100%, 0 100%, 0 9%);
  text-align: center;
  filter: drop-shadow(0 14px 22px oklch(0.12 0.05 150 / 0.5));
}
.tag[hidden] { display: none; }
.tag-edge { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tag-edge polygon { fill: none; stroke: var(--red); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.hole {
  position: absolute; top: 12px; left: 50%; width: 14px; height: 14px; translate: -50% 0;
  border-radius: 50%; background: var(--fir); box-shadow: 0 0 0 3px var(--gold);
}
.tag-day { margin: 4px 0 0; font-weight: 700; font-size: 0.85rem; color: var(--red); letter-spacing: 0.04em; }
.tag-art { width: min(52vw, 190px); aspect-ratio: 1; margin: -6px auto -10px; }
.tag-art svg { width: 100%; height: 100%; }
.tag-amount {
  margin: 0; font-family: var(--display); font-size: clamp(1.25rem, 6.2vw, 1.6rem); line-height: 1.18; color: var(--red-deep);
  text-wrap: balance; overflow-wrap: break-word;
}
.tag-name { margin: 8px 0 0; font-size: 0.92rem; color: var(--ink-soft); }

/* ——— Actions ——— */
.actions { display: grid; justify-items: center; gap: 10px; padding-top: 14px; }
.open {
  appearance: none; border: 0; cursor: pointer;
  min-height: 60px; padding: 0 34px; border-radius: 999px;
  font: 750 1.15rem/1 var(--body); letter-spacing: 0.01em;
  color: var(--red-deep);
  background: linear-gradient(180deg, oklch(0.93 0.12 92), var(--gold) 55%, var(--gold-deep));
  box-shadow: 0 4px 0 oklch(0.52 0.11 65), 0 10px 24px oklch(0.15 0.06 150 / 0.45);
  transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out), filter 160ms;
  -webkit-tap-highlight-color: transparent;
}
.open:hover { filter: brightness(1.05); }
.open:active { transform: translateY(3px); box-shadow: 0 1px 0 oklch(0.52 0.11 65), 0 6px 14px oklch(0.15 0.06 150 / 0.45); }
.open:focus-visible { outline: 3px solid var(--snow); outline-offset: 4px; }
.open:disabled { cursor: default; }
.open[hidden] { display: none; }
.status { margin: 0; min-height: 1.4em; font-size: 0.95rem; color: oklch(0.93 0.03 150); text-align: center; font-variant-numeric: tabular-nums; }
.status strong { color: var(--gold); font-weight: 700; }

/* ——— Calendar grid ——— */
section.calendar, section.left { max-width: 560px; margin: 0 auto; padding: 36px 20px 8px; }
h2 {
  margin: 0 0 16px; font-family: var(--display); font-weight: 400; font-size: 1.9rem; line-height: 1.1;
  color: var(--gold);
}
.count { margin: -8px 0 14px; font-weight: 700; color: oklch(0.93 0.03 150); font-variant-numeric: tabular-nums; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.grid li {
  position: relative; aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums;
  background: oklch(0.30 0.08 150); color: oklch(0.80 0.06 150);
  box-shadow: inset 0 0 0 1.5px oklch(0.45 0.09 150);
}
.grid li.done { background: var(--snow); color: var(--red); box-shadow: none; }
.grid li.done svg { position: absolute; inset: 8%; width: 84%; height: 84%; }
.grid li.done b { position: absolute; top: 4px; left: 7px; font-size: 0.72rem; z-index: 1; }
.grid li.today { background: var(--red); color: var(--snow); box-shadow: inset 0 0 0 2px var(--gold); }
.grid li.missed { box-shadow: inset 0 0 0 2px var(--gold); color: var(--gold); }

/* ——— Inventory ——— */
.inventory { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.inventory li {
  display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px;
  padding: 8px 4px; border-bottom: 1px solid oklch(0.45 0.08 150 / 0.6);
}
.inventory li:last-child { border-bottom: 0; }
.inventory svg { width: 52px; height: 52px; background: var(--snow); border-radius: 10px; }
.inventory .n { font-weight: 800; font-size: 1.1rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.inventory .what { font-weight: 600; line-height: 1.25; }
.inventory .what small { display: block; font-weight: 400; font-size: 0.85rem; color: oklch(0.86 0.04 150); }
.inventory .empty { grid-template-columns: 1fr; color: oklch(0.9 0.03 150); }

footer { height: calc(env(safe-area-inset-bottom) + 40px); }

@media (min-width: 700px) {
  .scene { min-height: 400px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bokeh i, .bulb, .rays.on { animation: none; }
}
