/* It's Denys: the hall of doors. Styles, version 2. (as of Nov 23 2026)
   Inside #world, 1em = 10 design px. The engine sets the font-size of #world, so every wall part is sized in em.
   Rule for anything positioned on a wall: keep its own font-size at 1em and put text sizes on an inner span. */

:root {
  --hud-h: 96px; --hz: 57%;
  --plaster: #EAD2A6; --plaster-shade: #D9BC8A; --oak: #9C6B3A; --oak-dark: #5E3D1F; --walnut: #3B2616;
  --floor: #A8763F; --ceiling: #F1E0BC; --fog: #F6DCA6; --glow: #FFE2A0; --accent: #E8A83A;
  --ink: #2A1A0E; --paper: #FFF6E0; --hud: #3B2616; --hud-ink: #F6E7C8;
  --display: "Cooper Black", "Bookman Old Style", Georgia, "Times New Roman", serif;
  --chunky: "Bahnschrift", "Arial Black", "Segoe UI", system-ui, sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--walnut); color: var(--ink); font-family: var(--body); overflow: hidden; }
body.plain { overflow: auto; background: var(--paper); }
button { font: inherit; color: inherit; }

.skip { position: fixed; left: 12px; top: -60px; z-index: 50; background: var(--paper); color: var(--ink); padding: 10px 14px; border: 2px solid var(--ink); border-radius: 6px; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid #1d6fd6; outline-offset: 2px; }
#world:focus { outline: none; }
#world :focus-visible { outline: .4em solid #2A1A0E; outline-offset: .25em; box-shadow: 0 0 0 .25em #FFF6E0; }   /* a two-tone ring: it shows on plaster, oak, the purple door and the bookcases */
.brick:focus-visible { border: .3em solid #2A1A0E; background: rgba(255,246,224,.7); }

/* ------------------------------------------------------------------ the 3D stage */
#stage { position: fixed; left: 0; top: 0; right: 0; bottom: var(--hud-h); overflow: hidden; overflow: clip; perspective: 700px; perspective-origin: 50% var(--hz);
  background: linear-gradient(var(--ceiling) 0%, var(--fog) 52%, var(--fog) 61%, var(--floor) 100%);
  touch-action: none; user-select: none; -webkit-user-select: none; }
body.plain #stage, body.plain #hud { display: none; }
#world { position: absolute; left: 50%; top: var(--hz); width: 0; height: 0; transform-style: preserve-3d; font-size: 15px; }
.plane { position: absolute; left: 0; top: 0; transform-origin: 0 0; backface-visibility: hidden; background-color: var(--plaster); background-repeat: repeat; image-rendering: pixelated; }
.plane.flip { backface-visibility: visible; }
.plane .inner { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform: scaleX(-1); }
.plane .lit { position: absolute; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; }
.plane.left, .plane.right { cursor: pointer; }
/* the wall picture is 320 x 520 units (wainscot, chair rail, plaster, moulding): it sits at the foot of the wall, and its moulding becomes the picture rail */
.plane.left, .plane.right, .plane.back { background-size: 32em 52em; background-repeat: repeat-x; background-position: 0 100%; }
.plane.end { transform-style: preserve-3d; }
.upper { position: absolute; left: 0; top: 0; width: 100%; height: 24em; background-size: 32em 52em; background-repeat: repeat-x; background-position: 0 0; image-rendering: pixelated; pointer-events: none; }
.upper.crown { height: 2em; }
.art { position: absolute; left: 0; width: 100%; height: 52em; }
.plane.floor { background-color: var(--floor); background-size: 32em 32em; }
.plane.ceil { background-color: var(--ceiling); background-size: 32em 32em; }
.plane.left .lit { background: linear-gradient(90deg, rgba(58,30,8,.34) 0%, rgba(58,30,8,.10) 26%, rgba(255,226,160,0) 55%, rgba(255,226,160,.18) 100%); }
.plane.right .lit { background: linear-gradient(270deg, rgba(58,30,8,.34) 0%, rgba(58,30,8,.10) 26%, rgba(255,226,160,0) 55%, rgba(255,226,160,.18) 100%); }
.plane.floor .lit { background: linear-gradient(0deg, rgba(58,30,8,.38) 0%, rgba(58,30,8,.06) 30%, rgba(255,226,160,.14) 100%); }
.plane.ceil .lit { background: linear-gradient(0deg, rgba(58,30,8,.30) 0%, rgba(58,30,8,0) 30%, rgba(255,226,160,.12) 100%); }
.plane.end .lit { background: radial-gradient(ellipse at 50% 26%, rgba(255,236,190,.30), rgba(255,226,160,0) 64%); }
.plane.up { background: linear-gradient(var(--plaster-shade), var(--plaster)); }   /* plain plaster above the side walls in the tall phone hall */
.plane.back { background-color: var(--plaster-shade); }
.plane.back .lit { background: rgba(58,30,8,.42); }

.rug { position: absolute; left: 33em; top: 0; width: 24em; height: 100%; background-size: 24em 32em; background-repeat: repeat; image-rendering: pixelated; background-color: #B8573A; box-shadow: 0 0 0 .5em rgba(42,26,14,.18); }
.pool { position: absolute; left: 20em; width: 50em; height: 44em; background: radial-gradient(ellipse at center, rgba(255,232,170,.36), rgba(255,232,170,0) 68%); pointer-events: none; }
.sky { position: absolute; left: 30em; width: 30em; height: 18em; border: 1em solid var(--oak-dark); background: linear-gradient(#8fc6e8, #d7efff); image-rendering: pixelated; background-size: cover; box-shadow: 0 0 6em 2em rgba(255,236,190,.55); }

/* signs that stick out into the hall and face the walker */
.sign { background: var(--walnut); border: .5em solid var(--oak-dark); color: var(--paper); font-family: var(--chunky); font-weight: 700; font-size: 1.9em; letter-spacing: .06em; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 .4em 0 rgba(0,0,0,.25); text-transform: uppercase; }
.sign small { color: var(--accent); font-size: .9em; margin: 0 .3em; }
.sign:hover, .sign:focus-visible { background: var(--oak-dark); color: #fff; }

/* ------------------------------------------------------------------ left wall: my story */
.rail { position: absolute; top: 16.9em; height: .6em; background: var(--oak-dark); box-shadow: 0 .2em 0 rgba(0,0,0,.22); pointer-events: none; }
.stem { position: absolute; width: .3em; background: var(--oak-dark); pointer-events: none; }
.knob { position: absolute; width: 1.4em; height: 1.4em; margin-left: -.7em; top: 16.5em; background: var(--accent); border: .3em solid var(--oak-dark); border-radius: 50%; pointer-events: none; }
.frame { position: absolute; width: 16.8em; height: 10.4em; border: .9em solid #C9973A; background: var(--paper); cursor: pointer;
  display: flex; align-items: center; gap: .5em; padding: .3em .5em; text-align: left;
  box-shadow: inset 0 0 0 .25em #7a5412, inset 0 0 0 .5em #F3D27A, 0 .5em 0 rgba(42,26,14,.28); transition: transform .15s ease, box-shadow .15s ease; }
.frame canvas { width: 6.2em; height: 6.2em; flex: none; image-rendering: pixelated; pointer-events: none; }
.frame .ft { flex: 1; min-width: 0; display: block; pointer-events: none; line-height: 1.05; }
.frame .fn { display: inline-block; font-family: var(--chunky); font-weight: 700; font-size: 1.55em; color: var(--oak-dark); margin-right: .25em; }
.frame .tag { display: inline-block; vertical-align: .3em; font-family: var(--chunky); font-size: .62em; font-weight: 700; background: var(--accent); color: var(--ink); padding: .1em .4em; border-radius: .3em; letter-spacing: .04em; }
.frame .ftit { display: block; font-family: var(--chunky); font-weight: 700; font-size: .95em; color: var(--ink); margin-top: .1em; }
.frame .fwhen { display: block; font-size: .78em; font-weight: 600; color: #6b4a1c; margin-top: .25em; }
.frame.living { border-color: var(--accent); box-shadow: inset 0 0 0 .25em #7a5412, inset 0 0 0 .5em #FFE9A8, 0 0 2.4em .5em rgba(255,214,120,.75), 0 .5em 0 rgba(42,26,14,.28); }
.frame .tag.on { background: var(--paper); box-shadow: 0 0 0 .12em #C9973A; }
.frame.ahead { background: transparent; border: .5em dashed rgba(94,61,31,.55); box-shadow: none; }
.frame.ahead canvas { opacity: .55; }
.frame.ahead .ftit { color: rgba(42,26,14,.72); }
.frame.ask .tag { background: var(--paper); box-shadow: 0 0 0 .12em var(--oak-dark); }
.frame:hover, .frame:focus-visible { transform: scale(1.06); z-index: 3; }
.brick { position: absolute; width: 5em; height: 3.2em; cursor: pointer; background: rgba(42,26,14,.10); border: .15em dashed rgba(42,26,14,.25); }
.brick:hover, .brick:focus-visible { background: rgba(232,168,58,.5); }

/* the map of the story: a framed sheet hanging at the door end of the wall */
.poster { position: absolute; padding: 0; cursor: zoom-in; background: #F3E2BC; border: .9em solid var(--oak-dark);
  box-shadow: inset 0 0 0 .22em #C9973A, 0 .7em 0 rgba(42,26,14,.3), 0 0 2em .2em rgba(255,226,160,.35); transition: transform .15s ease; }
.poster::before { content: ""; position: absolute; left: 50%; top: -2.9em; width: 1em; height: 1em; margin-left: -.5em; border-radius: 50%; background: #E9C46A; box-shadow: 0 0 0 .22em #6f4c12; }
.poster::after { content: ""; position: absolute; left: 50%; top: -2.2em; width: .2em; height: 1.4em; margin-left: -.1em; background: #6f4c12; }
.poster .sheet { position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.poster .sheet > div, .poster .sheet > svg { width: 100%; height: 100%; }
.poster .pfall { font-family: var(--display); font-size: 3em; line-height: 1.1; text-align: center; color: var(--oak-dark); }
.poster:hover, .poster:focus-visible { transform: scale(1.04); z-index: 3; }
.pcap { position: absolute; height: 2.3em; display: flex; align-items: center; justify-content: center; background: linear-gradient(#E9C46A, #B98524); border: .18em solid #6f4c12; border-radius: .25em; color: #2b1a05; font-family: var(--chunky); font-weight: 700; letter-spacing: .03em; pointer-events: none; }
.pcap span { font-size: .95em; }

/* ------------------------------------------------------------------ right wall: the bookshelf */
.bay { position: absolute; top: 10.4em; height: 38em; background-color: var(--walnut); image-rendering: pixelated; background-size: 100% 100%; box-shadow: 0 .6em 0 rgba(42,26,14,.3); cursor: pointer; }
.bay canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }
.topic { position: absolute; top: 8em; height: 2.2em; display: flex; align-items: center; justify-content: center; background: linear-gradient(#E9C46A, #B98524); border: .18em solid #6f4c12; border-radius: .25em; color: #2b1a05; font-family: var(--chunky); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; pointer-events: none; }
.quote { position: absolute; top: 4.3em; width: 62em; height: 3.3em; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 1em; background: var(--walnut); border: .35em solid var(--oak-dark); color: var(--paper); font-family: var(--display); line-height: 1.1; pointer-events: none; }
.quote span { font-size: 1.3em; }
.book { position: absolute; padding: 0; border: 0; cursor: pointer; background: var(--accent); color: #fff; overflow: hidden; box-shadow: inset .2em 0 0 rgba(255,255,255,.28), inset -.2em 0 0 rgba(0,0,0,.28), 0 0 0 .1em rgba(42,26,14,.6); transition: transform .12s ease; transform-origin: 50% 100%; }
.book span { position: absolute; left: 0; top: .8em; bottom: 1.3em; width: 100%; writing-mode: vertical-rl; text-orientation: mixed; font-family: var(--chunky); font-weight: 700; font-size: .78em; line-height: 1; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; padding-right: calc(50% - .5em); pointer-events: none; }
.book i { position: absolute; left: 0; right: 0; bottom: 0; height: 1.1em; font-style: normal; font-family: var(--chunky); font-weight: 700; font-size: .7em; text-align: center; line-height: 1.55; background: #FFF6E0; color: #2A1A0E; border-top: .15em solid rgba(42,26,14,.6); pointer-events: none; }
.book.read::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: .5em; background: #FFE08A; }
.book.reading::before { content: ""; position: absolute; left: 30%; width: 40%; top: -.2em; height: 2.2em; background: #D4472F; }
.book.next { opacity: .78; box-shadow: inset 0 0 0 .18em rgba(255,255,255,.75), 0 0 0 .1em rgba(42,26,14,.6); }
body.still .props-sway { animation-play-state: paused !important; }
.book.wrote::before { content: "\2605"; position: absolute; left: 0; right: 0; top: 0; font-size: .8em; text-align: center; color: #FFE08A; }
.book:hover, .book:focus-visible { transform: translateY(-.9em) scale(1.08); z-index: 4; }

/* ------------------------------------------------------------------ end wall: the doors, in even rows of three */
.basebd { position: absolute; left: 0; bottom: 0; width: 100%; height: 2.4em; background: var(--oak-dark); border-top: .5em solid var(--oak); pointer-events: none; }
.cab { position: absolute; left: .9em; top: 6.9em; width: 88.2em; height: 64.2em; background-color: var(--oak); background-size: 32em 32em; image-rendering: pixelated; border: .5em solid var(--oak-dark); box-shadow: inset 0 0 0 .3em rgba(255,226,160,.18), 0 .5em 0 rgba(42,26,14,.25); pointer-events: none; }
.marquee { position: absolute; left: 22em; top: .5em; width: 46em; height: 6em; padding: 0 1em; background: var(--walnut); border: .4em solid var(--oak-dark); color: var(--accent); font-family: var(--display); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; transform: translateZ(.3em); box-shadow: 0 .4em 0 rgba(0,0,0,.25); pointer-events: none; }
.marquee b { font-size: 2.7em; line-height: 1; letter-spacing: .05em; font-weight: 400; text-shadow: .08em .08em 0 #2A1A0E; }
.marquee i { font-size: 1.5em; line-height: 1.15; font-style: normal; font-family: var(--chunky); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--paper); margin-top: .1em; }
.door { position: absolute; padding: 0; cursor: pointer; transform-style: preserve-3d; transform: translateZ(.4em); outline-offset: .4em; }
.door .in { position: absolute; left: 0; top: 0; right: 0; bottom: 0; border: .5em solid var(--walnut); background: radial-gradient(ellipse at 50% 60%, #fff 0%, var(--c) 46%, #1a0f06 135%); display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; font-family: var(--chunky); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 0 1.2em; text-shadow: 0 .1em .3em rgba(0,0,0,.7); }
.door .in span { font-size: 1.9em; }
.door .leaf { position: absolute; left: 0; top: 0; right: 0; bottom: 0; border: .5em solid var(--walnut); background-color: var(--c); image-rendering: pixelated; transform-origin: 0 50%; transform: translateZ(.2em) rotateY(0deg); transition: transform .28s cubic-bezier(.3,.8,.3,1); overflow: hidden; box-shadow: 0 .4em 0 rgba(26,15,6,.35); }
.door .leaf canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.door .leaf .name { position: absolute; left: 0; right: 0; bottom: 0; padding: .14em .3em .18em; background: var(--c); color: var(--k); border-top: .14em solid rgba(26,15,6,.55); font-family: var(--chunky); font-weight: 700; font-size: 1.55em; letter-spacing: .04em; text-transform: uppercase; text-align: center; line-height: 1.1; white-space: nowrap; }
.door .leaf .name.long { font-size: 1.28em; padding: .25em .2em .3em; }
.door .knobb { position: absolute; right: .7em; top: 34%; width: 1.3em; height: 1.3em; border-radius: 50%; background: #F2C94C; box-shadow: inset -.2em -.2em 0 #9a7412, 0 .15em 0 rgba(0,0,0,.4); }
.door:hover .leaf, .door:focus-visible .leaf { transform: translateZ(.2em) rotateY(-36deg); }
.door.open .leaf { transform: translateZ(.2em) rotateY(-102deg); transition-duration: .5s; }
.door.locked .leaf canvas { filter: saturate(.5) brightness(.8); }
.door.locked .leaf .name { background: #4a3320; color: #F6E7C8; }
.door.locked:hover .leaf, .door.locked:focus-visible .leaf { transform: translateZ(.2em) rotateY(-6deg); }
.door.next .leaf canvas { filter: none; }
.door .lock { position: absolute; left: 1em; top: 1.5em; width: 1.6em; height: 1.4em; background: #F2C94C; border-radius: .25em; box-shadow: inset -.2em -.2em 0 #9a7412, 0 .15em 0 rgba(0,0,0,.4); }
.door .lock::before { content: ""; position: absolute; left: .3em; top: -.8em; width: 1em; height: 1em; border: .28em solid #F2C94C; border-bottom: 0; border-radius: .6em .6em 0 0; }
.dcap { position: absolute; text-align: center; font-family: var(--body); font-weight: 700; color: var(--paper); line-height: 1.1; white-space: nowrap; transform: translateZ(.3em); pointer-events: none; text-shadow: 0 .08em 0 rgba(26,15,6,.6); }
.dcap span { font-size: 1.22em; }
.dcap span, .rowlab span { display: inline-block; background: rgba(42,26,14,.82); padding: .08em .45em .12em; border-radius: .25em; }   /* a dark plate keeps the words readable on oak in every look */
.rowlab { position: absolute; left: 0; width: 100%; text-align: center; font-family: var(--chunky); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #FFE9A8; transform: translateZ(.3em); pointer-events: none; text-shadow: 0 .08em 0 rgba(26,15,6,.6); }
.rowlab span { font-size: 1.05em; }
.motto { position: absolute; left: 19em; top: 71.6em; width: 52em; height: 3.5em; display: flex; align-items: center; justify-content: center; background: var(--walnut); border: .35em solid var(--oak-dark); color: var(--accent); font-family: var(--display); transform: translateZ(.3em); pointer-events: none; }
.motto span { font-size: 2em; letter-spacing: .06em; }

/* sprites that always face the walker */
.bb { position: absolute; left: 0; top: 0; transform-origin: 50% 100%; image-rendering: pixelated; }
.bb.mine canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.bb.dancer { cursor: help; }
.bb.bee { cursor: pointer; }

body.view-left .sign, body.view-right .sign, body.view-left .bb.mine, body.view-right .bb.mine { visibility: hidden; }
/* floor dressing is out of sight when a wall is faced; hiding it also keeps machines without graphics acceleration from drawing it wrong */
body.view-left .plane[class*="props-"], body.view-right .plane[class*="props-"] { visibility: hidden; }
#vignette { position: absolute; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 46%, rgba(0,0,0,0) 58%, rgba(40,20,6,.30) 100%); }
#hand { position: absolute; left: 50%; bottom: -34px; width: 240px; height: 200px; margin-left: 10px; image-rendering: pixelated; pointer-events: none; }
body.view-left #hand, body.view-right #hand, body.card-open #hand, body.map-open #hand { opacity: 0; transition: opacity .2s; }

/* ------------------------------------------------------------------ flat interface on top of the hall */
#views { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); display: flex; gap: 6px; z-index: 6; }
#views button, .hud-btns button { border: 2px solid var(--ink); background: var(--paper); color: var(--ink); padding: 8px 14px; min-height: 44px; border-radius: 6px; font-family: var(--chunky); font-weight: 700; font-size: 14px; letter-spacing: .04em; cursor: pointer; box-shadow: 0 3px 0 rgba(42,26,14,.55); text-transform: uppercase; white-space: nowrap; }
#views button[aria-pressed="true"] { background: var(--accent); }
#views button:hover, .hud-btns button:hover { background: #FFE9A8; }
#brand { position: absolute; left: 14px; top: 11px; font-family: var(--display); font-size: 22px; line-height: 1; color: var(--paper); text-shadow: 2px 2px 0 var(--ink), -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink); z-index: 6; letter-spacing: .04em; pointer-events: none; }
#brand small { display: block; margin-top: 6px; font-family: var(--chunky); font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; text-shadow: 1px 1px 0 var(--ink), -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink); }
#hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); max-width: min(92vw, 760px); background: rgba(42,26,14,.86); color: var(--paper); padding: 8px 14px; border-radius: 8px; font-size: 16px; line-height: 1.35; text-align: center; z-index: 6; transition: opacity .5s; pointer-events: none; }
#hint.gone { opacity: 0; }
#tip { position: fixed; z-index: 20; max-width: 340px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; padding: 8px 11px; font-size: 15px; line-height: 1.35; pointer-events: none; box-shadow: 0 4px 0 rgba(42,26,14,.5); }
#tip b { display: block; font-family: var(--chunky); font-size: 15px; letter-spacing: .03em; text-transform: uppercase; margin-bottom: 2px; }
#tip em { font-style: normal; color: #6b4a1c; display: block; margin-top: 3px; font-size: 13.5px; }

/* ------------------------------------------------------------------ the status bar */
#hud { position: fixed; left: 0; right: 0; bottom: 0; height: var(--hud-h); background-color: var(--hud); background-size: auto 100%; image-rendering: pixelated; border-top: 4px solid #1b1008; display: flex; align-items: stretch; justify-content: center; color: var(--hud-ink); z-index: 8; box-shadow: inset 0 3px 0 rgba(255,220,150,.22); }
.hud-cell { width: 168px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-left: 3px solid rgba(0,0,0,.45); border-right: 3px solid rgba(255,220,150,.10); padding: 0 6px; }
.hud-cell .lab { font-family: var(--chunky); font-weight: 700; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #E9D3A6; }
.hud-cell .val { font-family: var(--chunky); font-weight: 700; font-size: 40px; line-height: 1; color: var(--accent); text-shadow: 3px 3px 0 #1b1008; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hud-face { width: 104px; display: flex; align-items: center; justify-content: center; background: #1b1008; border-left: 3px solid #000; border-right: 3px solid #000; }
.hud-face canvas { width: 78px; height: 78px; image-rendering: pixelated; background: #5E3D1F; border: 3px solid var(--accent); }
.hud-btns { flex: none; display: grid; grid-template-columns: auto auto auto; gap: 4px 6px; align-content: center; padding: 0 12px; border-left: 3px solid rgba(0,0,0,.45); }
.hud-btns button { padding: 3px 10px; min-height: 44px; font-size: 13px; box-shadow: 0 2px 0 rgba(0,0,0,.6); max-width: 168px; overflow: hidden; text-overflow: ellipsis; }
.hud-btns button[hidden] { display: none; }
.hud-btns button.on { background: var(--accent); }

/* ------------------------------------------------------------------ the title screen */
#title { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(ellipse at 50% 45%, rgba(42,26,14,.30), rgba(42,26,14,.80)); }
#title[hidden] { display: none; }
.tcard { width: min(92vw, 580px); background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 14px; box-shadow: 0 10px 0 rgba(20,10,4,.6); padding: 30px 24px 20px; text-align: center; }
.tcard h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(40px, 10vw, 76px); line-height: 1; letter-spacing: .03em; color: var(--accent); text-shadow: 3px 3px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink); }
.tcard .tline { margin: 14px 0 24px; font-family: var(--chunky); font-weight: 700; font-size: 18px; letter-spacing: .16em; text-transform: uppercase; color: #5c4526; }
.trow { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.tbtn { min-height: 54px; padding: 10px 22px; border: 3px solid var(--ink); border-radius: 10px; background: var(--paper); color: var(--ink); font-family: var(--chunky); font-weight: 700; font-size: 18px; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; box-shadow: 0 4px 0 rgba(42,26,14,.6); }
.tbtn.main { background: var(--accent); }
.tbtn:hover { background: #FFE9A8; }
.tsmall { margin: 18px 0 0; }
.tlink { border: 0; background: none; min-height: 44px; padding: 8px; color: #7a4a00; text-decoration: underline; cursor: pointer; font-size: 16px; }
body.plain #title { display: none; }

/* ------------------------------------------------------------------ the card (chapter, book, room) */
#shade { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(30,16,6,.58); z-index: 30; }
#card { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 640px); max-height: min(88vh, 720px); overflow: auto; background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 12px; padding: 24px 26px 22px; z-index: 31; box-shadow: 0 10px 0 rgba(20,10,4,.6); font-size: 17px; line-height: 1.55; }
#card[hidden], #shade[hidden], #plain[hidden], #tip[hidden] { display: none; }
#card.room { border-color: var(--c, var(--ink)); border-width: 6px; }
#card-x { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; border: 2px solid var(--ink); background: var(--paper); border-radius: 8px; font-size: 18px; cursor: pointer; }
#card h2 { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.12; margin: 0 52px 6px 0; }
#card .kicker { font-family: var(--chunky); font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: #6b4a1c; margin: 0 52px 4px 0; }
#card .lead { font-size: 19px; margin: 6px 0 12px; }
#card .pic { float: right; width: 128px; height: 128px; margin: 0 0 10px 16px; image-rendering: pixelated; border: 4px solid #C9973A; background: #fff; }
#card .scene { width: min(100%, 51vh); height: auto; aspect-ratio: 3 / 2; image-rendering: pixelated; border: 4px solid var(--ink); margin: 6px auto 12px; display: block; background: var(--c, #ddd); }
#card h3 { font-family: var(--chunky); font-size: 14px; letter-spacing: .12em; text-transform: uppercase; margin: 16px 0 4px; color: #6b4a1c; }
#card ul { margin: 0 0 8px; padding-left: 20px; }
#card .note { background: #FFE9A8; border-left: 6px solid var(--accent); padding: 10px 12px; margin: 10px 0; border-radius: 4px; font-family: "Ink Free", "Segoe Print", var(--body); font-size: 18px; line-height: 1.35; }
#card .pill { display: inline-block; font-family: var(--chunky); font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding: 3px 9px; border-radius: 20px; border: 2px solid var(--ink); margin: 0 6px 6px 0; background: #fff; }
#card .pill.DOCUMENTED { background: #cfe9c8; } #card .pill.CLAIMED { background: #ffd9b0; } #card .pill.read { background: #FFE08A; } #card .pill.reading { background: #ffc9c0; } #card .pill.wrote { background: var(--accent); }
#card .links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
#card a.btn, #card button.btn, #card span.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 2px solid var(--ink); border-radius: 8px; background: var(--accent); color: var(--ink); text-decoration: none; font-family: var(--chunky); font-weight: 700; letter-spacing: .04em; cursor: pointer; box-shadow: 0 3px 0 rgba(42,26,14,.55); }
#card button.btn[disabled] { opacity: .45; cursor: default; }
#card .btn.todo { background: #fff; border-style: dashed; cursor: default; box-shadow: none; color: #5c4526; }
#card .pill.shelf { background: #F6E7C8; }
#card .nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; clear: both; }
#card .muted { color: #5c4526; font-size: 16px; }

/* ------------------------------------------------------------------ the plain page */
#plain { max-width: 760px; margin: 0 auto; padding: 28px 20px 80px; font-size: 18px; line-height: 1.6; color: var(--ink); }
#plain h1 { font-family: var(--display); font-weight: 400; font-size: 44px; line-height: 1.1; margin: 8px 0 6px; }
#plain h2 { font-family: var(--display); font-weight: 400; font-size: 28px; margin: 34px 0 8px; border-bottom: 3px solid var(--accent); padding-bottom: 4px; }
#plain p { max-width: 66ch; }
#plain .slogan { font-family: var(--display); font-size: 24px; line-height: 1.25; color: #7a4a00; margin: 4px 0 14px; }
#plain ul, #plain ol { padding-left: 22px; max-width: 66ch; }
#plain li { margin: 0 0 8px; }
#plain a { color: #7a4a00; }
#plain .enter { display: inline-flex; min-height: 44px; align-items: center; padding: 8px 16px; border: 2px solid var(--ink); border-radius: 8px; background: var(--accent); color: var(--ink); font-family: var(--chunky); font-weight: 700; cursor: pointer; box-shadow: 0 3px 0 rgba(42,26,14,.55); }
#plain .muted { color: #5c4526; font-size: 16px; }
.noscript { max-width: 640px; margin: 60px auto; padding: 0 20px; color: var(--paper); font-size: 18px; line-height: 1.6; }

body.booting #world { visibility: hidden; }

/* the tall phone hall: the wall is seen smaller, so its words are set larger */
.lay-tall .marquee { top: .2em; height: 6.6em; }
.lay-tall .marquee b { font-size: 3.1em; }
.lay-tall .marquee i { font-size: 1.7em; letter-spacing: .08em; }
.lay-tall .door .leaf .name { font-size: 1.9em; }
.lay-tall .door .leaf .name.long { font-size: 1.5em; }
.lay-tall .dcap span { font-size: 1.5em; }
.lay-tall .rowlab span { font-size: 1.35em; }

@media (max-width: 1240px) {
  .hud-cell { width: 118px; } .hud-cell .val { font-size: 32px; } .hud-cell .lab { font-size: 11px; letter-spacing: .08em; }
}
@media (max-width: 1060px) {   /* mid-size windows: the Positivity cell gives its room to the buttons, so their words are never cut */
  .hud-cell { width: 96px; } .hud-cell .val { font-size: 26px; } .hud-cell .lab { font-size: 10px; letter-spacing: .05em; }
  .hud-cell:nth-child(4) { display: none; }
  .hud-face { width: 84px; } .hud-face canvas { width: 64px; height: 64px; }
}
@media (max-width: 860px) {
  .hud-cell { width: 92px; } .hud-cell .val { font-size: 26px; } .hud-cell .lab { font-size: 9px; letter-spacing: .06em; }
  .hud-face { width: 76px; } .hud-face canvas { width: 60px; height: 60px; }
  .hud-btns { padding: 0 6px; } .hud-btns button { font-size: 11px; padding: 2px 6px; max-width: 132px; }
  .hud-cell:nth-child(4) { display: none; }   /* a narrow window gives the Positivity cell's room to the buttons, so their words fit */
  #views button { padding: 6px 9px; font-size: 12px; } #brand { display: none; } #hand { display: none; }
}
@media (max-width: 560px) {
  :root { --hud-h: 80px; }
  .hud-cell { display: none; }   /* a phone keeps the face and the buttons */
  .hud-face { width: 62px; } .hud-face canvas { width: 50px; height: 50px; border-width: 2px; }
  .hud-btns { padding: 0 5px; gap: 4px; border-left: 0; } .hud-btns button { min-height: 34px; max-width: 98px; letter-spacing: 0; }
  #views { top: 8px; gap: 4px; } #views button { padding: 6px 8px; min-height: 40px; }
  #hint { font-size: 14px; bottom: 8px; padding: 6px 10px; }
}
@media (max-height: 480px) {   /* a phone held sideways */
  :root { --hud-h: 64px; }
  .hud-cell .val { font-size: 22px; margin-top: 1px; } .hud-cell .lab { font-size: 9px; }
  .hud-face canvas { width: 46px; height: 46px; border-width: 2px; }
  .hud-btns { gap: 3px 6px; } .hud-btns button { min-height: 28px; }
  #hand { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .door .leaf, .frame, .book, .poster { transition: none; }
}
