:root{color-scheme:light;--paper:#fbf3eb;--ink:#5a3826;--rust:#a84f33;--line:#b59882;font:100%/1.5 "Avenir Next",Avenir,system-ui,sans-serif;color:var(--ink);background:var(--paper)}
*{box-sizing:border-box}
html{scrollbar-gutter:stable both-edges}
body{margin:0;min-width:240px}
[hidden]{display:none!important}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;touch-action:manipulation}
button:disabled{cursor:wait}
:where(button,a,input,select,label,summary){-webkit-tap-highlight-color:transparent}
:focus-visible{outline:2px solid var(--rust);outline-offset:2px}
::selection{background:#efc79c;color:#442a20}
.shell{--tools-edge:clamp(16px,2.3vw,28px);--debug-space:76px;min-height:100svh;display:grid;place-items:center;padding:clamp(52px,8svh,90px) 12px 3svh}
/* Center the painting plus a reserved dialogue area, not the current line of text.
   Longer copy can flow below this row and scroll without repositioning the stall. */
main{--scene-width:min(100cqw,94vw,80svh,820px);width:100%;display:grid;grid-template-rows:auto 9rem;justify-items:center;text-align:center;container-type:inline-size}
.stage{--pose-fade:1s;position:relative;isolation:isolate;width:var(--scene-width);aspect-ratio:800/750;container-type:inline-size}
#scene{width:100%;height:100%;object-fit:fill;display:block;mask-image:linear-gradient(to bottom,transparent,#000 4%,#000 96%,transparent),linear-gradient(to right,transparent,#000 4%,#000 96%,transparent);mask-composite:intersect}
.stage h1{position:absolute;top:4.9%;left:50.2%;translate:-50% 0;margin:0;
  width:max-content;min-width:17cqw;max-width:51cqw;min-height:11.1cqw;padding:1.1cqw 2.35cqw;
  display:grid;place-items:center;font-size:clamp(.65rem,3.45cqw,1.85rem);line-height:1.15;font-weight:500;letter-spacing:.04em;text-wrap:balance;
  background:#f3d3ae;border:.3cqw solid #bc8b66;border-image:url(art/plaque.webp) 12 fill / 1.5cqw stretch;
  border-radius:.6cqw;box-shadow:0 .6cqw .7cqw #5a382631}
/* All actor crops come from one registered watercolor sheet. Each includes
   its own erased-underpainting region, so a turned head never reveals the idle face. */
#actor-poses{position:absolute;inset:0;isolation:isolate;pointer-events:none}
.actor-frame{position:absolute;left:19.25%;top:21.0666667%;width:62.25%;height:43.0666667%;opacity:0;mix-blend-mode:plus-lighter;transition:opacity var(--pose-fade) ease-in-out}
.actor-frame img{width:100%;height:100%;display:block}
.stage[data-pose=greet] .actor-frame[data-pose=greet],
.stage[data-pose=offer] .actor-frame[data-pose=offer],
.stage[data-pose=thanks] .actor-frame[data-pose=thanks],
.stage[data-pose=search] .actor-frame[data-pose=search],
.stage[data-pose=search-rear] .actor-frame[data-pose=search-rear],
.stage[data-pose=closed] .actor-frame[data-pose=closed]{opacity:1}
.tools{position:absolute;z-index:2;top:9px;right:var(--tools-edge);max-width:calc(100% - 2 * var(--tools-edge) - var(--debug-space) - 12px);display:flex;align-items:center;gap:clamp(14px,1.5vw,22px)}
.tools button,.tools summary,#debug{display:flex;align-items:center;justify-content:center;min-height:44px;padding:0;border:0;background:none;color:#775748;font-size:.82rem}
.tools #about-link{text-decoration:underline;text-underline-offset:.21em;line-height:1.2}
.tools #about-link{flex:none}
#promo{margin-top:1rem}
#promo-status:empty{display:none}
#promo-form button{margin-top:.65rem}
.tools #tools{flex:none;gap:5px;min-width:48px;padding-inline:3px;white-space:nowrap}
#language-code{font-weight:400}
.tools svg,#debug svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.5}
#debug{position:absolute;z-index:2;top:9px;left:var(--tools-edge);justify-content:flex-start;min-width:44px;gap:5px;font-size:.77rem}
.tools :is(button,summary):hover,#debug:hover,.action:hover{color:var(--rust)}
.step{align-self:start;width:min(600px,100%);padding:5px 4px;text-wrap:pretty}
#line,blockquote{font:400 clamp(1.12rem,2.4vw,1.56rem)/1.38 Georgia,serif;margin:6px 0;overflow-wrap:anywhere}
#edit-name-link{color:inherit;text-underline-offset:.16em;text-decoration-color:var(--rust)}
#edit-name-link:hover{color:var(--rust)}
.action{display:inline-flex;align-items:center;gap:.62em;min-height:46px;border:0;background:none;font-size:clamp(1.05rem,2.1vw,1.9rem);letter-spacing:.065em;padding:.1em .65em}
.action::before{content:"";width:.43em;height:.43em;background:#cf714e;transform:rotate(45deg)}
body:not([data-step=arrival]) .action{font-size:1.05rem}
/* Borrow the lower half of the stage for the slip. Long fortunes can grow
   past the artwork without moving it or colliding with the dialogue. */
.step:has(#fortune:not([hidden])){--slip-overlap:calc(var(--scene-width) * .48);width:min(100%,600px);margin-block-start:calc(-1 * var(--slip-overlap));position:relative;z-index:1}
#fortune{display:grid;justify-items:center;align-items:start;min-block-size:var(--slip-overlap)}
/* The fortune and every dialog come from the same roll of paper. */
.fortune-paper,.panel{
 --slip-edge:#c9a578;--slip-fill:#fff4db;
 border:1px solid var(--slip-edge);border-radius:4px 7px 3px 5px / 5px 3px 7px 4px;
 background:repeating-linear-gradient(176deg,#805b310b 0,transparent 1px 5px,transparent 8px),
   radial-gradient(ellipse at 48% 24%,#fffbef 18%,var(--slip-fill) 70%,#f5dab0);
 box-shadow:0 5px 9px #5a382628,inset 0 0 12px #ab713a24;
}
.fortune-paper{position:relative;isolation:isolate;width:fit-content;max-width:min(100%,var(--fortune-width,29rem));margin:0;
 padding:clamp(14px,3vw,23px) clamp(17px,4vw,32px) clamp(16px,3vw,25px);transform-origin:50% 23px;animation:unfold-slip 360ms cubic-bezier(.16,1,.3,1) both}
:is(.fortune-paper,.panel)::before,:is(.fortune-paper,.panel)::after{content:"";position:absolute;inset-block:4px;pointer-events:none;border-inline-start:1px solid #9d723937;border-radius:25%;transform:rotate(-.5deg)}
:is(.fortune-paper,.panel)::before{inset-inline-start:7px}
:is(.fortune-paper,.panel)::after{inset-inline-end:7px;transform:rotate(.5deg)}
.fortune-paper figcaption{font-size:.78rem;color:#745136;letter-spacing:.055em;margin:0 0 .45em}
.fortune-paper blockquote{margin:0;text-wrap:pretty;white-space:pre-line}
/* Announce dialogue and fortunes without framing them like controls. */
#line:focus,#fortune-line:focus{outline:none}
#daily-limit{font-size:.92rem;margin:4px 0 0}
#maker-invite{font-size:.92rem;margin:4px 0 0}
#maker-invite a{color:var(--ink);text-underline-offset:.2em}
#maker-invite a:hover{color:var(--rust)}
@keyframes unfold-slip{from{transform:translateY(8px) scale(.22,.15);opacity:0}25%{opacity:1}to{transform:none;opacity:1}}
/* Anchor the sprite to the saucer in the registered offer pose. The hit area
   stays put when the art rocks and remains 44px even on very narrow screens. */
#crack{--cookie-width:10.5cqw;position:absolute;z-index:1;inset:53.8% auto auto 49.4%;translate:-50% -100%;width:max(44px,var(--cookie-width));height:max(44px,8cqw);border:0;padding:0;background:transparent;border-radius:5px}
.cookie-whole,.cookie-shell{position:absolute;bottom:0;left:50%;translate:-50% 0;display:block;filter:drop-shadow(0 1px 1px #71452646);pointer-events:none}
.cookie-whole{width:var(--cookie-width);transform-origin:center 94%;animation:rock 3s ease-in-out infinite}
.cookie-shell{display:none;z-index:1;bottom:46.2%;left:49.4%;width:13.6cqw;aspect-ratio:512/255}
.cookie-piece{position:absolute;inset:0;width:100%;height:auto}
.piece-left{clip-path:inset(0 58% 0 0)}
.piece-right{clip-path:inset(0 0 0 58%)}
.piece-center{clip-path:inset(0 42%)}
#crack:is(:disabled,:hover,:focus-visible) .cookie-whole{animation:none}
body[data-step=offer] .shell{cursor:pointer}
body[data-step=result] .cookie-shell{display:block;animation:shell-away 450ms both}
@keyframes shell-away{0%,70%{opacity:1}100%{opacity:0;visibility:hidden}}
body[data-step=result] .piece-left{--nudge:15%;--twist:10deg;animation:break-apart 340ms cubic-bezier(.16,1,.3,1) both}
body[data-step=result] .piece-right{--nudge:-15%;--twist:-10deg;animation:break-apart 340ms cubic-bezier(.16,1,.3,1) both}
body[data-step=result] .piece-center{animation:sliver 220ms 105ms ease-out both}
@keyframes rock{0%,48%,100%{transform:rotate(0)}16%{transform:rotate(-4deg)}32%{transform:rotate(3deg)}}
@keyframes break-apart{0%{transform:translateX(var(--nudge)) rotate(var(--twist));opacity:1}to{transform:none;opacity:1}}
@keyframes sliver{from{opacity:0}to{opacity:1}}
.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
body:has(dialog[open]){overflow:hidden}
/* Native modal dialogs block background interaction without hiding the scene. */
dialog::backdrop{background:transparent}
.panel{position:fixed;inset:0;width:min(calc(100% - 24px),26rem);max-height:calc(100dvh - 24px);
 margin:auto;padding:clamp(20px,4vw,30px);color:var(--ink);overflow:auto;overscroll-behavior:contain;overflow-wrap:anywhere;line-height:1.45}
.panel h2{margin:0 0 .65rem;font:400 clamp(1.35rem,4vw,1.55rem)/1.2 Georgia,serif;text-wrap:balance}
.panel p{margin:.45rem 0;font-size:1rem}
.panel #about-stall{border:0;margin:1.25rem 0 0;padding:0}
.panel #about-stall p+p{font-size:.94rem;color:#735340}
.contact-link,.panel .quiet,.panel [data-dismiss],.panel #settings,.panel #exit-demo,.panel #reset-cookie{
 display:inline-flex;align-items:center;min-height:44px;padding:0 .15rem;border:0;background:none;color:var(--ink);text-underline-offset:.22em;text-decoration:underline;text-decoration-thickness:1px}
.panel :is(.quiet,[data-dismiss],#settings,#exit-demo,#reset-cookie,.contact-link):hover{color:var(--rust)}
/* Text links signal keyboard focus with an underline, not a box. */
#maker-title:focus{outline:none}
a[href]:focus:not(:focus-visible){outline:none}
:is(a[href],.panel .quiet,.panel [data-dismiss],.panel #essential-why):focus-visible{
 outline:none;text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:.22em
}
.contact-link{font-size:1rem}
.panel label{display:flex;align-items:baseline;flex-wrap:wrap;gap:.4rem;margin:.85rem 0 .3rem;font-size:1rem}
.panel label [data-copy=optional]{color:#755640;font-size:.86rem}
.panel :is(input:not([type=checkbox]),select){display:block;background:#fffbf2;border:1px solid #997554;padding:.55rem .65rem;border-radius:3px;width:100%;min-width:0;min-height:44px;font-size:1rem}
.panel button{color:inherit;border:1px solid var(--slip-edge);border-radius:3px;background:transparent;padding:.4rem .85rem;min-height:44px;font-size:1rem;line-height:1.35;max-width:100%;overflow-wrap:anywhere}
.panel input[type=text]{border-color:#cfbdab}
.panel input[type=text]:focus{outline:0;box-shadow:none}
.panel select:focus{outline:0;border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}
.cookie-choice{display:flex;align-items:center;flex-wrap:wrap;gap:0 .7rem;margin-block-start:.65rem}
.panel .cookie-choice input{flex:none;width:24px;height:24px;margin:0;accent-color:var(--rust);cursor:pointer}
@media not (forced-colors:active){
 .panel .cookie-choice input{appearance:none;display:grid;place-items:center;border:1px solid #997554;border-radius:3px;background:transparent}
 .panel .cookie-choice input:checked::after{content:"";width:6px;height:12px;border:solid var(--ink);border-width:0 2px 2px 0;transform:translateY(-1px) rotate(45deg)}
}
@media (forced-colors:active){
 .panel :is(input:not([type=checkbox]),select):focus{outline:2px solid Highlight}
}
.panel #essential-label{flex:1 1 11rem;min-height:44px;align-items:center;flex-wrap:nowrap;gap:.6rem;margin:0;padding:.2rem 0;cursor:pointer}
.panel #essential-why{border:0;background:none;min-width:44px;min-height:44px;padding:.15rem;text-decoration:underline;text-underline-offset:.22em;font-size:.95rem}
.panel #essential-help{margin:.15rem 0 .55rem;font-size:.94rem;color:#735340}
.dialog-actions{display:flex;align-items:center;flex-wrap:wrap;gap:6px 16px;justify-content:flex-end;margin-top:.85rem}
.panel .primary,.panel #simulate,.panel #reset-yes,.panel #promo-form button{color:#fffaf0;background:#68432f;border-color:#68432f}
.panel .primary:hover,.panel #simulate:hover,.panel #reset-yes:hover,.panel #promo-form button:hover{background:#563520}
.panel hr{border:0;border-top:1px solid #cfb79b;margin:.95rem 0 .45rem}
.panel [role=status],#promo-status{color:#853a22}
.status:empty,#debug-error:empty{display:none}
@media(max-width:540px){
 main{--scene-width:min(100cqw,76svh)}
 .shell{--tools-edge:9px;--debug-space:44px;padding-top:58px}
 .tools{gap:12px}
 .tools :is(button,summary){font-size:.9rem}
 #debug span{display:none}
 .stage h1{max-width:66cqw;font-size:clamp(.875rem,4.25cqw,1.3rem)}
 #line,blockquote{font-size:1.25rem}
 .fortune-paper figcaption{font-size:.875rem}
 body:not([data-step=arrival]) .action{font-size:1.125rem}
 #daily-limit,#maker-invite,.panel p,.panel label,.panel button{font-size:1rem}
}
@media(max-width:280px){.shell{padding-top:85px}}
@media(prefers-reduced-motion:reduce){
  .stage{--pose-fade:95ms}
  .fortune-paper{animation:none}
  body[data-step] #crack :is(.cookie-whole,.cookie-piece){animation:none}
  body[data-step=result] .cookie-shell{display:none}
}

#language-picker{position:relative;flex:none}
#language-picker summary{list-style:none;cursor:pointer;touch-action:manipulation}
#language-picker summary::-webkit-details-marker{display:none}
#language-menu{position:absolute;inset:calc(100% + 2px) 0 auto auto;display:block;width:max-content;min-width:min(13.5rem,100vw - 48px);max-width:calc(100vw - 48px);max-height:calc(100dvh - 72px);overflow:auto;overscroll-behavior:contain;padding:.3rem .65rem;background:#fff8ea;border:1px solid #d5bea5;border-radius:5px;box-shadow:0 5px 14px #583b2318}
#language-picker:not([open]) #language-menu{display:none}
#language-menu button{width:100%;justify-content:flex-start;gap:.65rem;text-align:start;line-height:1.25;font-size:1rem;padding:.25rem .4rem}
#language-menu img{flex:none;display:block;object-fit:contain;border-radius:2px}
#language-menu [aria-checked=true]::after{content:"";width:.3em;height:.65em;border:solid var(--rust);border-width:0 1.5px 1.5px 0;transform:rotate(45deg);margin-inline:auto .15em}
#language-menu button:focus-visible{outline-offset:-2px}
#language-menu #settings{border-top:1px solid #dfcdb7;margin-top:.2rem;font-size:.9rem}

body[data-production] #debug{display:none}
