/* The page around the kitchen table. table.js draws the scene on the canvas behind; this file lays the
   words and buttons over it. The night wall is the background, the candle colours the actions,
   enamel cream is for paper and cards. */
@font-face { font-family: Almanac; src: url(/fonts/almanac.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Almanac; font-style: italic; src: url(/fonts/almanac-italic.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Almanac; font-weight: 700; src: url(/fonts/almanac-bold.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Gothic; font-weight: 600; src: url(/fonts/gothic.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Text; font-weight: 400; src: url(/fonts/text-400.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Text; font-weight: 500; src: url(/fonts/text-500.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Text; font-weight: 600; src: url(/fonts/text-600.woff2) format("woff2"); font-display: swap; }

:root {
  --wall: #14161c; --wall-2: #1d2029; --wall-3: #262a35;
  --candle: #f2a541; --candle-light: #ffd58a; --candle-ink: #2a1b0b;
  --enamel: #efe6d2; --rim: #2f4f8f; --ink: #2a2018; --ink-muted: #6a5b4a;
  --fg: #efe6d2; --fg-muted: #b9b2a3; --fg-faint: rgba(239, 230, 210, .16);
  --gold: #d9a93a; --seal: #9e1f1a; --danger: #ffab9c;
  --almanac: Almanac, "Old Standard TT", Georgia, serif; --gothic: Gothic, Almanac, serif;
  --text: Text, "Fira Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --side: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--wall); }
html, body { margin: 0; color: var(--fg); font: 16px/1.5 var(--text); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; background: var(--wall); -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
body.sheet-open { overflow: hidden; }
a { color: var(--candle-light); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--candle-light); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--almanac); font-weight: 400; margin: 0; text-wrap: balance; letter-spacing: -0.005em; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--fg-muted); }
.small { font-size: 13.5px; line-height: 1.45; }
.center { text-align: center; }
.gothic { font-family: var(--gothic); font-weight: 600; }
.opt { font-weight: 400; color: var(--fg-muted); font-size: 12px; }
.err { color: var(--danger); font-size: 14px; margin-top: 8px; }
.err:empty { display: none; }

/* The scene sits behind everything. Taps on empty parts of the page reach it. */
#table { position: fixed; inset: 0; width: 100vw; height: 100lvh; display: block; z-index: 0; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
body.gesturing #table { touch-action: none; }
#app { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 100svh; padding: 0 var(--side); pointer-events: none; }
#app a, #app button, #app input, #app textarea, #app select, #app label, #app summary, #app details, #app .card, #app .more, #app form, #app .extra { pointer-events: auto; }
.gap { flex: 1 1 auto; min-height: 120px; }

/* Header */
.bar { display: flex; align-items: center; gap: 12px; padding: max(8px, env(safe-area-inset-top)) 0 6px; pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 0; color: var(--fg); text-decoration: none; font: 400 21px/1 var(--almanac); white-space: nowrap; }
.brand .bn { overflow: hidden; text-overflow: ellipsis; }
.brand svg { flex: none; filter: drop-shadow(0 0 6px rgba(242, 165, 65, .45)); }
.links { display: none; gap: 22px; margin-left: 18px; }
.links a { color: var(--fg-muted); text-decoration: none; font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; }
.links a:hover { color: var(--fg); }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tool { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--fg-faint); background: rgba(29, 32, 41, .7); color: var(--fg-muted); cursor: pointer; touch-action: manipulation; }
.tool[aria-pressed="true"] { color: var(--candle-light); }
@media (min-width: 900px) { .links { display: flex; } }
.bar-end .btn.small { white-space: nowrap; }
@media (max-width: 430px) { .brand { font-size: 18px; } .bar-end .btn.small { padding: 10px 13px; font-size: 14.5px; } .bar { gap: 8px; } }
@media (max-width: 380px) { .brand .bx { display: none; } }
@media (max-width: 340px) { .brand .bn { display: none; } }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 14px 20px; border: 0; border-radius: 999px;
  font: 600 17px/1.15 var(--text); text-align: center; cursor: pointer; text-decoration: none; touch-action: manipulation; transition: transform .12s var(--ease), background-color .15s, box-shadow .2s; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.candle { background: var(--candle); color: var(--candle-ink); box-shadow: 0 8px 26px -10px rgba(242, 165, 65, .7); }
.btn.ghost { background: rgba(29, 32, 41, .82); color: var(--fg); border: 1.5px solid var(--fg-faint); }
.btn.small { width: auto; min-height: 44px; padding: 10px 16px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: default; }
@media (hover: hover) { .btn.candle:hover:not(:disabled) { background: #f6b35a; } .btn.ghost:hover:not(:disabled) { border-color: var(--fg-muted); } }
.link { background: none; border: 0; padding: 10px 2px; font: inherit; color: var(--fg); opacity: .85; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--fg-muted); margin: 0 0 6px; letter-spacing: .02em; }
input, textarea { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--enamel); border: 1px solid #d8cdb4; border-radius: 14px; padding: 13px 15px; outline: none; }
input:focus, textarea:focus { border-color: var(--candle); box-shadow: 0 0 0 3px rgba(242, 165, 65, .25); }
input::placeholder, textarea::placeholder { color: #998a74; }
.field + .field, fieldset + .field, .field + fieldset { margin-top: 14px; }
fieldset { border: 0; padding: 0; margin: 14px 0 0; }
legend { font-size: 13px; font-weight: 600; color: var(--fg-muted); padding: 0; margin-bottom: 6px; }
.row { display: flex; gap: 10px; }
.row > input { flex: 1; min-width: 0; }
.row > .btn { flex: none; width: auto; }
.actions { display: flex; gap: 10px; margin-top: 16px; }
.actions > .btn { flex: 1; }
.actions.wrap { flex-wrap: wrap; }
.actions.wrap > .btn { flex: 1 1 auto; }
.stack > * + * { margin-top: 10px; }

/* Top of the screen: what this is, and what to do now */
.top { padding: 4px 0 0; pointer-events: none; }
.top h1 { font-size: clamp(34px, 7.4vw + 10px, 64px); line-height: 1.02; text-shadow: 0 2px 18px rgba(0, 0, 0, .5); }
.eyebrow { font-size: 14px; letter-spacing: .04em; color: var(--candle-light); margin-bottom: 2px; }
.eyebrow.gothic { font-size: 20px; letter-spacing: .02em; }
.tag { color: var(--fg-muted); margin-top: 6px; font-size: clamp(15px, .5vw + 14px, 18px); }
.countdown { margin-top: 8px; display: inline-block; padding: 6px 12px; border-radius: 999px; background: rgba(242, 165, 65, .14); color: var(--candle-light); font-variant-numeric: tabular-nums; font-weight: 600; }
.cap { margin-top: 10px; min-height: 1px; }
.cap .step { font: 400 clamp(19px, 1vw + 16px, 24px)/1.3 var(--almanac); text-shadow: 0 2px 12px rgba(0, 0, 0, .7); }
.cap .sub { color: var(--fg-muted); font-size: 14px; margin-top: 2px; }
.cap .turnof { color: var(--candle-light); font: 600 14px var(--text); letter-spacing: .03em; text-transform: uppercase; }
.cap .turnof.big { font: 400 clamp(24px, 2vw + 18px, 34px)/1.2 var(--almanac); text-transform: none; letter-spacing: 0; color: var(--fg); }
.status { color: var(--fg-muted); margin-top: 6px; }
/* The reveal moment: the figure takes over the top of the screen; titles step aside. */
body.moment .top h1, body.moment .top .tag, body.moment .top .eyebrow.gothic, body.moment .top .status, body.moment .top #head { display: none; }
.cap .fig-big { font: 400 clamp(40px, 9vw + 8px, 68px)/1.04 var(--almanac); color: var(--fg); text-shadow: 0 2px 22px rgba(0, 0, 0, .7); margin-top: 2px; }
.cap .meaning-top { font-size: clamp(17px, .6vw + 15px, 21px); color: var(--fg); max-width: 34ch; margin-top: 8px; text-shadow: 0 2px 12px rgba(0, 0, 0, .8); }
@media (max-width: 899px) { body.sheet-open #app .top { visibility: hidden; } .sheet.result-sheet { max-height: 64dvh; } }
.home .top .lede { display: none; }
@media (max-height: 700px) { .tag { display: none; } .top h1 { font-size: clamp(30px, 6vw + 10px, 44px); } }

/* Bottom of the screen: the controls of the moment */
.dock { padding: 10px 0 max(16px, env(safe-area-inset-bottom)); }
.dock, .ctl { width: min(100%, 520px); margin: 0 auto; }
.materials { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px; }
.mat { display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: 64px; padding: 8px 2px 7px; border-radius: 14px; border: 1.5px solid var(--fg-faint);
  background: rgba(29, 32, 41, .84); color: var(--fg-muted); font: 500 12px/1.15 var(--text); cursor: pointer; touch-action: manipulation; }
.mat[aria-checked="true"] { border-color: var(--candle); color: var(--fg); background: rgba(58, 44, 22, .9); }
.sw { width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .35), 0 1px 2px rgba(0, 0, 0, .4); }
.sw-tin { background: radial-gradient(circle at 35% 30%, #fbfcfe, #c9ccd2 45%, #7f848e); }
.sw-lead { background: radial-gradient(circle at 35% 30%, #b7bbc2, #6d717a 50%, #3e4149); }
.sw-wax-red { background: radial-gradient(circle at 35% 30%, #e76a5f, #b8322f 55%, #7a1d1a); }
.sw-wax-green { background: radial-gradient(circle at 35% 30%, #6fbf8b, #2f7a4d 55%, #1b4c2f); }
.sw-wax-blue { background: radial-gradient(circle at 35% 30%, #77a1e2, #2f5fa8 55%, #1c3a6a); }
.sw-gold { background: radial-gradient(circle at 35% 30%, #fff1b8, #d9a93a 50%, #8b6512); }
.lead-note { font-size: 13px; color: var(--fg-muted); margin: -4px 0 8px; text-align: center; }
.hold { position: relative; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.hold.on { background: #ffbf62; box-shadow: 0 0 0 6px rgba(242, 165, 65, .22), 0 0 40px rgba(242, 165, 65, .55); }

/* Below the first screen */
.more { padding: 26px 0 40px; margin: 0 calc(var(--side) * -1); padding-left: var(--side); padding-right: var(--side); background: linear-gradient(to bottom, rgba(20, 22, 28, 0), var(--wall) 40px); }
.more > * { width: min(100%, 680px); margin-left: auto; margin-right: auto; }
.more h2 { font-size: 30px; margin-bottom: 14px; }
.more h2.gothic { font-family: var(--gothic); color: var(--candle-light); }
.below { position: relative; z-index: 1; background: linear-gradient(to bottom, rgba(20, 22, 28, 0), var(--wall) 60px); padding: 40px var(--side) 10px; }
body:not(.at-home) .below { display: none; }
.about { width: min(100%, 680px); margin: 0 auto 44px; }
.about h2 { font-size: clamp(28px, 2vw + 20px, 38px); margin-bottom: 14px; }
.about p { color: var(--fg-muted); margin-top: 10px; }
.steps { padding-left: 1.4em; margin: 0; }
.steps li { margin: 0 0 10px; color: var(--fg-muted); }
.steps li::marker { font: 700 1.1em var(--almanac); color: var(--candle); }
.steps b { color: var(--fg); font-weight: 600; }
.popular { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.popular a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--fg-faint); color: var(--fg); text-decoration: none; background: var(--wall-2); }
.faq details { border-bottom: 1px solid var(--fg-faint); }
.faq summary { list-style: none; cursor: pointer; padding: 15px 30px 15px 0; font-weight: 500; position: relative; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 22px; color: var(--candle); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { padding-bottom: 14px; margin: 0; }
.notes-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.notes-list li { background: var(--wall-2); border-radius: 16px; padding: 14px 16px 6px; }
.notes-list p { color: var(--fg); margin: 0; }
.notes-list .who { font-size: 13px; color: var(--fg-muted); }

/* Footer */
.foot { position: relative; z-index: 1; background: var(--wall); padding: 28px var(--side) max(28px, env(safe-area-inset-bottom)); border-top: 1px solid var(--fg-faint); }
.foot > * { width: min(100%, 680px); margin-left: auto; margin-right: auto; }
.foot h2 { font: 600 13px var(--text); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 8px; }
.foot ul { padding: 0; margin: 0 0 18px; list-style: none; }
.foot li { color: var(--fg-muted); font-size: 14px; padding: 4px 0; }
.foot a { color: var(--fg); }
.foot .legal { color: var(--fg-muted); font-size: 13.5px; }
.foot .legal a { display: inline-block; padding: 8px 0; }

/* Sheets: a panel from the bottom; the table stays visible above */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-height: 74dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--wall-2); border-radius: 24px 24px 0 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .5); border-top: 1px solid var(--fg-faint);
  transform: translateY(102%); transition: transform .38s var(--ease); padding: 0 var(--side) max(22px, env(safe-area-inset-bottom)); }
.sheet.in { transform: none; }
.sheet.out { pointer-events: none; }
.sheet-body { width: min(100%, 560px); margin: 0 auto; padding-top: 22px; }
.sheet-close { position: sticky; top: 8px; float: right; margin-top: 8px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--wall-3); color: var(--fg); cursor: pointer; }
.sheet h2 { font-size: 28px; margin: 4px 50px 8px 0; }
.result .eyebrow { margin-top: 2px; }
.fig-name { font-size: clamp(34px, 6vw + 14px, 46px); line-height: 1.05; margin: 2px 50px 8px 0; }
.meaning { font-size: 19px; line-height: 1.45; color: var(--fg); }
.lore { font: italic 400 16px/1.5 var(--almanac); color: var(--fg-muted); margin-top: 10px; }
.more-link { display: inline-block; margin-top: 8px; font-size: 14px; min-height: 44px; padding-top: 10px; }
.extras { display: grid; gap: 8px; margin-top: 16px; }
.extra { display: grid; gap: 2px; text-align: left; width: 100%; padding: 13px 16px; border-radius: 16px; border: 1px solid var(--fg-faint); background: var(--wall-3); color: var(--fg); font: inherit; cursor: pointer; }
.extra b { font-weight: 600; }
.extra span { color: var(--fg-muted); font-size: 13.5px; line-height: 1.4; }
.extra.gold { border-color: rgba(217, 169, 58, .6); background: linear-gradient(135deg, rgba(217, 169, 58, .16), rgba(38, 42, 53, 1) 60%); }
.extra.gold b { color: #f0cf7a; }
.paynote { font-size: 12.5px; color: var(--fg-muted); margin: 6px 2px 0; }
.paynote a { color: var(--fg-muted); }
.wish { margin: 16px 0 0; background: var(--enamel); color: var(--ink); border-radius: 14px; padding: 16px 18px 10px; box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .6); }
.wish p { font: italic 400 19px/1.45 var(--almanac); white-space: pre-wrap; }
.wish footer { font-size: 14px; color: var(--ink-muted); margin-top: 6px; }
.wish .link { color: var(--ink-muted); }
.charm-line { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: var(--fg); }
.charm-line canvas { flex: none; }
.thanks-head { margin-top: 16px; font-weight: 600; }
.thanks-row { display: flex; gap: 8px; margin-top: 8px; }
.thanks-row input { flex: 1; min-width: 0; }
.heart { flex: none; width: 50px; height: 50px; border-radius: 50%; border: 1.5px solid var(--fg-faint); background: var(--wall-3); color: var(--fg-muted); cursor: pointer; display: grid; place-items: center; }
.heart[aria-pressed="true"] { color: #e0564b; border-color: rgba(224, 86, 75, .5); }
.thanked { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--wall-3); }
.heart-on { color: #e0564b; display: grid; }
.sent { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--fg); }
.sent svg { color: #e0564b; }
.note-offer { margin-top: 18px; border-top: 1px solid var(--fg-faint); padding-top: 6px; }
.note-offer summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--fg-muted); }
.note-offer label { color: var(--fg-muted); }

/* Share */
.linkrow { display: flex; gap: 8px; margin: 12px 0; }
.linkrow input { flex: 1; min-width: 0; font-size: 15px; }
.channels { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chan { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 999px; background: var(--wall-3); color: var(--fg); text-decoration: none; border: 1px solid var(--fg-faint); font-size: 15px; }
.qr { display: flex; align-items: center; gap: 14px; margin: 10px 0 14px; }
.qr-art { width: 132px; height: 132px; flex: none; border-radius: 10px; overflow: hidden; }
.qr-art svg { width: 100%; height: 100%; display: block; }
.share .btn + .btn, .share .btn + .channels { margin-top: 10px; }

/* The round's oracle */
.oracle { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.oracle li { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: start; padding: 12px; border-radius: 16px; background: var(--wall-2); border: 1px solid var(--fg-faint); }
.oracle .lump { width: 72px; height: 72px; border-radius: 12px; background: radial-gradient(circle at 30% 30%, rgba(242, 165, 65, .2), rgba(20, 22, 28, 0) 70%), var(--wall-3); display: grid; place-items: center; }
.empty-lump { width: 34px; height: 22px; border-radius: 50%; border: 2px dashed var(--fg-faint); }
.oracle .who b { font: 700 19px var(--almanac); }
.oracle .fig { color: var(--fg-muted); font-size: 14.5px; margin-top: 2px; }
.oracle .fig a { color: var(--candle-light); font-weight: 600; }
.charm-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--gold); margin-left: 6px; vertical-align: middle; }
.reacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.react { min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--fg-faint); background: var(--wall-3); color: var(--fg-muted); font: 500 13px var(--text); cursor: pointer; }
.react[aria-pressed="true"] { color: var(--candle-ink); background: var(--candle-light); border-color: var(--candle-light); }
.react span { font-weight: 600; }
@media (pointer: coarse) { .react { min-height: 44px; } }
.addrow { margin: 6px 0 18px; }

/* The poster and its seal */
.poster-view { text-align: center; }
.poster-frame { position: relative; display: inline-block; margin: 6px auto 12px; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .8); }
.poster-frame canvas { display: block; border-radius: 3px; }
.seal-drop { position: absolute; right: 7%; bottom: 5%; width: 26%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #d0483b, #8e1d17 70%); box-shadow: 0 14px 22px rgba(0, 0, 0, .5);
  transform: translateY(-260px) scale(1.5) rotate(-30deg); opacity: 0; transition: transform .5s cubic-bezier(.5, 0, .75, 0), opacity .2s; }
.seal-drop:not([hidden]) { opacity: 1; }
.seal-drop.down { transform: translateY(0) scale(1) rotate(-10deg); }
.secret { margin: 6px 0 10px; text-align: left; }
.downloads { text-align: left; margin-top: 10px; }

/* Waiting for a payment, and little messages */
.paying { position: fixed; left: 50%; top: max(12px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 30; width: min(92vw, 440px);
  background: var(--wall-3); border: 1px solid var(--fg-faint); border-radius: 16px; padding: 12px 16px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); display: grid; gap: 2px; }
.paying span { color: var(--fg-muted); font-size: 13.5px; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 40; max-width: min(92vw, 480px);
  background: var(--enamel); color: var(--ink); padding: 12px 18px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease); font-size: 15px; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 900px) {
  .home .top { max-width: 560px; }
  .sheet { left: auto; right: 24px; bottom: 24px; width: 460px; border-radius: 24px; max-height: calc(100dvh - 120px); }
  .sheet-body { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
