:root{--ink:#3b2a14;--gold:#e9cf8f;--edge:#a8894a;--paper:#fdf3d0;--ease:cubic-bezier(.16,1,.3,1)}
::selection{background:var(--gold);color:var(--ink)}
html,body{margin:0;height:100%;overflow:hidden;background:#3d3a14;color:var(--paper)}
canvas{display:block;image-rendering:pixelated;touch-action:none;cursor:pointer}
.hint{position:fixed;left:50%;bottom:28px;translate:-50% 0;box-sizing:border-box;width:max-content;max-width:calc(100% - 32px);margin:0;padding:10px 14px;font:400 14px/1.5 Silkscreen,monospace;color:var(--paper);text-align:center;background:var(--ink);border:3px solid var(--gold);box-shadow:0 0 0 3px var(--ink);pointer-events:none}
/* the title card: the name types itself in, the welcome follows; both go at the first step */
/* it fills the top half and sits at its foot, just over big Florian's head (who stands in the middle) */
.title{position:fixed;inset:0 16px 50%;display:flex;flex-direction:column;justify-content:safe flex-end;align-items:center;padding:16px 0 96px;text-align:center;pointer-events:none;transition:opacity .8s steps(4),translate .8s var(--ease)}
.title.gone{opacity:0;translate:0 -20px}
.title h1{margin:0 0 26px;font:400 clamp(26px,6.6vw,56px)/1 Silkscreen,monospace;white-space:nowrap;letter-spacing:.02em;color:var(--paper);text-shadow:3px 0 var(--ink),-3px 0 var(--ink),0 3px var(--ink),0 -3px var(--ink),3px 3px var(--ink),-3px 3px var(--ink),3px -3px var(--ink),-3px -3px var(--ink),3px 7px var(--ink),0 7px var(--ink),-3px 7px var(--ink);animation:type .9s steps(14) .4s both}
.title p{box-sizing:border-box;margin:0;padding:14px 20px 15px;max-width:min(40ch,100%);font:400 clamp(16px,2.4vw,19px)/1.5 'Pixelify Sans',monospace;color:var(--paper);background:var(--ink);border:3px solid var(--gold);box-shadow:0 0 0 3px var(--ink),0 16px 30px -8px rgba(28,16,2,.6);text-wrap:balance;animation:rise .7s var(--ease) 1.4s both}
@keyframes type{from{clip-path:inset(-12px 100% -12px -12px)}to{clip-path:inset(-12px -12px -12px -12px)}}
@keyframes rise{from{opacity:0;translate:0 10px}}
/* how to walk: the arrow keys as keycaps that press down with yours; they make room for the Talk button */
.keys{position:fixed;left:50%;bottom:calc(30px + env(safe-area-inset-bottom));translate:-50% 0;display:grid;grid-template-columns:repeat(3,38px);gap:16px 9px;pointer-events:none;transition:opacity 1.2s}
.keys.gone,.prompt.show~.keys{opacity:0;transition-duration:.3s}
.keys kbd{display:grid;place-items:center;height:32px;background:var(--gold);box-shadow:0 0 0 3px var(--ink),0 7px 0 var(--edge),0 7px 0 3px var(--ink);transition:translate .05s,box-shadow .05s}
.keys kbd.down{translate:0 5px;box-shadow:0 0 0 3px var(--ink),0 2px 0 var(--edge),0 2px 0 3px var(--ink)}
.keys [data-dir=up]{grid-column:2}
.keys [data-dir=up]~kbd{grid-row:2}
/* a pixel arrow, 7 x 7 cells of 2px, pointing up; turned for the other three */
.keys kbd::before{content:'';width:14px;height:14px;background:var(--ink);clip-path:polygon(6px 0,8px 0,8px 2px,10px 2px,10px 4px,12px 4px,12px 6px,14px 6px,14px 8px,10px 8px,10px 14px,4px 14px,4px 8px,0 8px,0 6px,2px 6px,2px 4px,4px 4px,4px 2px,6px 2px)}
.keys [data-dir=right]::before{rotate:90deg}
.keys [data-dir=down]::before{rotate:180deg}
.keys [data-dir=left]::before{rotate:-90deg}
@media (hover:none){.keys{display:none}}
/* "Talk": the E key, in the place of the arrow keys, while you stand next to someone; touch screens have no E and get the word */
.prompt{position:fixed;left:50%;bottom:calc(40px + env(safe-area-inset-bottom));translate:-50% 10px;display:grid;place-items:center;min-width:38px;height:32px;margin:0;padding:0 10px;box-sizing:border-box;font:400 16px/1 Silkscreen,monospace;color:var(--ink);background:var(--gold);border:0;box-shadow:0 0 0 3px var(--ink),0 7px 0 var(--edge),0 7px 0 3px var(--ink);cursor:pointer;opacity:0;visibility:hidden;transition:opacity .2s,translate .3s var(--ease),visibility 0s .3s}
.prompt.show{opacity:1;visibility:visible;translate:-50% 0;transition-delay:0s}
.prompt:active{translate:-50% 5px;box-shadow:0 0 0 3px var(--ink),0 2px 0 var(--edge),0 2px 0 3px var(--ink)}
.prompt kbd{font:inherit}
.prompt span{display:none}
.close kbd{display:grid;place-items:center;min-width:22px;height:22px;padding:0 4px;box-sizing:border-box;font:inherit;color:var(--ink);background:var(--gold);box-shadow:0 3px 0 var(--edge)}
@media (hover:none){.prompt kbd,.close kbd{display:none}.prompt span{display:inline}.prompt{height:44px;padding:0 16px}.close{padding:9px 12px}}
/* the panel: what someone is busy with, over the village; the topic on a plate over its top edge, the way out on the right */
.panel{box-sizing:border-box;width:min(640px,calc(100% - 32px));max-width:none;max-height:none;margin:auto;padding:0;overflow:visible;color:var(--paper);background:var(--ink);border:3px solid var(--gold);box-shadow:0 0 0 3px var(--ink),0 16px 30px -8px rgba(28,16,2,.6);opacity:0;translate:0 18px;transition:opacity .18s,translate .38s var(--ease),overlay .38s allow-discrete,display .38s allow-discrete}
.panel[open]{opacity:1;translate:0 0}
@starting-style{.panel[open]{opacity:0;translate:0 18px}}
.panel::backdrop{background:rgba(28,16,2,.4)}
.panel article{box-sizing:border-box;max-height:min(72vh,680px);overflow-y:auto;padding:34px 26px 24px;scrollbar-color:var(--gold) var(--ink)}
.panel h2{position:absolute;top:-17px;left:18px;max-width:calc(100% - 150px);margin:0;padding:6px 10px 5px;font:400 14px/1 Silkscreen,monospace;color:var(--ink);background:var(--gold);box-shadow:0 0 0 3px var(--ink)}
.panel p{margin:0 0 .8em;max-width:62ch;font:400 19px/1.5 'Pixelify Sans',monospace;text-wrap:pretty}
.panel p:last-child{margin-bottom:0}
.close{position:absolute;top:-19px;right:18px;display:flex;align-items:center;gap:8px;margin:0;padding:4px 5px 4px 10px;font:400 14px/1 Silkscreen,monospace;color:var(--paper);background:var(--ink);border:3px solid var(--gold);cursor:pointer}
.close:hover{color:var(--gold)}
.close:focus-visible,.prompt:focus-visible{outline:3px solid var(--paper);outline-offset:3px}
@media (max-width:600px){.panel article{padding:32px 18px 22px}.panel p{font-size:17px}}
@media (prefers-reduced-motion:reduce){.prompt{translate:-50% 0;transition:opacity .2s,visibility 0s .2s}.prompt.show{transition-delay:0s}.panel,.panel[open]{translate:0 0}.title.gone{translate:0 0}.title h1,.title p{animation:none}.keys kbd{transition:none}}
