/* Santa's Nice List Check v01. System fonts only (no web fonts). Pictures come from art.js. */
:root {
  --night: #0f1c3f; --night2: #1b2d63; --gold: #e2b13c; --gold-lt: #ffe08a; --red: #c8102e; --green: #2e8b57;
  --paper: #fbf3dc; --ink: #1d3d8f; --brown: #3b2a1a;
  --serif: Georgia, 'Times New Roman', serif;
  --hand: 'Segoe Print', 'Bradley Hand', 'Noteworthy', 'Chalkboard SE', 'Comic Sans MS', cursive;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --top: env(safe-area-inset-top, 0px); --bot: env(safe-area-inset-bottom, 0px); --left: env(safe-area-inset-left, 0px); --right: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--night); color: #fff; font-family: var(--sans); -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
/* v04: no double-tap-zoom wait on any tap target (the good-thing chips had none, so a phone could hold each tap) */
button, a, input, label, select, .cell { touch-action: manipulation; }
.chip.press, .rough-btn.press { transform: scale(.94); filter: brightness(.92); }
.chip, .rough-btn { transition: transform .06s; }
.hl-n { font-size: 12px; font-weight: 700; color: #9a8a70; }
.sky { position: fixed; inset: 0; background: radial-gradient(120% 70% at 50% 0%, var(--night2) 0%, var(--night) 60%, #091231 100%); z-index: -1; overflow: hidden; }
.snow i { position: absolute; top: -12px; width: var(--s); height: var(--s); border-radius: 50%; background: #fff; opacity: .75; animation: fall var(--d) linear infinite; animation-delay: var(--delay); }
@keyframes fall { to { transform: translate(var(--sway), 105vh); } }

#app { position: relative; max-width: 760px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }
.screen { min-height: 100vh; min-height: 100dvh; padding: calc(var(--top) + 56px) calc(var(--right) + 16px) calc(var(--bot) + 24px) calc(var(--left) + 16px); }
.center-col { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; max-width: 560px; margin: 0 auto; }
.eyebrow { margin: 0; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-lt); font-weight: 700; }
.title { margin: 0; font-family: var(--serif); font-size: clamp(30px, 8.4vw, 46px); line-height: 1.08; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.lead { margin: 0; font-size: 19px; line-height: 1.4; max-width: 30em; }
.small { margin: 0; font-size: 14px; line-height: 1.4; opacity: .8; }
.center { text-align: center; }
[data-art] svg, [data-art] img, .tag svg { display: block; width: 100%; height: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border: 0; border-radius: 999px; font-weight: 800; font-size: 18px; color: #3b2600; text-decoration: none; transition: transform .12s; touch-action: manipulation; }
.btn:active { transform: translateY(2px); }
.btn-gold { background: linear-gradient(#ffe7a0, var(--gold)); box-shadow: 0 4px 0 #a37415, 0 8px 18px rgba(0,0,0,.25); }
.btn-red { background: linear-gradient(#f0485f, var(--red)); color: #fff; box-shadow: 0 4px 0 #7d0a1c, 0 8px 18px rgba(0,0,0,.25); animation: pulse 1.1s ease-in-out infinite alternate; }
.btn-quiet { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); }
.btn-big { font-size: 21px; padding: 16px 30px; min-height: 58px; }
.btn-sm { min-height: 38px; padding: 8px 18px; font-size: 16px; }
.btn-wide { width: 100%; }
.link-btn { background: none; border: 0; color: var(--gold-lt); font-size: 16px; font-weight: 700; text-decoration: underline; padding: 10px; }
@keyframes pulse { to { transform: scale(1.05); } }

.gu-btn { position: absolute; top: calc(var(--top) + 10px); right: calc(var(--right) + 12px); z-index: 20; display: flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; border-radius: 999px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.85); font-size: 13px; font-weight: 700; }
.gu-btn svg { width: 14px; height: 14px; }
.preview-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(var(--top) + 8px) calc(var(--right) + 14px) 8px calc(var(--left) + 14px); background: var(--gold); color: #3b2600; font-weight: 800; font-size: 14px; }
.preview-bar button { border: 0; border-radius: 999px; background: #3b2600; color: #fff; padding: 7px 14px; font-weight: 800; font-size: 14px; }
.preview-bar:not([hidden]) ~ .gu-btn { top: calc(var(--top) + 58px); }
.preview-bar:not([hidden]) ~ .screen { padding-top: 60px; }

/* ---------- welcome and home ---------- */
.hero-art { width: 150px; }
.home-scene { display: flex; align-items: flex-end; justify-content: center; gap: 6px; margin: 6px 0; }
.home-elf { width: 110px; animation: bob 1.6s ease-in-out infinite alternate; }
@keyframes bob { to { transform: translateY(-6px); } }
.closed-book { width: 160px; aspect-ratio: 4 / 5; transform: rotate(-4deg); container-type: inline-size; }
.cb-cover, .lg-cover { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3cqw; height: 100%; border-radius: 4px 12px 12px 4px; background: linear-gradient(90deg, #5e0d19 0 7%, #8f1a2c 7% 9%, #9e1b31 9%, #7d1325 100%); color: var(--gold); box-shadow: 0 10px 24px rgba(0,0,0,.45), inset 0 0 0 2.4cqw rgba(0,0,0,.08), inset 0 0 0 3cqw rgba(226,177,60,.55); font-family: var(--serif); text-align: center; }
.cb-cover b, .lg-cover b { font-size: 9cqw; letter-spacing: .08em; }
.cb-cover small, .lg-cover small { font-size: 6cqw; letter-spacing: .2em; }
.cb-emblem { width: 34cqw; display: block; }
.kid-buttons { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 380px; }
.kid-row { display: flex; gap: 8px; align-items: center; }
.kid-row .kid-go { flex: 1; }
.kid-cert { font-size: 15px; padding: 10px 14px; }

/* ---------- the missing-boot news cutaway ---------- */
.boot-news-desk, .boot-news-cutaway { position: absolute; inset: 0; }
.boot-news-cutaway { opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.boot-cutting .boot-news-cutaway { opacity: 1; }
.boot-cutting .boot-news-desk { visibility: hidden; }
.boot-news-cutaway .sn { width: 100%; height: 100%; }
@media (prefers-reduced-motion: reduce) { .boot-news-cutaway { transition: none; } }

/* ---------- the check ---------- */
#screen-check { display: flex; flex-direction: column; padding-left: calc(var(--left) + 12px); padding-right: calc(var(--right) + 12px); }
.check-top { display: flex; align-items: center; gap: 6px; max-width: 660px; width: 100%; margin: 0 auto 8px; }
.back { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; }
.back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.elf-row { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 84px; }
.elf-small { width: 64px; flex: none; }
.bubble { position: relative; flex: 1; margin: 0; padding: 10px 14px; background: #fff; color: var(--brown); border-radius: 16px; font-size: 17px; font-weight: 700; line-height: 1.3; min-height: 44px; }
.bubble::before { content: ''; position: absolute; left: -8px; top: 50%; margin-top: -8px; border: 8px solid transparent; border-left: 0; border-right-color: #fff; }
.bubble.pop { animation: popIn .25s ease-out; }
@keyframes popIn { from { transform: scale(.92); opacity: .4; } }
.ledger-wrap { position: relative; display: flex; justify-content: center; }
.ledger { position: relative; width: min(90vw, 520px, calc((100vh - 470px) * .87)); width: min(90vw, 520px, calc((100dvh - 470px) * .87)); min-width: 260px; aspect-ratio: 4 / 4.6; container-type: inline-size; perspective: 1800px; cursor: pointer; }
.lg-page { position: absolute; inset: 0; overflow: hidden; border-radius: 4px 12px 12px 4px; border-left: 4.5cqw solid #7a1424; padding: 6cqw 12cqw 6cqw 7cqw; color: var(--brown); font-family: var(--serif);
  background: repeating-linear-gradient(180deg, transparent 0 calc(7.4cqw - 1px), rgba(70,110,170,.22) calc(7.4cqw - 1px) 7.4cqw), linear-gradient(90deg, rgba(0,0,0,.12), transparent 8%), var(--paper);
  background-position: 0 4cqw, 0 0, 0 0; box-shadow: 0 12px 28px rgba(0,0,0,.45); }
.lg-tabs { position: absolute; right: 0; top: 4cqw; bottom: 4cqw; width: 7.5cqw; display: flex; flex-direction: column; gap: .6cqw; }
.lg-tabs i { flex: 1; display: grid; place-items: center; font-style: normal; font-size: 2.6cqw; font-weight: 700; font-family: var(--sans); color: #6d5638; background: #eadbb4; border-radius: 1.4cqw 0 0 1.4cqw; }
.lg-tabs i:nth-child(odd) { background: #e1cd9c; }
.ledger.found .lg-tabs i.on { background: var(--gold); color: #3b2600; transform: translateX(-1.6cqw); transition: transform .3s; }
.lg-head { text-align: center; font-weight: 700; letter-spacing: .14em; font-size: 4.4cqw; color: #7a1424; border-bottom: 1.1cqw double #c9a55a; padding-bottom: 1.6cqw; }
.lg-head small { display: block; font-size: 3.4cqw; letter-spacing: .3em; color: #8a6a3a; }
.lg-letter { text-align: center; font-size: 7cqw; font-weight: 700; color: #7a1424; margin: 1.6cqw 0 .4cqw; opacity: 0; transition: opacity .3s; }
.ledger.found .lg-letter { opacity: 1; }
.lg-lines i { display: block; height: 1.7cqw; margin: 2.8cqw 0 2.8cqw 2cqw; border-radius: 1cqw; background: rgba(59,42,26,.24); }
.lg-lines i:nth-child(2) { background: rgba(29,61,143,.25); }
.lg-entry { opacity: 0; }
.ledger.found .lg-entry { opacity: 1; }
.lg-name { position: relative; display: inline-block; max-width: 100%; margin: 1cqw 0 1.6cqw; padding: 0 2cqw; font-family: var(--hand); font-size: 10cqw; line-height: 1.25; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; clip-path: inset(0 100% 0 0); }
.lg-name.mid { font-size: 8cqw; } .lg-name.long { font-size: 6.2cqw; }
.lg-name.wrap { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; } /* v08: a name too long even when shrunk wraps, never "…" */
.lg-name::before { content: ''; position: absolute; left: 0; right: 0; top: 38%; bottom: 8%; background: rgba(255,214,80,.55); border-radius: 2cqw; z-index: -1; transform: scaleX(0); transform-origin: left; }
.ledger.found .lg-name { clip-path: inset(0 0 0 0); transition: clip-path 1s ease-out; }
.ledger.found .lg-name::before { transform: scaleX(1); transition: transform .5s .9s ease-out; }
.lg-name { z-index: 0; isolation: isolate; }
.lg-deeds { list-style: none; margin: 0; padding: 0; }
.lg-deeds li { position: relative; padding-left: 7cqw; margin: 1.2cqw 0; font-family: var(--hand); font-size: 4.6cqw; line-height: 1.28; color: var(--ink); opacity: 0; transform: translateX(-3cqw); transition: opacity .45s, transform .45s; }
.lg-deeds li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--green); font-weight: 900; font-family: var(--sans); }
.lg-deeds li.show { opacity: 1; transform: none; }
.lg-mark { position: absolute; right: 10cqw; bottom: 3cqw; width: 44cqw; opacity: 0; transform: rotate(-12deg) scale(2.4); mix-blend-mode: multiply; pointer-events: none; }
.ledger.stamped .lg-mark { opacity: .9; transform: rotate(-12deg) scale(1); transition: transform .18s cubic-bezier(.3,1.7,.5,1), opacity .1s; }
.lg-leaves i { position: absolute; top: 1.2cqw; bottom: 1.2cqw; left: 4.5cqw; right: 0; border-radius: 0 12px 12px 0; transform-origin: left center; z-index: 2;
  background: repeating-linear-gradient(180deg, transparent 0 calc(7.4cqw - 1px), rgba(70,110,170,.2) calc(7.4cqw - 1px) 7.4cqw), repeating-linear-gradient(180deg, transparent 0 4.2cqw, rgba(59,42,26,.18) 4.2cqw 5.6cqw, transparent 5.6cqw 7.4cqw), #f8eccd;
  background-size: 100% 100%, 60% 100%; background-repeat: repeat, no-repeat; background-position: 0 0, 12cqw 3cqw; box-shadow: inset 6px 0 10px rgba(0,0,0,.1), 2px 0 4px rgba(0,0,0,.15); }
.lg-leaves i.flip { transform: rotateY(-172deg); opacity: 0; transition: transform .5s ease-in, opacity .18s .34s; }
.lg-cover { position: absolute; inset: 0; z-index: 3; transform-origin: left center; transition: transform .9s cubic-bezier(.5,0,.3,1), opacity .25s .62s; }
.ledger.open .lg-cover { transform: rotateY(-168deg); opacity: 0; pointer-events: none; }
.ledger:not(.open) .lg-cover { animation: nudge 2.2s ease-in-out infinite; }
@keyframes nudge { 0%, 70%, 100% { transform: none; } 80% { transform: rotateY(-14deg); } 90% { transform: rotateY(-4deg); } }
.lg-stamp { position: absolute; right: 12cqw; bottom: 22cqw; z-index: 5; width: 30cqw; padding: 0; border: 0; background: none; filter: drop-shadow(0 10px 8px rgba(0,0,0,.35)); animation: hover 0.9s ease-in-out infinite alternate; }
.lg-stamp::after { content: ''; position: absolute; left: 8%; right: 8%; bottom: -10cqw; height: 6cqw; border-radius: 50%; background: rgba(200,16,46,.18); animation: pulse 0.9s ease-in-out infinite alternate; }
@keyframes hover { from { transform: translateY(-2cqw) rotate(-6deg); } to { transform: translateY(2cqw) rotate(-6deg); } }
.lg-stamp.down { animation: none; transform: translateY(15cqw) rotate(-10deg) scale(.96); transition: transform .2s ease-in; }
.ledger.shake { animation: shake .4s; }
@keyframes shake { 20% { transform: translate(-1.5%, 1%); } 40% { transform: translate(1.5%, -1%); } 60% { transform: translate(-1%, .5%); } 80% { transform: translate(1%, 0); } }
.burst { position: absolute; left: 50%; top: 72%; width: 0; height: 0; pointer-events: none; z-index: 6; }
.burst i { position: absolute; width: var(--s); height: var(--s); margin: calc(var(--s) / -2); border-radius: 50%; background: #fff; box-shadow: 0 0 6px rgba(255,255,255,.9); animation: pop var(--t) ease-out forwards; }
.burst i:nth-child(3n) { background: var(--gold-lt); }
@keyframes pop { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(var(--dx), calc(var(--dy) + 60px)); opacity: 0; } }
.check-foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; min-height: 84px; padding-top: 16px; }
.check-foot .eve-done { min-width: 78%; } /* Nov 16: Christmas Eve, the last child's Done takes the row, so Santa's corner stays clear */

/* ---------- the certificate (one design, on screen and on paper) ---------- */
.cert-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 560px; margin: 0 auto 12px; font-size: 18px; }
.cert-top span { width: 44px; }
.cert-fit { width: 100%; max-width: 640px; margin: 0 auto; overflow: hidden; }
.cert-scale { transform-origin: 0 0; }
.cert-actions { display: flex; justify-content: center; gap: 10px; margin: 16px 0 8px; flex-wrap: wrap; }
.cert { position: relative; width: 7.3in; height: 9.6in; padding: 0; background: #fffdf6; color: var(--brown); font-family: var(--serif); text-align: center; border: .11in solid #b3122c; box-shadow: 0 10px 30px rgba(0,0,0,.4); -webkit-print-color-adjust: exact; print-color-adjust: exact; overflow: hidden; }
.cert-in { position: absolute; inset: .12in; border: 4px double #c9a55a; padding: .55in .5in .4in; display: flex; flex-direction: column; justify-content: space-between; align-items: center; }
.c-group { width: 100%; }
.c-corner { position: absolute; width: 1.05in; z-index: 1; }
.c-corner svg, .c-corner img { display: block; width: 100%; height: auto; }
.c-corner.tl { left: -.02in; top: .1in; transform: rotate(-32deg); }
.c-corner.tr { right: -.02in; top: .1in; transform: rotate(32deg) scaleX(-1); }
.c-corner.bl { left: -.02in; bottom: .1in; transform: rotate(32deg) scaleY(-1); }
.c-corner.br { right: -.02in; bottom: .1in; transform: rotate(-32deg) scale(-1, -1); }
.c-eyebrow { margin: 0; font-size: 11pt; letter-spacing: .24em; text-transform: uppercase; color: #7a1424; font-weight: 700; }
.c-title { margin: .1in 0 0; font-size: 34pt; line-height: 1.08; color: #1f5a3a; }
.c-small { margin: 0; font-size: 14pt; font-style: italic; }
.c-name { display: inline-block; min-width: 4.2in; max-width: 6in; margin: .06in 0 .12in; padding: 0 .25in .04in; font-family: var(--hand); font-size: 50pt; line-height: 1.2; color: var(--ink); border-bottom: 2px solid #c9a55a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-name.mid { font-size: 40pt; } .c-name.long { font-size: 29pt; }
.c-text { margin: 0; font-size: 15pt; line-height: 1.45; }
.c-because { margin: 0 0 .08in; font-size: 16pt; font-style: italic; font-weight: 700; color: #7a1424; }
/* Kevin (Nov 13): Santa's note on the certificate, in the handwriting font */
.c-note { margin: 0 auto; max-width: 5.6in; font-family: var(--hand, cursive); font-size: 19pt; line-height: 1.35; color: #1d3d8f; }
.c-deeds { display: inline-block; margin: 0; padding: 0; list-style: none; text-align: left; max-width: 5.6in; }
.c-deeds li { position: relative; padding-left: .36in; margin: .08in 0; font-family: var(--hand); font-size: 18pt; line-height: 1.3; color: var(--ink); }
.c-deeds li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--green); font-family: var(--sans); font-weight: 900; }
.c-bottom { width: 100%; display: grid; grid-template-columns: 1.2in 1fr 1.95in; align-items: end; gap: .18in; }
.c-seal { width: 1.15in; }
.c-sign { text-align: left; }
.c-hand { display: block; font-family: var(--hand); font-size: 22pt; line-height: 1.1; color: var(--ink); }
.c-hand-sm { font-size: 15pt; margin-top: .14in; }
.c-sign i { display: block; border-top: 1.5px solid var(--brown); margin-top: .02in; }
.c-sign small { display: block; font-size: 8.5pt; margin-top: .03in; color: #6d5638; font-family: var(--sans); }
.c-mark { width: 1.95in; transform: rotate(-9deg); opacity: .9; mix-blend-mode: multiply; }
#print-area { display: none; }

/* ---------- December 24 ---------- */
.night .moon { position: absolute; left: 0; top: -40px; width: 56px; filter: drop-shadow(0 0 18px rgba(255,243,196,.6)); }
.sleigh-scene { display: flex; align-items: flex-end; justify-content: center; width: 100%; max-width: 520px; margin-top: 10px; }
.reindeer { width: 30%; margin-right: -2%; margin-bottom: 4%; }
.sleigh-box { position: relative; width: 70%; }
.gifts { position: absolute; left: 6%; right: 12%; bottom: 42%; display: flex; align-items: flex-end; justify-content: center; gap: 1%; }
.gift { position: relative; flex: 0 1 50%; animation: settle .7s ease-out backwards; }
.gifts[data-n="2"] .gift { flex-basis: 44%; } .gifts[data-n="3"] .gift { flex-basis: 33%; } .gifts[data-n="4"] .gift { flex-basis: 25%; }
.gift:nth-child(2) { animation-delay: .15s; } .gift:nth-child(3) { animation-delay: .3s; } .gift:nth-child(4) { animation-delay: .45s; }
.gift:nth-child(even) { transform: translateY(-6%); }
@keyframes settle { from { transform: translateY(-40px); opacity: 0; } }
.tag { position: absolute; left: 50%; top: 100%; margin-top: -14%; transform: translateX(-50%) rotate(-6deg); z-index: 2; display: flex; flex-direction: column; align-items: center; min-width: 70%; max-width: 118%; padding: 3px 7px 4px; background: #fffaf0; color: var(--brown); border-radius: 4px 12px 12px 4px; box-shadow: 0 3px 6px rgba(0,0,0,.3); font-family: var(--hand); line-height: 1.1; }
.tag b { font-size: clamp(13px, 4.6vw, 24px); color: var(--red); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag small { font-size: clamp(9px, 2.6vw, 13px); }
.gifts[data-n="3"] .tag b, .gifts[data-n="4"] .tag b { font-size: clamp(11px, 3.3vw, 18px); }
.gifts[data-n="3"] .tag small, .gifts[data-n="4"] .tag small { font-size: clamp(8px, 2.1vw, 11px); }
.checklist { list-style: none; margin: 4px 0 0; padding: 0; text-align: left; font-size: 17px; line-height: 1.6; }
.checklist span { color: #7ee2a8; font-weight: 900; margin-right: 6px; }
.countdown { width: 100%; max-width: 420px; padding: 14px 16px; border-radius: 18px; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.2); display: flex; flex-direction: column; gap: 4px; }
.countdown b { font-size: clamp(34px, 10vw, 52px); font-variant-numeric: tabular-nums; color: var(--gold-lt); letter-spacing: .02em; }
.countdown em { font-style: normal; font-size: .45em; opacity: .8; margin-left: 2px; }
.countdown small { font-size: 15px; opacity: .85; line-height: 1.35; }
.countdown.bed b { font-family: var(--serif); font-size: clamp(30px, 8vw, 42px); }

/* ---------- December 25 ---------- */
.plate { width: 190px; }
.santa-note { position: relative; width: 100%; max-width: 540px; padding: 22px 22px 18px; text-align: left; color: var(--ink); font-family: var(--hand); font-size: 19px; line-height: 1.45; transform: rotate(-1deg); border-radius: 6px; box-shadow: 0 12px 28px rgba(0,0,0,.45);
  background: repeating-linear-gradient(180deg, transparent 0 calc(1.45em - 1px), rgba(70,110,170,.2) calc(1.45em - 1px) 1.45em), #fffaf0; background-position: 0 22px; }
.santa-note p { margin: 0 0 .6em; }
.n-corner { position: absolute; right: -10px; top: -18px; width: 86px; transform: rotate(18deg); }
.n-corner svg, .n-corner img { display: block; width: 100%; height: auto; }
.n-dear { font-size: 1.15em; padding-right: 60px; }
.n-merry { font-size: 1.2em; color: var(--red); }
.n-love { margin-bottom: 0 !important; }
.n-sig { font-size: 2em; color: var(--red); line-height: 1.1; }
.n-ps { font-size: .85em; opacity: .85; }
.n-quote { padding-left: 1em; color: #2a5a3a; }

/* ---------- grown-ups ---------- */
.setup { background: #fbf6ea; color: #2b2118; padding: 0 0 calc(var(--bot) + 30px); }
.setup-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: calc(var(--top) + 10px) calc(var(--right) + 16px) 10px calc(var(--left) + 16px); background: var(--night); color: #fff; font-size: 19px; }
#setup-form, .setup-more { padding: 6px 16px 0; max-width: 620px; margin: 0 auto; }
.setup h2 { margin: 24px 0 10px; font-family: var(--serif); font-size: 21px; }
.setup h2 small { font-family: var(--sans); font-size: 14px; font-weight: 400; color: #7a6a50; }
.setup-today { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: #fff1c9; font-size: 15px; line-height: 1.4; }
.kid { margin: 0 0 12px; padding: 10px 14px 14px; border: 1.5px solid #e3d6b8; border-radius: 16px; background: #fff; min-width: 0; }
.kid legend { display: flex; align-items: center; gap: 10px; padding: 0 6px; font-weight: 800; font-size: 16px; color: #7a1424; }
.kid legend .link-btn { color: #9a7b4f; font-size: 14px; padding: 4px; }
.field { display: block; margin: 8px 0; }
.field > span { display: block; font-size: 14px; font-weight: 700; color: #5b4a33; margin-bottom: 4px; }
.field input { width: 100%; font: inherit; font-size: 17px; padding: 11px 12px; border: 1.5px solid #d8c9a6; border-radius: 10px; background: #fffdf8; color: #2b2118; min-height: 46px; }
.field input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.field.deed { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.field.deed > span { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; margin: 0; background: #e9f5ee; color: var(--green); font-size: 14px; }
.deed-lead { margin: 12px 0 4px; font-size: 14.5px; color: #5b4a33; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 0; border-radius: 999px; background: #f1e6cc; color: #4a3a22; padding: 8px 12px; font-size: 14px; }
.chip::before { content: '+ '; color: var(--green); font-weight: 800; }
.chip:active { background: var(--gold); }
.hint { margin: 2px 0 8px; font-size: 14px; color: #7a6a50; line-height: 1.4; }
.setup .btn-quiet { background: #efe4cb; color: #3b2a1a; box-shadow: none; font-size: 16px; }
.setup .btn-wide { margin-top: 6px; }
.preview-buttons { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 560px) { .preview-buttons { grid-template-columns: repeat(3, 1fr); } }
.switch { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; font-weight: 700; }
.switch input { position: absolute; opacity: 0; }
.switch-ui { position: relative; width: 50px; height: 30px; border-radius: 999px; background: #cbbd9c; transition: background .2s; flex: none; }
.switch-ui::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .switch-ui { background: var(--green); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--gold); }
.form-error { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: #fde3e6; color: #8a0b1f; font-weight: 700; font-size: 15px; }
.danger { color: #9a2a2a !important; margin-top: 18px; }
.version { font-size: 12px; color: #9a8a70; }

/* ---------- grown-up check, toast ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5,10,30,.7); }
.gate-card { position: relative; width: min(100%, 360px); padding: 24px 20px 20px; border-radius: 20px; background: #fffaf0; color: #2b2118; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.gate-card h2 { margin: 0 0 8px; font-family: var(--serif); }
.gate-card p { margin: 0 0 14px; font-size: 16px; line-height: 1.4; }
.gate-card form { display: flex; justify-content: center; gap: 10px; }
.gate-card input { width: 110px; font: inherit; font-size: 28px; font-weight: 800; text-align: center; padding: 6px; border: 2px solid #d8c9a6; border-radius: 12px; }
.gate-card .x { position: absolute; right: 8px; top: 6px; width: 40px; height: 40px; border: 0; background: none; font-size: 28px; color: #7a6a50; }
.gate-card .form-error { margin: 12px 0 0; }
.gate-card.shake { animation: shake .4s; }

/* v02 parts of the ledger page */
.lg-namerow { display: flex; align-items: baseline; justify-content: space-between; gap: 2cqw; margin-top: 3cqw; }
.lg-namerow .lg-name { margin: 0; }
.lg-date { flex: none; font-family: var(--sans); font-size: 3.4cqw; font-weight: 700; color: #8a6a3a; white-space: nowrap; }
.lg-label { margin: 2.4cqw 0 .6cqw; font-style: italic; font-weight: 700; font-size: 4.2cqw; color: #7a1424; }
.lg-rough { display: flex; gap: 3cqw; align-items: flex-start; margin-top: 4cqw; opacity: 0; transform: translateY(2cqw); transition: opacity .5s, transform .5s; }
.lg-rough.show { opacity: 1; transform: none; }
.lg-rough .rm { flex: none; width: 13cqw; margin-top: 1cqw; }
.lg-rough b { display: block; font-family: var(--hand); font-weight: 400; font-size: 5.6cqw; color: var(--red); line-height: 1.2; }
.lg-rough q { display: block; font-family: var(--hand); font-size: 4.2cqw; color: #6d5638; line-height: 1.3; }
.lg-rough span { display: block; margin-top: 1.4cqw; font-family: var(--hand); font-size: 4.8cqw; color: var(--ink); line-height: 1.3; }
.lg-empty { margin: 4cqw 0 0; font-family: var(--hand); font-size: 4.6cqw; line-height: 1.35; color: #6d5638; opacity: 0; transition: opacity .5s; }
.lg-empty.show { opacity: 1; }
.lg-days { position: absolute; left: 7cqw; right: 12cqw; bottom: 3.5cqw; display: flex; flex-wrap: wrap; gap: 1cqw; opacity: 0; transition: opacity .5s; }
.ledger.days .lg-days { opacity: 1; }
.d { width: 5.8cqw; display: flex; flex-direction: column; align-items: center; font-style: normal; }
.d b { width: 5.4cqw; height: 5.4cqw; border-radius: 50%; display: grid; place-items: center; font-family: var(--sans); font-size: 3.2cqw; color: #fff; background: rgba(59,42,26,.1); }
.d.good b { background: var(--gold); color: #5a3d00; }
.d.rough b { background: #fde3e6; }
.d.rough b svg { width: 80%; height: auto; display: block; }
.d small { font-family: var(--sans); font-size: 2.3cqw; color: #8a6a3a; line-height: 1.3; }
.d.today b { box-shadow: 0 0 0 .6cqw var(--ink); }
.ledger.days .d.today b { animation: popIn .5s ease-out; }
.ledger.finale .lg-mark { bottom: 21cqw; }
.ledger.finale .lg-stamp { bottom: 40cqw; }

/* the Nice-o-meter */
.meter { width: min(92vw, 360px); margin: 10px auto 0; text-align: center; cursor: pointer; }
.meter-title { margin: 0 0 2px; font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-lt); }
.dial { position: relative; width: 100%; max-width: 180px; margin: 0 auto; aspect-ratio: 220 / 125; }
.dial-face svg, .dial-face img { display: block; width: 100%; height: auto; }
.needle { position: absolute; left: calc(50% - 3px); bottom: 10.4%; width: 6px; height: 56%; border-radius: 3px 3px 0 0; background: linear-gradient(#ffffff, #ffd56b); transform-origin: 50% 100%; transform: rotate(-90deg); box-shadow: 0 0 6px rgba(0,0,0,.45); }
.hub { position: absolute; left: 50%; top: 89.6%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--gold); border: 3px solid #fff; }
.meter-level { margin: 4px 0; min-height: 1.25em; font-family: var(--serif); font-weight: 800; font-size: 26px; line-height: 1.2; color: var(--gold-lt); }
.meter-level.pop { animation: popIn .35s ease-out; }
.meter-level.big { font-size: 32px; text-shadow: 0 0 14px rgba(255,214,107,.7); }
.meter-level.z0 { color: #b9cdf2; } .meter-level.z1 { color: #a5e3bb; } .meter-level.z2 { color: #7fe0a6; } .meter-level.z3 { color: var(--gold-lt); }
.meter-zones { display: flex; justify-content: space-between; gap: 4px; }
.meter-zones span { flex: 1; padding: 4px 2px; border-radius: 999px; font-size: 11.5px; line-height: 1.2; opacity: .5; }
.meter-zones span.on { opacity: 1; font-weight: 800; background: rgba(255,255,255,.18); }

/* home, certificate, preview bar */
.kid-go { flex-direction: column; gap: 0; position: relative; line-height: 1.15; }
.kid-go .lvl { font-size: 13px; font-weight: 700; opacity: .75; }
.kid-go .new { position: absolute; top: -9px; right: 16px; padding: 3px 9px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; letter-spacing: .08em; box-shadow: 0 2px 4px rgba(0,0,0,.3); }
#home-sleigh { margin-top: 4px; }
#morning-certs { flex-direction: row; flex-wrap: wrap; justify-content: center; max-width: 520px; }
.c-days { margin: .1in 0 0; font-style: italic; font-size: 12pt; color: #6d5638; }
.preview-bar { gap: 6px; }
.preview-bar #preview-what { flex: 1; text-align: center; }
.preview-bar .pv-step { width: 36px; height: 34px; padding: 0; font-size: 24px; line-height: 1; }

/* grown-ups: the day's report and highlights */
.setup-in { max-width: 620px; margin: 0 auto; padding: 0 16px; }
.setup-in #setup-form { padding: 0; }
.panel { margin: 0 0 8px; }
.field select { width: 100%; font: inherit; font-size: 17px; padding: 11px 12px; border: 1.5px solid #d8c9a6; border-radius: 10px; background: #fffdf8; color: #2b2118; min-height: 46px; }
.lvl-sm { font-weight: 700; font-size: 12px; color: var(--green); background: #e9f5ee; border-radius: 999px; padding: 2px 8px; }
.day-kid legend span { font-size: 18px; }
.deed-lead small { color: #9a8a70; }
.chip.on { background: var(--green); color: #fff; }
.chip.on::before { content: '✓ '; color: #fff; }
.own { display: flex; gap: 8px; margin-top: 10px; }
.own input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 9px 12px; border: 1.5px solid #d8c9a6; border-radius: 10px; background: #fffdf8; }
.setup .own .btn-quiet { min-height: 42px; }
.rough-btn { margin-top: 10px; padding: 8px 16px; border: 1.5px solid var(--red); border-radius: 999px; background: #fff; color: var(--red); font-weight: 800; font-size: 15px; }
.rough-btn.on { background: var(--red); color: #fff; }
.rough-tell { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: #fff4f5; color: #7a1424; font-size: 14px; line-height: 1.35; }
.rough-extra { display: grid; grid-template-columns: 1fr; gap: 0; }
.rough-extra .field, .rough-public .field input { min-width: 0; }
.rough-copy { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.rough-extras { list-style: none; margin: 2cqw 0 0; padding: 0; }
.rough-extras li { margin-top: 2cqw; font-family: var(--hand); font-size: 4.4cqw; line-height: 1.25; }
.rough-extras strong { display: block; font-family: var(--sans); font-size: 2.9cqw; color: var(--red); }
.rough-extras .good strong { color: var(--green); }
.ledger.rough-detail { aspect-ratio: 4 / 5.7; }
.ledger.rough-detail .lg-rough { gap: 2cqw; margin-top: 2cqw; }
.ledger.rough-detail .lg-rough .rm { width: 7cqw; }
.ledger.rough-detail .rough-reason { font-size: 4.4cqw; }
.remind { margin: 0; padding: 9px 16px; border: 0; border-radius: 999px; background: rgba(255,224,138,.92); color: #3b2600; font-weight: 800; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.handoff-card .handoff-kids { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.handoff-card .link-btn { color: #7a6a50; }
.santa-video { width: 100%; max-width: 480px; margin: 4px 0; }
.santa-video video { display: block; width: 100%; border-radius: 14px; background: #000; }
.santa-video figcaption { margin-top: 6px; font-size: 14px; opacity: .85; }
/* ================= v03 ================= */
.snd-btn { position: absolute; top: calc(var(--top) + 10px); left: calc(var(--left) + 12px); z-index: 20; width: 40px; height: 34px; border: 0; border-radius: 999px; background: rgba(255,255,255,.12); font-size: 17px; line-height: 1; }
/* v05 (Kevin, via Codex: "does not have sound"): sound turned off must be easy to see, not a faded icon */
.snd-btn.off { background: #fff; box-shadow: 0 0 0 2px #c0392b; }
.preview-bar:not([hidden]) ~ .snd-btn { top: calc(var(--top) + 58px); }
.ios-hint { opacity: .7; }
.kid-row .kid-cal, .kid-row .kid-cert { flex: none; width: 58px; min-height: 58px; padding: 0; font-size: 22px; }
.kid-go .new.done { background: var(--green); }
.ledger.still *, .ledger.still { transition: none !important; animation: none !important; }
.btn-cal { font-size: 16px; }
.jump-test { display: block; margin: 6px 0 0 auto; padding: 6px 0; color: #9a6a00; font-size: 15px; }
#test-panel { scroll-margin-top: 70px; }
.test-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--gold); color: #3b2600; font-size: 15px; line-height: 1.4; }
.test-note .link-btn { color: #3b2600; padding: 0 0 0 6px; font-size: 15px; }
#unlock-kids { display: flex; flex-direction: column; gap: 8px; }
.day-kid legend .day-clear { margin-left: auto; font-size: 13px; color: #9a7b4f; }
.field > span small { font-weight: 400; color: #9a8a70; }

/* the December calendar */
#screen-cal .cert-top { margin-bottom: 8px; }
.cal-kids { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 auto 10px; max-width: 560px; }
.cal-kid { border: 0; border-radius: 999px; padding: 8px 14px; background: rgba(255,255,255,.12); color: #fff; font-weight: 700; font-size: 15px; }
.cal-kid.on { background: var(--gold); color: #3b2600; }
.cal { max-width: 560px; margin: 0 auto; padding: 14px 10px 12px; border-radius: 22px; background: #fffaf0; color: #2b2118; box-shadow: 0 12px 28px rgba(0,0,0,.4); }
.cal-month { margin: 0 6px 8px; font-family: var(--serif); font-size: 24px; font-weight: 800; color: var(--red); }
.cal-wd, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd span { text-align: center; font-size: 12px; font-weight: 700; color: #9a8a70; padding-bottom: 4px; }
.cell { position: relative; aspect-ratio: 1 / 1.08; border: 0; border-radius: 12px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 4px 0 0; font: inherit; color: #2b2118; box-shadow: inset 0 0 0 1px #efe4cb; }
.cell.blank { background: none; box-shadow: none; }
.cell .n { font-size: 15px; font-weight: 700; line-height: 1.2; }
.cell .m { flex: 1; display: grid; place-items: center; width: 100%; font-size: 15px; }
.cell .ck { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #5a3d00; font-size: 14px; }
.cell .rm { display: block; width: 26px; }
.cell .rm svg { display: block; width: 100%; height: auto; }
.cell.good { background: #fff6dc; }
.cell.today { box-shadow: inset 0 0 0 3px var(--ink); }
.cell.today .n { color: #fff; background: var(--red); border-radius: 999px; padding: 0 7px; }
.cell.future { background: #f4efe4; color: #b9ad98; box-shadow: none; }
.cell.future .m { color: var(--gold); font-size: 16px; }
.cell.xmas.future { background: #fdf0d2; }
.cal-key { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 6px; margin: 12px 0 0; font-size: 13px; color: #6d5638; }
.cal-key .k { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; margin-left: 8px; }
.cal-key .k.good { background: var(--gold); color: #5a3d00; }
.cal-key .k.rough { background: #fde3e6; padding: 3px; }
.cal-key .k.rough svg { width: 100%; height: auto; display: block; }
.cal-key .k.none { background: #fff; box-shadow: inset 0 0 0 1px #e3d6b8; }
.map-slot { max-width: 560px; margin: 16px auto 0; }

/* a past day from the calendar */
.daypop { position: relative; width: min(100%, 400px); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.dp-elf { width: 80px; margin-bottom: -28px; z-index: 1; }
.dp-page { width: 100%; container-type: inline-size; padding: 6cqw 7cqw 7cqw 10cqw; border-radius: 4px 14px 14px 4px; border-left: 4.5cqw solid #7a1424; color: var(--brown); font-family: var(--serif); box-shadow: 0 14px 30px rgba(0,0,0,.5);
  background: repeating-linear-gradient(180deg, transparent 0 calc(8cqw - 1px), rgba(70,110,170,.22) calc(8cqw - 1px) 8cqw), var(--paper); }
.dp-page .lg-name { clip-path: none; }
.dp-page .lg-name::before { transform: scaleX(1); }
.dp-page .lg-deeds li { font-size: 5.4cqw; }
.dp-page .lg-rough b { font-size: 6cqw; } .dp-page .lg-rough span { font-size: 5.2cqw; }
.dp-page .lg-empty { font-size: 5.2cqw; }
.dp-page .lg-label { font-size: 4.8cqw; }
.dp-approved { margin: 3cqw 0 0; font-family: Arial Black, Impact, sans-serif; font-size: 8cqw; color: var(--red); transform: rotate(-6deg); }
.santa-video + .countdown { margin-top: 4px; }
#ring-bells { margin-top: -4px; }
.hl-row { display: flex; gap: 10px; align-items: center; padding: 7px 0; font-size: 15.5px; border-bottom: 1px solid #f1e8d4; }
.hl-row:last-child { border-bottom: 0; }
.hl-row input { width: 20px; height: 20px; accent-color: var(--green); flex: none; }
.toast { position: fixed; left: 50%; bottom: calc(var(--bot) + 20px); z-index: 60; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: rgba(15,20,40,.95); color: #fff; font-size: 15px; font-weight: 700; transform: translate(-50%, 140%); opacity: 0; transition: transform .25s, opacity .25s; pointer-events: none; text-align: center; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01s !important; transition-delay: 0s !important; }
}

/* ---------- printing: only the certificate(s), one per page; fits US Letter and A4 ---------- */
@page { margin: 0.45in; }
@media print {
  html, body { background: #fff !important; min-height: 0; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  .cert-page { display: flex; justify-content: center; break-after: page; page-break-after: always; }
  .cert-page:last-child { break-after: auto; page-break-after: auto; }
}

/* ================= v02: the daily check, the Nice-o-meter, the day's report ================= */
.check-body { display: flex; flex-direction: column; align-items: center; }
@media (min-aspect-ratio: 1/1) and (min-width: 700px) {
  .check-body { flex-direction: row; justify-content: center; align-items: center; gap: 32px; }
  .ledger { width: min(48vw, 520px, calc((100vh - 290px) * .87)); width: min(48vw, 520px, calc((100dvh - 290px) * .87)); }
  .meter { width: 300px; }
}
@media print { .check-body { display: none; }
  .cert { box-shadow: none; }
}

/* v04: the December calendar icon */
.cal-ico { width: 1.35em; height: 1.35em; vertical-align: -0.3em; flex: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.kid-cal .cal-ico { width: 30px; height: 30px; }
.home-try { display: block; margin: 14px auto 0; font-size: 15px; opacity: .85; }
/* v04: one clear Home button beside the sound button (the old round back arrows were easy to miss) */
.home-btn { position: absolute; top: calc(var(--top) + 10px); left: calc(var(--left) + 76px); /* v05: was 8px from the sound button, an easy mis-tap that turned sound off */ z-index: 20; height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--gold); color: #3b2600; font-weight: 800; font-size: 15px; touch-action: manipulation; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.preview-bar:not([hidden]) ~ .home-btn { top: calc(var(--top) + 58px); }
.screen .back { display: none; }
/* Nov 16: the day buttons read "‹ Day" and "Day ›" but were still sized as 36px round arrows, so the words spilled over
   the bar and under "Exit test". They now fit their words, and the day's name has the room left (two short lines at most). */
.preview-bar .pv-step { width: auto; height: 34px; padding: 0 11px; font-size: 14px; line-height: 1; white-space: nowrap; flex: none; }
.preview-bar #preview-exit { flex: none; white-space: nowrap; }
.preview-bar #preview-what { min-width: 0; font-size: 12.5px; line-height: 1.2; }
@media (max-width: 359px) { .preview-bar .pv-word { display: none; } .preview-bar .pv-step { font-size: 20px; padding: 0 12px; } }
/* v04: the grown-ups' "how was today?" sits at the top of the start screen and glows at reminder time */
#screen-home .remind { display: block; margin: 0 auto 14px; }
#screen-home .remind.due { animation: remindGlow 1.6s ease-in-out infinite; }
@keyframes remindGlow { 0%, 100% { box-shadow: 0 4px 12px rgba(0,0,0,.3); } 50% { box-shadow: 0 0 0 6px rgba(255,224,138,.35), 0 4px 12px rgba(0,0,0,.3); } }

/* ================= v05: gifts, tonight's surprise, the storm ================= */
.sale #home-try, .sale #jump-test, .sale #test-panel, .sale:not(.practicing) .preview-bar { display: none !important; }
#screen-gift .center-col, .night-wrap { padding-top: calc(var(--top) + 64px); }
.preview-bar:not([hidden]) ~ #screen-gift .center-col, .preview-bar:not([hidden]) ~ #screen-night .night-wrap { padding-top: calc(var(--top) + 112px); }
.gift-elf { margin: 0 auto 14px; max-width: 520px; }
.gift-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 520px; margin: 0 auto; }
.gift-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; border: 0; border-radius: 18px; background: #fbf3df; color: #3b2600; box-shadow: 0 6px 16px rgba(0,0,0,.35); touch-action: manipulation; transition: transform .1s; }
.gift-card:active { transform: scale(.96); }
.gift-pic { font-size: 46px; line-height: 1; }
.gift-card b { font-size: 17px; }
.gift-card small { font-size: 13px; line-height: 1.3; color: #6d5638; }
.gift-sent { text-align: center; margin: 10px auto 6px; max-width: 420px; }
.gift-sent p { font-size: 19px; font-weight: 800; color: var(--gold-lt); }
.gift-fly { font-size: 84px; line-height: 1; margin: 8px 0; }
.gift-fly.go { animation: giftFly 1.6s cubic-bezier(.3,0,.4,1) both; }
@keyframes giftFly { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-12px) scale(1.15) rotate(-6deg); } 100% { transform: translateY(0) scale(1); } }
.gift-sent.pop .gift-fly { filter: drop-shadow(0 0 18px rgba(255,224,138,.9)); }
#gift-foot { position: static; margin-top: 14px; }

.night-wrap { max-width: 560px; margin: 0 auto; padding-left: 16px; padding-right: 16px; padding-bottom: calc(var(--bot) + 24px); display: flex; flex-direction: column; gap: 12px; }
.night-title { margin: 0; text-align: center; font-family: var(--serif, Georgia, serif); font-size: 26px; color: var(--gold-lt); }
.night-stage { position: relative; height: 190px; border-radius: 22px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 10%, #26407a, #0d1834); box-shadow: inset 0 0 0 2px rgba(255,224,138,.25); }
.scene-pic { font-size: 92px; line-height: 1; animation: sceneBob 2.6s ease-in-out infinite; }
@keyframes sceneBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.scene-arrival .scene-pic { animation: elfDrop 1.2s cubic-bezier(.3,1.6,.5,1) both, sceneBob 2.6s 1.2s ease-in-out infinite; }
@keyframes elfDrop { 0% { transform: translateY(-180px) rotate(-30deg); } 100% { transform: translateY(0) rotate(0); } }
.scene-news, .scene-weather { background: linear-gradient(#1b2d5c, #0d1834 70%, #3b2a12 70%); }
.scene-alert { background: linear-gradient(#5c1b1b, #2a0d0d 70%, #3b2a12 70%); animation: alertFlash 1s steps(2) infinite; }
@keyframes alertFlash { 50% { box-shadow: inset 0 0 0 4px #ff5a5a; } }
.news-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 12px; background: var(--red); color: #fff; font-weight: 900; letter-spacing: .14em; font-size: 14px; text-align: left; }
.scene-alert .news-bar { background: #ffd23f; color: #3b0000; }
.scene-party { background: radial-gradient(circle at 50% 30%, #6a2a7a, #1a0d34); }
.scene-party .scene-pic { animation: partyPop .8s cubic-bezier(.3,1.7,.5,1) both, sceneBob 2.6s .8s ease-in-out infinite; }
@keyframes partyPop { 0% { transform: scale(.2) rotate(-40deg); } 100% { transform: scale(1) rotate(0); } }
.night-stage.big .scene-pic { font-size: 120px; }
.scene-story { background: radial-gradient(120% 90% at 50% 20%, #3a2b18, #140d06); }
.scene-letter { background: radial-gradient(circle, #4a3216, #1c1206); }
.scene-bedtime { background: radial-gradient(circle at 70% 30%, #23336a, #070b1c); }
[class*="scene-storm"], .scene-storm { background: linear-gradient(#5d6b85, #2c3446); }
.scene-found { background: radial-gradient(circle at 50% 80%, #ffcf6a, #2a2f5c 60%); }
.snowfall { position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(3px 3px at 20% 10%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 60% 30%, #fff 50%, transparent 51%), radial-gradient(3px 3px at 80% 60%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 35% 70%, #fff 50%, transparent 51%), radial-gradient(4px 4px at 50% 50%, #fff 50%, transparent 51%); background-size: 120px 120px; animation: blizzard .9s linear infinite; opacity: .9; }
@keyframes blizzard { from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; } to { background-position: -60px 120px, -40px 120px, -80px 120px, -30px 120px, -50px 120px; } }
.night-card { background: #fffdf6; color: #2b2118; border-radius: 18px; padding: 16px 18px; box-shadow: 0 8px 20px rgba(0,0,0,.35); min-height: 120px; }
.night-who { display: inline-block; margin-bottom: 6px; padding: 2px 10px; border-radius: 999px; background: var(--green); color: #fff; font-size: 13px; letter-spacing: .06em; }
.night-card p { margin: 0; font-size: 19px; line-height: 1.5; }
.night-card.page p { font-family: var(--hand, cursive); font-size: 21px; color: #2a2a6a; }
.night-card.letter { background: #fbf1d8; }
.night-card.letter p { font-family: var(--hand, cursive); font-size: 20px; color: #3b2600; }
.night-card.big p { font-size: 40px; font-weight: 900; text-align: center; color: var(--red); letter-spacing: .06em; }
.night-screen { display: block; margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: #fff1c9; font-weight: 800; font-size: 17px; color: #6a4500; }
.night-dots { display: flex; justify-content: center; gap: 6px; min-height: 8px; }
.night-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.3); }
.night-dots i.on { background: var(--gold-lt); }
.night-nav { display: flex; gap: 10px; justify-content: space-between; }
.night-nav .btn { flex: 1; }
.night-nav .btn:disabled { opacity: .4; }
.night-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick-book { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; border: 0; border-radius: 16px; background: #7a1424; color: #ffe08a; box-shadow: 0 6px 14px rgba(0,0,0,.35); touch-action: manipulation; }
.pick-book span { font-size: 40px; }
.pick-book b { font-size: 15px; line-height: 1.25; }
.job-tick { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #eef7f0; color: #24563a; font-size: 15px; line-height: 1.35; }
.job-tick input { width: 22px; height: 22px; flex: none; accent-color: var(--green); }
#dp-night { margin-bottom: 8px; }
/* v05: keep each card, its picture and the Next button on one phone screen */
.night-stage { height: 150px; }
.scene-pic { font-size: 74px; }
.night-card p { font-size: 17px; line-height: 1.45; }
.night-card.page p { font-size: 18px; line-height: 1.45; }
.night-title { font-size: 22px; }
@media (min-height: 800px) { .night-stage { height: 180px; } .night-card.page p { font-size: 19px; } }
/* ================= v05: animated scenes (scenes.js), from the approved proof of concept ================= */
.night-stage { display: block; place-items: unset; }
.night-stage .sn { display: block; width: 100%; height: 100%; }
.night-stage .scene-spot { position: absolute; right: 10px; top: 8px; font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.sn-fall, .sn-conf { animation: snFall linear infinite; }
.sn-blow { animation: snBlow linear infinite; }
.sn-drop { animation: snDrop 1.1s cubic-bezier(.35,0,.4,1) both; }
.sn-puff { transform-box: fill-box; transform-origin: center; animation: snPuff 1s .95s ease-out both; }
.sn-card { animation: snBob 2.4s ease-in-out infinite; }
/* Kevin: the characters looked like they were shaking; now they only breathe, slowly and barely */
.sn-bob { animation: snIdle 5s ease-in-out infinite; }
.sn-bob2 { animation: snIdle 5s 1.3s ease-in-out infinite; }
.sn-breathe { animation: snIdle 5.5s ease-in-out infinite; }
.sn-wave { transform-box: fill-box; transform-origin: 0% 100%; animation: snWave 1s ease-in-out infinite; }
.sn-fire { transform-box: fill-box; transform-origin: 50% 100%; animation: snFlicker .6s ease-in-out infinite alternate; }
.sn-fire2 { transform-box: fill-box; transform-origin: 50% 100%; animation: snFlicker .45s ease-in-out infinite alternate-reverse; }
.sn-page { transform-box: fill-box; transform-origin: 0% 50%; animation: snTurn 3.2s ease-in-out infinite; }
.sn-alertlight, .sn-swirl { opacity: 0; }
[data-beat="weather"] .sn-swirl, [data-beat="alert"] .sn-swirl { opacity: 1; transform-box: fill-box; transform-origin: center; animation: snSpin 3s linear infinite; }
[data-beat="alert"] .sn-alertlight { opacity: 1; animation: snFlash 1s steps(1) infinite; }
[data-beat="alert"] .sn-ticker-bg { fill: #ffd23f; }
.sn-nutmeg { opacity: 0; transform-box: fill-box; transform-origin: 50% 100%; }
.met .sn-nutmeg { opacity: 1; animation: snPop .7s cubic-bezier(.3,1.7,.5,1) both, snBob 2.4s .7s ease-in-out infinite; }
.sn-tick { stroke-dasharray: 30; stroke-dashoffset: 30; animation: snDraw .5s ease-out forwards; }
.sn-finger { animation: snFinger 3s ease-in-out infinite; }
.sn-flap { transform-box: fill-box; transform-origin: 50% 0%; animation: snFlap 1s .4s ease-out forwards; }
.sn-twinkle { animation: snTwinkle 2s ease-in-out infinite; }
.sn-heart { animation: snRise 3s ease-in infinite; opacity: 0; }
.sn-window { opacity: .15; transition: opacity 1.5s; }
[data-beat="bedtime"] .sn-window, .b-storm-ornament .sn-window { opacity: 1; animation: snGlow 1.6s ease-in-out infinite; }
.sn-sleigh { transform: translate(400px, 60px); transition: transform 2.4s ease-in-out; }
[data-beat="storm"] .sn-sleigh { transform: translate(320px, 70px); }
[data-beat="storm-lantern"] .sn-sleigh { transform: translate(250px, 52px); }
[data-beat="storm-oats"] .sn-sleigh { transform: translate(200px, 78px); }
[data-beat="storm-tools"] .sn-sleigh { transform: translate(160px, 60px); }
[data-beat="storm-ornament"] .sn-sleigh { transform: translate(210px, 86px); }
[data-beat="found"] .sn-sleigh { transform: translate(318px, 124px) scale(.8); }
.sn-team { animation: snBob .45s linear infinite; }
.b-storm-oats .sn-team { animation-duration: .22s; }
.sn-lantern { opacity: .2; }
.b-storm-lantern .sn-lantern { opacity: 1; animation: snGlow .9s ease-in-out infinite; }
.sn-presents { opacity: 0; transition: opacity .8s; }
.b-storm-tools .sn-presents { opacity: 1; }
.sn-treelight { opacity: .15; }
.b-storm-ornament .sn-treelight { opacity: 1; animation: snGlow 1.2s ease-in-out infinite; }
.sn-fog { transition: opacity 2.5s; }
.b-found .sn-fog { opacity: 0; }
/* batch 4: the storm with Codex's art. The flight (Nutmeg, the reindeer, the sleigh) is about 150 wide, so it has its own
   path: in from the right, through the storm, then down over the cottage's chimney when Santa finds the house */
/* (kept between y 66 and 78 so Santa's hat stays in frame on small phones, which show only y 40 to 180 of the stage) */
.night-stage .sn-sleigh.art { transform: translate(470px, 70px); }
.night-stage[data-beat="storm"] .sn-sleigh.art { transform: translate(300px, 72px); }
.night-stage[data-beat="storm-lantern"] .sn-sleigh.art { transform: translate(250px, 66px); }
.night-stage[data-beat="storm-oats"] .sn-sleigh.art { transform: translate(205px, 78px); }
.night-stage[data-beat="storm-tools"] .sn-sleigh.art { transform: translate(170px, 68px); }
.night-stage[data-beat="storm-ornament"] .sn-sleigh.art { transform: translate(215px, 72px); }
.night-stage[data-beat="found"] .sn-sleigh.art { transform: translate(282px, 86px) scale(.7); }
.sn-live { animation: snFlash 1.2s steps(1) infinite; }
/* Kevin: on "Goodnight", the house light goes out and the night dims before the app returns to the start screen */
.night-stage.lights-out .sn-window { opacity: 0 !important; animation: none !important; transition: opacity 1.1s ease-in; }
.night-stage.lights-out .sn { filter: brightness(.7); transition: filter 1.4s ease-in; }
.sn-fireglow { transform-box: fill-box; transform-origin: 50% 100%; animation: snFlicker .7s ease-in-out infinite alternate; }
/* batch 5: the story's own picture in the corner spot, floating gently */
.night-stage .scene-spot.pic { right: 8px; top: 6px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.45)); animation: snBob 3.2s ease-in-out infinite; }
.night-stage .scene-spot.pic img { display: block; width: 64px; height: 64px; }
@media (max-height: 700px) { .night-stage .scene-spot.pic img { width: 46px; height: 46px; } }
@media (min-width: 700px) { .night-stage .scene-spot.pic img { width: 96px; height: 96px; } }
@keyframes snFall { from { transform: translateY(-30px); } to { transform: translateY(250px); } }
@keyframes snBlow { from { transform: translate(0, -40px); } to { transform: translate(-160px, 260px); } }
@keyframes snDrop { 0% { transform: translateY(-200px) rotate(-20deg); } 70% { transform: translateY(8px) rotate(3deg); } 85% { transform: translateY(-5px); } 100% { transform: translateY(0); } }
@keyframes snPuff { 0% { opacity: 0; transform: scale(.3); } 60% { opacity: 1; } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes snBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes snIdle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.2px); } }
@keyframes snWave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-28deg); } }
@keyframes snFlicker { from { transform: scaleY(1); } to { transform: scaleY(1.15) scaleX(.92); } }
@keyframes snTurn { 0%, 60% { transform: scaleX(1); } 80% { transform: scaleX(-1); } 100% { transform: scaleX(1); } }
@keyframes snSpin { to { transform: rotate(-360deg); } }
@keyframes snFlash { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .2; } }
@keyframes snPop { 0% { transform: scale(.2); } 100% { transform: scale(1); } }
@keyframes snDraw { to { stroke-dashoffset: 0; } }
@keyframes snFinger { 0% { transform: translate(120px, 52px); } 50% { transform: translate(120px, 160px); } 100% { transform: translate(120px, 52px); } }
@keyframes snFlap { to { transform: scaleY(-1); } }
@keyframes snTwinkle { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes snRise { 0% { opacity: 0; transform: translateY(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-200px); } }
@keyframes snGlow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .night-stage * { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition-duration: .01s !important; } }
.sn-snow circle { fill: #fff; }
/* v05: short phones keep Next on screen; tablets get a bigger scene */
@media (max-height: 700px) { .night-wrap { padding-top: calc(var(--top) + 54px); gap: 8px; } .night-stage { height: 120px; } .night-title { font-size: 19px; } .night-card { padding: 12px 14px; min-height: 0; } .night-card p, .night-card.page p { font-size: 16px; } }
@media (min-width: 700px) { .night-wrap { max-width: 720px; } .night-stage { height: 300px; } .night-card p { font-size: 19px; } .night-card.page p { font-size: 21px; } }
.early-surprise { display: block; margin: 10px auto 0; font-size: 15px; }
/* v05: the approved gift pictures */
.gift-pic img { width: 92px; height: 92px; object-fit: contain; display: block; }
.gift-fly img { width: 150px; height: 150px; object-fit: contain; display: block; margin: 0 auto; }
/* v05 (Kevin): the home screen is all elf; Pip big, holding the Nice List, his words in a bubble above his head */
.home-bubble { position: relative; display: inline-block; margin: 10px auto 2px; padding: 10px 18px; background: #fff; color: var(--brown); border-radius: 18px; font-size: 19px; font-weight: 800; line-height: 1.3; max-width: 88%; box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.home-bubble::after { content: ''; position: absolute; left: 50%; bottom: -11px; margin-left: -11px; border: 11px solid transparent; border-top-color: #fff; border-bottom: 0; }
.home-scene { position: relative; display: block; width: min(80vw, 340px); margin: 4px auto 6px; }
.home-elf { width: 64%; margin: 0 auto; }
.home-elf img { display: block; width: 100%; height: auto; }
.home-scene .closed-book { position: absolute; z-index: 2; width: 38%; left: 31%; top: 47%; transform: rotate(-6deg); }
@media (max-height: 760px) { .home-scene { width: min(66vw, 300px); } }
.home-scene { width: min(62vw, 290px); }
.home-scene .closed-book { width: 33%; left: 34%; top: 50%; transform: rotate(-8deg); }
#screen-home .title { font-size: clamp(26px, 7.5vw, 44px); margin: 2px 0 4px; }
#screen-home .eyebrow { margin-top: 2px; }
@media (max-height: 760px) { .home-scene { width: min(50vw, 230px); } #screen-home .eyebrow { display: none; } }
/* v05 batch 2: Pip tumbles out of the sky (centre pivot), lands with a puff, then Pip and Holly stand together */
.sn-falling { transform-box: fill-box; transform-origin: center; animation: snFallIn 1.25s cubic-bezier(.4,0,.5,1) both; }
@keyframes snFallIn { 0% { transform: translateY(-190px) rotate(-25deg); opacity: 1; } 80% { transform: translateY(25px) rotate(8deg); opacity: 1; } 100% { transform: translateY(25px) rotate(8deg); opacity: 0; } }
.sn-landed { opacity: 0; animation: snAppear .35s 1.15s ease-out forwards; }
@keyframes snAppear { to { opacity: 1; } }
.sn-puff2 { transform-box: fill-box; transform-origin: 50% 100%; animation: snPuff 1s 1s ease-out both; }
/* the news desk's beacon sits on the desk all the time, and flashes (with a red wash) only on the storm alert */
.sn-alertlight { opacity: 1; }
.sn-alertwash { opacity: 0; }
[data-beat="alert"] .sn-alertwash { animation: snWash 1s steps(1) infinite; }
@keyframes snWash { 0%, 49% { opacity: .22; } 50%, 100% { opacity: 0; } }
/* v05 batch 3: the elf really holds the Nice List now, so the stand-in book is hidden and the elf can be a little bigger */
.home-scene.holding .closed-book { display: none; }
.home-scene.holding .home-elf { width: 70%; }

/* Kevin: "can we make the scene take up the width of the screen instead of having it cropped ... I would like to see the
   scene take up much more": on phones the scene runs edge to edge and shows the whole picture (380 x 220), nothing cut off */
#screen-night .night-stage { height: auto; aspect-ratio: 380 / 220; width: 100vw; max-width: none; margin: 0 calc(50% - 50vw); border-radius: 0; box-shadow: inset 0 2px 0 rgba(255,224,138,.25), inset 0 -2px 0 rgba(255,224,138,.25); }
@media (min-width: 700px) { #screen-night .night-stage { width: 100%; margin: 0; border-radius: 22px; box-shadow: inset 0 0 0 2px rgba(255,224,138,.25); } }
/* Kevin: "what happens if you rotate the phone?": turned sideways, the scene fills the left side as tall as the screen
   allows, and the words and buttons sit on the right */
@media (orientation: landscape) and (max-height: 540px) {
  .night-wrap { max-width: none; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); column-gap: 18px; row-gap: 8px; align-content: start; padding-top: calc(var(--top) + 54px); }
  #screen-night .night-stage { grid-column: 1; grid-row: 1 / span 5; align-self: start; margin: 0; border-radius: 16px; box-shadow: inset 0 0 0 2px rgba(255,224,138,.25); width: min(100%, calc((100vh - var(--top) - 70px) * 1.727)); }
  .night-title, .night-card, .night-dots, .night-nav, .night-pick { grid-column: 2; }
  .night-title { font-size: 19px; text-align: left; }
  .night-card p, .night-card.page p { font-size: 16px; }
}
@media (max-height: 700px) and (orientation: portrait) { .night-title { font-size: 17px; } .night-wrap { gap: 6px; padding-top: calc(var(--top) + 50px); } } /* small phones: the bigger scene still leaves the buttons on screen */
/* Kevin's Gemini scene videos: 16:9, placed exactly where the 380 x 220 scene's 16:9 middle sits, under the code layer */
.night-stage .sn-video { position: absolute; left: 0; top: 1.42%; width: 100%; height: 97.16%; object-fit: fill; display: block; }
.night-stage .sn-video ~ .sn { position: relative; z-index: 1; }
.night-stage .sn-video ~ .sn { position: absolute; inset: 0; } /* the code list layer sits exactly over the still layer below */
/* a background video (Kevin's Gemini clip of a whole 1600 x 900 background) sits exactly where the still background is drawn */
.night-stage .sn-video.bg { top: 0; height: 100%; left: -1.4737%; width: 102.947%; }
/* Kevin: a child's button stays locked until a grown-up tells the elves about today */
.kid-go.locked { filter: saturate(.55) brightness(.85); }
/* Kevin (Nov 13): the shared Nice-o-meter screen, one bar per child, spun one at a time */
.meters-title { font-family: var(--serif, Georgia, serif); color: #ffe08a; font-size: 24px; margin: 10px 0 6px; text-align: center; }
.meters { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 420px; margin: 6px auto 12px; }
.mtr { background: rgba(255,255,255,.08); border: 1px solid rgba(255,224,138,.35); border-radius: 14px; padding: 10px 12px 8px; }
.mtr-top { display: flex; justify-content: space-between; align-items: baseline; color: #fff; font-weight: 700; font-size: 18px; }
.mtr-lvl { color: #ffe08a; font-size: 15px; opacity: 0; transition: opacity .3s; }
.mtr.on .mtr-lvl { opacity: 1; }
.mtr-bar { position: relative; height: 18px; margin-top: 8px; border-radius: 9px; overflow: hidden; background: linear-gradient(90deg, #6a8fd8 0 25%, #66b7a0 25% 50%, #8ccf6a 50% 75%, #f2c94c 75% 100%); opacity: .35; }
.mtr.on .mtr-bar { opacity: 1; transition: opacity .3s; }
.mtr-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255,255,255,.0); border-right: 4px solid #fff; box-shadow: 0 0 10px #fff; transition: width 1s cubic-bezier(.2,.8,.3,1); }
.mtr-zones { display: flex; justify-content: space-between; color: rgba(255,255,255,.7); font-size: 10.5px; margin-top: 4px; }
.mtr-up { display: inline-block; margin-left: 6px; color: #8cf28c; font-size: 13px; transform: scale(0); transition: transform .35s cubic-bezier(.3,1.6,.5,1); }
.mtr.up .mtr-up { transform: scale(1); }
/* Kevin (Nov 13): tapping the locked button wiggles it (no page, no voice) */
.kid-go.locked.wiggle { animation: lockWiggle .45s ease; }
@keyframes lockWiggle { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* Kevin (Nov 13): Dec 1's visitor plays like a movie; each card fades in as the next line starts */
.night-card.fadein { animation: cardIn .6s ease both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .night-card.fadein { animation: none; } }

/* ================= Kevin (Nov 13): the talking Pip and Holly (Dec 1 and Christmas Eve) =================
   Four stacked layers per elf (app.js Puppets switches them): the mouth follows the real voice, the eyes blink on their
   own clock, and the body keeps the gentle idle bob, with a small nod while talking */
.pup .pl { opacity: 0; }
.pup .pl.on { opacity: 1; }
.pup { transform-box: fill-box; transform-origin: 50% 96%; }
.pup.talking { animation: pupNod 1.6s ease-in-out infinite; }
@keyframes pupNod { 0%, 100% { transform: rotate(-1deg); } 50% { transform: rotate(1.2deg); } }
.puppet { position: relative; width: 100%; aspect-ratio: 360 / 520; transform-origin: 50% 96%; animation: snIdle 5s ease-in-out infinite; }
.puppet .pup-in { position: absolute; inset: 0; transform-origin: 50% 96%; }
.puppet .pup-in.talking { animation: pupNod 1.6s ease-in-out infinite; }
.puppet img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.puppet img.pl { opacity: 0; }
.puppet img.pl.on { opacity: 1; }
.elf-small.has-puppet { width: 70px; }
.eve-elf { margin: 4px 0 8px; }
.eve-elf .elf-small { width: 70px; }
@media (prefers-reduced-motion: reduce) { .pup.talking, .puppet, .puppet .pup-in.talking { animation: none !important; } }

/* Kevin (Nov 13): the drawn sleigh and reindeer on Dec 24's "Santa's sleigh" card (both face left; the reindeer leads) */
.sleigh-scene.art .reindeer { width: 26%; margin: 0 3% 0 0; }
.sleigh-scene.art .sleigh-box { width: 71%; }
.sleigh-scene.art .gifts { left: 33%; right: 7%; bottom: 47%; }
.sleigh-scene.art .gifts[data-n="3"], .sleigh-scene.art .gifts[data-n="4"] { left: 19%; right: 3%; }

/* ================= Kevin (Nov 14): talking Santa and Sprocket, and the approved motion =================
   Santa (520 x 400) and Sprocket (420 x 360) use the same four layers as Pip and Holly (app.js Puppets). */
.puppet.santa { aspect-ratio: 520 / 400; }
.puppet.sprocket { aspect-ratio: 420 / 360; }
/* Where Santa speaks but isn't in the picture, his half-body rises from a bottom corner while he speaks, then sinks away.
   The Dec 23 letter: inside the scene, right of the envelope. APPROVED and the Christmas morning note: the page's
   bottom left corner, small, under the text (pointer-events off, so it never blocks a tap). */
.sn-santapop { transform-box: fill-box; transform: translateY(105%); transition: transform .7s cubic-bezier(.3,1.2,.5,1); }
.sn-santapop.up { transform: none; }
.santa-pop { position: fixed; left: max(6px, env(safe-area-inset-left)); bottom: 0; width: min(23vw, 112px); z-index: 40; pointer-events: none;
  transform: translateY(105%); transition: transform .7s cubic-bezier(.3,1.2,.5,1); filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.santa-pop.up { transform: translateY(6%); }
.santa-pop .puppet { animation: none; }
/* the Christmas Eve storm (storm-fly.js): the canvas sits between the town and the elves, then the curtain */
.night-stage .sn-stormfly { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; display: block; }
.night-stage .sn-stormfly ~ .sn { position: absolute; inset: 0; z-index: 2; }
.night-stage .sn-curtain { position: absolute; inset: 0; z-index: 3; background: #0b1430; opacity: 0; pointer-events: none; transition: opacity .4s; }
.night-stage.storm-end .sn-curtain { opacity: 1; transition: opacity 1.8s ease-in; }
/* Dec 12: Nutmeg hops in (motion.js drives her while hopping; then her usual gentle bob) */
.met .sn-nutmeg.hopping { opacity: 1; animation: none; }
.met .sn-nutmeg.hopped { opacity: 1; animation: snBob 2.4s ease-in-out infinite; }
.sn-nutshadow { transform-box: fill-box; transform-origin: 50% 50%; }
.met .sn-nutshadow { opacity: .35; }
/* Christmas Eve's sleigh card: the team glides in; the presents wait until it lands */
.sleigh-scene { will-change: transform; }
.sleigh-scene .reindeer, .sleigh-scene .sleigh-box { transform-origin: 30% 100%; }
.sleigh-scene.gliding .gift { opacity: 0; animation: none; }
.glide-spark { position: fixed; z-index: 30; width: 6px; height: 6px; margin: -3px; border-radius: 50%; pointer-events: none; background: radial-gradient(#fff6c8, rgba(255,214,90,0)); animation: glideSpark 1.1s ease-out forwards; }
@keyframes glideSpark { from { opacity: .95; transform: scale(1); } to { opacity: 0; transform: translateY(8px) scale(.3); } }
@media (prefers-reduced-motion: reduce) { .sn-santapop, .santa-pop { transition: none; } .met .sn-nutmeg.hopped { animation: none; } }

/* ---------- Nov 15 (Kevin): brothers and sisters don't have to sit down together ---------- */
/* the start screen's way on to tonight's surprise ("Go on without…"), then any pages a child can still open */
.home-next { display: flex; flex-direction: column; align-items: stretch; gap: 6px; width: 100%; max-width: 380px; }
.home-next:empty { display: none; }
.home-forward { flex-direction: column; gap: 2px; line-height: 1.2; text-align: center; }
.home-forward small { font-size: 14px; font-weight: 700; opacity: .92; }
.home-forward.btn-quiet { box-shadow: inset 0 0 0 2px var(--gold-lt); }
.home-catch { display: block; margin: 0 auto; padding: 8px 10px; font-size: 15px; }
/* three or four children plus the extra button: the elf steps back so the button stays on the screen */
.home-scene.crowd { width: min(40vw, 170px); }
.home-scene.tight { width: min(30vw, 130px); }
@media (max-height: 760px) { .home-scene.crowd { width: min(36vw, 150px); } .home-scene.tight { width: min(27vw, 112px); } }
/* a past day's page: its quiet buttons are solid, so the calendar behind doesn't show through the words */
.daypop .btn-quiet { background: #27304f; }
/* the calendar: a page this child hasn't opened yet (a little book, not the check or the mark) */
.cell.missed { background: #eef6ff; box-shadow: inset 0 0 0 2px #2f5fb3; }
.cell .pg { display: grid; place-items: center; font-size: 17px; font-weight: 400; animation: pageWait 1.2s ease-in-out infinite alternate; }
.cell.xmas.missed .pg { color: #c98a00; font-size: 20px; }
@keyframes pageWait { to { transform: translateY(-2px) scale(1.12); } }
.cal-key-page { margin-top: 6px; }
.cal-key .k.page { background: #eef6ff; box-shadow: inset 0 0 0 1.5px #2f5fb3; font-size: 11px; }
@media (prefers-reduced-motion: reduce) { .cell .pg { animation: none; } }

/* ================= Nov 17 (the audit's fix 5): short phones =================
   On an iPhone in Safari (about 664 px tall) the way-on button was below the screen on several screens: the child had
   to scroll to find it. These rules tighten only those screens, and only on a phone that is short; a full-height phone
   keeps its look apart from the three small rules at the end, and tablets don't change at all. */
@media (max-height: 700px) and (max-width: 699px) {
  /* the start screen with three big rows (each child, the way-on button, the sleigh): a slightly smaller elf;
     with four or more: slimmer rows too, and a smaller elf still */
  #screen-home.rows3 .home-scene { width: min(46vw, 176px); }
  #screen-home.rows4 .center-col { gap: 10px; }
  #screen-home.rows4 .home-scene { width: min(44vw, 166px); margin: 0 auto; }
  #screen-home.rows5 .home-scene { width: min(29vw, 108px); }
  #screen-home.rows6 .home-scene { width: min(27vw, 100px); }
  /* the same with the gold practice bar across the top */
  .practicing #screen-home.rows4 .home-scene { width: min(38vw, 142px); }
  .practicing #screen-home.rows5 .home-scene { width: min(25vw, 94px); }
  #screen-home.rows4 .kid-buttons { gap: 8px; }
  #screen-home.rows4 .kid-buttons .kid-go { min-height: 50px; padding: 8px 14px; font-size: 20px; }
  #screen-home.rows4 .kid-buttons .kid-cal, #screen-home.rows4 .kid-buttons .kid-cert { width: 50px; min-height: 50px; }
  #screen-home.rows4 .home-forward { min-height: 50px; padding: 8px 18px; font-size: 19px; }
  #screen-home.rows4 #home-sleigh { min-height: 50px; padding: 8px 22px; font-size: 20px; margin-top: 0; }
  #screen-home.rows6 .kid-buttons .kid-go { font-size: 17px; padding: 8px 10px; }
  #screen-home.rows6 .kid-buttons .kid-cal, #screen-home.rows6 .kid-buttons .kid-cert { width: 44px; min-height: 44px; font-size: 18px; }
  #screen-home.rows6 .home-forward { font-size: 17px; min-height: 46px; }
  /* a child's page: the buttons under it (three of them with brothers and sisters) */
  .check-foot { gap: 8px; padding-top: 10px; min-height: 70px; }
  .check-foot .btn-big { min-height: 52px; padding: 12px 24px; font-size: 20px; }
  /* Christmas Eve's final check: the book and the Nice-o-meter together were taller than the screen */
  .ledger.finale { min-width: 0; width: min(90vw, 216px); }
  #screen-check.finale .check-top { margin-bottom: 4px; }
  #screen-check.finale .elf-row { min-height: 74px; }
  #screen-check.finale .check-foot { gap: 6px; padding-top: 8px; }
  #screen-check.finale .check-foot .btn-big { min-height: 48px; padding: 10px 22px; font-size: 19px; }
  #screen-check.finale .check-foot .btn-quiet { min-height: 42px; padding: 8px 18px; font-size: 16px; }
  #screen-check.finale .meter { margin-top: 2px; }
  #screen-check.finale .meter .dial { max-width: 122px; }
  #screen-check.finale .meter .meter-level { font-size: 21px; margin: 2px 0; }
  #screen-check.finale .meter .meter-level.big { font-size: 25px; }
  /* the gift: the four cards, and the long "Here's a secret" speech on the family's first gift */
  .gift-pic img { width: 74px; height: 74px; }
  .gift-card { padding: 12px 8px; }
  #screen-gift.long-line .gift-elf { margin-bottom: 4px; }
  #screen-gift.long-line .bubble { font-size: 15.5px; line-height: 1.28; padding: 9px 12px; }
  #screen-gift.long-line .gift-sent { margin: 0 auto; }
  #screen-gift.long-line .gift-fly { margin: 0; }
  #screen-gift.long-line .gift-fly img { width: 104px; height: 104px; }
  #screen-gift.long-line .gift-sent p { font-size: 17px; margin: 6px 0 0; }
  #screen-gift.long-line #gift-foot { margin-top: 4px; padding-top: 8px; }
  /* four children's Nice-o-meters */
  .meters[data-n="4"] { gap: 8px; margin-bottom: 4px; }
  .meters[data-n="4"] .mtr { padding: 7px 12px 6px; }
  .meters[data-n="4"] .mtr-bar { height: 14px; margin-top: 5px; }
  .meters[data-n="4"] ~ .check-foot { padding-top: 6px; }
  /* tonight's surprise: the longest story pages, the storm card naming four children's gifts, pick-a-story's four books */
  .night-wrap { gap: 5px; padding-top: calc(var(--top) + 46px); }
  .night-card.page { padding: 9px 14px; }
  .night-card.page p { font-size: 16px; line-height: 1.3; }
  .night-screen { margin-top: 6px; padding: 6px 10px; font-size: 15px; line-height: 1.3; }
  .night-pick { gap: 8px; }
  .pick-book { flex-direction: row; justify-content: flex-start; text-align: left; gap: 8px; padding: 8px 10px; }
  .pick-book span { font-size: 28px; line-height: 1; }
  .pick-book b { font-size: 14px; line-height: 1.2; }
}
/* a full-height phone (390 x 844): only what ran a few pixels over */
@media (min-height: 701px) and (max-height: 860px) and (max-width: 699px) {
  .night-wrap { gap: 9px; }
  #screen-home.rows4 .home-scene { width: min(52vw, 204px); }
  #screen-home.rows5 .home-scene { width: min(36vw, 138px); }
  #screen-home.rows6 .home-scene { width: min(29vw, 112px); }
  /* where the elf had already stepped back for the way-on button (the rules of .crowd and .tight), it keeps that size:
     the three rules above were making it bigger there, which pushed the lines under the buttons further down */
  #screen-home.rows4 .home-scene.crowd { width: min(40vw, 170px); }
  #screen-home.rows4 .home-scene.tight { width: min(30vw, 130px); }
  #screen-home.rows6 .home-scene.tight { width: min(29vw, 112px); }
  #screen-home.rows4 .kid-buttons .kid-go { padding-left: 14px; padding-right: 14px; }
  #screen-home.rows6 .kid-buttons .kid-go { font-size: 18px; padding: 8px 10px; }
  #screen-home.rows6 .kid-buttons .kid-cal, #screen-home.rows6 .kid-buttons .kid-cert { width: 48px; min-height: 48px; }
  /* Christmas Eve's page after the stamp: its second button was half off the bottom */
  .ledger.finale { width: min(90vw, 520px, calc((100dvh - 506px) * .87)); }
}

/* ================= Nov 18 (v06): the smallest phone and the tablet on its side =================
   Two sizes still had the gold way-on button below the first screenful after the Nov 17 rules: the smallest phone
   (320 x 568, 44 screens) and a tablet on its side (1180 x 820, 20 screens). These rules apply only to a phone screen
   600 px tall or less, held upright, and to a tablet on its side 541 to 900 px tall; the iPhone sizes, a phone turned
   sideways and the upright tablet don't change. Words, art, sounds and the story are the same; only sizes and spacing move. */

/* -- both sizes: tonight's surprise. The screen's own top padding is dropped (the night page already has its own room
   under the Home and sound buttons), and the picture gives way, a little smaller, whole and never cropped, only on a
   card whose words would otherwise push the buttons below the screen. Santa's letter and pick-a-story still scroll. -- */
@media (max-height: 600px) and (max-width: 699px) and (orientation: portrait), (orientation: landscape) and (min-width: 700px) and (min-height: 541px) and (max-height: 900px) {
  #screen-night { padding-top: 0; padding-bottom: 0; }
  #screen-night .night-wrap { height: 100vh; height: 100dvh; padding-top: calc(var(--top) + 52px); padding-bottom: calc(var(--bot) + 12px); }
  .preview-bar:not([hidden]) ~ #screen-night .night-wrap { height: calc(100vh - 50px); height: calc(100dvh - 50px); padding-top: calc(var(--top) + 52px); }
  #screen-night .night-wrap > * { flex-shrink: 0; }
  #screen-night .night-wrap > .night-stage { flex: 0 1 auto; width: auto; max-width: none; align-self: center; margin-left: 0; margin-right: 0; }
  #screen-night .night-wrap:has(.night-card.letter), #screen-night .night-wrap:has(.night-pick:not([hidden])) { height: auto; }
}
@media (max-height: 600px) and (max-width: 699px) and (orientation: portrait) {
  #screen-night .night-wrap > .night-stage { height: calc(100vw * 220 / 380); min-height: 112px; }
}
@media (orientation: landscape) and (min-width: 700px) and (min-height: 541px) and (max-height: 900px) {
  #screen-night .night-wrap > .night-stage { height: calc((min(100vw, 720px) - 32px) * 220 / 380); min-height: 250px; }
}

/* -- the smallest phone (600 px tall or less, upright) -- */
@media (max-height: 600px) and (max-width: 699px) and (orientation: portrait) {
  /* the first screen a grown-up sees */
  #screen-welcome .eyebrow { display: none; }
  #screen-welcome .hero-art { width: 112px; }
  /* the start screen: a smaller elf, a one-line title, and slimmer rows */
  #screen-home .title { font-size: 21px; }
  #screen-home .center-col { gap: 9px; }
  #screen-home .home-bubble { font-size: 17px; padding: 8px 14px; margin-top: 4px; }
  #screen-home .home-scene { width: min(40vw, 128px); }
  #screen-home.rows3 .home-scene { width: min(36vw, 116px); }
  #screen-home.rows4 .home-scene { width: min(31vw, 100px); }
  #screen-home.rows5 .home-scene, #screen-home .home-scene.crowd { width: min(23vw, 74px); }
  #screen-home.rows6 .home-scene, #screen-home .home-scene.tight { width: min(18vw, 58px); }
  #screen-home .kid-buttons { gap: 7px; }
  #screen-home .kid-buttons .kid-go { min-height: 48px; padding: 6px 12px; font-size: 19px; }
  #screen-home .kid-buttons .kid-cal, #screen-home .kid-buttons .kid-cert { width: 46px; min-height: 46px; }
  #screen-home.rows4 .kid-buttons .kid-go { font-size: 17px; line-height: 1.12; }
  #screen-home.rows4 .home-forward { line-height: 1.12; }
  #screen-home.rows6 .center-col { gap: 6px; }
  #screen-home.rows6 .kid-buttons { gap: 6px; }
  #screen-home.rows6 .home-forward { font-size: 16px; padding: 6px 10px; min-height: 46px; }
  #screen-home .home-forward { min-height: 48px; padding: 6px 16px; }
  #screen-home #home-sleigh { min-height: 46px; padding: 6px 20px; }
  .preview-bar:not([hidden]) ~ #screen-home .home-scene, .practicing #screen-home .home-scene { width: min(30vw, 96px); }
  .preview-bar:not([hidden]) ~ #screen-home.rows4 .home-scene, .practicing #screen-home.rows4 .home-scene { width: min(22vw, 70px); }
  .preview-bar:not([hidden]) ~ #screen-home.rows5 .home-scene, .practicing #screen-home.rows5 .home-scene { width: min(18vw, 58px); }
  /* the first gift's long "Here's a secret" speech: the screen's top padding was counted twice */
  #screen-gift { padding-top: 0; }
  #screen-gift .center-col { padding-top: calc(var(--top) + 52px); }
  .preview-bar:not([hidden]) ~ #screen-gift .center-col { padding-top: calc(var(--top) + 52px); }
  #screen-gift.long-line .elf-small { width: 50px; }
  #screen-gift.long-line .bubble { line-height: 1.22; padding: 7px 11px; }
  #screen-gift.long-line .gift-fly img { width: 64px; height: 64px; }
  #screen-gift.long-line .gift-sent p { margin-top: 2px; }
  #screen-gift.long-line #gift-foot { margin-top: 2px; padding-top: 4px; }
  /* four children's Nice-o-meters */
  #screen-meters .elf-row { min-height: 0; }
  #screen-meters .elf-small { width: 50px; }
  #screen-meters .bubble { font-size: 15.5px; padding: 8px 12px; }
  #screen-meters .center-col { gap: 8px; }
  .meters-title { margin: 4px 0 2px; font-size: 22px; }
  .meters[data-n="3"], .meters[data-n="4"] { gap: 6px; }
  .meters[data-n="4"] .mtr { padding: 6px 12px 5px; }
  .meters[data-n="4"] .mtr-top { font-size: 17px; }
  .meters[data-n="4"] .mtr-zones { margin-top: 2px; }
  #screen-meters .check-foot .btn-big { min-height: 52px; padding: 12px 24px; font-size: 20px; }
  /* Christmas Eve's final check: the closed book a little smaller */
  .ledger.finale { width: min(90vw, 164px); }
  #screen-check.finale .bubble { font-size: 15.5px; line-height: 1.25; padding: 8px 12px; }
  #screen-check.finale .meter .dial { max-width: 104px; }
  /* the gold test bar (and a grown-up's practice bar) across the top */
  .preview-bar:not([hidden]) ~ .screen { padding-top: 50px; }
}

/* -- a tablet on its side (541 to 900 px tall): no eyebrow line, a smaller elf with four or more rows, slimmer rows -- */
@media (orientation: landscape) and (min-width: 700px) and (min-height: 541px) and (max-height: 900px) {
  #screen-home .eyebrow { display: none; }
  #screen-home .center-col { gap: 10px; }
  #screen-home.rows3 .home-scene { width: min(24vw, 240px); }
  #screen-home.rows4 .home-scene { width: min(20vw, 230px); }
  #screen-home.rows4 .home-scene.crowd { width: min(14vw, 150px); }
  #screen-home.rows4 .home-scene.tight { width: min(11vw, 120px); }
  #screen-home.rows4 .kid-buttons { gap: 8px; }
  #screen-home.rows4 .kid-buttons .kid-go { min-height: 52px; padding: 8px 16px; font-size: 20px; }
  #screen-home.rows4 .kid-buttons .kid-cal, #screen-home.rows4 .kid-buttons .kid-cert { width: 52px; min-height: 52px; }
  #screen-home.rows4 .home-forward { min-height: 52px; padding: 8px 18px; }
  #screen-home.rows4 #home-sleigh { min-height: 52px; padding: 8px 22px; margin-top: 0; }
  .preview-bar:not([hidden]) ~ #screen-home .home-scene, .practicing #screen-home .home-scene { width: min(16vw, 160px); }
  .preview-bar:not([hidden]) ~ #screen-home.rows4 .home-scene, .practicing #screen-home.rows4 .home-scene { width: min(12vw, 128px); }
  .preview-bar:not([hidden]) ~ .screen { padding-top: 50px; }
}

/* ================= Nov 20 (v07): two smallest-phone screens that needed a scroll =================
   The Nov 19 full check found the gold way-on button below the first screenful on a 320 x 568 phone on two screens:
   a rough day's page (the elf's longer rough-day speech, 124 px down, and up to 193 px with a reason and extras) and four children's Nice-o-meters (88 px down,
   each row's level word wrapped to a second line). Only sizes and spacing change, only on a phone 600 px tall or less
   held upright; the words, voices, art and story are the same, and every other size is untouched. */
@media (max-height: 600px) and (max-width: 699px) and (orientation: portrait) {
  /* a rough day's page: a smaller elf, a slightly smaller speech, and the gold button's words on one line */
  #screen-check:has(#lg-rough.show) .elf-small { width: 50px; }
  #screen-check:has(#lg-rough.show) .elf-small img { width: 50px; height: auto; }
  #screen-check:has(#lg-rough.show) .bubble { font-size: 15px; line-height: 1.22; padding: 7px 11px; }
  #screen-check:has(#lg-rough.show) .check-foot .btn-big { font-size: 17px; padding: 10px 16px; min-height: 48px; }
  /* and the book a little smaller (the taller book with a reason and extras keeps more of its height) */
  #screen-check:has(#lg-rough.show) .ledger { min-width: 228px; }
  #screen-check:has(#lg-rough.show) .ledger.rough-detail { aspect-ratio: 4 / 5; }
  /* four children's Nice-o-meters: each child's name and level word on one line, so each row is one line shorter */
  .meters[data-n="4"] .mtr-top { font-size: 16px; align-items: center; }
  .meters[data-n="4"] .mtr-top > span:first-child { min-width: 0; }
  .meters[data-n="4"] .mtr-up { font-size: 11px; margin-left: 4px; }
  .meters[data-n="4"] .mtr-lvl { font-size: 14px; white-space: nowrap; flex-shrink: 0; margin-left: 6px; }
}

/* ================= Nov 22 (v08): the first gift's long speech on a full-size phone =================
   Fable's Nov 21 play-check: at 375 x 812, after the family's first gift, the elf's long "Here's a secret" speech pushed
   "Pass to the next one" 15 px below the screen (more in the practice run, under its gold bar). Phones 701 to 900 px
   tall held upright only (smaller phones already have their own rules above); the words keep their size, the ornament
   or gift picture is a little smaller and the spacing tighter. */
@media (min-height: 701px) and (max-height: 900px) and (max-width: 699px) and (orientation: portrait) {
  #screen-gift.long-line .center-col { padding-top: calc(var(--top) + 56px); }
  .preview-bar:not([hidden]) ~ #screen-gift.long-line .center-col { padding-top: calc(var(--top) + 56px); } /* the gold bar was counted twice here */
  #screen-gift.long-line .gift-elf { margin-bottom: 6px; }
  #screen-gift.long-line .gift-sent { margin: 4px auto 2px; }
  #screen-gift.long-line .gift-fly { margin: 2px 0; }
  #screen-gift.long-line .gift-fly img { width: 112px; height: 112px; }
  #screen-gift.long-line .gift-sent p { margin: 6px 0 0; }
  #screen-gift.long-line #gift-foot { margin-top: 8px; }
}

/* ================= Nov 22 (v09): Mavis's two QA passes (three devices, then four children) =================
   Only sizes, spacing and tap areas change here; the words, voices, art and story are the same. */

/* --- no sideways scroll on iPhone / iPad (the sleigh, Christmas morning, a gift flying off) --- */
@supports (overflow-x: clip) { html, body { overflow-x: clip; } }
@media (max-width: 760px) { @supports (overflow-x: clip) { #app, .screen { overflow-x: clip; } } }
/* the sparkles that trail a gliding sleigh live in their own see-through layer the size of the screen (motion.js) */
.glide-layer { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 30; overflow: hidden; pointer-events: none; }
.glide-layer .glide-spark { position: absolute; }
@media (max-width: 420px) { .n-corner { right: -2px; } }

/* --- every tap target at least 44 px --- */
/* the three top-corner buttons keep their small look: a see-through edge makes the tap area 44 px tall */
.snd-btn, .home-btn, .gu-btn { box-sizing: border-box; border: 5px solid transparent; background-clip: padding-box; }
.snd-btn { top: calc(var(--top) + 5px); left: calc(var(--left) + 7px); width: 50px; height: 44px; }
.snd-btn.off { background-clip: padding-box; box-shadow: inset 0 0 0 2px #c0392b; }
.home-btn { top: calc(var(--top) + 5px); left: calc(var(--left) + 71px); height: 44px; box-shadow: none; -webkit-filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.gu-btn { border-width: 7px; top: calc(var(--top) + 3px); right: calc(var(--right) + 5px); min-height: 44px; }
.preview-bar:not([hidden]) ~ .snd-btn, .preview-bar:not([hidden]) ~ .home-btn { top: calc(var(--top) + 53px); }
.preview-bar:not([hidden]) ~ .gu-btn { top: calc(var(--top) + 51px); }
.remind { min-height: 44px; }
#screen-home .remind { margin-bottom: 8px; }
#setup-done { min-height: 44px; }
.chip { min-height: 44px; padding: 8px 14px; }
.rough-btn { min-height: 44px; }
.cal-kid { min-height: 44px; }
.home-catch { min-height: 44px; }
/* "Remove" and "Clear day" stay small words; the tap area around them is 44 px and the line they sit on doesn't grow */
.kid legend .kid-remove, .day-kid legend .day-clear { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin-top: -12px; margin-bottom: -12px; }
/* an iPhone SE: each of the calendar's seven columns at least 44 px wide */
@media (max-width: 380px) {
  #screen-cal { padding-left: calc(var(--left) + 8px); padding-right: calc(var(--right) + 8px); }
  #screen-cal .cal { padding-left: 6px; padding-right: 6px; }
  #screen-cal .cal-wd, #screen-cal .cal-grid { gap: 4px; }
}

/* --- the calendar's name pills: one row that slides sideways on a phone (four names used to wrap 3 + 1) --- */
@media (max-width: 500px) {
  .cal-kids { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .cal-kids::-webkit-scrollbar { display: none; }
  .cal-kid { flex: 0 0 auto; white-space: nowrap; padding: 8px 12px; }
  .cal-kid:first-child { margin-left: auto; }
  .cal-kid:last-child { margin-right: auto; }
}

/* --- the sleigh's name tags --- */
/* at every size: a name can never spill out of its tag (app.js makes a long name's letters smaller first) */
.tag { max-width: 100%; overflow: hidden; }
.gifts[data-n="3"] .tag, .gifts[data-n="4"] .tag { max-width: 94%; }
.tag b { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.gift-tags { display: none; }
/* three or four presents: the presents stay clean on the sleigh and the tags sit in a strip under it. (The sleigh is never
   wider than 520 px, so a tag on a present is about 70 px wide at every screen size: "Christopher" was cut short on a tablet too.) */
.gifts[data-n="3"] .tag, .gifts[data-n="4"] .tag { display: none; }
.gift-tags:not([hidden]) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; width: 100%; max-width: 320px; margin: 6px auto 0; }
.gift-tags .strip-tag { position: relative; left: auto; top: auto; margin: 0; min-width: 0; max-width: 100%; padding: 3px 10px 4px; border-left: 7px solid var(--g, var(--red)); transform: rotate(-2deg); }
.gift-tags .strip-tag:nth-child(even) { transform: rotate(2deg); }
.gift-tags .strip-tag b { font-size: 21px; }
.gift-tags .strip-tag small { font-size: 11px; }
/* a phone: two tags a row (the third of three sits in the middle under them) */
@media (max-width: 599px) {
  .gift-tags[data-n="3"] .strip-tag:last-child { grid-column: 1 / -1; justify-self: center; width: calc(50% - 6px); }
}
/* a tablet or a computer: one row, a tag under each present */
@media (min-width: 600px) {
  .gift-tags:not([hidden]) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 560px; margin-top: 10px; }
  .gift-tags[data-n="3"]:not([hidden]) { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 430px; }
  .gift-tags .strip-tag { padding: 3px 8px 4px; }
  .gift-tags .strip-tag b { font-size: 19px; }
}

/* --- Home: long names and a short phone's Christmas Eve --- */
.kid-row .kid-go { min-width: 0; }
.kid-go .kid-name { display: block; max-width: 100%; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kid-go .kid-name.wrap { white-space: normal; overflow-wrap: anywhere; }
@media (max-height: 700px) and (max-width: 699px) {
  /* five or six rows (four children, the way on, the sleigh, pages waiting): everything a little closer so the way on stays on the screen */
  #screen-home.rows5 { padding-top: calc(var(--top) + 48px); }
  .preview-bar:not([hidden]) ~ #screen-home.rows5 { padding-top: 48px; }
  #screen-home.rows5 .center-col { gap: 6px; }
  #screen-home.rows5 .home-scene { width: min(21vw, 80px); }
  #screen-home.rows6 .home-scene { width: min(20vw, 74px); }
  #screen-home.rows5 .title { font-size: 26px; }
  #screen-home.rows5 .lead { font-size: 17px; }
}

/* --- Christmas Eve's last page (the finale) --- */
/* a short phone (iPhone SE, 375 x 667): the elf beside the speech is a little smaller and the dial a touch narrower, and
   the book gets that room back (it was 216 px wide; now up to 236 px, sized from the screen's height so the buttons stay on) */
@media (min-height: 601px) and (max-height: 700px) and (max-width: 699px) {
  #screen-check.finale .elf-small { width: 56px; }
  #screen-check.finale .elf-small img { width: 56px; height: auto; }
  #screen-check.finale .elf-row { min-height: 66px; }
  #screen-check.finale .meter .dial { max-width: 116px; }
  .ledger.finale { width: min(90vw, 236px, calc((100dvh - 394px) * .87)); }
}
/* a full-size phone in the practice run: the gold bar's 50 px comes off the book's room too (and the book may go under
   260 px wide here: held at 260 it left "See my certificate" 8 px below the screen) */
@media (min-height: 701px) and (max-height: 860px) and (max-width: 699px) {
  .preview-bar:not([hidden]) ~ #screen-check .ledger.finale { min-width: 0; width: min(90vw, 520px, calc((100dvh - 566px) * .87)); }
}
/* a tablet on its side or a computer (book and Nice-o-meter side by side): the last page has two buttons under the book,
   and the second one was 9 px below an 800-820 px tall screen (53 px with the gold practice bar) */
@media (min-aspect-ratio: 1/1) and (min-width: 700px) and (min-height: 600px) {
  .ledger.finale { width: min(48vw, 520px, calc((100vh - 314px) * .87)); width: min(48vw, 520px, calc((100dvh - 314px) * .87)); }
  .preview-bar:not([hidden]) ~ #screen-check .ledger.finale { width: min(48vw, 520px, calc((100vh - 364px) * .87)); width: min(48vw, 520px, calc((100dvh - 364px) * .87)); }
}