/* What Nicole Wants for Christmas — Winter Wonderland styles */
:root {
  --powder: #B9D6EB; --ice: #DDEDF7; --pearl: #FCFCFA; --silver: #C5CBD3;
  --champagne: #F5E9D3; --snow: #FFFFFF; --dusty: #8CAEC9; --candle: #FFF4DF;
  --ink: #243A52;          /* main text: dark blue, high contrast on pearl */
  --ink-soft: #3F5C78;     /* secondary text, still >= 4.5:1 on pearl */
  --button: #3E6A8F;       /* primary button (white text 5.6:1) */
  --button-hover: #335a7a;
  --ok: #2F6B4F;
  --warn: #8A4B12;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(62, 106, 143, .16), 0 2px 6px rgba(62, 106, 143, .08);
  --font-script: 'Great Vibes', 'Snell Roundhand', 'Apple Chancery', cursive;
  --font-title: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --base: 18px;
}
html.big { --base: 22px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 400 var(--base)/1.55 var(--font-body); color: var(--ink);
  background: radial-gradient(120% 70% at 50% 0%, #EEF6FC 0%, #F8FBFD 45%, #F2F6FA 100%) fixed;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--button); }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid #2F7FC1; outline-offset: 3px; border-radius: 8px; }

/* ---------------------------------------------------------- snow layer --- */
#snow { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
html.simple #snow, html.reduce #snow { display: none; }

/* ------------------------------------------------------------ top bar ---- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; gap: 8px; align-items: center;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; background: rgba(252, 252, 250, .82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid rgba(197, 203, 211, .55);
}
.topbar .spacer { flex: 1; }
.chip-btn {
  min-height: 48px; min-width: 48px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--silver);
  background: var(--pearl); display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .85rem;
  color: var(--ink); cursor: pointer; text-decoration: none; box-shadow: 0 2px 8px rgba(62,106,143,.08);
}
.chip-btn svg { width: 24px; height: 24px; }
.bell-btn { position: relative; }
.bell-btn .badge {
  position: absolute; top: -4px; right: -4px; min-width: 24px; height: 24px; border-radius: 12px; padding: 0 6px;
  background: #3E6A8F; color: #fff; font-size: .75rem; display: grid; place-items: center; border: 2px solid #fff;
}
.bell-btn.ring svg { animation: ring 1.2s ease-in-out 2; transform-origin: 50% 10%; }
@keyframes ring { 0%,100% { transform: rotate(0) } 15% { transform: rotate(16deg) } 30% { transform: rotate(-14deg) } 45% { transform: rotate(10deg) } 60% { transform: rotate(-6deg) } 75% { transform: rotate(3deg) } }

main { position: relative; z-index: 2; padding: calc(env(safe-area-inset-top) + 84px) 16px 140px; max-width: 760px; margin: 0 auto; }
main.full { padding: 0; max-width: none; }

/* -------------------------------------------------------------- type ---- */
.script { font-family: var(--font-script); font-weight: 400; line-height: 1.15; color: #4C7091; }
h1, h2, h3 { font-family: var(--font-title); font-weight: 600; line-height: 1.15; margin: .2em 0 .4em; color: var(--ink); }
h1 { font-size: 2.15rem; } h2 { font-size: 1.75rem; } h3 { font-size: 1.35rem; }
h1.script, h2.script { font-weight: 400; color: #46698A; }
h1.script { font-size: 3.1rem; } h2.script { font-size: 2.5rem; }
.lead { font-size: 1.08rem; color: var(--ink-soft); }
.muted { color: var(--ink-soft); font-size: .92rem; }
.center { text-align: center; }
.small { font-size: .85rem; }

/* ------------------------------------------------------------- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 12px 22px;
  border-radius: 999px; border: 0; background: var(--button); color: #fff; font-weight: 800; font-size: 1.02rem;
  cursor: pointer; text-decoration: none; box-shadow: 0 8px 20px rgba(62,106,143,.28); text-align: center;
  transition: transform .15s ease, background .2s;
}
.btn:hover { background: var(--button-hover); }
.btn:active { transform: scale(.97); }
.btn.secondary { background: var(--pearl); color: var(--ink); border: 2px solid var(--silver); box-shadow: 0 4px 12px rgba(62,106,143,.1); }
.btn.ghost { background: transparent; color: var(--button); box-shadow: none; text-decoration: underline; min-height: 48px; }
.btn.block { width: 100%; }
.btn.big { min-height: 64px; font-size: 1.15rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn-col { display: grid; gap: 12px; }

/* --------------------------------------------------------------- cards --- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(252,252,250,.9)); border-radius: var(--radius);
  border: 1px solid rgba(197,203,211,.7); box-shadow: var(--shadow); padding: 22px; margin: 18px 0; position: relative;
}
.card.frost { background: rgba(255,255,255,.72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.card .corner-flake { position: absolute; width: 40px; opacity: .55; }
.silver-border { border: 2px solid transparent; background:
  linear-gradient(#FCFCFA, #FCFCFA) padding-box, linear-gradient(135deg, #E7EAEE, #C5CBD3, #F4F6F8, #B9C1CB) border-box; }
.notice { border-radius: 16px; padding: 14px 16px; background: var(--candle); border: 1px solid #EBD9B4; color: #5A4520; }
.notice.blue { background: #EAF3FA; border-color: #B9D6EB; color: var(--ink); }
.notice.ok { background: #EAF6EF; border-color: #BFDCCB; color: var(--ok); }
.error { color: #8A1F1F; font-weight: 700; }

/* ---------------------------------------------------------------- intro -- */
.stage { position: fixed; inset: 0; overflow: hidden; z-index: 3; background: #EEF5FA; }
.stage .room { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform 2.2s cubic-bezier(.3,.7,.2,1), filter 1.5s; }
.stage.opening .room { transform: scale(1.12); filter: brightness(1.08); }
.stage .vignette { position: absolute; inset: 0; background: radial-gradient(70% 60% at 50% 60%, transparent 40%, rgba(140,174,201,.35) 100%); pointer-events: none; }
.intro-title {
  position: absolute; top: calc(env(safe-area-inset-top) + 18px); left: 0; right: 0; text-align: center; padding: 0 16px;
  z-index: 5; transition: opacity .8s;
}
.intro-title .panel { display: inline-block; padding: 12px 22px 14px; border-radius: 26px; background: rgba(252,252,250,.78);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.intro-title h1 { font-family: var(--font-script); font-weight: 400; font-size: clamp(2.1rem, 9vw, 3rem); margin: 0; color: #3F6487; line-height: 1.05; }
@media (max-height: 700px) { .intro-title p:not(.year) { display: none; } .gift-wrap { width: min(62vw, 300px); } }
.intro-title p { margin: 2px 0; color: var(--ink-soft); }
.intro-title .year { font-family: var(--font-title); letter-spacing: .25em; text-transform: uppercase; font-size: .85rem; color: var(--ink); }
.gift-wrap {
  position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 190px); width: min(78vw, 360px);
  transform: translateX(-50%); z-index: 6; border: 0; background: none; padding: 0; cursor: pointer;
  transition: transform 1.6s cubic-bezier(.3,.7,.2,1), bottom 1.6s cubic-bezier(.3,.7,.2,1);
}
.gift-wrap svg { width: 100%; height: auto; overflow: visible; display: block; }
.stage:not(.opening) .gift-wrap svg { animation: wiggle 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0) } 74% { transform: rotate(-3deg) } 78% { transform: rotate(3deg) } 82% { transform: rotate(-2deg) } 86% { transform: rotate(1deg) } }
.giftbox .g-glow { animation: breathe 2.6s ease-in-out infinite; transform-origin: 150px 170px; }
@keyframes breathe { 0%,100% { opacity: .6; transform: scale(.96) } 50% { opacity: 1; transform: scale(1.04) } }
.giftbox .tag-text text { font-family: var(--font-script); font-size: 10.5px; fill: #47607A; }
.intro-actions {
  position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 18px); z-index: 7; display: grid; gap: 8px;
  justify-items: center; padding: 0 16px; transition: opacity .6s;
}
.intro-actions .hint { font-weight: 800; background: rgba(252,252,250,.9); padding: 6px 16px; border-radius: 999px; font-size: .95rem; text-align: center; }
.stage.opening .intro-actions, .stage.opening .intro-title { opacity: 0; pointer-events: none; }
.skip { position: absolute; right: 14px; top: calc(env(safe-area-inset-top) + 14px); z-index: 20; display: none; }
.stage.opening .skip { display: inline-flex; }

/* Gift unwrap sequence (classes added one after another by app.js) */
.giftbox g { transform-box: fill-box; }
.stage.opening .gift-wrap { transform: translateX(-50%) scale(1.18); bottom: calc(env(safe-area-inset-bottom) + 200px); }
.step-untie .g-loop-l { animation: loopL 1s cubic-bezier(.5,0,.4,1) forwards; transform-origin: 100% 80%; }
.step-untie .g-loop-r { animation: loopR 1s cubic-bezier(.5,0,.4,1) forwards; transform-origin: 0% 80%; }
.step-untie .g-knot { animation: knot .9s ease forwards; transform-origin: 50% 50%; }
.step-untie .g-tail-l, .step-untie .g-tail-r { animation: tails 1s ease forwards .2s; transform-origin: 50% 0; }
@keyframes loopL { 40% { transform: rotate(-18deg) scale(1.05) } 100% { transform: translate(-60px, 160px) rotate(-120deg) scale(.6); opacity: 0 } }
@keyframes loopR { 40% { transform: rotate(18deg) scale(1.05) } 100% { transform: translate(60px, 170px) rotate(120deg) scale(.6); opacity: 0 } }
@keyframes knot { 50% { transform: scale(1.2) } 100% { transform: translateY(140px) scale(.3); opacity: 0 } }
@keyframes tails { 100% { transform: translateY(180px) rotate(14deg); opacity: 0 } }
.step-ribbon .g-ribbon-v { animation: ribV .8s ease-in forwards; transform-origin: 50% 100%; }
.step-ribbon .g-ribbon-h { animation: ribH .8s ease-in forwards .1s; transform-origin: 50% 50%; }
.step-ribbon .g-lid rect:nth-of-type(4) { animation: fadeOut .5s forwards; }
@keyframes ribV { 100% { transform: scaleY(0); opacity: 0 } }
@keyframes ribH { 100% { transform: scaleX(0) translateY(30px); opacity: 0 } }
.step-paper .g-paper-l { animation: peelL 1s cubic-bezier(.6,0,.3,1) forwards; transform-origin: 0% 50%; }
.step-paper .g-paper-r { animation: peelR 1s cubic-bezier(.6,0,.3,1) forwards .08s; transform-origin: 100% 50%; }
@keyframes peelL { 60% { transform: perspective(500px) rotateY(-70deg) } 100% { transform: perspective(500px) rotateY(-100deg) translateX(-40px); opacity: 0 } }
@keyframes peelR { 60% { transform: perspective(500px) rotateY(70deg) } 100% { transform: perspective(500px) rotateY(100deg) translateX(40px); opacity: 0 } }
.giftbox .g-body > rect:first-child { transition: fill .6s; }
.step-paper .g-body > rect:first-child { fill: #F2F5F8; }
.step-lid .g-lid { animation: lid 1.1s cubic-bezier(.4,0,.2,1) forwards; transform-origin: 0% 100%; }
@keyframes lid { 30% { transform: translateY(-26px) } 100% { transform: translate(-140px, -150px) rotate(-38deg); opacity: 0 } }
.step-glow .g-light path { animation: beam 1.6s ease-out forwards; }
.step-glow .g-light ellipse { animation: beamE 1.2s ease-out forwards; }
@keyframes beam { 100% { opacity: .75 } }
@keyframes beamE { 100% { opacity: .95 } }
@keyframes fadeOut { to { opacity: 0 } }
.reveal-item {
  position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 300px); width: min(62vw, 260px); z-index: 8;
  transform: translate(-50%, 140px) scale(.4); opacity: 0; transition: transform 1.4s cubic-bezier(.2,.9,.3,1.2), opacity .8s;
  filter: drop-shadow(0 18px 24px rgba(62,106,143,.3));
}
.reveal-item.up { transform: translate(-50%, 0) scale(1); opacity: 1; animation: float 4s ease-in-out infinite 1.4s; }
@keyframes float { 0%,100% { margin-bottom: 0 } 50% { margin-bottom: 10px } }
.reveal-title {
  position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 40px); text-align: center; z-index: 9; opacity: 0;
  transform: translateY(14px); transition: all 1s ease; padding: 0 18px;
}
.reveal-title.show { opacity: 1; transform: none; }
.reveal-title .panel { display: inline-block; padding: 16px 22px; border-radius: 26px; background: rgba(252,252,250,.86); box-shadow: var(--shadow); max-width: 560px; }
.reveal-title h1 { font-family: var(--font-script); font-weight: 400; font-size: 2.6rem; margin: 0; color: #3F6487; }
.particles { position: absolute; inset: 0; pointer-events: none; z-index: 10; overflow: hidden; }
.particle { position: absolute; will-change: transform, opacity; }

/* ------------------------------------------------------------- camera --- */
.camera-art { width: 100%; max-width: 300px; display: block; margin: 0 auto; }
.camera-art .acc { font: 700 9px var(--font-body); fill: #3F5C78; text-anchor: middle; }
.hero-cam { text-align: center; }
.hero-cam .photo { max-height: 260px; border-radius: 18px; }
.illus-note { font-size: .78rem; color: var(--ink-soft); }

/* ------------------------------------------------------------- envelope -- */
.envelope-btn { display: block; margin: 0 auto; border: 0; background: none; cursor: pointer; width: min(86vw, 330px); padding: 0; }
.envelope { width: 100%; overflow: visible; }
.envelope .env-flap { transform-origin: 50% 0; transform-box: fill-box; transition: transform .8s ease .45s; }
.envelope .env-ribbon { transition: opacity .5s, transform .6s; transform-box: fill-box; transform-origin: 50% 50%; }
.envelope-btn.open .env-ribbon { opacity: 0; transform: scale(1.3) translateY(30px); }
.envelope-btn.open .env-flap { transform: rotateX(180deg); }
.letter {
  font-family: var(--font-title); font-size: 1.22rem; line-height: 1.6; white-space: pre-line; color: #2C4560;
  background: linear-gradient(#FFFEFB, #FCFAF4); border-radius: 18px; padding: 28px 24px; position: relative;
  border: 2px solid transparent;
  background-image: linear-gradient(#FFFEFB, #FCFAF4), linear-gradient(135deg, #E7EAEE, #C5CBD3, #F4F6F8, #B9C1CB);
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: var(--shadow); animation: unfold .9s cubic-bezier(.2,.8,.2,1);
}
.letter .sig { font-family: var(--font-script); font-size: 2.3rem; color: #46698A; display: block; margin-top: 6px; }
@keyframes unfold { from { transform: translateY(-30px) scaleY(.6); opacity: 0 } to { transform: none; opacity: 1 } }

/* --------------------------------------------------------- gift options -- */
.options { display: grid; gap: 18px; }
@media (min-width: 720px) { .options { grid-template-columns: 1fr 1fr; } }
.option { padding-top: 46px; overflow: hidden; }
.option .ribbon-label {
  position: absolute; top: 0; left: 0; right: 0; padding: 10px; text-align: center; color: #fff; font-weight: 800;
  background: linear-gradient(90deg, #7FA6C6, #A9CBE6, #7FA6C6); letter-spacing: .02em; font-size: .95rem;
}
.option.second .ribbon-label { background: linear-gradient(90deg, #A7AFBA, #D5DAE0, #A7AFBA); color: var(--ink); }
.option .bow { position: absolute; right: 10px; top: 22px; width: 64px; }
.price { font-family: var(--font-title); font-size: 2.1rem; font-weight: 700; color: var(--ink); }
.includes { margin: 8px 0 0; padding-left: 20px; }
.includes li { margin: 3px 0; }
.math { width: 100%; border-collapse: collapse; margin: 8px 0; }
.math td { padding: 6px 0; border-bottom: 1px dashed var(--silver); }
.math td:last-child { text-align: right; font-weight: 700; }
.math tr.total td { border-bottom: 0; font-size: 1.1rem; padding-top: 10px; }
.compare { width: 100%; border-collapse: collapse; font-size: .95rem; }
.compare th, .compare td { padding: 8px 6px; border-bottom: 1px solid #E3E9EF; text-align: center; }
.compare th:first-child, .compare td:first-child { text-align: left; }
.yes { color: var(--ok); font-weight: 800; } .no { color: #8B95A1; }
.split-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.split-pair > div { background: #F3F8FC; border-radius: 14px; padding: 12px; text-align: center; border: 1px solid #DDEDF7; }
.split-pair strong { display: block; font-size: 1.35rem; font-family: var(--font-title); }

/* --------------------------------------------------------------- tags ---- */
.tags { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tag {
  position: relative; min-height: 120px; padding: 22px 14px 16px 30px; border-radius: 14px 22px 22px 14px; border: 0; cursor: pointer;
  background: linear-gradient(160deg, #FFFFFF, #F4F8FB); box-shadow: var(--shadow); text-align: left; color: var(--ink);
  clip-path: polygon(16px 0, 100% 0, 100% 100%, 16px 100%, 0 50%);
  display: flex; flex-direction: column; justify-content: center; gap: 4px; text-decoration: none;
}
.tag::before { content: ''; position: absolute; left: 12px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  border: 2px solid var(--silver); background: #fff; }
.tag::after { content: ''; position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; opacity: .8;
  background: radial-gradient(circle at 35% 30%, #fff, var(--powder) 40%, var(--dusty)); border-radius: 50%; }
.tag.v1::after { background: radial-gradient(circle at 35% 30%, #fff, #E4E8EE 35%, #9AA4B1); }
.tag.v2::after { background: radial-gradient(circle at 35% 30%, #fff, #F4F1EA 55%, #D9D3C7); }
.tag.v3::after { background: radial-gradient(circle at 35% 30%, #fff, var(--champagne) 45%, #D8C39C); }
.tag.v4 { background: linear-gradient(160deg, #EAF3FA, #D7E8F5); }
.tag .name { font-family: var(--font-script); font-size: 2rem; line-height: 1.1; color: #3F6487; padding-right: 36px; }
.tag .sub { font-size: .9rem; color: var(--ink-soft); font-weight: 700; }
.tag.nav .name { font-size: 1.75rem; }
.tag.big-tag { min-height: 140px; }
.status { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 800; background: #EEF2F6; color: var(--ink); }
.status.join { background: #E5F3EA; color: var(--ok); }
.status.deciding { background: var(--candle); color: #6E4F14; }
.status.separate { background: #EEF0FB; color: #3C4B8C; }

/* ------------------------------------------------------------ choices ---- */
.choices { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 16px; border-radius: 16px; cursor: pointer;
  border: 2px solid #D5DFE8; background: #fff; text-align: left; font-weight: 700; width: 100%;
}
.choice .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--dusty); flex: 0 0 auto; display: grid; place-items: center; }
.choice.on { border-color: var(--button); background: #EEF5FB; }
.choice.on .dot::after { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--button); }
input[type=text], input[type=number], input[type=url], input[type=date], textarea, select {
  width: 100%; min-height: 54px; border-radius: 14px; border: 2px solid #CBD7E2; padding: 12px 14px; background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
label.field { display: block; font-weight: 800; margin: 14px 0 6px; }
.toggle { display: flex; align-items: center; gap: 12px; min-height: 52px; font-weight: 700; cursor: pointer; }
.toggle input { width: 28px; height: 28px; accent-color: var(--button); }
details.more { margin-top: 12px; border-radius: 16px; background: #F6FAFD; padding: 4px 14px; border: 1px solid #DDEDF7; }
details.more summary { cursor: pointer; min-height: 52px; display: flex; align-items: center; font-weight: 800; }

/* ------------------------------------------------------------- keypad ---- */
.pin-dots { display: flex; justify-content: center; gap: 18px; margin: 18px 0; }
.pin-dots span { width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--dusty); background: #fff; transition: all .15s; }
.pin-dots span.on { background: radial-gradient(circle at 35% 30%, #fff, var(--powder) 40%, var(--button)); border-color: var(--button); transform: scale(1.12); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px) } 40%, 80% { transform: translateX(10px) } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 340px; margin: 0 auto; }
.key {
  height: 76px; border-radius: 50%; aspect-ratio: 1; justify-self: center; width: 76px; border: 2px solid #C9D6E2; cursor: pointer;
  background: radial-gradient(circle at 35% 25%, #FFFFFF 0%, #F3F8FC 55%, #DDEDF7 100%); font: 800 1.9rem var(--font-body); color: var(--ink);
  box-shadow: 0 6px 14px rgba(62,106,143,.18), inset 0 -3px 0 rgba(140,174,201,.35);
}
html.big .key { width: 86px; height: 86px; }
.key:active { transform: scale(.94); background: var(--powder); }
.key.fn { font-size: 1rem; background: transparent; box-shadow: none; border-color: transparent; color: var(--button); }

/* -------------------------------------------------------- tracker tree --- */
.tracker-wrap { display: grid; gap: 14px; align-items: center; }
@media (min-width: 640px) { .tracker-wrap { grid-template-columns: 260px 1fr; } }
.tracker { width: 100%; max-width: 300px; margin: 0 auto; display: block; }
.tree .light { opacity: .12; }
.tree .light.on { opacity: 1; animation: twinkle 2.6s ease-in-out infinite; filter: drop-shadow(0 0 3px #FFE3A0); }
@keyframes twinkle { 0%,100% { opacity: 1 } 50% { opacity: .45 } }
.tree .star { opacity: .85; }
.tree .star .star-halo { opacity: 0; }
.tree .star.glow .star-halo { opacity: 1; animation: breathe 2s infinite; }
.tree .star.glow path { fill: #FFFDF5; }
.pop { animation: pop .6s cubic-bezier(.2,.9,.3,1.4) both; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes pop { from { transform: scale(.2); opacity: 0 } }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: #F3F8FC; border-radius: 14px; padding: 10px 12px; border: 1px solid #DDEDF7; }
.stat b { display: block; font-size: 1.25rem; font-family: var(--font-title); }
.bar { height: 14px; background: #E6EEF5; border-radius: 999px; overflow: hidden; margin: 8px 0; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #A9CBE6, #3E6A8F); border-radius: 999px; transition: width 1s; }
.flames .flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 1.2s ease-in-out infinite alternate; }
.flames .f2 { animation-duration: .9s; } .flames .f3 { animation-duration: 1.5s; }
@keyframes flicker { 0% { transform: scaleY(1) skewX(0) } 50% { transform: scaleY(1.12) skewX(3deg) } 100% { transform: scaleY(.92) skewX(-3deg) } }
.fireglow { animation: breathe 2.4s infinite; transform-box: fill-box; transform-origin: center; }
.candle { animation: candle 1.6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes candle { to { transform: scale(.9, 1.1); opacity: .85 } }

/* ----------------------------------------------------- family wonderland -- */
.wonder { position: relative; text-align: center; }
.wonder .big-tree { width: min(78vw, 340px); margin: 0 auto; display: block; }
.presents { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: -30px; }
@media (min-width: 640px) { .presents { grid-template-columns: repeat(5, 1fr); } }
.pg {
  border: 0; background: none; cursor: pointer; padding: 6px 4px 10px; border-radius: 18px; display: grid; justify-items: center; gap: 2px;
  min-height: 140px;
}
.pg:hover { background: rgba(255,255,255,.6); }
.pg svg { width: 96px; height: 96px; overflow: visible; }
.pg .nm { font-family: var(--font-script); font-size: 1.7rem; color: #3F6487; line-height: 1; }
.pg .ct { font-size: .78rem; color: var(--ink-soft); font-weight: 700; }
.pg.opening .g-bow { animation: knot .6s forwards; transform-box: fill-box; transform-origin: 50% 50%; }
.pg.opening .g-lid { animation: lid .8s forwards .25s; transform-box: fill-box; }
.stockings { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 0; }
.stockings span { font-size: .8rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid #D5DFE8; }

/* --------------------------------------------------------------- wishes -- */
.wish { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: start; }
.wish .ph { width: 92px; height: 92px; border-radius: 16px; object-fit: cover; background: #EAF3FA; display: grid; place-items: center; }
.wish .ph svg { width: 70px; }
.prio { display: inline-block; font-size: .78rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--ice); margin-bottom: 4px; }
.prio.biggest { background: #DCEAF6; color: #234A6B; } .prio.treat { background: var(--candle); color: #6B5020; } .prio.surprise { background: #F0EDF8; color: #4B3E7A; }
.res-box { margin-top: 10px; padding: 12px; border-radius: 14px; background: #F6FAFD; border: 1px dashed #B9D6EB; }
.drop-anim { position: fixed; left: 50%; top: 40%; z-index: 80; transform: translate(-50%,-50%); width: 160px; pointer-events: none; }
.drop-anim .card-mini { background: #fff; border-radius: 12px; padding: 8px 12px; font-weight: 800; box-shadow: var(--shadow); text-align: center; animation: dropIn 1.4s ease-in forwards; }
@keyframes dropIn { 0% { transform: translateY(-80px); opacity: 0 } 30% { opacity: 1 } 80% { transform: translateY(70px) scale(.6); opacity: 1 } 100% { transform: translateY(90px) scale(.2); opacity: 0 } }
.drop-anim svg { width: 160px; }

/* ------------------------------------------------------------ letters ---- */
.letters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.mini-env { border: 0; background: none; cursor: pointer; text-align: center; padding: 0; }
.mini-env svg { width: 100%; }
.mini-env .who { font-family: var(--font-script); font-size: 1.6rem; color: #3F6487; display: block; margin-top: -6px; }

/* -------------------------------------------------------- notifications -- */
.sheet-back { position: fixed; inset: 0; background: rgba(36,58,82,.25); z-index: 60; animation: fadeIn .25s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 82vh; overflow: auto; background: var(--pearl);
  border-radius: 26px 26px 0 0; padding: 18px 18px calc(env(safe-area-inset-bottom) + 24px); box-shadow: 0 -10px 40px rgba(36,58,82,.2);
  animation: slideUp .35s cubic-bezier(.2,.9,.3,1);
}
@media (min-width: 720px) { .sheet { left: 50%; width: 640px; transform: translateX(-50%); } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0 } }
@media (min-width: 720px) { @keyframes slideUp { from { transform: translate(-50%, 40px); opacity: 0 } to { transform: translate(-50%, 0) } } }
@keyframes fadeIn { from { opacity: 0 } }
.note { display: grid; grid-template-columns: 40px 1fr; gap: 10px; padding: 12px 4px; border-bottom: 1px solid #E6ECF2; }
.note.unread { background: #F1F7FC; border-radius: 12px; }
.note .ic { width: 40px; height: 40px; border-radius: 50%; background: var(--ice); display: grid; place-items: center; font-size: 1.2rem; }
.note time { display: block; font-size: .78rem; color: var(--ink-soft); }

/* ------------------------------------------------------------- music ----- */
.music-fab { position: fixed; right: 14px; bottom: calc(env(safe-area-inset-bottom) + 14px); z-index: 50; }
.music-fab .chip-btn { box-shadow: var(--shadow); min-height: 56px; padding: 6px 18px; }
.music-panel { position: fixed; right: 14px; bottom: calc(env(safe-area-inset-bottom) + 82px); z-index: 51; width: min(92vw, 340px);
  background: var(--pearl); border-radius: 22px; padding: 16px; box-shadow: var(--shadow); border: 1px solid var(--silver); animation: fadeIn .2s; }
.music-panel input[type=range] { width: 100%; height: 40px; accent-color: var(--button); }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 16px; }
.eq i { width: 3px; background: var(--button); border-radius: 2px; animation: eq 1s infinite ease-in-out; }
.eq i:nth-child(2) { animation-delay: .2s } .eq i:nth-child(3) { animation-delay: .4s }
@keyframes eq { 0%,100% { height: 4px } 50% { height: 16px } }

/* ---------------------------------------------------------- countdown ---- */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; text-align: center; }
.orn { position: relative; padding-top: 14px; }
.orn .ball { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #fff, var(--powder) 45%, #6F93B4); box-shadow: 0 8px 18px rgba(62,106,143,.25); color: #fff; }
.orn:nth-child(2) .ball { background: radial-gradient(circle at 35% 30%, #fff, #E4E8EE 40%, #8E99A7); }
.orn:nth-child(3) .ball { background: radial-gradient(circle at 35% 30%, #fff, #F4F1EA 50%, #BDB4A4); color: var(--ink); }
.orn .ball b { font: 700 1.9rem var(--font-title); color: var(--ink); text-shadow: 0 0 6px #fff, 0 0 2px #fff; }
.orn::before { content: ''; position: absolute; top: 0; left: 50%; width: 14px; height: 16px; margin-left: -7px; border-radius: 4px; background: linear-gradient(#F4F6F8, #B9C1CB); }
.orn small { display: block; margin-top: 6px; font-weight: 800; }

/* -------------------------------------------------------------- misc ----- */
.sealed-wrap { text-align: center; }
.sealed { width: min(70vw, 280px); animation: float 4s ease-in-out infinite; }
.celebrate-card { text-align: center; animation: unfold 1s; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 90px); transform: translateX(-50%); z-index: 90;
  background: var(--ink); color: #fff; padding: 14px 20px; border-radius: 16px; font-weight: 700; max-width: 90vw; box-shadow: var(--shadow); animation: fadeIn .3s; text-align: center; }
.demo-banner { position: relative; z-index: 2; margin: 0 auto 10px; max-width: 760px; font-size: .85rem; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--ice); border-top-color: var(--button); animation: spin 1s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg) } }
hr.flakes { border: 0; height: 26px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Cpath d='M13 3v20M4.3 8l17.4 10M4.3 18l17.4-10' stroke='%23C5CBD3' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center/26px no-repeat; margin: 26px 0; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.retailer h3 { margin-bottom: 2px; }
.retailer dl { display: grid; grid-template-columns: 1fr; gap: 2px 10px; margin: 8px 0; }
.retailer dt { font-weight: 800; margin-top: 6px; } .retailer dd { margin: 0; color: var(--ink-soft); }
.admin-grid { display: grid; gap: 10px; }
.admin-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #E6ECF2; }
.code-box { font: 700 1rem ui-monospace, Menlo, monospace; background: #EEF5FB; padding: 10px; border-radius: 10px; word-break: break-all; }

html.simple .room .light, html.simple .flames, html.simple .giftbox .g-glow { animation: none !important; }
html.simple .card { box-shadow: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .2s !important; }
}
html.reduce *, html.reduce *::before, html.reduce *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
.stage.opening .intro-actions.reveal-actions { opacity: 1; pointer-events: auto; animation: fadeIn .8s; }
.step-lid .g-tag { animation: fadeOut .5s forwards; }
.step-glow .g-body { transition: opacity 1.2s ease .6s; opacity: .45; }
