:root {
  --paper: #f6f0e4;
  --card: #fffdf8;
  --ink: #2a2924;
  --muted: #6b675c;
  --line: #e2d9c6;
  --forest: #2f5d46;
  --pine: #1f3d2f;
  --ember: #d9642f;
  --sun: #f2b544;
  --alert: #fff3df;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 8px 30px rgba(40, 30, 10, .08);
  --display: "Fraunces", Georgia, serif;
  --body: "Work Sans", system-ui, -apple-system, Segoe UI, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 18px/1.55 var(--body);
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600' viewBox='0 0 600 600'%3E%3Cg fill='none' stroke='%23d8ccb2' stroke-width='1.2' opacity='.55'%3E%3Cpath d='M-20 120c80-40 160 30 240-10s140-70 220-20 120 40 180 10'/%3E%3Cpath d='M-20 160c90-30 150 40 240 0s150-60 220-10 110 30 180 0'/%3E%3Cpath d='M-20 205c100-25 150 45 240 10s150-50 220 0 110 25 180-5'/%3E%3Cpath d='M300 330c40-50 120-50 150 0s-20 100-80 100-110-50-70-100z'/%3E%3Cpath d='M270 330c50-80 170-80 210 0s-30 140-110 140-150-70-100-140z'/%3E%3Cpath d='M240 330c60-110 220-110 270 0s-40 180-140 180-190-90-130-180z'/%3E%3Cpath d='M-20 520c80-30 140 20 220-10s120-40 200 0'/%3E%3C/g%3E%3C/svg%3E");
  min-height: 100vh;
  transition: background-color .5s ease;
}
body.campfire {
  --card: #1c2230;
  --ink: #f4ead8;
  --muted: #b9ae9a;
  --line: #36405a;
  background-color: #10141d;
  background-image: radial-gradient(ellipse at 50% 110%, rgba(232, 112, 50, .35), transparent 60%);
}

#app { max-width: 860px; margin: 0 auto; padding: 16px 16px 64px; }

h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 7vw, 3.8rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 4.4vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: .6rem; }
p { margin: .4rem 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; color: var(--ember); margin: 0 0 .5rem; }
.eyebrow.light { color: #fff3d6; text-shadow: 0 1px 10px rgba(0, 0, 0, .55), 0 0 2px rgba(0, 0, 0, .35); }
.help { color: var(--muted); margin: .5rem 0 0; font-size: .95rem; }
.fine { color: var(--muted); font-size: .82rem; margin-top: 1rem; }

/* buttons */
.btn {
  font: 600 1rem var(--body);
  padding: .85rem 1.3rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: transform .12s ease, background .2s ease, border-color .2s;
  min-height: 48px;
}
@media (hover: hover) { .btn:hover { transform: translateY(-1px); border-color: var(--forest); } }
.btn.primary { background: var(--forest); border-color: var(--forest); color: #fff; }
.btn.primary:hover { background: var(--pine); }
body.campfire .btn.primary { background: var(--ember); border-color: var(--ember); }
.btn.ghost { background: transparent; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--forest); text-decoration: underline; cursor: pointer; }
body.campfire .link { color: var(--sun); }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.5rem; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* welcome */
.welcome, .results { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.hero { position: relative; line-height: 0; }
.scene { width: 100%; height: auto; display: block; }
.welcome .scene { aspect-ratio: 1200 / 460; }
.hero-badge {
  position: absolute; right: 6%; top: 14%;
  width: 104px; height: 104px; border-radius: 50%;
  background: var(--ember); color: #fff; line-height: 1;
  display: grid; place-content: center; text-align: center;
  font-family: var(--display); box-shadow: 0 6px 24px rgba(0, 0, 0, .2);
  transform: rotate(-8deg);
}
.hero-badge span { font-size: 2.6rem; font-weight: 800; }
.hero-badge small { font-size: .95rem; font-weight: 600; opacity: .9; }
.welcome-body { padding: 28px clamp(20px, 5vw, 48px) 36px; }
.lede { font-size: 1.15rem; margin: 1rem 0; }
.facts { list-style: none; padding: 0; margin: 1.2rem 0; display: grid; gap: .45rem; }
.facts li::before { content: "↟ "; color: var(--forest); font-weight: 700; }

/* progress trail */
.trail { margin: 4px 4px 18px; }
.trail-line { position: relative; height: 8px; border-radius: 99px; background: repeating-linear-gradient(90deg, var(--line) 0 10px, transparent 10px 16px); margin: 22px 20px 8px 0; }
.trail-done { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--forest); transition: width .4s ease; }
body.campfire .trail-done { background: var(--ember); }
.flag { position: absolute; top: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--sun); border: 2px solid var(--card); transform: translateX(-50%); }
.hiker { position: absolute; top: -26px; font-size: 22px; transform: translateX(-50%) scaleX(-1); transition: left .4s ease; line-height: 1; }
.summit { position: absolute; right: -20px; top: -24px; font-size: 22px; line-height: 1; }
.trail-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; }

/* question card */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(22px, 5vw, 44px); animation: rise .35s ease; }
body.campfire .card { box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(0, 0, 0, .4); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.field {
  width: 100%; margin-top: 1.3rem; font: 1.1rem/1.5 var(--body); color: var(--ink);
  background: transparent; border: 1.5px solid var(--line); border-radius: 12px; padding: .9rem 1rem;
}
.field:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(47, 93, 70, .15); }
body.campfire .field { background: rgba(255, 255, 255, .03); }
body.campfire .field:focus { border-color: var(--ember); box-shadow: 0 0 0 3px rgba(217, 100, 47, .25); }
.field.story { min-height: 170px; resize: vertical; font-family: var(--display); font-size: 1.15rem; }
.say-it { margin: 22px 0 6px; padding: 16px 18px; border-radius: 14px; border: 1px dashed var(--ember); background: rgba(217, 100, 47, .08); font-size: 1.05rem; }

.opts { display: grid; gap: .65rem; margin-top: 1.3rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.opts.scale { grid-template-columns: 1fr; }
.opts.dense { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.opt {
  display: flex; align-items: center; gap: .8rem; text-align: left;
  font: inherit; color: var(--ink); background: transparent;
  border: 1.5px solid var(--line); border-radius: 14px; padding: .85rem 1rem; cursor: pointer; min-height: 56px;
  transition: border-color .15s, background .15s, transform .12s;
}
@media (hover: hover) { .opt:hover { border-color: var(--forest); transform: translateY(-1px); } }
.opt.on { border-color: var(--forest); background: rgba(47, 93, 70, .09); box-shadow: inset 0 0 0 1px var(--forest); }
body.campfire .opt:hover, body.campfire .opt.on { border-color: var(--ember); }
body.campfire .opt.on { background: rgba(217, 100, 47, .14); box-shadow: inset 0 0 0 1px var(--ember); }
.opt .em { font-size: 1.6rem; line-height: 1; flex: none; }
.opt .ot { display: flex; flex-direction: column; }
.opt .ot b { font-weight: 600; }
.opt .ot small { color: var(--muted); font-size: .88rem; line-height: 1.35; margin-top: 2px; }
.opt .lvl { color: var(--forest); font-size: .8rem; letter-spacing: 1px; min-width: 64px; flex: none; }
.opt.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.months { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; margin-top: 1.3rem; }
.opt.mo { justify-content: center; padding: .7rem .2rem; font-weight: 600; min-height: 52px; }
.opt.mo.any { grid-column: 1 / -1; }
@media (max-width: 520px) { .months { grid-template-columns: repeat(4, 1fr); } }

.nav { display: flex; gap: .6rem; margin-top: 1.8rem; align-items: center; flex-wrap: wrap; }
.nav .spacer { flex: 1; }

/* thinking */
.thinking { min-height: 70vh; display: grid; place-content: center; text-align: center; color: #f4ead8; font-family: var(--display); font-size: 1.4rem; }
.compass { font-size: 4rem; animation: spin 1.3s ease-in-out infinite; }
@keyframes spin { 0% { transform: rotate(-30deg); } 50% { transform: rotate(40deg); } 100% { transform: rotate(-30deg); } }

/* results */
.result-hero .scene { aspect-ratio: 1200 / 520; }
.result-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 15, 12, .74), rgba(10, 15, 12, .18) 75%, rgba(10, 15, 12, .1)); }
.hero-text { position: absolute; left: clamp(18px, 5vw, 44px); right: 140px; bottom: clamp(16px, 4vw, 36px); z-index: 1; color: #fff; line-height: 1.2; }
.hero-text h1 { font-size: clamp(1.9rem, 6vw, 3.4rem); text-shadow: 0 2px 20px rgba(0, 0, 0, .35); }
.hero-text .place { opacity: .92; margin-top: .4rem; }
.match {
  position: absolute; right: clamp(14px, 4vw, 36px); bottom: clamp(16px, 4vw, 36px); z-index: 1;
  width: 96px; height: 96px; border-radius: 50%; background: var(--sun); color: var(--pine);
  display: grid; place-content: center; text-align: center; line-height: 1;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25); transform: rotate(6deg);
}
.match b { font-family: var(--display); font-size: 1.9rem; }
.match small { font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.result-body { padding: 24px clamp(18px, 5vw, 44px) 36px; }

.badge-row { display: grid; grid-template-columns: 1.6fr 1fr; gap: .8rem; }
.badge-row > div { border: 1.5px dashed var(--line); border-radius: 14px; padding: .8rem 1rem; display: flex; flex-direction: column; }
.badge-row small { text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; color: var(--muted); font-weight: 600; }
.badge-row b { font-family: var(--display); font-size: 1.2rem; color: var(--forest); }
.pitch { font-family: var(--display); font-size: 1.3rem; line-height: 1.45; margin: 1.4rem 0; }

.panel { border-top: 1.5px solid var(--line); padding: 1.4rem 0 .4rem; }
.panel ul { margin: 0; padding-left: 1.2rem; }
.panel li { margin: .3rem 0; }
.why ul { list-style: none; padding: 0; }
.why li::before { content: "✓"; color: var(--forest); font-weight: 700; margin-right: .5rem; }

.hikes { list-style: none; padding: 0 !important; display: grid; gap: .55rem; }
.hike { display: flex; align-items: center; gap: .9rem; padding: .7rem .9rem; border-radius: 12px; background: rgba(47, 93, 70, .05); margin: 0 !important; }
.hike .lvl { color: var(--forest); font-size: .78rem; letter-spacing: 1px; flex: none; }
.hike .lvl i { color: var(--line); font-style: normal; }
.hike div { flex: 1; display: flex; flex-direction: column; }
.hike small { color: var(--muted); font-size: .9rem; }
.hike .tag { font-style: normal; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ember); border: 1px solid currentColor; border-radius: 99px; padding: .15rem .55rem; white-space: nowrap; }

.plan { list-style: none; padding: 0 !important; margin-top: 1rem !important; position: relative; }
.plan::before { content: ""; position: absolute; left: 47px; top: 10px; bottom: 10px; border-left: 2px dashed var(--line); }
.plan li { display: flex; gap: 1rem; margin: 0 0 1rem !important; position: relative; }
.plan .dl { flex: none; width: 96px; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--card); padding-top: 3px; position: relative; z-index: 1; }
.plan li div p { margin: .1rem 0 0; color: var(--muted); }
.plan li.star div { background: rgba(242, 181, 68, .18); border-radius: 12px; padding: .6rem .8rem; margin: -.4rem 0 0; }
.plan li.star div p { color: var(--ink); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.6rem; }
.alert { background: var(--alert); border: 0; border-radius: 14px; padding: 1rem 1.2rem; margin-top: 1rem; }

.runners { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .8rem; }
.runner { text-align: left; font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; padding: 0; cursor: pointer; display: flex; flex-direction: column; position: relative; transition: transform .15s, border-color .15s; }
@media (hover: hover) { .runner:hover { transform: translateY(-2px); border-color: var(--forest); } }
.runner .mini { line-height: 0; }
.runner .mini .scene { aspect-ratio: 16 / 7; }
.runner .rt { padding: .6rem .8rem .8rem; display: flex; flex-direction: column; line-height: 1.3; }
.runner .rt small { color: var(--muted); font-size: .82rem; }
.runner .rp { position: absolute; top: 8px; right: 8px; background: var(--card); border-radius: 99px; padding: .1rem .55rem; font-weight: 600; font-size: .85rem; }

.board { margin-top: 1rem; }
.board summary { cursor: pointer; color: var(--forest); font-weight: 600; }
.board ol { columns: 2; column-gap: 2rem; font-size: .92rem; padding-left: 1.4rem; }
.board li { break-inside: avoid; }
.board li span { color: var(--muted); }

.book .story-item { margin: 1.2rem 0; padding-left: 1rem; border-left: 3px solid var(--sun); }
.book h4 { margin: 0; font: 600 .82rem var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.book p { font-family: var(--display); font-size: 1.15rem; margin-top: .3rem; }
.sig { font-family: var(--display); font-size: 1.3rem; text-align: center; margin-top: 2rem; color: var(--forest); }

@media (max-width: 640px) {
  body { font-size: 17px; }
  .badge-row, .grid2 { grid-template-columns: 1fr; }
  .hero-text { right: 18px; bottom: 76px; }
  .match { width: 76px; height: 76px; bottom: 14px; }
  .match b { font-size: 1.5rem; }
  .result-hero .scene { aspect-ratio: 4 / 3; }
  .welcome .scene { aspect-ratio: 16 / 10; }
  .hero-badge { width: 80px; height: 80px; }
  .hero-badge span { font-size: 2rem; }
  .plan::before { left: 31px; }
  .plan .dl { width: 64px; }
  .board ol { columns: 1; }
  .nav .btn { padding: .8rem 1rem; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media print {
  body, body.campfire { background: #fff; color: #000; font-size: 12pt; }
  #app { max-width: none; padding: 0; }
  .results { box-shadow: none; }
  .results-actions, .board, .runners, .runner, .fine { display: none !important; }
  .panel { break-inside: avoid; }
  .book { break-before: page; }
}

/* ---------- backpacking results ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.stats > div { border: 1.5px dashed var(--line); border-radius: 14px; padding: .65rem .85rem; display: flex; flex-direction: column; min-width: 0; }
.stats small { text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; color: var(--muted); font-weight: 600; }
.stats b { font-family: var(--display); font-size: 1.15rem; color: var(--forest); line-height: 1.25; }
.stats b.tn { font-size: .98rem; }
.stats .dots { font-size: .7rem; letter-spacing: 1px; color: var(--ember); display: block; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin: -.4rem 0 1rem; }
.chips span { background: rgba(47, 93, 70, .08); color: var(--pine); border-radius: 99px; padding: .3rem .8rem; font-size: .88rem; font-weight: 500; }
.why .watch { margin-top: .6rem; }
.why .watch li::before { content: "⚠"; color: var(--ember); }

.logic summary { cursor: pointer; list-style: none; }
.logic summary::-webkit-details-marker { display: none; }
.logic summary h3 { display: inline; }
.logic summary::after { content: " ▾"; color: var(--muted); }
.logic[open] summary::after { content: " ▴"; }
.bars { display: grid; gap: .55rem; margin-top: 1rem; }
.bar { display: grid; grid-template-columns: 170px 1fr; grid-template-rows: auto auto; column-gap: .9rem; align-items: center; }
.bar .bl { font-weight: 600; font-size: .9rem; display: flex; justify-content: space-between; gap: .4rem; }
.bar .bl small { color: var(--muted); font-weight: 500; }
.bar .bt { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar .bt i { display: block; height: 100%; background: var(--forest); border-radius: 99px; }
.bar .bt i.mid { background: var(--sun); }
.bar .bt i.lo { background: var(--ember); }
.bar .bn { grid-column: 2; font-size: .82rem; color: var(--muted); }

.map { height: 380px; border-radius: 14px; margin-top: 1rem; border: 1.5px solid var(--line); z-index: 0; }
.map-key { font-size: .82rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.map-key .k { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-left: .5rem; }
.map-key .k.top { background: #d9642f; } .map-key .k.ok { background: #2f5d46; } .map-key .k.out { background: #d6d0c2; }
.ruled { font-size: .88rem; padding-left: 1.2rem; }
.ruled li { margin: .35rem 0; color: var(--muted); }
.ruled b { color: var(--ink); font-weight: 600; }
.plan.train::before { left: 70px; }
.plan.train .dl { width: 140px; }

@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .bar { grid-template-columns: 1fr; }
  .bar .bn { grid-column: 1; }
  .map { height: 300px; }
  .plan.train::before { left: 31px; }
  .plan.train .dl { width: 64px; }
}
@media print { .map, .map-key, .logic { display: none !important; } }

/* ---------- packing list ---------- */
.btn.jump { display: inline-block; text-decoration: none; font-size: .92rem; padding: .6rem 1.1rem; min-height: 0; }
.pm { display: flex; gap: .4rem; flex-wrap: wrap; margin: .8rem 0; }
.chip { font: 600 .85rem var(--body); border: 1.5px solid var(--line); background: transparent; color: var(--ink); border-radius: 99px; padding: .35rem .85rem; cursor: pointer; }
.chip.on { background: var(--forest); border-color: var(--forest); color: #fff; }
.wx { display: grid; grid-template-columns: repeat(3, auto) 1fr; gap: .4rem 1.4rem; align-items: center; background: rgba(47, 93, 70, .06); border-radius: 14px; padding: .8rem 1rem; }
.wx div { display: flex; flex-direction: column; }
.wx small { text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; color: var(--muted); font-weight: 600; }
.wx b { font-family: var(--display); font-size: 1.3rem; color: var(--forest); text-transform: capitalize; }
.wx p { margin: 0; font-size: .9rem; color: var(--muted); }
.pk-progress { font-size: .88rem; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.pk-progress #pk-n { font-weight: 700; color: var(--forest); }
.pk-grid { columns: 2; column-gap: 1.6rem; margin-top: .6rem; }
.pk-sec { break-inside: avoid; margin-bottom: 1.1rem; }
.pk-sec h4 { font: 600 .8rem var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .4rem; }
.pk-sec.is-req, .pk-sec.is-route { background: var(--alert); border-radius: 12px; padding: .7rem .8rem .3rem; }
.pk-sec ul { list-style: none; padding: 0 !important; margin: 0; }
.pk-sec li { margin: 0 0 .45rem !important; }
.pk-sec label { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; font-size: .95rem; line-height: 1.35; }
.pk-sec input { margin-top: .2rem; width: 18px; height: 18px; accent-color: var(--forest); flex: none; }
.pk-sec label span { display: block; }
.pk-sec small { display: block; color: var(--muted); font-size: .8rem; margin-top: 1px; }
.pk-sec input:checked + span b { text-decoration: line-through; color: var(--muted); }
.tag-shared, .tag-each { font-style: normal; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; border-radius: 99px; padding: .05rem .45rem; vertical-align: 1px; }
.tag-shared { background: rgba(242, 181, 68, .3); color: #7a5300; }
.tag-each { background: var(--line); color: var(--muted); }
.pk-notes { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; font-size: .9rem; margin: .4rem 0 1rem; }
.pk-notes dt { font-weight: 600; }
.pk-notes dd { margin: 0; color: var(--muted); }
.pk-skip { border: 1.5px dashed var(--line); border-radius: 12px; padding: .7rem 1rem; }
.pk-skip h4 { margin: 0 0 .3rem; font: 600 .85rem var(--body); }
.pk-skip ul { margin: 0; font-size: .9rem; color: var(--muted); }
@media (max-width: 640px) {
  .pk-grid { columns: 1; }
  .wx { grid-template-columns: repeat(3, 1fr); }
  .wx p { grid-column: 1 / -1; }
  .pk-notes { grid-template-columns: 1fr; }
  .pk-notes dd { margin-bottom: .4rem; }
}
@media print { .pm, .btn.jump { display: none !important; } .packing { break-before: page; } }
/* print robustness: Safari/iOS can print clipped or animated containers as blank pages */
@media print {
  *, *::before, *::after { animation: none !important; transition: none !important; box-shadow: none !important; }
  html, body { height: auto !important; min-height: 0 !important; overflow: visible !important; background-image: none !important; }
  .welcome, .results, .card { overflow: visible !important; border-radius: 0 !important; }
  .result-hero .scene { aspect-ratio: auto !important; max-height: 2.6in; }
}

/* ---------- the reveal page ---------- */
.reveal-stats { grid-template-columns: repeat(4, 1fr); }
.gift { margin: 2rem 0 .5rem; text-align: center; }
.gift-intro { font-family: var(--display); font-size: 1.35rem; margin: 0 0 1rem; }
.gift-card {
  position: relative; width: min(100%, 380px); aspect-ratio: 1.586; margin: 0 auto; border-radius: 18px; overflow: hidden;
  padding: 20px 22px; color: #fff; text-align: left; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 90% at 85% 10%, rgba(242, 181, 68, .35), transparent 55%), linear-gradient(135deg, var(--pine), var(--forest));
  box-shadow: 0 18px 40px rgba(31, 61, 47, .35); transform: rotate(-2deg);
}
.gift-card::after {
  content: ""; position: absolute; inset: auto -10% -30% -10%; height: 70%; opacity: .25;
  background: linear-gradient(160deg, transparent 40%, #fff 41%, transparent 60%), linear-gradient(20deg, transparent 45%, #fff 46%, transparent 62%);
}
.gc-top { display: flex; justify-content: space-between; align-items: baseline; position: relative; z-index: 1; }
.gc-brand { font-weight: 800; letter-spacing: .22em; font-size: 1.05rem; }
.gc-tag { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; opacity: .85; }
.gc-amt { font-family: var(--display); font-size: clamp(3rem, 12vw, 4.2rem); font-weight: 800; line-height: 1; position: relative; z-index: 1; color: var(--sun); }
.gc-bottom { font-size: .85rem; opacity: .9; position: relative; z-index: 1; }
.gift-note { margin: 1.4rem auto 0; padding: .7rem 1rem; display: inline-block; border-radius: 999px; background: var(--alert); font-weight: 600; font-size: .98rem; }
.reveal-actions { justify-content: center; margin-top: 2rem; }
.reveal-actions .btn { font-size: 1.1rem; padding-inline: 2rem; }
.center { text-align: center; }
@media (max-width: 640px) { .reveal-stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- quick actions + PDF ---------- */
.quick-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 1.2rem; }
.quick-actions .btn { font-size: .95rem; padding: .6rem 1.1rem; min-height: 44px; display: inline-flex; align-items: center; }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
/* While the PDF is being drawn: hide interactive-only bits */
.pdf-mode .quick-actions, .pdf-mode .results-actions, .pdf-mode .runners, .pdf-mode .map, .pdf-mode .map-key,
.pdf-mode .board, .pdf-mode .logic, .pdf-mode .pm, .pdf-mode .pk-progress, .pdf-mode .runners-panel, .pdf-mode .sources { display: none !important; }
.pdf-mode .result-hero .match { transform: none; }

/* ---------- phones ---------- */
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  #app { padding: 10px 12px calc(40px + env(safe-area-inset-bottom)); }

  /* welcome: get the start button closer to the fold */
  .welcome .scene { aspect-ratio: 16 / 8; }
  .welcome-body { padding: 20px 20px 26px; }
  .welcome h1 { font-size: 2.2rem; }
  .lede { font-size: 1.02rem; margin: .7rem 0; }
  .facts { margin: .9rem 0; font-size: .95rem; }
  .welcome .actions { margin-top: 1rem; }
  .welcome .actions .btn { flex: 1 1 100%; }

  /* questions */
  .trail { margin: 2px 2px 12px; }
  .card { padding: 20px 18px 0; }
  .card h2 { font-size: 1.42rem; }
  .help { font-size: .9rem; }
  .opts { margin-top: 1rem; gap: .5rem; }
  .opt { padding: .7rem .85rem; min-height: 52px; }
  .opt .em { font-size: 1.4rem; }
  .opt .ot small { font-size: .84rem; }
  /* pick-several questions: compact two-column tiles */
  .opts.multi { grid-template-columns: 1fr 1fr; }
  .opts.multi .opt { gap: .5rem; padding: .55rem .65rem; min-height: 54px; }
  .opts.multi .opt .em { font-size: 1.2rem; }
  .opts.multi .opt .ot b { font-size: .92rem; line-height: 1.25; }
  .say-it { margin-top: 16px; font-size: 1rem; }
  /* Back / Continue stay pinned to the bottom of the screen */
  .nav {
    position: sticky; bottom: 0; z-index: 5; margin: 1.2rem -18px 0; padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    background: var(--card); border-top: 1.5px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); flex-wrap: nowrap;
  }
  .nav .btn { white-space: nowrap; }
  .nav .btn.primary { flex: 1; }

  /* results banner: let long names flow instead of overflowing the art */
  .result-hero { display: grid; }
  .result-hero > .scene { grid-area: 1 / 1; height: 100%; min-height: 260px; aspect-ratio: auto; }
  .result-hero .hero-text { grid-area: 1 / 1; position: relative; inset: auto; align-self: end; padding: 84px 18px 96px; }
  .result-hero .hero-text h1 { font-size: clamp(1.7rem, 8vw, 2.2rem); }
  .result-hero .hero-text .place { font-size: .95rem; }
  .result-hero .match { left: 18px; right: auto; bottom: 16px; width: 72px; height: 72px; }
  .result-body { padding: 18px 18px 28px; }
  .pitch { font-size: 1.15rem; margin: 1rem 0; }
  .stats b { font-size: 1.05rem; }
  .quick-actions .btn { flex: 1 1 100%; justify-content: center; }
  .results-actions { flex-direction: column; }
  .results-actions .btn { width: 100%; }

  /* bigger touch targets */
  .chip { padding: .5rem 1rem; min-height: 40px; }
  .pk-sec label { padding: .2rem 0; }
  .pk-sec input { width: 22px; height: 22px; margin-top: 0; }
  .board summary { padding: .5rem 0; }
  .trail-meta .link { padding: .4rem 0; }

  .gift-intro { font-size: 1.2rem; }
  .reveal-actions .btn { width: 100%; }
}

/* ---------- birthday intro note ---------- */
.intro-note h2 { font-size: clamp(1.9rem, 6vw, 2.6rem); margin-bottom: .6rem; }
.intro-lede { font-size: 1.12rem; }
.intro-lede b { color: var(--forest); }
.how { list-style: none; padding: 0; margin: 1.2rem 0; display: grid; gap: .7rem; }
.how li { display: flex; gap: .9rem; align-items: flex-start; padding: .9rem 1rem; border-radius: 14px; background: rgba(47, 93, 70, .06); }
.how li:nth-child(2) { background: rgba(217, 100, 47, .08); }
.how-ic { font-size: 1.6rem; line-height: 1.2; flex: none; }
.how b { font-family: var(--display); font-size: 1.1rem; }
.how p { margin: .15rem 0 0; color: var(--muted); font-size: .95rem; line-height: 1.45; }
.intro-sign { font-family: var(--display); font-size: 1.15rem; margin-top: 1.2rem; }
@media (max-width: 640px) {
  .intro-lede { font-size: 1.04rem; }
  .how li { padding: .75rem .8rem; gap: .7rem; }
  .how p { font-size: .9rem; }
}

.intro-note .hl { color: var(--forest); }
.party .stepper { display: inline-flex; align-items: center; gap: .35rem; margin: 0 .2rem; vertical-align: middle; }
.party .stepper b { min-width: 1.4em; text-align: center; color: var(--ink); }
.party .stepper .chip { padding: .15rem .65rem; line-height: 1.2; font-size: 1rem; }
@media (max-width: 640px) { .party .stepper .chip { min-height: 34px; padding: .2rem .8rem; } }
