/* QuestWish: the storefront and the card builder. One stylesheet for both pages. */
/* Fonts are self-hosted (assets/fonts/, from scripts/fetch-fonts.js): visitors' browsers never contact a third party. */
@import url('../assets/fonts/fonts.css');

:root {
  --ink: #1f1a2e;
  --ink-2: #4a4458;
  --muted: #736c80;
  --paper: #fbf7f1;
  --paper-2: #f4eee4;
  --card: #ffffff;
  --line: #e7dfd2;
  --line-strong: #d6ccbc;
  --accent: #f0603e;
  --accent-hover: #e04f2d;
  --accent-soft: #fde8e1;
  --accent-ink: #ffffff;
  --gold: #f4b740;
  --night: #1b1830;
  --ok: #2f9e6b;
  --danger: #c4402c;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(31 26 46 / 6%), 0 6px 20px rgb(31 26 46 / 7%);
  --shadow-lift: 0 2px 4px rgb(31 26 46 / 8%), 0 14px 32px rgb(31 26 46 / 12%);
  --display: 'Fraunces', Georgia, serif;
  --sans: 'DM Sans', system-ui, 'Segoe UI', sans-serif;
  --gutter: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
img, canvas { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -.01em; line-height: 1.12; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { color: var(--accent-ink); background: var(--accent); box-shadow: 0 6px 16px rgb(240 96 62 / 28%); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { color: rgb(255 255 255 / 85%); background: #e9b4a6; box-shadow: none; cursor: not-allowed; }
.btn-ghost { color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn-ghost:hover { background: var(--paper-2); }
.btn-quiet { min-height: 40px; padding: 0 12px; color: var(--ink-2); background: transparent; font-weight: 600; font-size: 15px; }
.btn-quiet:hover { color: var(--ink); background: var(--paper-2); }
.btn-light { color: var(--night); background: #fff; }
.btn-light:hover { background: var(--paper); }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 17px; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---- site header and footer */
.site-header { position: sticky; top: 0; z-index: 20; background: rgb(251 247 241 / 88%); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color 150ms ease; }
.site-header.scrolled { border-color: var(--line); }
/* Before launch: when sending opens (ui.js launchBanner). */
.launch-banner { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px var(--gutter); color: #fff8f1; background: var(--accent); text-align: center; }
.launch-banner span { font-size: 22px; }
.launch-banner p { margin: 0; max-width: 880px; font-size: 16px; line-height: 1.4; }
.launch-banner b { font-weight: 800; }
.site-header .inner { display: flex; align-items: center; gap: 12px; max-width: 1160px; min-height: 64px; margin: 0 auto; padding: 0 var(--gutter); }
.logo { display: inline-flex; align-items: center; gap: 10px; font: 700 21px var(--display); text-decoration: none; letter-spacing: -.01em; }
/* The mark: the coral envelope with the star cut through it (assets/logo.svg, inline in each page). */
.logo-mark { display: block; width: 40px; height: 31px; flex: none; }
.site-header nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.site-header nav a:not(.btn) { padding: 8px 12px; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: 15px; text-decoration: none; }
.site-header nav a:not(.btn):hover { color: var(--ink); background: var(--paper-2); }
.site-header .btn { min-height: 42px; padding: 0 18px; font-size: 15px; }
@media (max-width: 640px) { .site-header nav a:not(.btn) { display: none; } }

.site-footer { margin-top: 48px; padding: 32px var(--gutter) 40px; color: var(--muted); border-top: 1px solid var(--line); font-size: 14px; }
.site-footer .inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 24px; max-width: 1160px; margin: 0 auto; }
.footer-about { display: grid; gap: 4px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
/* QuestWish on social media: small round icon links. */
.footer-social { display: flex; gap: 10px; }
.footer-social a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--ink-2); background: var(--card); box-shadow: var(--shadow); transition: color 150ms ease, transform 150ms ease; }
.footer-social a:hover, .footer-social a:focus-visible { color: var(--accent); transform: translateY(-1px); }
.footer-social svg { width: 18px; height: 18px; }

/* ---- the legal pages (terms.html, privacy.html; generated from docs/legal by scripts/build-legal.js) */
.wrap.legal { max-width: calc(760px + 2 * var(--gutter)); padding-block: 40px 8px; color: var(--ink-2); line-height: 1.65; }
.legal p { margin: 0 0 14px; }
.legal h1 { font-size: clamp(32px, 6vw, 44px); color: var(--ink); margin-bottom: 8px; }
.legal h1 + p { color: var(--muted); margin: 0 0 18px; }
.legal h2 { font-size: 24px; color: var(--ink); margin: 36px 0 10px; scroll-margin-top: 80px; }
.legal h3 { font: 700 17px var(--sans); color: var(--ink); margin: 22px 0 6px; }
.legal p, .legal li { max-width: 68ch; }
.legal strong { color: var(--ink); }
.legal a { color: var(--accent-hover); }
.legal ul, .legal ol { padding-left: 22px; }
.legal li + li { margin-top: 6px; }
.legal li ul { margin-top: 6px; }
.legal blockquote { margin: 14px 0; padding: 14px 18px; background: var(--paper-2); border-radius: var(--radius-sm); }
.legal-table { overflow-x: auto; margin: 14px 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.legal th { color: var(--ink); font-weight: 700; background: var(--paper-2); }

/* The agreement line on the review step. */
.agree { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); }
.agree a { color: var(--ink-2); font-weight: 600; }

/* ---- home */
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 48px; padding-top: 56px; padding-bottom: 72px; }
.hero h1 { margin: 14px 0 18px; font-size: clamp(38px, 6vw, 64px); }
.hero h1 em { color: var(--accent); font-style: italic; }
.hero .lede { max-width: 34em; color: var(--ink-2); font-size: 19px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero .lede-note { margin: 12px 0 0; color: var(--muted); font-size: 15px; }
.steps h3 small { margin-left: 6px; color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
/* People in the feature tiles: the game's own sprites. */
.feature .icon canvas { width: 36px; height: 48px; image-rendering: pixelated; }
/* The header's buttons: long words, and short ones on a phone (so Resume and New fit by the logo). */
.site-header .short { display: none; }
@media (max-width: 480px) {
  .site-header .long { display: none; } .site-header .short { display: inline; }
  .site-header nav { gap: 6px; }
  .site-header .btn { min-height: 40px; padding: 0 14px; }
}
/* The narrowest phones: a smaller logo and tighter buttons, so both still fit. */
@media (max-width: 360px) {
  .site-header .inner { gap: 8px; }
  .site-header .logo { gap: 7px; font-size: 18px; }
  .site-header .logo-mark { width: 34px; height: 27px; }
  .site-header .btn { padding: 0 11px; font-size: 14px; }
}
.hero .draft-note { margin: 22px 0 0; color: var(--ink-2); font-size: 15px; font-weight: 600; }
.hero .draft-note:not([hidden]) + .cta { margin-top: 12px; }
.hero .reassure { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 22px; color: var(--muted); font-size: 14px; }
.hero .reassure span { display: inline-flex; align-items: center; gap: 6px; }
.hero .reassure svg { width: 16px; height: 16px; color: var(--ok); }
.hero-art { position: relative; aspect-ratio: 1 / .86; }
.hero-art .shot { position: absolute; width: 74%; overflow: hidden; border: 6px solid #fff; border-radius: 18px; background: #fff; box-shadow: var(--shadow-lift); }
.hero-art .shot img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hero-art .shot:nth-child(1) { top: 0; left: 0; transform: rotate(-5deg); }
.hero-art .shot:nth-child(2) { top: 14%; right: 0; transform: rotate(4deg); }
.hero-art .shot:nth-child(3) { bottom: 0; left: 12%; z-index: 2; transform: rotate(-1deg); }
.hero-art .tag { position: absolute; z-index: 3; right: 4%; bottom: 10%; display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px; border-radius: 999px; background: var(--night); color: #fff; font-weight: 700; box-shadow: var(--shadow-lift); }
.hero-art .tag canvas { width: 32px; height: 32px; }
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 32px; padding-bottom: 48px; }
  /* A little narrower than the column, so the tilted shots stay on screen. */
  .hero-art { max-width: 520px; width: 94%; margin: 0 auto; }
}

.section { padding: 56px 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); }
.section-head p { max-width: 36em; color: var(--ink-2); }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; padding: 0; margin: 0; list-style: none; counter-reset: step; }
.steps li { padding: 24px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 14px; border-radius: 50%; color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.steps h3 { margin-bottom: 6px; font-size: 21px; }
.steps p { color: var(--ink-2); }
@media (max-width: 1060px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* Full rows of occasions at every width: 6, 4, 3 or 2 across (12 occasions; keep it a count those
   divide, or the last row comes up short). */
.occasion-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .occasion-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 800px) { .occasion-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.occasion-chip { display: block; min-width: 0; container-type: inline-size; border-radius: var(--radius-sm); background: var(--card); box-shadow: var(--shadow); font-weight: 700; text-decoration: none; transition: transform 150ms ease, box-shadow 150ms ease; }
.chip-body { display: flex; align-items: center; gap: 12px; height: 100%; min-height: 64px; padding: 10px 16px; }
.occasion-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.occasion-chip canvas { width: 32px; height: 32px; flex: none; }
/* A narrow chip puts its picture above its name, so "Congratulations" fits whole (the chip's own
   width decides). Phones show two to a row. */
@container (max-width: 210px) { .chip-body { flex-direction: column; justify-content: center; gap: 6px; min-height: 0; padding: 14px 8px 12px; font-size: 15px; text-align: center; } }
@media (max-width: 640px) { .occasion-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

.world-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
@media (max-width: 640px) {
  /* A swipeable row on phones. */
  .world-gallery { grid-auto-flow: column; grid-auto-columns: 78%; grid-template-columns: none; overflow-x: auto; margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter) 18px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .world-gallery::-webkit-scrollbar { display: none; }
  .world-gallery > * { scroll-snap-align: start; }
}

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature { padding: 22px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.feature .icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 14px; border-radius: 14px; background: var(--paper-2); }
.feature .icon canvas { width: 40px; height: 40px; }
.feature h3 { margin-bottom: 6px; font-size: 19px; }
.feature p { color: var(--ink-2); font-size: 15px; }
@media (max-width: 960px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } }

.closing { display: grid; justify-items: center; gap: 16px; padding: 56px 24px; border-radius: 28px; color: #fff; background: radial-gradient(120% 140% at 20% 0%, #3a2f6b 0%, var(--night) 60%); text-align: center; }
.closing h2 { font-size: clamp(28px, 4.4vw, 44px); }
.closing p { max-width: 30em; color: rgb(255 255 255 / 78%); }

/* ---- world card (home gallery and the builder) */
.world-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); text-align: left; text-decoration: none; transition: transform 150ms ease, box-shadow 150ms ease; }
.world-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.world-card .art { position: relative; aspect-ratio: 4 / 3; background: var(--paper-2); }
.world-card .art img { width: 100%; height: 100%; object-fit: cover; }
.world-card .body { display: grid; gap: 4px; padding: 14px 16px 16px; }
.world-card .name { font: 700 19px/1.2 var(--display); }
.world-card .line { color: var(--ink-2); font-size: 14px; }
.world-card .family { position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px; color: #fff; background: rgb(27 24 48 / 78%); font-size: 12px; font-weight: 700; }

/* ---- the builder */
.builder-body { background: var(--paper); }
.builder-header .inner { max-width: none; }
.builder-header .progress-text { margin-left: auto; color: var(--muted); font-size: 14px; font-weight: 600; }
.builder { display: grid; grid-template-columns: 236px minmax(0, 1fr) 300px; gap: 32px; max-width: 1280px; margin: 0 auto; padding: 28px var(--gutter) 120px; }

.stepper { position: sticky; top: 92px; align-self: start; display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.stepper button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 12px 6px 8px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 600; text-align: left; cursor: pointer; }
.stepper button:hover:not(:disabled) { color: var(--ink); background: var(--paper-2); }
.stepper button:disabled { cursor: default; opacity: .55; }
.stepper .dot { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-strong); font-size: 14px; font-weight: 700; }
.stepper .done .dot { color: #fff; background: var(--ok); box-shadow: none; }
.stepper .current button { color: var(--ink); background: var(--card); box-shadow: var(--shadow); }
.stepper .current .dot { color: #fff; background: var(--accent); box-shadow: none; }
.stepper small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; }

.stage { min-width: 0; }
.step-head { margin-bottom: 22px; }
.step-head h1 { font-size: clamp(28px, 3.6vw, 38px); }
.step-head p { margin-top: 8px; color: var(--ink-2); }
.step-section + .step-section { margin-top: 30px; }
.step-section > h2 { margin-bottom: 4px; font-size: 21px; }
.step-section > .hint { margin-bottom: 14px; color: var(--muted); font-size: 15px; }

/* Picking tiles: real radio buttons, styled. */
.choice-grid { display: grid; gap: 12px; }
.choice-grid.occasions { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); }
/* A narrow occasion tile (a small window, a tablet, a phone) puts its picture above the words, so
   a long name ("Congratulations") always fits. The tile's own width decides, not the screen's. */
.choice-grid.occasions .choice { container-type: inline-size; }
@container (max-width: 230px) { .choice-grid.occasions .tile { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; } }
.choice-grid.worlds { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.choice-grid.jobs, .choice-grid.pets { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice-grid.pets { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .tile { display: flex; align-items: center; gap: 12px; height: 100%; min-height: 64px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1.5px transparent; transition: box-shadow 120ms ease, transform 120ms ease; }
.choice:hover .tile { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.choice input:checked + .tile { box-shadow: var(--shadow), inset 0 0 0 2.5px var(--accent); }
.choice input:focus-visible + .tile { outline: 3px solid var(--gold); outline-offset: 2px; }
.choice .tile canvas { width: 44px; height: 44px; flex: none; }
.choice .tile .text { display: grid; gap: 2px; min-width: 0; }
.choice .tile b { font-size: 16px; line-height: 1.25; }
.choice .tile small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.choice .check { position: absolute; top: 10px; right: 10px; z-index: 2; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; background: var(--accent); opacity: 0; transform: scale(.6); transition: opacity 120ms ease, transform 120ms ease; }
.choice .check svg { width: 15px; height: 15px; }
.choice input:checked ~ .check { opacity: 1; transform: scale(1); }
.choice.world .tile { flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden; border-radius: var(--radius); }
.choice.world .art { position: relative; aspect-ratio: 4 / 3; background: var(--paper-2); }
/* The world step: six places on one screen, then the styles of the one picked. */
.choice-grid.places { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.choice.place .art .badge { position: absolute; left: 10px; bottom: 10px; padding: 3px 10px; border-radius: 999px; color: #fff; background: rgb(31 26 46 / 78%); font-weight: 700; font-size: 12px; }
.choice.place .text small { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 720px) {
  .choice-grid.places { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .choice.place .text { padding: 10px 12px 12px; }
  .choice.place b { font-size: 16px; }
  .choice.place .text small { font-size: 12.5px; }
}
.style-panel { margin-top: 20px; padding: 18px; border-radius: var(--radius); background: var(--paper-2); scroll-margin: 16px 0 96px; }
.style-panel h2 { margin-bottom: 12px; font-size: 20px; }
.choice-grid.styles { grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); gap: 10px; }
.choice-grid.styles.plain { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.choice.style .tile { padding: 10px 36px 10px 10px; }
.choice.style .tile small { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.choice-grid.styles.plain .choice.style .tile { padding-left: 14px; }
.choice.style .thumb { flex: none; width: 60px; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; background: var(--card); }
.choice.style .thumb img { width: 100%; height: 100%; object-fit: cover; }
.choice.style .check { top: 50%; margin-top: -13px; }
@media (max-width: 520px) { .choice-grid.styles.plain { grid-template-columns: repeat(2, minmax(0, 1fr)); } .choice-grid.styles.plain .tile small { display: none; } }
.choice.world .art img { width: 100%; height: 100%; object-fit: cover; }
.choice.world .text { padding: 12px 14px 14px; }
.choice.world b { font: 700 18px/1.2 var(--display); }
.choice.pet .tile { flex-direction: column; justify-content: center; gap: 6px; padding: 12px 8px; text-align: center; }
.choice.pet .tile canvas { width: 48px; height: 48px; }
.choice.pet b { font-size: 14px; }

.filter-row { display: flex; gap: 8px; margin: 0 0 18px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-row button { flex: none; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; color: var(--ink-2); background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 600; font-size: 15px; cursor: pointer; }
.filter-row button[aria-pressed="true"] { color: #fff; background: var(--ink); box-shadow: none; }

.subpanel { margin-top: 22px; padding: 20px; border-radius: var(--radius); background: var(--paper-2); }
.subpanel h2 { margin-bottom: 4px; font-size: 20px; }
.subpanel .hint { margin-bottom: 14px; color: var(--muted); font-size: 15px; }

/* Form fields */
/* Each field keeps its own height: a tall neighbor never stretches a text box. */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px 16px; }
.fields .full { grid-column: 1 / -1; }
/* Your name starts its own row, just above your message (everything above it is about them). */
.fields .sender-name { grid-column: 1; }
@media (max-width: 560px) { .fields { grid-template-columns: 1fr; } }
.field { display: grid; align-content: start; gap: 6px; }
.field > span { font-weight: 600; font-size: 15px; }
.field > span em { color: var(--muted); font-style: normal; font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; min-height: 50px; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--card); font-size: 16px; transition: border-color 120ms ease, box-shadow 120ms ease; }
.field textarea { min-height: 104px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(240 96 62 / 16%); }
.field .help { color: var(--muted); font-size: 13px; }
/* "What is this?": a small ? beside a label or heading, and the note it opens under it. */
.ask { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 7px; padding: 0; vertical-align: 2px; color: var(--ink-2); background: var(--card); border: 1.5px solid var(--line-strong); border-radius: 50%; font: 700 12px/1 var(--sans); letter-spacing: 0; text-transform: none; cursor: pointer; }
.ask:hover, .ask[aria-expanded="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }
.ask:focus-visible { outline: 3px solid rgb(240 96 62 / 35%); outline-offset: 2px; }
.explain { display: block; margin: 2px 0 4px; padding: 10px 12px; color: var(--ink-2); background: var(--card); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; font: 500 14px/1.5 var(--sans); letter-spacing: 0; text-transform: none; }
.explain[hidden] { display: none; }
.cast-group .ask { width: 20px; height: 20px; font-size: 11px; }

/* ---- the walkthrough: the offer on the first screen, the spotlit field, and the panel. */
.guide-offer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; margin-bottom: 22px; padding: 18px 20px; border: 2px solid var(--accent); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-lift); }
.guide-offer b { font-size: 18px; }
.guide-offer p { max-width: 52ch; margin-top: 4px; color: var(--ink-2); font-size: 15px; }
.guide-offer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* (Doubled up, to win over the rows' and fields' own shadows.) */
/* (A gap of the background between what it is about and the ring, so the ring never touches it.) */
.tour-target.tour-target { position: relative; z-index: 60; border-radius: 14px; box-shadow: 0 0 0 8px var(--paper), 0 0 0 12px var(--accent), 0 0 0 9999px rgb(28 22 38 / 40%); transition: box-shadow 200ms ease; }
.tour { position: fixed; z-index: 70; right: 24px; bottom: calc(96px + env(safe-area-inset-bottom)); width: min(380px, calc(100vw - 48px)); max-height: calc(100vh - 200px); overflow-y: auto; padding: 16px 18px; border-radius: 16px; background: var(--card); box-shadow: 0 18px 50px rgb(28 22 38 / 28%), 0 0 0 1px var(--line); }
.tour[hidden] { display: none; }
/* In someone's editor: a smaller panel, and a ring (no dimming), so their picture stays in view. */
.tour.compact { padding: 10px 14px 12px; }
.tour.compact h3 { margin-top: 4px; font-size: 17px; }
.tour.compact > p { margin-top: 2px; font-size: 14px; }
.tour.compact .tour-actions { margin-top: 10px; }
.tour.compact .tour-actions .btn { min-height: 36px; padding: 6px 16px; }
.tour-ring.tour-ring { position: relative; z-index: 4; border-radius: 12px; box-shadow: 0 0 0 8px var(--card), 0 0 0 11px var(--accent), 0 0 0 16px rgb(240 96 62 / 18%); }
.hero-basics { margin: 0; }
.link-button { padding: 0; color: var(--accent); background: none; border: 0; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
/* Room below the last fields, so any of them can scroll up to the top while the panel is open. */
.touring .stage { padding-bottom: 45vh; }
.guide-toggle .short { display: none; }
.tour-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tour-count { color: var(--muted); font: 700 12px var(--sans); letter-spacing: .04em; }
.tour-tag { padding: 3px 10px; border-radius: 999px; font: 700 12px var(--sans); white-space: nowrap; }
.tour-tag.required { color: #fff; background: var(--accent); }
.tour-tag.optional { color: #1f5a3a; background: #d8efe0; }
.tour-tag.other { color: var(--ink-2); background: var(--paper-2); }
.tour h3 { margin-top: 10px; font-size: 20px; }
.tour > p { margin-top: 6px; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.tour-preview { margin-top: 12px; }
.tour-preview > span { display: block; margin-bottom: 6px; color: var(--muted); font: 700 11px var(--sans); letter-spacing: .09em; text-transform: uppercase; }
.tour-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.tour-actions .tour-exit { margin-right: auto; padding: 0; color: var(--muted); background: none; border: 0; font: 600 13px var(--sans); text-decoration: underline; cursor: pointer; }
.tour-actions .btn { min-height: 40px; padding: 8px 18px; }
@media (max-width: 820px) {
  .tour { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); left: 12px; width: auto; max-height: 58vh; }
  .builder-header .guide-toggle { padding-inline: 10px; }
  .guide-toggle .long { display: none; }
  .guide-toggle .short { display: inline; }
  .builder-header .progress-text { white-space: nowrap; }
}
/* The game in miniature, for the walkthrough's "In the game". */
/* The finale preview (finishing touches): someone before and after, and the game's line. */
.finale-preview { display: grid; gap: 10px; margin-top: 14px; padding: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.finale-preview-head { margin: 0; color: var(--ink-2); font-weight: 600; }
.finale-stage { display: flex; align-items: center; justify-content: center; gap: 10px; }
.finale-stage figure { display: grid; justify-items: center; gap: 4px; margin: 0; }
.finale-stage figcaption { color: var(--ink-2); font: 700 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.finale-art { width: 138px; height: 156px; image-rendering: pixelated; background: var(--card); border-radius: 10px; }
.finale-arrow { color: var(--accent); font: 700 22px var(--sans); }
@media (prefers-reduced-motion: no-preference) { .finale-stage .after .finale-art { animation: finale-pop .45s ease-out; } }
@keyframes finale-pop { 0% { transform: scale(.7); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
.mock { color: #f9f6e9; background: #183b35; border: 2px solid #e5bc67; border-radius: 6px; }
.mock-dialog { padding: 10px 12px; }
.mock-dialog b { display: block; color: #e5bc67; font: 700 12px ui-monospace, 'Cascadia Mono', Menlo, monospace; }
.mock-dialog p { margin-top: 4px; font-size: 14px; line-height: 1.45; }
.mock-title { display: grid; justify-items: center; gap: 2px; padding: 12px; text-align: center; background: #fbf4e6; color: #2a1d1f; border-color: #c89a4a; }
.mock-title small { color: #8a6a3a; font: 700 11px var(--sans); letter-spacing: .12em; }
.mock-title b { font: 700 20px var(--display); }
.mock-party { display: grid; gap: 4px; padding: 10px 12px; }
.mock-party b { font: 700 14px ui-monospace, 'Cascadia Mono', Menlo, monospace; }
.mock-party b span { margin-left: 6px; color: #e5bc67; font-size: 12px; }
.mock-party small { color: #cfe3d8; font-size: 13px; }
.mock-party i { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #e05a4a 78%, #3a2a2a 78%); }
.mock-ending { padding: 14px; text-align: center; background: #241a2e; border-color: #e5bc67; }
.mock-ending p { font: italic 15px/1.5 var(--display); }
/* A typed field with a word the card can't carry. */
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"], .friend input[aria-invalid="true"] { border-color: #d64545; box-shadow: 0 0 0 4px rgb(214 69 69 / 14%); }
.btn.is-busy { cursor: progress; opacity: .85; }
.notice .retry { min-height: 36px; margin-left: 6px; padding: 0 12px; color: inherit; text-decoration: underline; }
.field .counter { justify-self: end; color: var(--muted); font-size: 13px; }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--paper-2); }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: grid; place-items: center; min-height: 42px; padding: 0 16px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 15px; }
.segmented input:checked + span { color: var(--ink); background: var(--card); box-shadow: var(--shadow); }
/* On a panel the same color as the bar, the bar goes a shade darker so it still reads. */
.subpanel .segmented { background: color-mix(in srgb, var(--paper-2), #5a4a36 9%); }
/* Browsers indent a menu's text a little; less padding lines it up with the boxes around it. */
.field select { padding-left: 10px; }
.friend select { padding-left: 8px; }
.segmented input:focus-visible + span { outline: 3px solid var(--gold); }
.segmented-wide { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
.segmented-wide span { display: grid; gap: 0; min-height: 60px; padding: 8px 10px; text-align: center; line-height: 1.25; }
.segmented-wide span small { color: var(--muted); font-weight: 500; font-size: 12px; }

.friend-list { display: grid; gap: 10px; }
.friend { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.friend .who { display: grid; gap: 2px; align-content: center; min-width: 0; }
.friend .who b { display: block; font-size: 15px; }
/* A character's Default / Custom tag and its reset link (rows, and the villain's and guard's summaries). */
.char-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; }
details.more summary .char-status { margin: 0 0 0 auto; }
.char-tag { padding: 2px 8px; border-radius: 999px; background: var(--paper-2); color: var(--muted); font: 700 11px var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.char-tag.custom { background: var(--accent-soft); color: var(--accent-hover); }
.char-reset { padding: 2px 0; border: 0; background: none; color: var(--accent-hover); font: 600 13px var(--sans); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.char-reset:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
/* A field still showing the world's default: lighter, so it reads as "what you will get". */
.friend input.is-default, .friend select.is-default, .field input.is-default, .field select.is-default { color: var(--muted); }
/* Reset all characters, with its own confirmation. */
.reset-all { display: grid; justify-items: start; gap: 10px; margin: 4px 0 6px; }
.reset-all-open svg { width: 16px; height: 16px; }
.confirm-pane { display: grid; gap: 8px; width: 100%; padding: 14px 16px; border: 1.5px solid var(--accent); border-radius: var(--radius-sm); background: var(--card); box-shadow: var(--shadow); }
.confirm-pane p { margin: 0; color: var(--ink-2); }
.confirm-pane p b { color: var(--ink); }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.friend .who small { color: var(--muted); font-size: 13px; }
.friend-fields { display: grid; gap: 8px; min-width: 0; }
.friend-gender { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.friend-gender[hidden] { display: none; }
.friend-gender span { min-height: 36px; padding: 0 8px; font-size: 14px; }
.friend .friend-gender input { position: absolute; width: auto; min-height: 0; opacity: 0; }
.friend input, .friend select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--card); color: inherit; font-size: 16px; }
.friend input:focus, .friend select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(240 96 62 / 16%); }
@media (max-width: 520px) { .friend { grid-template-columns: 1fr; gap: 8px; } }

/* The big finale: a pill per person; tap to pick who falls. */
.finale-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; max-width: 100%; cursor: pointer; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill > span { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 44px; padding: 0 16px; border-radius: 999px; color: var(--ink-2); background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1.5px var(--line); font-size: 15px; transition: background 120ms ease, color 120ms ease; }
.pill b { overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.pill small { flex: none; padding: 2px 8px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-weight: 700; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.pill svg { display: none; flex: none; width: 16px; height: 16px; }
.pill:hover > span { box-shadow: var(--shadow-lift), inset 0 0 0 1.5px var(--line-strong); }
.pill input:checked + span { color: #fff; background: var(--accent); box-shadow: 0 6px 16px rgb(240 96 62 / 28%); }
.pill input:checked + span svg { display: block; }
.pill input:checked + span small { color: var(--accent); background: #fff; }
.pill input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.finale-summary { margin-top: 12px; color: var(--ink-2); font-size: 14px; }
.hero-pill { order: -1; }

details.more { margin-top: 30px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
details.more summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 0 20px; font-weight: 700; cursor: pointer; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary small { color: var(--muted); font-weight: 500; }
details.more summary svg { width: 20px; height: 20px; transition: transform 150ms ease; }
details.more[open] summary svg { transform: rotate(180deg); }
details.more .inner { display: grid; gap: 18px; padding: 0 20px 20px; }

/* Review */
.review-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
@media (max-width: 980px) { .review-grid { grid-template-columns: 1fr; } }
/* People in the review: one per line, a little apart, their title lighter. */
.summary-list .person { display: block; }
.summary-list .person + .person { margin-top: 6px; }
.summary-list .person-title { color: var(--muted); font-weight: 500; }
.summary-list { display: grid; margin: 0; padding: 4px 0; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.summary-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'label edit' 'value edit'; align-items: center; column-gap: 12px; padding: 12px 16px; }
.summary-list dt { grid-area: label; }
.summary-list dd { grid-area: value; }
.summary-list .edit { grid-area: edit; }
.summary-list > div + div { border-top: 1px solid var(--line); }
.summary-list dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.summary-list dd { margin: 0; min-width: 0; font-weight: 600; overflow-wrap: break-word; }
.summary-list dd small { display: block; color: var(--muted); font-weight: 500; font-size: 14px; }
.summary-list .edit { min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; color: var(--accent); background: transparent; font-weight: 700; font-size: 14px; cursor: pointer; }
.summary-list .edit:hover { background: var(--accent-soft); }
.preview-frame { overflow: hidden; border-radius: var(--radius); background: var(--night); box-shadow: var(--shadow-lift); }
.preview-frame .bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; color: rgb(255 255 255 / 80%); font-size: 14px; font-weight: 600; }
.preview-frame iframe { display: block; width: 100%; aspect-ratio: 4 / 3.2; border: 0; background: #000; }
.preview-frame .poster { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; }
.preview-frame .poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.preview-frame .poster .btn { position: relative; }

/* Done */
.done-screen { display: grid; justify-items: center; gap: 18px; max-width: 620px; margin: 8px auto 0; text-align: center; }
.done-screen .burst { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; background: var(--accent-soft); }
.done-screen .burst canvas { width: 64px; height: 64px; }
.done-screen h1 { font-size: clamp(30px, 4vw, 42px); }
.done-screen p { color: var(--ink-2); }
.link-box { display: flex; width: 100%; gap: 8px; padding: 6px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1.5px var(--line); }
.link-box input { flex: 1; min-width: 0; padding: 0 14px; border: 0; background: transparent; color: var(--ink-2); font-size: 15px; text-overflow: ellipsis; }
.link-box input:focus { outline: none; }
.link-box .btn { min-height: 44px; }
/* Ways to send it: an app per tile, in one row (they share it evenly on a phone). */
.share-apps { display: flex; width: 100%; gap: 10px; }
.share-app { display: grid; flex: 1 1 0; justify-items: center; gap: 8px; min-width: 0; padding: 14px 4px 12px; border: 0; border-radius: 16px; color: var(--ink-2); background: var(--card); box-shadow: var(--shadow); font: 600 14px var(--sans); text-decoration: none; cursor: pointer; transition: transform 120ms ease, box-shadow 120ms ease; }
.share-app:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.share-app:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.share-app > span:last-child { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.share-app .icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: #fff; background: var(--ink); }
.share-app .icon svg { width: 24px; height: 24px; }
.share-app.native .icon { color: var(--accent); background: var(--accent-soft); }
.share-app.facebook .icon { background: #1877f2; }
.share-app.whatsapp .icon { background: #25d366; }
.share-app.sms .icon { background: #34c759; }
@media (max-width: 420px) { .share-apps { gap: 6px; } .share-app { padding: 12px 0 10px; font-size: 12px; letter-spacing: -.01em; } .share-app .icon { width: 42px; height: 42px; } }
.done-screen .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.done-screen .fine { color: var(--muted); font-size: 14px; }

/* The live card on the right (desktop) */
.card-preview { position: sticky; top: 92px; align-self: start; overflow: hidden; border-radius: 20px; background: var(--card); box-shadow: var(--shadow-lift); }
.card-preview .art { position: relative; aspect-ratio: 4 / 3; background: radial-gradient(120% 120% at 30% 10%, #3a2f6b, var(--night)); }
.card-preview .art img { width: 100%; height: 100%; object-fit: cover; }
.card-preview .art .empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; color: rgb(255 255 255 / 72%); font-size: 14px; text-align: center; }
.card-preview .body { display: grid; gap: 10px; padding: 16px 18px 18px; }
.card-preview .kicker { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.card-preview .kicker canvas { width: 32px; height: 32px; }
.card-preview .title { font: 700 22px/1.2 var(--display); }
.card-preview .from { color: var(--ink-2); font-size: 15px; }
.card-preview .message { padding: 12px 14px; border-radius: 12px; background: var(--paper-2); color: var(--ink-2); font-size: 14px; font-style: italic; }
.card-preview .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.card-preview .chips span { padding: 4px 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); font-size: 13px; font-weight: 600; }

/* The action bar: Back / Continue, always within reach. */
.action-bar { position: fixed; right: 0; bottom: 0; left: 0; z-index: 15; border-top: 1px solid var(--line); background: rgb(251 247 241 / 94%); backdrop-filter: blur(10px); padding-bottom: env(safe-area-inset-bottom); }
.action-bar .inner { display: flex; align-items: center; gap: 12px; max-width: 1280px; min-height: 76px; margin: 0 auto; padding: 0 var(--gutter); }
.action-bar .why { flex: 1; min-width: 0; color: var(--muted); font-size: 14px; text-align: right; }
.action-bar .btn-primary { min-width: 168px; }
.mobile-progress { display: none; }

.notice { padding: 14px 16px; border-radius: 12px; background: #fff4e5; color: #7a4a10; font-size: 15px; }
.notice.error { background: #fde8e4; color: var(--danger); }
/* Back from Stripe's payment page: confirming the payment, then the link. */
.pay-wait { display: grid; justify-items: center; gap: 14px; max-width: 520px; margin: 48px auto; text-align: center; }
.pay-wait h1 { margin: 0; font: 700 clamp(28px, 5vw, 36px)/1.15 var(--display); }
.pay-wait p { margin: 0; color: var(--ink-2); }
.spinner { width: 44px; height: 44px; border: 4px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

@media (max-width: 1180px) {
  .builder { grid-template-columns: 220px minmax(0, 1fr); }
  .card-preview { display: none; }
}
@media (max-width: 820px) {
  .builder { grid-template-columns: 1fr; gap: 0; padding-top: 14px; }
  .stepper { display: none; }
  .mobile-progress { display: block; position: sticky; top: 64px; z-index: 10; height: 4px; margin: 0 calc(var(--gutter) * -1) 18px; background: var(--line); }
  .mobile-progress span { display: block; height: 100%; background: var(--accent); transition: width 250ms ease; }
  .action-bar .inner { min-height: 72px; }
  .action-bar .why { display: none; }
  .action-bar .btn { flex: 1; }
  .action-bar .btn-ghost { flex: 0 0 auto; }
  .choice-grid.occasions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice-grid.worlds { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
}
@media (min-width: 821px) { .builder-header .progress-text { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Builder odds and ends */
.choice.pet .own-icon { display: grid; place-items: center; width: 48px; height: 48px; color: var(--ink-2); }
.choice.pet .own-icon svg { width: 30px; height: 30px; }
.choice.pet small { color: var(--muted); font-size: 12px; }
.follower-fields { margin-top: 16px; }
details.more .hint { color: var(--muted); font-size: 15px; }
.summary-list .none { color: var(--muted); font-weight: 500; }
.preview-frame .bar a { color: inherit; }
.start-over-inline { justify-self: start; margin-top: 10px; }
.review-grid > div:first-child { display: grid; }
@media (max-width: 820px) { #start-over { display: none; } }

.stepper .dot svg { width: 16px; height: 16px; }
#start-over { margin-left: auto; }
.btn-primary.is-blocked { opacity: .55; box-shadow: none; }
html { scroll-padding-bottom: 96px; }
.choice-grid.jobs { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.choice-grid.jobs .tile { align-items: flex-start; min-height: 96px; padding: 16px 18px; }

.stepper button { justify-content: flex-start; }
.stepper button > span:last-child { display: grid; text-align: left; }
/* The review has the whole card on screen; the side preview steps aside for it. */
@media (min-width: 1181px) {
  body.reviewing .builder { grid-template-columns: 236px minmax(0, 1fr); }
  body.reviewing .card-preview { display: none; }
}

/* Phones: worlds two to a row, so more fit on screen. */
@media (max-width: 560px) {
  .choice-grid.worlds { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .choice.world .text { padding: 10px 12px 12px; }
  .choice.world b { font-size: 16px; }
  .choice.world small { font-size: 12.5px; }
  .choice .check { top: 8px; right: 8px; }
}
.more-friends { margin-top: 10px; color: var(--accent); }
/* Occasion pictures: 16 px art at whole multiples, so the pixels stay square. */
.choice-grid.occasions .tile canvas { width: 48px; height: 48px; }
/* Menu links land below the sticky header. */
.section { scroll-margin-top: 64px; }
.segmented-wide span { min-height: 46px; }

/* Sidekick: three kinds of sidekick, then what the chosen kind needs. */
.choice-grid.sidekick-types { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.choice-grid.sidekick-types .tile { min-height: 76px; }
.choice .type-icon { display: grid; place-items: center; width: 56px; height: 48px; flex: none; color: var(--ink-2); }
.choice .type-icon svg { width: 30px; height: 30px; }
#sidekick-detail .subpanel { margin-top: 14px; }
#sidekick-detail .subpanel h2 { margin-bottom: 12px; font-size: 18px; }
.choice-grid.animals { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); grid-auto-rows: 1fr; gap: 10px; }
.choice.pet .tile { min-height: 0; }
canvas.pet-art, .choice .tile canvas.pet-art { width: 56px; height: 48px; }
.feature .icon { width: 64px; height: 56px; }
.feature .icon canvas { width: 48px; height: 48px; }
/* Styles with pictures: small cards, the picture above the name. */
.choice-grid.styles:not(.plain) { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice-grid.styles:not(.plain) .choice.style .tile { flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden; }
.choice-grid.styles:not(.plain) .choice.style .thumb { width: 100%; border-radius: 0; }
.choice-grid.styles:not(.plain) .choice.style .text { padding: 10px 12px 12px; }
.choice-grid.styles:not(.plain) .choice.style .tile small { -webkit-line-clamp: 2; }
.choice-grid.styles:not(.plain) .choice.style .check { top: 8px; margin-top: 0; }
@media (max-width: 520px) { .choice-grid.styles:not(.plain) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Inside a place: a breadcrumb back to all the places, then its styles where the places were. */
/* Recommended for the occasion: a tag on the picture's top-left corner. */
.rec { display: inline-flex; align-items: center; gap: 4px; width: max-content; padding: 4px 10px 4px 8px; border-radius: 999px; color: #fff; background: var(--accent); box-shadow: 0 4px 12px rgb(240 96 62 / 35%); font: 700 12px var(--sans); letter-spacing: .02em; }
.rec svg { width: 13px; height: 13px; }
.choice .art .rec { position: absolute; top: 10px; left: 10px; z-index: 1; }
.choice.style .text .rec { margin: 2px 0; }
.choice:has(.rec) input:not(:checked) + .tile { box-shadow: var(--shadow), inset 0 0 0 2px rgb(240 96 62 / 35%); }
.choice.place .art .badge { display: inline-flex; align-items: center; gap: 4px; }
.choice.place .art .badge svg { width: 13px; height: 13px; }
.drill { animation: drill-in 220ms ease; }
@keyframes drill-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .drill { animation: none; } }
.crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 15px; }
.crumbs button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px 0 10px; border: 0; border-radius: 999px; color: var(--ink); background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1.5px var(--line); font: 600 15px var(--sans); cursor: pointer; }
.crumbs button:hover { box-shadow: var(--shadow-lift), inset 0 0 0 1.5px var(--line-strong); }
.crumbs button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.crumbs button svg { width: 16px; height: 16px; }
.crumbs .sep { color: var(--muted); }
.crumbs b { font-weight: 700; }
.style-head { margin: 12px 0 14px; font-size: 22px; }
.drill .choice-grid.styles.plain { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.drill .choice.style .tile { min-height: 76px; }
@media (max-width: 520px) {
  .drill .choice-grid.styles.plain { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .drill .choice.style .tile { min-height: 60px; padding: 10px 34px 10px 12px; }
  .drill .choice.style .tile b { font-size: 15px; }
  .drill .choice.style .check { right: 8px; width: 22px; height: 22px; margin-top: -11px; }
}

/* ---- The cast: everyone as a short list; each opens into its editor (basics, then More options). */
.cast { display: grid; gap: 10px; }
.cast-group { margin: 18px 0 2px; color: var(--muted); font: 700 12px var(--sans); letter-spacing: .09em; text-transform: uppercase; }
.cast-group:first-child { margin-top: 4px; }
.cast-row { border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); overflow: clip; }
.cast-head { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cast-head:hover { background: var(--paper); }
.cast-head:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.cast-portrait { display: grid; place-items: center; width: 56px; height: 66px; border-radius: 12px; background: var(--paper-2); overflow: hidden; }
.cast-portrait canvas, .cast-portrait svg { width: 48px; height: 64px; image-rendering: pixelated; }
.cast-text { display: grid; gap: 1px; min-width: 0; }
.cast-text b { font-size: 15px; }
.cast-now { color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.cast-text small { color: var(--muted); font-size: 12.5px; }
.cast-chevron svg { width: 18px; height: 18px; color: var(--muted); transition: transform .15s ease; }
.cast-head[aria-expanded="true"] .cast-chevron svg { transform: rotate(180deg); }
.cast-editor { display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: start; gap: 18px; padding: 16px; border-top: 1px solid var(--line); }
.cast-editor[hidden] { display: none; }
.cast-preview { position: sticky; top: 84px; z-index: 5; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 6px; padding: 18px 8px 12px; border-radius: 14px; background: var(--paper-2); }
.cast-preview canvas, .cast-preview svg { image-rendering: pixelated; }
.cast-preview [data-preview="front"] canvas { width: 120px; height: 160px; }
.cast-preview [data-preview="side"] canvas { width: 54px; height: 72px; }
.cast-preview-name { flex-basis: 100%; overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 700; text-align: center; white-space: nowrap; text-overflow: ellipsis; }
.cast-fields { display: grid; gap: 14px; min-width: 0; }
.cast-fields .fields { grid-template-columns: 1fr; }
.more-options { border-radius: 12px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.more-options summary { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; font-weight: 700; cursor: pointer; list-style: none; }
.more-options summary::-webkit-details-marker { display: none; }
.more-options summary small { color: var(--muted); font-weight: 500; }
.more-options summary svg { width: 16px; height: 16px; margin-left: auto; color: var(--muted); transition: transform .15s ease; }
.more-options[open] summary svg { transform: rotate(180deg); }
.more-options > .fields { padding: 4px 14px 16px; }
/* The look editor: Hair, Face, Outfit and Hat, each under its own heading. */
.look-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; }
.look-shuffle { min-height: 36px; padding: 0 14px; font-size: 14px; }
.look-part { display: grid; gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.look-part h3 { font: 700 13px/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.look-group { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.look-group legend { margin-bottom: 8px; padding: 0; color: var(--ink); font-weight: 600; font-size: 14px; }
.look-options { display: flex; flex-wrap: wrap; gap: 6px; }
.look-option { position: relative; }
.look-option input { position: absolute; opacity: 0; pointer-events: none; }
.look-option > span { display: grid; place-items: center; gap: 2px; min-width: 46px; min-height: 46px; padding: 4px 6px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--card); color: var(--ink-2); font-size: 12px; font-weight: 600; cursor: pointer; }
.look-option > span small { font-size: 11.5px; font-weight: 600; }
.look-option input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); color: var(--ink); }
.look-option input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.look-mini canvas { width: 36px; height: 48px; image-rendering: pixelated; }
.swatch { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(31 26 46 / 22%); }
.cast-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cast-done { margin-left: auto; }
.cast .more-friends { justify-self: start; }
@media (max-width: 640px) {
  .cast-editor { grid-template-columns: 1fr; gap: 14px; padding: 12px; }
  .cast-preview { top: 68px; padding: 8px 8px 6px; box-shadow: 0 6px 12px -8px rgb(31 26 46 / 35%); }
  .cast-preview [data-preview="front"] canvas { width: 72px; height: 96px; }
  .cast-preview [data-preview="side"] canvas { width: 36px; height: 48px; }
  .cast-head { grid-template-columns: 48px minmax(0, 1fr) auto 16px; gap: 10px; padding: 10px 12px; }
  .cast-portrait { width: 48px; height: 58px; }
  .cast-portrait canvas { width: 42px; height: 56px; }
}

/* A question to confirm (ui.js confirmChoice): a box over the page. */
.confirm-dialog { width: min(440px, calc(100% - 32px)); padding: 22px 22px 18px; border: 0; border-radius: var(--radius); background: var(--card); color: var(--ink); box-shadow: var(--shadow-lift); }
.confirm-dialog::backdrop { background: rgb(31 26 46 / 45%); }
.confirm-dialog h2 { margin: 0 0 8px; font: 700 22px/1.2 var(--display); }
.confirm-dialog p { margin: 0 0 18px; color: var(--ink-2); }
.confirm-dialog .confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- the done screen's email notice, also used on My cards */
.notify-box { display: grid; gap: 10px; width: 100%; padding: 16px 18px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); text-align: left; }
.notify-box label, .notify-box p { margin: 0; color: var(--ink-2); font-size: 15px; }
.notify-row { display: flex; gap: 8px; }
.notify-row input { flex: 1; min-width: 0; min-height: 46px; padding: 0 14px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--card); font-size: 16px; }
.notify-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(240 96 62 / 16%); }
.notify-row .btn { min-height: 46px; }
.notify-status:empty { display: none; }
.notify-status.ok { color: var(--ok); }
.notify-status.error { color: var(--danger); }
.done-screen .fine a { color: var(--ink-2); font-weight: 600; }

/* ---- pages with a form or a list (My cards, Report a card, Contact, Moderation) */
.form-page { max-width: calc(760px + 2 * var(--gutter)); padding-block: 36px 8px; }
.form-page h1 { font-size: clamp(30px, 5vw, 42px); margin: 0 0 10px; }
.form-page .lede { margin: 0 0 24px; color: var(--ink-2); font-size: 17px; max-width: 62ch; }
.form-page .lede a, .form-page .fine a { color: var(--accent-hover); font-weight: 600; }
.form-page .fine { margin: 24px 0 0; color: var(--muted); font-size: 14px; }
.stack-form { display: grid; gap: 18px; }
.stack-form > .btn { justify-self: start; }
.stack-form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.stack-form legend { margin-bottom: 8px; padding: 0; font-weight: 600; font-size: 15px; }
.radio-list { display: grid; gap: 8px; }
.radio { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1.5px transparent; cursor: pointer; }
.radio input { margin: 3px 0 0; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.radio span { display: grid; gap: 2px; }
.radio small { color: var(--muted); font-size: 13.5px; }
.radio:has(input:checked) { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); }
.radio:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The field only bots see (it catches spam). */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sent-panel { display: grid; justify-items: start; gap: 12px; padding: 24px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.sent-panel h2 { margin: 0; font-size: 24px; }
.sent-panel p { margin: 0; color: var(--ink-2); }
.notice.ok { background: #e7f5ee; color: #1f6b48; }
.empty-state { display: grid; justify-items: start; gap: 14px; padding: 24px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.empty-state p { margin: 0; color: var(--ink-2); }
.link-button { padding: 0; border: 0; background: none; color: var(--accent-hover); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: #fde8e4; }

/* A card's state: Live, Turned off, open report... */
.state { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.state.live { color: #1f6b48; background: #e7f5ee; }
.state.off, .state.gone { color: var(--muted); background: var(--paper-2); }
.state.open { color: #8a4a00; background: #fff1d6; }

/* My cards */
.card-list { display: grid; gap: 16px; }
.sent-card { display: grid; gap: 10px; padding: 20px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.sent-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sent-head h2 { margin: 0; font-size: 21px; min-width: 0; }
.sent-meta { margin: 0; color: var(--muted); font-size: 14px; }
.sent-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.sent-stats .stat { color: var(--ink-2); font-size: 15px; }
.sent-stats .stat b { color: var(--ink); font: 700 24px var(--display); margin-right: 4px; font-variant-numeric: tabular-nums; }
.sent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sent-actions .btn { min-height: 42px; padding: 0 16px; font-size: 15px; }
.sent-card .notify-box { box-shadow: none; padding: 14px; background: var(--paper); }

/* Moderation */
.mod-tabs { margin-bottom: 18px; }
.mod-panel { display: grid; gap: 14px; }
.mod-filter { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; }
.mod-item { display: grid; gap: 10px; padding: 18px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.mod-item-head, .mod-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mod-card-head a { color: var(--ink-2); font-size: 14px; }
.mod-card { display: grid; gap: 6px; padding: 14px; border-radius: 12px; background: var(--paper); }
.mod-card p, .mod-item p { margin: 0; }
.mod-card.gone { color: var(--muted); }
.mod-meta { color: var(--muted); font-size: 14px; }
.mod-quote { padding: 10px 12px; border-left: 3px solid var(--line-strong); color: var(--ink-2); white-space: pre-wrap; }
.mod-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mod-actions .btn { min-height: 40px; padding: 0 14px; font-size: 14px; }
.mod-reason, .mod-rule { flex: 1 1 200px; min-height: 40px; padding: 0 12px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--card); font-size: 15px; }
.mod-sub { margin: 10px 0 0; font-size: 18px; }
.lookup { display: flex; gap: 8px; }
.lookup input { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--card); font-size: 16px; }
.signin { max-width: 420px; }

/* Moderation: the Stats tab */
.stats-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.stats-bar select { min-height: 40px; margin-left: 6px; padding: 0 10px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--card); font-size: 15px; }
.stats-bar .btn { min-height: 40px; padding: 0 16px; font-size: 14px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.stat-tile { display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.stat-tile b { font: 700 28px var(--display); font-variant-numeric: tabular-nums; }
.stat-tile span { color: var(--muted); font-size: 13px; }
.stat-chart { margin: 4px 0 0; padding: 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.stat-chart svg { display: block; width: 100%; height: 140px; }
.stat-chart .bar-visits { fill: #f4c9b9; }
.stat-chart .bar-cards { fill: var(--accent); }
.stat-chart figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; }
.stat-chart .key { display: inline-block; width: 10px; height: 10px; margin: 0 4px 0 10px; border-radius: 2px; vertical-align: -1px; }
.stat-chart .key:first-child { margin-left: 0; }
.stat-chart .key.visits { background: #f4c9b9; }
.stat-chart .key.cards { background: var(--accent); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 12px; }
.stat-block { min-width: 0; padding: 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.stat-block.wide { grid-column: 1 / -1; }
.stat-block h3 { margin: 0 0 10px; font-size: 17px; }
.stat-block .mod-meta { margin: -4px 0 10px; }
.stat-bars { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.stat-bars li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 14px; }
.stat-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink-2); }
.stat-track { height: 8px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.stat-track i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.stat-bars b { font-variant-numeric: tabular-nums; text-align: right; }
.stat-bars b small { color: var(--muted); font-weight: 500; }
.stat-rest .stat-label { color: var(--muted); }

/* A quest back (from the end of a card) and the done screen's filming tip */
.reply-note, .film-tip { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink-2); font-size: 15px; text-align: left; }
.reply-note { width: fit-content; max-width: 100%; margin-bottom: 14px; }
.reply-note svg, .film-tip svg { flex: none; width: 20px; height: 20px; color: var(--accent); }
.film-tip { width: 100%; }
