/* Shared building blocks for every page. Colors and fonts come from theme tokens
   (--bg --bg2 --ink --card --cardInk --muted --accent --accent2 --accent3 --gold --line --btnInk
   --font-display --font-body), set on <body> or a preview frame by BPPThemes.cssVars(). */
/* Metric-matched fallbacks for Fredoka and Nunito (measured against Arial in Chrome, design
   system): text doesn't jump when the web fonts swap in. */
@font-face { font-family: "BPP Display Fallback"; src: local("Arial"), local("ArialMT"), local("Helvetica"); size-adjust: 93.4%; ascent-override: 103.8%; descent-override: 25.7%; line-gap-override: 0%; }
@font-face { font-family: "BPP Body Fallback"; src: local("Arial"), local("ArialMT"), local("Helvetica"); size-adjust: 98.9%; ascent-override: 102.2%; descent-override: 35.4%; line-gap-override: 0%; }
:root {
  --bg: #1d1640; --bg2: #2e2468; --ink: #fff7fb; --card: #fffaf6; --cardInk: #2a1f4f; --muted: #6d6491;
  --accent: #ff8fc0; --accent2: #c8b4ff; --accent3: #9ff0d0; --gold: #ffe394; --line: #eadff5; --btnInk: #1d1533;
  --font-display: "Fredoka", "BPP Display Fallback", system-ui, sans-serif; --font-body: "Nunito", "BPP Body Fallback", system-ui, sans-serif;
  --warn-bg: #fff1c2; --warn-ink: #6b5200; --tap: 44px;
  --radius: 22px; --shadow: 0 10px 30px rgba(20, 10, 50, .18), 0 2px 6px rgba(20, 10, 50, .12);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; font-family: var(--font-body), "BPP Body Fallback", system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--font-display), "BPP Display Fallback", system-ui, sans-serif; line-height: 1.15; margin: 0 0 .4em; text-wrap: balance; }
p, li { text-wrap: pretty; }
a { color: inherit; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.muted { opacity: .7; }

/* ---- cards ---- */
.card { background: var(--card); color: var(--cardInk); border-radius: var(--radius); padding: 20px 18px; box-shadow: var(--shadow); margin: 0 0 16px; }
.card h2 { font-size: 1.35rem; display: flex; align-items: center; gap: .4em; }
.sec-head { margin-bottom: 12px; }
.sec-head p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 46px; padding: 10px 20px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--btnInk); font-family: var(--font-display), "BPP Display Fallback", system-ui, sans-serif; font-weight: 600; font-size: 1.05rem; text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .18); transition: transform .12s ease, box-shadow .12s ease, filter .12s; -webkit-tap-highlight-color: transparent; }
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.big { min-height: 60px; font-size: 1.2rem; width: 100%; }
.btn.sm { min-height: 44px; padding: 7px 14px; font-size: .95rem; }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.btn.alt { background: var(--accent2); }
.btn.danger { background: #c92a2a; color: #fff; } /* 5.5:1 */
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; }
.chip { display: inline-flex; align-items: center; gap: .3em; min-height: 44px; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--accent2) 30%, transparent); color: var(--cardInk); text-decoration: none; font-weight: 700; font-size: .9rem; border: 0; cursor: pointer; transition: transform .12s var(--ease-out, ease-out), filter .12s; }
.chip:hover { filter: brightness(.97); }
.chip:active { transform: scale(.96); }
.chip:disabled, .chip[aria-disabled="true"] { opacity: .45; cursor: default; transform: none; }
.chip[aria-busy="true"] { opacity: .7; cursor: progress; }
@media (prefers-reduced-motion: reduce) { .chip, .btn { transition: none; } .chip:active { transform: none; } }
/* Accent used as TEXT on a light card (prices, current step, stats): the accent mixed toward the card
   ink, AA (4.5:1+) on every theme's card. Declared on [data-theme] too, because a custom property that
   uses var() resolves where it's declared, and themes set --accent on their own element. */
:root, [data-theme] { --accent-ink: color-mix(in srgb, var(--accent) 40%, var(--cardInk)); }
/* No orphaned last words in headings; nicer paragraph rag. */
h1, h2, h3, legend { text-wrap: balance; }
p, li { text-wrap: pretty; }
/* Long names (24+ characters) and notes wrap instead of clipping at 320px. */
.badge, .fine-print li, .serving, .waiting-on li, .allergy-list li, .split { overflow-wrap: anywhere; min-width: 0; }

/* ---- forms ---- */
.f { display: block; margin: 0 0 12px; font-weight: 700; font-size: .95rem; }
.f input, .f select, .f textarea, input.inp, select.inp, textarea.inp { display: block; width: 100%; margin-top: 5px; min-height: 46px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--cardInk); font-weight: 600; font-size: 1rem; }
.f textarea, textarea.inp { min-height: 84px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus, .inp:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.opt { font-weight: 600; color: var(--muted); font-size: .85em; }
.row2 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 560px) { .row2 { grid-template-columns: 1fr 1fr; } }
fieldset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
legend { font-weight: 800; margin-bottom: 6px; padding: 0; }
.note { font-size: .92rem; color: var(--muted); margin: 8px 0 0; }
.note.err, .err { color: #c62e4a; font-weight: 700; }
.choices { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.choices.big { grid-template-columns: 1fr; }
.choices.thirds { grid-template-columns: repeat(3, 1fr); }
.choices.list { grid-template-columns: 1fr; }
.choices.buddies { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
.choices.tints { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice > span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 48px; padding: 8px 10px; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--cardInk); font-weight: 700; text-align: center; transition: border-color .15s, background .15s, transform .12s; }
.choices.big .choice > span { min-height: 58px; font-size: 1.08rem; }
.choice input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, #fff); }
.choice input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.choice small { font-weight: 700; font-size: .78rem; }
.sw { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12); }
.chk { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 700; position: relative; }
.chk input { position: absolute; opacity: 0; width: 28px; height: 28px; margin: 0; cursor: pointer; }
.chk .box { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--line); background: #fff; color: transparent; flex: none; transition: background .15s, color .15s; }
.chk input:checked + .box { background: var(--accent3); border-color: var(--accent3); color: var(--cardInk); }
.chk input:focus-visible + .box { outline: 3px solid var(--gold); outline-offset: 2px; }
details.more { border-top: 2px dashed var(--line); padding-top: 10px; margin: 6px 0 12px; }
details.more summary { cursor: pointer; font-weight: 800; min-height: 44px; display: flex; align-items: center; gap: 6px; }
.more-in { padding-top: 10px; }

/* ---- toast ---- */
.toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translate(-50%, 140%); z-index: 100; display: flex; gap: 12px; align-items: center;
  background: #1e1638; color: #fff; padding: 12px 18px; border-radius: 999px; box-shadow: var(--shadow); font-weight: 700; max-width: calc(100vw - 32px); transition: transform .25s ease; }
.toast.on { transform: translate(-50%, 0); }
.toast button { background: none; border: 0; color: var(--gold); font-weight: 800; cursor: pointer; text-decoration: underline; }
#confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 90; }

/* ---- the party characters ---- */
.critter { display: block; overflow: visible; }
.critter.pixel { image-rendering: pixelated; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }
