/* Layout: a cranberry gift-wrap band with a ribbon, then one column of cards. */
:root {
  color-scheme: light;
  --paper: #fbf5f1;
  --card: #ffffff;
  --ink: #2b1418;
  --muted: #7a5f64;
  --line: #efdcd7;
  --red: #b3122e;
  --red-deep: #7a0b20;
  --red-soft: #fbe6e8;
  --on-red: #fff7f2;
  --gold: #d8a54a;
  --ok: #2f7a4f;
  --display: "Young Serif", Georgia, "Times New Roman", serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #170d10; --card: #22141a; --ink: #f6e9e6; --muted: #b8999e; --line: #3b2329;
    --red: #e04a63; --red-deep: #6e0c20; --red-soft: #3a1820; --on-red: #fff3ef; --gold: #e2b45f; --ok: #7fd3a0;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.inner { max-width: 700px; margin: 0 auto; }

.band {
  position: relative; overflow: hidden; color: var(--on-red);
  background-color: var(--red-deep);
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.10) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 70%, rgba(255,255,255,.08) 0 1.5px, transparent 2.5px),
    linear-gradient(160deg, #c4183a 0%, #8f0d26 100%);
  background-size: 46px 46px, 31px 31px, 100% 100%;
  padding-block: calc(44px + env(safe-area-inset-top, 0px)) 56px;
}
.band::before { content: ""; position: absolute; top: 0; bottom: 0; right: 18%; width: 22px; background: var(--gold); opacity: .9; }
.band::after { content: ""; position: absolute; left: 0; right: 0; bottom: 22px; height: 14px; background: var(--gold); opacity: .9; }
.band .inner { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; opacity: .85; }
h1 { font-family: var(--display); font-weight: 400; font-size: clamp(40px, 9vw, 60px); line-height: 1.02; margin: 0; text-wrap: balance; }
.band .lead { max-width: 54ch; opacity: .92; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip { font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); font-variant-numeric: tabular-nums; }
.chip.done { background: var(--gold); border-color: var(--gold); color: #3a1608; }

main.gutter { padding-block: 28px calc(64px + env(safe-area-inset-bottom, 0px)); }
main .inner { display: flex; flex-direction: column; gap: 22px; margin-top: -40px; position: relative; z-index: 2; }
h2 { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.2; margin: 0; text-wrap: balance; }
h3 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.hint { font-size: 14px; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 10px 30px -18px rgba(122, 11, 32, .35); }
.card.plain { box-shadow: none; }

label { font-weight: 600; font-size: 14px; }
input[type="text"], input[type="email"], input[type="password"], textarea {
  font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%;
}
input:focus, textarea:focus { border-color: var(--red); }
textarea { min-height: 130px; resize: vertical; }
input:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.end { justify-content: space-between; }
.field { display: flex; flex-direction: column; gap: 6px; }
form.stack { display: flex; flex-direction: column; gap: 14px; }
button {
  font: inherit; font-weight: 600; border-radius: 12px; padding: 11px 18px; cursor: pointer;
  border: 1.5px solid var(--red); background: var(--red); color: var(--on-red);
}
button:hover:not(:disabled) { filter: brightness(1.06); }
button.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
button.small { padding: 6px 10px; font-size: 13px; border-radius: 9px; }
button.link { background: none; border: 0; padding: 0; color: var(--red); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.status { font-size: 14px; color: var(--muted); min-height: 1.4em; }
.status.err { color: var(--red); }
.status.ok { color: var(--ok); }
.topline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); }
.topline span { overflow-wrap: anywhere; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--paper); border-radius: 12px; border: 1px solid var(--line); }
.tabs button { flex: 1; background: transparent; color: var(--muted); border: 0; padding: 9px 12px; border-radius: 9px; }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.steps { display: flex; gap: 6px; }
.steps span { flex: 1; height: 6px; border-radius: 6px; background: var(--line); }
.steps span.on { background: var(--red); }
.stepno { font-size: 13px; font-weight: 600; color: var(--red); font-variant-numeric: tabular-nums; }
.q { font-family: var(--display); font-weight: 400; font-size: clamp(24px, 5.5vw, 30px); line-height: 1.2; margin: 0; text-wrap: balance; }
.opt { font-family: var(--body); font-size: 13px; font-weight: 600; color: var(--muted); }
.review { display: flex; flex-direction: column; margin: 0; }
.review div { padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.review div:first-child { border-top: 0; padding-top: 0; }
.review dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.review dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.review dd.none { color: var(--muted); font-style: italic; }

.tag { position: relative; background: var(--red); color: var(--on-red); border-radius: 18px; padding: 30px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.tag::before { content: ""; position: absolute; top: 18px; right: 20px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--gold); background: var(--card); }
.tag .to { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; opacity: .85; }
.tag .who { font-family: var(--display); font-size: clamp(32px, 8vw, 44px); line-height: 1.05; overflow-wrap: anywhere; }
.tag .review div { border-top-color: rgba(255,255,255,.25); }
.tag .review dt { color: var(--on-red); opacity: .75; }
.tag .review dd.none { color: var(--on-red); opacity: .7; }
.sealed { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; padding: 22px; border-radius: 16px; background: var(--red-soft); border: 1.5px dashed var(--red); }
.empty { color: var(--muted); }

.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.people li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.people li:first-child { border-top: 0; }
.people .nm { font-weight: 600; }
.people .meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.mx-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.mx { border-collapse: collapse; font-size: 14px; }
table.mx th, table.mx td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 7px 9px; text-align: center; }
table.mx thead th { font-weight: 600; white-space: nowrap; writing-mode: vertical-rl; transform: rotate(180deg); padding: 10px 7px; vertical-align: bottom; }
table.mx tbody th { text-align: left; white-space: nowrap; font-weight: 600; position: sticky; left: 0; background: var(--card); }
table.mx td.self { background: var(--paper); color: var(--muted); }
table.mx input { width: 18px; height: 18px; accent-color: var(--red); cursor: pointer; }
.qed { display: flex; flex-direction: column; gap: 12px; }
.qrow { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.qrow .flags { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; }
.qrow .flags label { font-weight: 500; display: flex; gap: 6px; align-items: center; }
.qrow input[type="checkbox"] { accent-color: var(--red); width: 16px; height: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }
.confirm { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--red-soft); }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
@media (prefers-reduced-motion: no-preference) {
  .anim { animation: pop .45s ease-out; }
  @keyframes pop { from { transform: translateY(6px) scale(.98); opacity: .2; } to { transform: none; opacity: 1; } }
}

/* story sign-up */
:root { --snow: #ffffff; --snow-edge: #e6dcd9; }
@media (prefers-color-scheme: dark) { :root { --snow: #e9eef1; --snow-edge: #9fb0b8; } }
.chapter { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--red); }
.story { font-size: 17px; line-height: 1.65; max-width: 60ch; }
.riddle { font-family: var(--display); font-size: 20px; line-height: 1.4; padding: 16px 18px; background: var(--red-soft); border-radius: 14px; margin: 0; }
.dig { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 340px; }
.dig button {
  aspect-ratio: 1; padding: 6px; font-size: 13px; line-height: 1.25; color: var(--muted);
  background: radial-gradient(ellipse at 50% 80%, var(--snow) 55%, var(--snow-edge) 100%);
  border: 1.5px solid var(--line); border-radius: 50% 50% 16px 16px;
}
.dig button.dug { background: var(--paper); border-style: dashed; border-radius: 16px; cursor: default; }
.dig button.found { background: var(--gold); border-color: var(--gold); color: #3a1608; border-radius: 16px; font-weight: 700; }
.short { max-width: 200px; }
.snowstage {
  position: relative; overflow: hidden; border-radius: 16px; padding: 34px 22px; color: var(--on-red);
  background: linear-gradient(180deg, var(--red-deep), var(--red)); display: flex; flex-direction: column; gap: 8px;
}
.snowstage .big { font-family: var(--display); font-size: clamp(28px, 7vw, 38px); line-height: 1.1; position: relative; z-index: 1; }
.snowstage p { position: relative; z-index: 1; max-width: 52ch; }
.flake { position: absolute; top: -10px; width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: .8; }
@media (prefers-reduced-motion: no-preference) {
  .flake { animation: fall linear infinite; }
  @keyframes fall { to { transform: translate(-30px, 260px); } }
}
