/* design: v2 */
/* Virtual Pass the Parcel, board B "the party on the telly" (design/home-v2-B.png, James 8 Nov 2026): a tangerine
   living room with bunting, the family on the telly, chunky chocolate outlines, teal, lilac, warm yellow and pink.
   Luckiest Guy for headings, Nunito for reading (both OFL, self-hosted). The tangerine, the pastel cards and the party
   screen keep their own colours in dark mode (always with the dark chocolate --ink on them); the page around them
   turns to a night-time aubergine. Every text and background pair is checked in tests/design.test.ts. */

@font-face { font-family: "Luckiest Guy"; src: url("/fonts/luckiest-guy.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/fonts/nunito-normal.woff2") format("woff2"); font-weight: 200 1000; font-style: normal; font-display: swap; }

:root {
  --brand: #ff7a2e;
  --on-brand: #3f2216;
  --bg: #f3efff;
  --text: #3f2216;
  --muted: #6b4a3a;
  --line: #dccdf3;
  --card: #fffaf1;
  --link: #0a6a63;
  --ink: #3f2216;
  --outline: #4b2a1c;
  --cream: #fff8ec;
  --teal: #17a59c;
  --mint: #a6e6dc;
  --lilac: #c68bea;
  --lilac-lt: #ecdcf8;
  --yellow: #ffc83d;
  --yellow-lt: #ffe6a1;
  --pink: #ff8fb1;
  --pink-lt: #ffd3e0;
  --footer: #4b2a1c;
  --on-footer: #fff3e6;
  --on-footer-muted: #ecd2bd;
  --notice: #fff0bf;
  --notice-ink: #5a3d00;
  --error: #ffe0e5;
  --error-ink: #8a1c2b;
  --display: "Luckiest Guy", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 22px;
  --pop: 0 5px 0 var(--outline);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1530;
    --text: #fff1e4;
    --muted: #d9cbec;
    --line: #463962;
    --card: #2a2043;
    --link: #ffc83d;
    --notice: #3b2f12;
    --notice-ink: #f7dc9c;
    --error: #43161f;
    --error-ink: #ffc4ce;
    --footer: #120c1f;
    color-scheme: dark;
  }
}

body { font-family: var(--sans); background: var(--bg); color: var(--text); font-size: 1.1rem; line-height: 1.6; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; line-height: 1.1; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
a { color: var(--link); font-weight: 700; }
.wrap-wide { max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.hint, .form-note, .link-note { color: var(--muted); font-size: 0.97rem; }
.page-pad { padding-top: 1.6rem; padding-bottom: 3rem; }

/* ---- Header: the cream frame round the telly ----------------------------------------------------------------- */
.site-header { background: var(--card); border-bottom: 0; }
.site-header .wrap { max-width: 1320px; padding: 0 24px; }
.header-row { padding-top: 12px; padding-bottom: 12px; }
.brand svg { height: 40px; }
.wordmark { font-family: var(--sans); font-weight: 900; font-size: 1.3rem; letter-spacing: -0.01em; color: var(--text); }
.main-nav { gap: 6px 26px; font-size: 1.08rem; }
.main-nav a { color: var(--text); font-weight: 800; text-decoration: none; }
.main-nav a[aria-current="page"], .main-nav a:hover { color: var(--text); text-decoration: underline wavy var(--brand); text-underline-offset: 7px; }
.main-nav a[href="/christmas-pass-the-parcel"] {
  background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 32' stroke='%234B2A1C' stroke-width='2.4' stroke-linejoin='round'%3E%3Cpath d='M20 16C12 4 2 6 4 14C6 20 14 20 20 16Z' fill='%234F9A33'/%3E%3Cpath d='M20 16C26 2 38 4 36 12C34 20 26 20 20 16Z' fill='%2378C451'/%3E%3Ccircle cx='16' cy='20' r='5' fill='%23E8493E'/%3E%3Ccircle cx='24' cy='21' r='5' fill='%23E8493E'/%3E%3C/svg%3E") no-repeat right 10px center / 26px auto;
  color: var(--ink); padding: 6px 44px 6px 16px; border-radius: 999px;
}
@media (max-width: 760px) {
  .wordmark { font-size: 0.95rem; }
  .site-header.js-menu:not(.menu-open) .header-row { flex-wrap: nowrap; gap: 8px; }
  .brand svg { height: 30px; }
  .brand { gap: 6px; }
  .menu-btn { padding: 4px 12px; border: 3px solid var(--outline); border-radius: 999px; background: var(--yellow); color: var(--ink); font-weight: 900; }
  .has-menu.menu-open .main-nav a { border-top-color: var(--line); }
  .has-menu.menu-open .main-nav a[href="/christmas-pass-the-parcel"] { border-top: 0; margin-top: 8px; padding: 10px 44px 10px 16px; }
}

/* ---- Bunting: a repeating tile across the top of every tangerine band ------------------------------------------ */
.hero::before, .page-head.has-art::before, .pp-head::before, .party::before {
  content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 60px; pointer-events: none;
  background: url("/img/art/bunting.svg") repeat-x 0 0 / 360px 60px;
}

/* ---- Home: the living room ---------------------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; background: var(--brand); color: var(--ink); padding: 70px 0 0; border-bottom: 6px solid var(--outline); }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 34px; background: #e8621c; border-top: 4px solid var(--outline); }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.25fr) 300px; gap: 16px; align-items: end; }
.hero-copy { align-self: center; padding-bottom: 60px; }
.bubble { margin: 0 0 22px; font-size: clamp(2.2rem, 3.3vw, 3.05rem); line-height: 1.22; color: var(--ink); }
.bubble { display: inline; background: var(--cream); padding: 0.14em 0.34em 0.06em; border-radius: 30px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hero-copy .bubble + .hero-sub { margin-top: 28px; }
.hero-sub { font-size: 1.15rem; font-weight: 750; line-height: 1.5; max-width: 32rem; color: var(--ink); }
.hero-art { align-self: end; margin: 0 -24px -4px -12px; }
.hero-scene { display: block; width: 100%; height: auto; }
.hero-card { align-self: start; margin-top: 4px; margin-bottom: 64px; background: var(--cream); color: var(--ink); border: 4px solid var(--outline); border-radius: 28px; padding: 22px 22px 16px; box-shadow: 0 8px 0 rgba(75, 42, 28, 0.35); }
.hero-card h2 { margin: 0 0 12px; font-size: 2.1rem; color: var(--ink); }
.hero-card .field > span { color: var(--ink); }
.hero-card .form-note { color: var(--ink); font-weight: 700; text-align: center; margin: 10px 0 0; }
@media (max-width: 1180px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .hero-art { grid-column: 1 / -1; grid-row: 2; max-width: 680px; justify-self: center; width: 100%; }
  .hero-copy { padding-bottom: 10px; }
  .hero-card { margin-bottom: 0; }
}
@media (max-width: 760px) {
  .hero { padding-top: 54px; }
  .hero::before { height: 46px; background-size: 270px 45px; }
  .hero-grid { grid-template-columns: 1fr; gap: 6px; }
  .hero-art { grid-row: auto; margin: 0 -6px; }
  .hero-card { margin: 8px 0 52px; }
  .bubble { font-size: 2.3rem; }
  .hero-sub { font-size: 1.08rem; }
}

.home-row { padding: 56px 0 40px; }
.row-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 56px; }
.row-grid h2 { margin: 0 0 18px; color: var(--text); }
.kinds-col { border-left: 4px dashed var(--pink); padding-left: 48px; }
.how-body { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 22px; align-items: start; }
.how-spot { width: 150px; height: auto; margin-top: 6px; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 54px; margin: 0 0 16px; min-height: 40px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 40px; height: 40px; border-radius: 50%;
  background: var(--lilac); color: var(--ink); border: 3px solid var(--outline); font: 1.25rem/38px var(--display); text-align: center;
}
.steps .lead { display: block; font-weight: 900; font-size: 1.12rem; }
.steps .lead + span { color: var(--muted); font-size: 1rem; }
.more { margin: 18px 0 0; }
.more a { font-weight: 900; }
.more a::after { content: " \2192"; }
@media (max-width: 960px) {
  .row-grid { grid-template-columns: 1fr; gap: 40px; }
  .kinds-col { border-left: 0; padding-left: 0; border-top: 4px dashed var(--pink); padding-top: 36px; }
}
@media (max-width: 520px) { .how-body { grid-template-columns: 1fr; } .how-spot { width: 120px; } }

.kinds { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kind { position: relative; color: var(--ink); padding: 18px 108px 18px 22px; min-height: 140px; border-radius: 34px 44px 30px 48px; }
.kind:nth-child(2) { border-radius: 46px 30px 48px 34px; }
.kind:nth-child(3) { border-radius: 30px 48px 40px 30px; }
.kind:nth-child(4) { border-radius: 44px 34px 30px 46px; }
.kind h3 { margin: 0 0 6px; font-size: 1.55rem; color: var(--ink); }
.kind p { margin: 0; font-weight: 700; font-size: 1.02rem; line-height: 1.4; }
.kind-message { background: var(--lilac-lt); }
.kind-photo { background: var(--mint); }
.kind-dare { background: var(--yellow-lt); }
.kind-clue { background: var(--pink-lt); }
.kind-spot { position: absolute; right: 8px; top: 50%; width: 100px; height: auto; transform: translateY(-50%) rotate(4deg); }
@media (max-width: 600px) { .kinds { grid-template-columns: 1fr; } .kind { padding-right: 96px; min-height: 120px; } .kind-spot { width: 86px; } }

.middle-band { background: var(--card); border-top: 4px dashed var(--line); border-bottom: 4px dashed var(--line); padding: 48px 0; }
.middle-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.middle-copy h2 { margin-top: 0; }
@media (max-width: 960px) { .middle-grid { grid-template-columns: 1fr; gap: 20px; } }
.faq-band { padding: 48px 0 24px; }
.faq-band h2 { margin-top: 0; }

/* The parcel cut in half */
.figure { margin: 1.5rem 0; }
.figure figcaption { color: var(--muted); font-size: 0.97rem; margin-top: 0.5rem; }
.diagram { width: 100%; height: auto; display: block; }
.diagram .ring-0 { fill: #c68bea; }
.diagram .ring-1 { fill: #ffc83d; }
.diagram .ring-2 { fill: #17a59c; }
.diagram .ring-3 { fill: #ff8fb1; }
.diagram .gift { fill: #ff7a2e; }
.diagram .gift-string { stroke: #ffc83d; stroke-width: 9px; }
.diagram .circled { stroke: #4b2a1c; }
.diagram .leader { stroke: var(--muted); }
.diagram .dot { fill: var(--text); }
.diagram .lbl { fill: var(--text); font: 400 22px var(--display); letter-spacing: 0.02em; }
.diagram .lbl-note { fill: var(--muted); font: 700 17px var(--sans); }
.diagram .lbl-centre { fill: #3f2216; font: 900 12px var(--sans); }

/* ---- Article pages: the page head is a tangerine telly band with bunting and a spot ------------------------------ */
.article-wrap { max-width: 1060px; padding-top: 26px; }
.page-head.has-art {
  position: relative; overflow: hidden; background: var(--brand); color: var(--ink); border: 4px solid var(--outline);
  border-radius: 34px; padding: 70px 36px 26px; margin-bottom: 30px; box-shadow: var(--pop);
}
.page-head.has-art h1 { color: var(--ink); margin-top: 0; }
.page-head.has-art .lede { color: var(--ink); font-weight: 750; font-size: 1.2rem; }
.page-head.has-art .byline { color: var(--ink); font-weight: 700; margin-bottom: 0; }
.page-head.has-art .byline a { color: var(--ink); }
.page-head-art { width: clamp(120px, 20vw, 200px); background: var(--cream); border: 4px solid var(--outline); border-radius: 50%; padding: 10px; }
@media (max-width: 560px) {
  .page-head.has-art { padding: 56px 20px 20px; border-radius: 26px; }
  .page-head.has-art::before { height: 46px; background-size: 270px 45px; }
  .page-head-art { width: 112px; }
}
.page-body { max-width: 740px; }
.page-body > p, .page-body li { font-size: 1.12rem; }
.page-body h2 {
  display: inline-block; margin: 1.6em 0 0.5em; padding: 0.22em 0.7em 0.12em; border-radius: 999px;
  background: var(--lilac-lt); color: var(--ink); font-size: clamp(1.35rem, 2.6vw, 1.7rem);
}
.page-body h2:nth-of-type(4n + 2) { background: var(--yellow-lt); }
.page-body h2:nth-of-type(4n + 3) { background: var(--mint); }
.page-body h2:nth-of-type(4n + 4) { background: var(--pink-lt); }
.page-body ul { padding-left: 1.3em; }
.page-body ul li { margin: 0.35em 0; }
.page-body ul li::marker { color: var(--brand); font-size: 1.3em; }
.toc { border: 3px dashed var(--lilac); border-radius: var(--radius); background: var(--card); }
.toc-title { font-family: var(--display); font-weight: 400; font-size: 1.2rem; }
.callout { border: 3px solid var(--outline); border-radius: var(--radius); }
th { background: var(--lilac-lt); color: var(--ink); }
.faqs details { background: var(--card); border: 3px solid var(--outline); border-radius: 20px; padding: 12px 18px; margin: 0 0 12px; }
.faqs summary { font-weight: 900; font-size: 1.12rem; list-style: none; position: relative; padding-right: 40px; }
.faqs summary::-webkit-details-marker { display: none; }
.faqs summary::after {
  content: "+"; position: absolute; right: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; text-align: center;
  background: var(--yellow); color: var(--ink); border: 2px solid var(--outline); font: 1.3rem/28px var(--display);
}
.faqs details[open] summary::after { content: "\2013"; background: var(--mint); }

/* Layer ideas: the age jump links and a little drawing beside each list */
.page-body .age-tabs { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0 0 8px; }
.age-tabs a { display: inline-block; padding: 6px 18px; border-radius: 999px; background: var(--lilac-lt); color: var(--ink); border: 3px solid var(--outline); font-weight: 900; text-decoration: none; }
.age-tabs li:nth-child(2) a { background: var(--yellow); }
.age-tabs li:nth-child(3) a { background: var(--mint); }
.age-tabs li:nth-child(4) a { background: var(--pink-lt); }
.age-tabs a:hover { transform: translateY(-2px); }
.idea-spot { float: right; width: 112px; height: auto; margin: 0 0 10px 16px; }
.page-body h2 { clear: both; }

/* The 404 (the kit's page has no head band): the torn corner above it */
.article-wrap > .page:not(:has(.page-head)) { text-align: center; padding: 20px 0 40px; }
.article-wrap > .page:not(:has(.page-head))::before {
  content: ""; display: block; width: 180px; height: 180px; margin: 0 auto 8px; background: url("/img/art/torn.svg") no-repeat center / contain;
}

/* ---- Forms and buttons -------------------------------------------------------------------------------------- */
.field { display: block; margin-bottom: 0.9rem; }
.field > span { display: block; font-weight: 800; margin-bottom: 0.3rem; }
.field input, .field select, .field textarea, .link-input {
  width: 100%; box-sizing: border-box; font: inherit; font-weight: 700; color: var(--ink); background: #ffffff;
  border: 3px solid var(--outline); border-radius: 14px; padding: 0.55rem 0.8rem;
}
.field input::placeholder, .field textarea::placeholder { color: #8b6f62; font-weight: 600; }
.field input:focus, .field select:focus, .field textarea:focus, .link-input:focus { outline: 4px solid var(--teal); outline-offset: 1px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.btn, .btn:hover {
  font-family: var(--sans); font-weight: 900; background: var(--yellow); color: var(--ink); border: 3px solid var(--outline);
  border-radius: 999px; box-shadow: var(--pop); cursor: pointer; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--outline); }
.btn:focus-visible { outline: 4px solid var(--teal); outline-offset: 3px; }
.btn-big { font-size: 1.15rem; padding: 0.7rem 1.6rem; }
.btn-start { display: block; position: relative; margin: 6px auto 0; white-space: nowrap; font-family: var(--display); font-weight: 400; font-size: 1.35rem; padding: 0.5em 1.2em 0.38em; letter-spacing: 0.02em; }
.btn-start::before, .btn-start::after {
  content: ""; position: absolute; top: 50%; width: 22px; height: 40px; margin-top: -20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 40' stroke='%23FFC83D' stroke-width='4' stroke-linecap='round'%3E%3Cpath d='M18 6L6 2M18 20H4M18 34L6 38'/%3E%3C/svg%3E") no-repeat center / contain;
}
.btn-start::before { left: -30px; }
.btn-start::after { right: -30px; transform: scaleX(-1); }
.btn-small { padding: 0.45rem 1rem; white-space: nowrap; box-shadow: 0 3px 0 var(--outline); }
.btn-outline, .btn-outline:hover { background: var(--cream); color: var(--ink); }
.btn-gold, .btn-gold:hover { background: var(--yellow); color: var(--ink); }
.btn-mini { font: inherit; font-weight: 800; font-size: 0.92rem; padding: 0.25rem 0.85rem; border-radius: 999px; border: 2px solid var(--outline); background: var(--cream); color: var(--ink); cursor: pointer; }
.btn-mini:disabled { opacity: 0.45; cursor: default; }
.btn-mini.danger { color: var(--error-ink); border-color: var(--error-ink); background: var(--error); }
.linkish { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; font: inherit; font-weight: 800; cursor: pointer; }
.stack { margin: 1rem 0 1.4rem; }
.inline-form { display: inline-block; margin: 0.5rem 0.6rem 0.5rem 0; }
.check { display: block; margin-bottom: 1rem; font-weight: 700; }
.photo-preview { max-width: 220px; border-radius: 12px; border: 3px solid var(--outline); margin-top: 0.6rem; display: block; }
.notice { background: var(--notice); color: var(--notice-ink); border-radius: 18px; padding: 0.9rem 1.1rem; margin: 1rem 0; border: 3px solid currentColor; }
.form-error { background: var(--error); color: var(--error-ink); border-radius: 14px; padding: 0.8rem 1rem; font-weight: 800; }
.count { font-size: 1.15rem; font-weight: 800; }
.kicker { display: inline-block; margin: 0 0 10px; padding: 3px 14px; border-radius: 999px; background: var(--yellow); color: var(--ink); border: 3px solid var(--outline); font-weight: 900; font-size: 0.98rem; transform: rotate(-2deg); }

/* The start form at the foot of a guide */
.cta-band { background: var(--card); border: 4px solid var(--outline); border-radius: 30px; padding: 22px 26px 18px; margin: 2.8rem 0 1rem; box-shadow: var(--pop); }
.cta-head { display: flex; gap: 18px; align-items: center; }
.cta-spot { width: 110px; height: auto; flex: none; }
.page-body .cta-band h2, .cta-band h2 { margin: 0 0 4px; display: block; background: none; padding: 0; color: var(--text); }
.cta-band .start-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; margin-top: 12px; }
.cta-band .btn-start, .cta-band .form-note { grid-column: 1 / -1; }
.cta-band .form-note { text-align: center; margin: 8px 0 0; }
@media (max-width: 700px) { .cta-band .start-form { grid-template-columns: 1fr; } .cta-spot { width: 80px; } .cta-band { padding: 18px; } }

/* ---- Footer: chocolate, with the bunting along its top ------------------------------------------------------- */
.site-footer { position: relative; background: var(--footer); color: var(--on-footer-muted); border-top: 0; margin-top: 56px; padding-top: 74px; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 60px; background: url("/img/art/bunting.svg") repeat-x 0 0 / 360px 60px; }
.site-footer .wrap { max-width: 1320px; padding: 0 24px; }
.site-footer a { color: var(--on-footer); }
.footer-brand .brand, .footer-brand .wordmark { color: var(--on-footer); }
.footer-col h2 { color: var(--yellow); font-family: var(--display); font-weight: 400; font-size: 1.15rem; letter-spacing: 0.04em; text-transform: none; }
.footer-legal::before { border-top-color: rgba(255, 243, 230, 0.25); }

/* ---- The parcel pages (private links): the same world ---------------------------------------------------------- */
.pp-head {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 22px; background: var(--brand); color: var(--ink);
  border: 4px solid var(--outline); border-radius: 30px; padding: 66px 28px 22px; margin-bottom: 22px; box-shadow: var(--pop);
}
.pp-head-text { flex: 1 1 auto; min-width: 0; }
.pp-head h1 { margin: 0 0 6px; color: var(--ink); font-size: clamp(2rem, 4.6vw, 3rem); overflow-wrap: anywhere; }
.pp-head .count { color: var(--ink); margin: 0; }
.pp-head-art { flex: none; width: clamp(96px, 18vw, 150px); background: var(--cream); border: 4px solid var(--outline); border-radius: 50%; padding: 8px; }
.pp-head-art img { display: block; width: 100%; height: auto; }
@media (max-width: 560px) {
  .pp-head { flex-direction: column-reverse; align-items: flex-start; padding: 54px 18px 18px; gap: 10px; }
  .pp-head::before { height: 46px; background-size: 270px 45px; }
  .pp-head-art { width: 96px; }
}
.pp-card { background: var(--card); border: 3px solid var(--outline); border-radius: 26px; padding: 6px 22px 16px; margin: 0 0 18px; }
.pp-card > h2 { font-size: 1.6rem; margin: 18px 0 10px; }
.pp-card > p:first-child, .pp-card > .lead-in { margin-top: 16px; }
.lead-in { font-size: 1.12rem; font-weight: 650; }
.wrap-card { border-width: 4px; box-shadow: var(--pop); }
.empty { display: flex; gap: 16px; align-items: center; }
.empty-spot { width: 90px; height: auto; flex: none; }

.link-box { background: var(--bg); border: 3px dashed var(--teal); border-radius: 20px; padding: 14px 16px; margin: 10px 0 16px; }
.link-label { font-family: var(--display); font-size: 1.25rem; margin: 0 0 8px; letter-spacing: 0.02em; }
.link-row { display: flex; gap: 10px; align-items: center; }
.link-input { font-size: 0.95rem; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.share { display: inline-block; font: inherit; font-weight: 900; font-size: 0.97rem; padding: 0.35rem 1rem; border-radius: 999px; border: 3px solid var(--outline); color: var(--ink); background: var(--mint); text-decoration: none; cursor: pointer; }
.share:nth-child(2) { background: var(--lilac-lt); }
.share:nth-child(3) { background: var(--yellow-lt); }

.org-layers { list-style: none; padding: 0; margin: 0 0 6px; }
.org-layer { position: relative; background: var(--bg); border: 3px solid var(--outline); border-radius: 18px; padding: 12px 16px 12px 30px; margin-bottom: 12px; overflow: hidden; }
.org-layer::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 14px; background: var(--paper-c, var(--lilac)); border-right: 3px solid var(--outline); }
.paper-0 { --paper-c: #c68bea; } .paper-1 { --paper-c: #17a59c; } .paper-2 { --paper-c: #ffc83d; } .paper-3 { --paper-c: #ff8fb1; }
.org-layer-head b { font-family: var(--display); font-weight: 400; font-size: 1.25rem; letter-spacing: 0.02em; }
.org-layer-body p { margin: 0.35rem 0; }
.org-layer.centre { display: flex; align-items: center; gap: 12px; background: var(--yellow); color: var(--ink); padding-left: 16px; }
.org-layer.centre::before { display: none; }
.org-layer.centre b { font-family: var(--display); font-weight: 400; font-size: 1.35rem; }
.centre-spot { width: 54px; height: auto; }
.org-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.layer-card { position: relative; background: var(--bg); border: 3px solid var(--outline); border-radius: 18px; padding: 12px 16px 12px 32px; overflow: hidden; font-size: 1.12rem; }
.layer-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 14px; background: var(--paper-c, var(--lilac)); border-right: 3px solid var(--outline); }
.layer-photo { max-width: 100%; max-height: 420px; border-radius: 14px; border: 3px solid var(--outline); display: block; margin: 0.5rem 0; }
.surprise span { display: inline-block; background: var(--yellow); color: var(--ink); font-weight: 900; font-size: 0.85rem; border: 2px solid var(--outline); border-radius: 999px; padding: 0 0.6rem; margin-right: 0.35rem; }
.edit-layer { margin: 1rem 0; }
.edit-layer summary { cursor: pointer; font-weight: 900; color: var(--link); }

/* ---- The party, on the telly: always the tangerine room, whatever the device's mode ------------------------------- */
.party { position: relative; overflow: hidden; background: var(--brand); color: var(--ink); padding: 64px 0 48px; min-height: 80vh; border-bottom: 6px solid var(--outline); }
.party-head { text-align: center; }
.party-head .kicker { display: table; margin: 0 auto 14px; }
.party-head h1 { margin: 0 0 6px; color: var(--ink); font-size: clamp(2rem, 4.2vw, 3.3rem); }
.party-head h1 { display: inline; background: var(--cream); padding: 0.08em 0.36em 0; border-radius: 26px; line-height: 1.25; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.party-head .count { color: var(--ink); font-size: 1.2rem; margin: 14px 0 0; }
.party .hint { color: var(--ink); font-weight: 700; }
.party .linkish { color: var(--ink); }
.party a { color: var(--ink); }
.party-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 36px; align-items: start; margin-top: 18px; }
.party-stage { text-align: center; position: sticky; top: 12px; }
.stage-parcel { position: relative; width: min(100%, 400px, 40vh); margin: 0 auto; --paper: #9e62d3; --lid: #b27be0; --deco: #ffc83d; --ribbon: #ff8fb1; --size: 1; }
.stage-parcel[data-paper="1"] { --paper: #17a59c; --lid: #2cbdb2; --deco: #fff8ec; --ribbon: #ffc83d; }
.stage-parcel[data-paper="2"] { --paper: #ffc83d; --lid: #ffd76b; --deco: #ff7a2e; --ribbon: #17a59c; }
.stage-parcel[data-paper="3"] { --paper: #ff8fb1; --lid: #ffa9c3; --deco: #ffffff; --ribbon: #9e62d3; }
.party-parcel { display: block; width: 100%; height: auto; transform: scale(var(--size)); transform-origin: 50% 92%; transition: transform 0.5s cubic-bezier(.3, 1.6, .5, 1); }
.party-parcel .pp-paper { fill: var(--paper); }
.party-parcel .pp-lid { fill: var(--lid); }
.party-parcel .pp-deco { color: var(--deco); }
.party-parcel .pp-ribbon { fill: var(--ribbon); }
.party-parcel .pp-shadow { fill: rgba(75, 42, 28, 0.28); }
.stage-parcel.playing .party-parcel { animation: wobble 0.42s ease-in-out infinite alternate; }
@keyframes wobble { from { transform: scale(var(--size)) rotate(-7deg) translateX(-14px); } to { transform: scale(var(--size)) rotate(7deg) translateX(14px); } }
.stage-notes { position: absolute; right: -6%; top: -8%; width: 34%; opacity: 0; pointer-events: none; }
.stage-notes img { width: 100%; height: auto; display: block; }
.stage-parcel.playing .stage-notes { animation: notes 1.2s ease-in-out infinite; }
@keyframes notes { 0% { opacity: 0; transform: translateY(20px) rotate(-6deg); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-40px) rotate(8deg); } }
.stage-parcel.pop .party-parcel { animation: pop 0.5s ease-out; }
@keyframes pop { 0% { transform: scale(var(--size)); } 30% { transform: scale(calc(var(--size) * 1.12)) rotate(-3deg); } 100% { transform: scale(var(--size)); } }
.fly { position: absolute; left: 50%; top: 45%; width: 46%; height: 34%; background: var(--paper); border: 4px solid var(--outline); pointer-events: none;
  clip-path: polygon(0 10%, 14% 0, 28% 12%, 44% 2%, 60% 14%, 78% 0, 100% 10%, 92% 40%, 100% 66%, 84% 100%, 62% 86%, 40% 100%, 20% 88%, 4% 100%, 8% 60%);
  animation: fly 0.9s cubic-bezier(.2, .7, .4, 1) forwards; }
@keyframes fly { from { transform: translate(-50%, -50%) rotate(0); opacity: 1; } to { transform: translate(calc(-50% + var(--fx)), calc(-50% - 260px)) rotate(var(--fr)); opacity: 0; } }
.confetti { position: absolute; left: 50%; top: 40%; width: 0; height: 0; pointer-events: none; }
.confetti i { position: absolute; left: 0; top: 0; width: 12px; height: 18px; border-radius: 3px; background: var(--c); animation: burst var(--d) cubic-bezier(.15, .6, .4, 1) forwards; }
.confetti i:nth-child(3n) { border-radius: 50%; width: 13px; height: 13px; }
@keyframes burst { from { transform: translate(0, 0) rotate(0); opacity: 1; } 75% { opacity: 1; } to { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }
.layer-dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 10px 0 4px; }
.layer-dots li { width: 22px; height: 22px; border-radius: 6px; border: 3px solid var(--outline); background: var(--paper-c); transition: transform 0.3s, opacity 0.3s; }
.layer-dots .dot-gift { background: var(--yellow); border-radius: 50%; }
.layer-dots li.gone { opacity: 0.25; transform: scale(0.7); }
.party-status { font-size: clamp(1.25rem, 2.2vw, 1.7rem); font-weight: 900; line-height: 1.3; min-height: 2.6em; margin: 6px 0 10px; color: var(--ink); }
.party-buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn-music, .btn-music:hover { font-family: var(--display); font-weight: 400; font-size: clamp(1.4rem, 2.6vw, 2rem); padding: 0.45em 1.2em 0.3em; background: var(--lilac); letter-spacing: 0.02em; }
.btn-music::before { content: ""; display: inline-block; width: 0; height: 0; margin-right: 12px; vertical-align: 0.05em; border-left: 0.75em solid var(--ink); border-top: 0.45em solid transparent; border-bottom: 0.45em solid transparent; }
.btn-unwrap, .btn-unwrap:hover { font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 3vw, 2.4rem); padding: 0.45em 1.3em 0.3em; background: var(--yellow); letter-spacing: 0.02em; animation: nudge 0.9s ease-in-out infinite; }
@keyframes nudge { 50% { transform: scale(1.06) rotate(-2deg); } }

.party-layers { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.party.js-on .party-layers { flex-direction: column-reverse; }
.party-layer { position: relative; background: var(--cream); color: var(--ink); border: 4px solid var(--outline); border-radius: 28px; padding: 18px 24px 18px 40px; box-shadow: var(--pop); font-size: 1.2rem; overflow: hidden; }
.party-layer::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 18px; background: var(--paper-c); border-right: 4px solid var(--outline); }
.party-layer .layer-from { color: var(--ink); font-size: 1rem; font-weight: 800; margin-top: 0; }
.party-layer .layer-from b { font-family: var(--display); font-weight: 400; font-size: 1.3rem; letter-spacing: 0.02em; }
.party-layer a { color: var(--link); }
.party-layer .surprise span { font-size: 0.9rem; }
.party-layer.is-current { font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.4; padding: 26px 32px 26px 50px; }
.party-layer.is-current .layer-from b { font-size: 1.7rem; }
.party-layer.is-past { font-size: 1rem; box-shadow: none; }
.party-layer.is-past .layer-photo { max-height: 160px; }
.party-layer.is-new { animation: arrive 0.65s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes arrive { from { transform: scale(0.6) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }
.party-gift { background: var(--yellow); text-align: center; padding-left: 24px; }
.party-gift::before { display: none; }
.party-gift h2 { color: var(--ink); font-size: clamp(2.2rem, 5vw, 3.8rem); margin: 0.1em 0 0.3em; }
.party-gift .btn-gold, .party-gift a.btn-gold { background: var(--cream); color: var(--ink); font-size: 1.2rem; padding: 0.6rem 1.4rem; }
.gift-spot { width: 150px; height: auto; display: block; margin: 0 auto; }
.party.is-finished .party-grid { grid-template-columns: 1fr; max-width: 860px; margin-left: auto; margin-right: auto; }
.party.is-finished .party-gift { padding: 30px 30px 34px; }
.party.is-finished .gift-spot { width: 220px; animation: arrive 0.8s cubic-bezier(.2, 1.4, .4, 1); }
.party.is-finished .confetti { position: fixed; top: 35%; z-index: 5; }
.after { text-align: center; margin-top: 36px; font-weight: 700; }
@media (max-width: 860px) {
  .party-grid { grid-template-columns: 1fr; gap: 20px; }
  .party-stage { position: static; }
  .stage-parcel { width: min(80%, 320px); }
  .party-layer.is-current { padding: 20px 20px 20px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .stage-parcel.playing .party-parcel, .stage-parcel.playing .stage-notes, .stage-parcel.pop .party-parcel, .party-layer.is-new,
  .btn-unwrap, .party.is-finished .gift-spot { animation: none; }
  .fly, .confetti { display: none; }
  .party-parcel { transition: none; }
}
