/* Magic Christmas List. Phone first: everything must fit 250px wide. Nothing flashes; motion is off under reduced motion.
   A warm white page, so the scroll is the star (Vic, 29 Nov 2026: "The green background I don't like. Can we make it like a
   white background maybe?"). He picked Look A, "Candy cane", from three: the red Mountains of Christmas title and round buttons. */
@font-face { font-family: "ML Title"; src: url(fonts/title/MountainsofChristmas-Bold.ttf); font-display: swap; }
:root {
  --ink: #3a2210; --paper: #ecd9ac; --paper-edge: #c9a86a;
  --text: #25221c; --muted: #655f52; --line: #e3dccb; --focus: #1d5fd1;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --page: #fbf7ee; --card: #ffffff; --title-font: "ML Title", Georgia, serif; --title: #a8261c; --title-size: 2rem; --title-space: 0;
  --go: #a8261c; --go-text: #fff; --radius: 999px; --b2-bg: #fff; --b2-line: #d9d1bf; --b2-text: #25221c; --seal: #8b1a12;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--page); }
body { margin: 0; background: var(--page); color: var(--text); font: 16px/1.5 var(--font); min-height: 100vh; }
.top { text-align: center; padding: calc(16px + env(safe-area-inset-top)) 10px 4px; }
.top h1 { margin: 0; font: 400 var(--title-size)/1.15 var(--title-font); color: var(--title); letter-spacing: var(--title-space); overflow-wrap: anywhere; }
.top p { margin: 6px 0 0; color: var(--muted); font-size: .92rem; }
.wrap { max-width: 520px; margin: 0 auto; padding: 8px 10px 20px; }

/* buttons: one main action, calmer second and third tiers */
.btn { font: inherit; font-weight: 700; min-height: 44px; padding: 9px 14px; border-radius: var(--radius); border: 1.5px solid var(--b2-line); background: var(--b2-bg); color: var(--b2-text); cursor: pointer; }
.btn-go { background: var(--go); border-color: var(--go); color: var(--go-text); }
.btn-3 { border-color: transparent; background: none; color: var(--muted); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; min-height: 40px; padding: 6px 10px; }
.btn-small { min-height: 36px; padding: 4px 12px; font-size: .88rem; }
.btn:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.add, .card, .update { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 10px 0; }
.add label, .title-form label, .edit label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 4px; }
.add-row { display: flex; flex-wrap: wrap; gap: 8px; }
/* the wish card: on a very small phone it reads top to bottom (wish, link, Write it); wider, Write it sits beside the wish */
.add { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "wl" "wish" "ll" "link" "btn" "hint"; column-gap: 8px; }
.add .wish-label { grid-area: wl; } .add #wish { grid-area: wish; } .add .link-label { grid-area: ll; } .add #link { grid-area: link; }
.add #write { grid-area: btn; margin-top: 10px; } .add .hint { grid-area: hint; }
.add #wish { min-width: 0; width: 100%; font: inherit; padding: 10px 12px; border: 1.5px solid #b9b1a0; border-radius: 10px; background: #fff; color: var(--text); min-height: 44px; }
@media (min-width: 340px) {
  .add { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "wl wl" "wish btn" "ll ll" "link link" "hint hint"; }
  .add #write { margin-top: 0; }
}
.add-row input, .edit input { flex: 1 1 150px; min-width: 0; width: 100%; font: inherit; padding: 10px 12px; border: 1.5px solid #b9b1a0; border-radius: 10px; background: #fff; color: var(--text); min-height: 44px; }
/* the link box: small and quiet, so the wish stays the main thing */
.add .link-label, .edit .link-label { font-weight: 600; font-size: .8rem; color: var(--muted); margin: 8px 0 3px; }
.link-box { display: block; width: 100%; min-width: 0; font: inherit; font-size: .88rem; padding: 7px 10px; min-height: 40px; border: 1px dashed #b9b1a0; border-radius: 10px; background: #fffdf8; color: var(--text); }
.edit .link-box { flex: none; }
/* on the scroll: a small gold gift tag after a wish that has a link, showing only the shop's name */
.line { margin-bottom: 4px; }
.line .line-btn { margin-bottom: 0; }
.tag { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; margin: -2px 0 6px; padding: 2px 10px 2px 8px; border-radius: 999px 6px 6px 999px; background: #e8c765; border: 1px solid #a67c1e; color: #3a2210; font: 700 .72rem/1.5 var(--font); text-decoration: none; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fbf7ee; border: 1px solid #a67c1e; flex: 0 0 auto; }
.tag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wishes li small { display: block; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.hint { margin: 6px 2px 0; font-size: .88rem; color: var(--muted); min-height: 1.2em; }
#save-hint { text-align: center; }

/* The scroll: our own parchment and wooden rollers, with a soft shadow so its edges read on the white page. */
.scroll { margin: 14px auto; max-width: 440px; padding: 0 6px; filter: drop-shadow(0 8px 14px rgba(70, 45, 10, .28)); }
.scroll-top, .scroll-bottom { height: 22px; margin: 0 -6px; border-radius: 11px; background: linear-gradient(#b98f52, #e9cf98 35%, #c79f60 70%, #8f6a36); border: 1px solid #7d5a2b; position: relative; z-index: 1; }
.scroll-roll { display: grid; grid-template-rows: 1fr; margin: -4px 0; }
/* Winnie unrolls the scroll once, at the start: the paper grows down from the top roller. One slow move. */
.scroll-roll.rolled { grid-template-rows: 0fr; }
.scroll-roll.unrolling { transition: grid-template-rows 1.1s ease-out; }
.scroll-clip { overflow: hidden; overflow: clip; min-height: 0; }
.scroll-body { position: relative; padding: 22px 18px 20px; color: var(--ink); min-height: 320px; display: flex; flex-direction: column;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255,255,255,.32), transparent 60%),
    linear-gradient(90deg, rgba(120,80,30,.30), transparent 9%, transparent 91%, rgba(120,80,30,.30)),
    url(art/paper.webp) center top / 100% auto repeat-y,
    var(--paper);
  box-shadow: inset 0 0 26px rgba(120,80,30,.25); }
.title-btn, .line-btn { display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; color: inherit; cursor: pointer; border-radius: 8px; text-align: left; font: inherit; }
.title-btn { margin-bottom: 6px; }
.title-btn svg, .lines svg { display: block; max-width: 100%; overflow: visible; }
.title-btn svg { margin: 0 auto; }
.lines { flex: 1 0 auto; }
.line-btn { margin-bottom: 4px; }
.lines path, .title-btn path { fill: var(--ink); stroke: var(--ink); stroke-width: .6; stroke-linejoin: round; }
.empty { margin: 18px 4px; text-align: center; font: italic .95rem/1.45 Georgia, serif; opacity: .85; }
.empty img { display: block; width: min(200px, 70%); height: auto; aspect-ratio: 1; margin: 0 auto 8px; border-radius: 50%; object-fit: cover; background: #d9c493; }
.empty p { margin: 0; }
.foot { display: flex; flex-wrap: wrap-reverse; align-items: flex-end; justify-content: space-between; gap: 6px 8px; margin-top: 14px; }
.foot small { font: italic .7rem/1.3 Georgia, serif; opacity: .78; }
.foot small span { white-space: nowrap; }
.foot img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; margin-left: auto; background: #d9c493; }
.paw { width: 64px; height: 64px; flex: 0 0 auto; }
.foot .paw { border-radius: 0; background: none; }
.paw[hidden] { display: none; }
.paw + #duo { margin-left: 0; }
.paw.fresh { animation: press .5s ease-out both; }
@keyframes press { from { opacity: 0; transform: scale(1.25); } to { opacity: 1; transform: none; } }
.quill { position: absolute; left: 0; top: 0; width: 46px; height: 46px; pointer-events: none; opacity: 0; transition: opacity .25s; will-change: transform; z-index: 2; }
.quill.on { opacity: 1; }

/* under the scroll: one main button, a calm row of three, the seal, then the two ways to erase */
.actions { display: grid; gap: 8px; margin: 14px 0 4px; }
.tools { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.tools .btn { padding-left: 4px; padding-right: 4px; font-size: .92rem; }
.btn-seal { border-color: var(--seal); color: var(--seal); background: #fff; }
.fix { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 14px; }
.fix-tip { margin: 0; text-align: center; font-size: .86rem; color: var(--muted); }
.undo { margin: 8px 0; padding: 8px 12px; text-align: center; background: #fff6d8; border: 1px solid #e6cf85; border-radius: 12px; font-size: .95rem; }
.undo[hidden], .fix-tip[hidden] { display: none; }

.card summary { font-weight: 700; cursor: pointer; min-height: 32px; }
.card summary span { font-weight: 400; color: var(--muted); }
.card p { margin: 6px 0; }
.wishes { margin: 8px 0; padding: 0; list-style: none; counter-reset: w; }
.wishes li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); counter-increment: w; }
.wishes li::before { content: counter(w) "."; color: var(--muted); flex: 0 0 auto; min-width: 1.6em; }
.wishes li span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.title-form { margin: 12px 0 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.steps { margin: 6px 0; padding-left: 18px; }
.steps li { margin: 4px 0; }
.steps .steps-note { list-style: none; margin-left: -18px; color: var(--muted); font-size: .9rem; }
.small { font-size: .86rem; color: var(--muted); }
/* the install kit: four short videos and the printable steps, fetched only when asked for */
.kit { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.kit-h { font-weight: 700; }
.kit-pick { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); margin: 8px 0; }
.kit-pick .btn { padding-left: 6px; padding-right: 6px; }
.kit-pick .btn[aria-pressed="true"] { background: var(--title); border-color: var(--title); color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.kit-show { margin: 10px 0; text-align: center; }
.kit-show[hidden] { display: none; }
.kit-name { font-weight: 700; margin: 0 0 6px; }
/* The player's own buttons sit along the bottom of a video, where each clip has its caption. So the video box is made taller than
   the picture by a plain band (--kit-band), the picture is held to the top, and the buttons land in the band, never on the words. */
.kit-frame { container-type: inline-size; width: 100%; max-width: 300px; margin: 0 auto 4px; --kit-band: 88px; }
.kit-frame.wide { max-width: 100%; }
.kit-frame video { display: block; box-sizing: border-box; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; background: #faf8ec; }
@supports (height: 1cqw) {
  .kit-frame video { height: calc(100cqw * 16 / 9 + var(--kit-band)); object-fit: contain; object-position: 50% 0; }
  .kit-frame.wide video { height: calc(100cqw * 9 / 16 + var(--kit-band)); }
}
.kit-print { margin: 10px 0 6px; }
.kit-print .btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; max-width: 100%; }
.free-line { text-align: center; font-weight: 700; color: var(--title); margin: 16px 8px 0; font-size: .95rem; }
.no-card { text-align: center; margin: 2px 8px 0; font-size: .92rem; font-weight: 600; color: var(--text); }
.private { color: var(--muted); font-size: .86rem; text-align: center; margin: 6px 8px 0; }
.foot-page { text-align: center; color: var(--muted); font-size: .82rem; padding: 6px 12px calc(18px + env(safe-area-inset-bottom)); }
.foot-page p { margin: 0; }
.update p { margin: 0 0 8px; }

.seals h2 { margin: 0 0 6px; font-size: 1rem; }
.seals h2 span { font-weight: 400; color: var(--muted); }
.seal-bar { height: 8px; border-radius: 4px; background: #e9e3d4; overflow: hidden; }
.seal-bar i { display: block; height: 100%; width: 0; background: #b8862b; border-radius: 4px; transition: width .5s; }
.seal-row { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 6px; margin: 10px 0 4px; }
.seal-btn { width: 56px; height: 56px; padding: 0; border-radius: 50%; border: 2px dashed #b9b1a0; background: #f3eee2; cursor: pointer; display: grid; place-items: center; color: var(--muted); font: 700 1.1rem var(--font); }
.seal-btn img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.seal-btn.got { border: 0; background: none; }
.seal-say { margin: 4px 0 0; font-size: .9rem; color: var(--muted); min-height: 2.6em; }

.moment { border: 0; border-radius: 16px; padding: 16px; width: min(340px, calc(100vw - 24px)); max-width: none; text-align: center; background: #fff; color: var(--text); }
.moment::backdrop { background: rgba(40, 30, 14, .6); }
.moment img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 12px; object-fit: cover; background: #d9c493; }
.moment h2 { margin: 10px 0 4px; font: 700 1.2rem Georgia, serif; }
.moment p { margin: 0 0 12px; }
.edit { text-align: left; }
.edit h2 { margin: 0 0 8px; }
.edit-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.edit-row .btn-go { flex: 1 1 100%; }

.print-sheet { display: none; }
@media print {
  body { background: #fff; }
  body > *:not(.print-sheet) { display: none !important; }
  .print-sheet { display: block; text-align: center; }
  .print-sheet img { max-width: 100%; max-height: 96vh; }
}
@media (prefers-reduced-motion: reduce) { .quill { display: none; } * { transition: none !important; animation: none !important; } }
