/* ═════════════════════════════ THE BASEMENT (floor B) ═════════════════════════════
   The shared fb-* frame lives in workshop.css. Room: 1200 × 600 (phones: 400 × 700). */

.floor-basement {
  --fb-wall: #17161F;
  background:
    radial-gradient(40% 50% at 18% 70%, rgba(255, 120, 40, .16), transparent 70%),
    radial-gradient(30% 40% at 34% 30%, rgba(255, 210, 120, .10), transparent 70%),
    linear-gradient(180deg, #14131C, #1B1A25 60%, #1E1C26);
}
.floor-basement::before { /* the warm light from the open vault */
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 1.4s ease;
  background: radial-gradient(38% 60% at 78% 78%, rgba(255, 196, 110, .26), transparent 70%);
}
.floor-basement.is-vault-open::before { opacity: 1; }
.bm-back {
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .35) 0 4px, transparent 4px 46px),
    repeating-linear-gradient(90deg, transparent 0 92px, rgba(0, 0, 0, .28) 92px 96px),
    linear-gradient(180deg, #1F1D29, #242230);
}
.bm-pipes-back { top: 132px; left: 0; width: 100%; height: 80px; opacity: .85; }
.bm-arch { width: clamp(120px, 14vw, 230px); left: max(12px, 2vw); bottom: calc(140px + 12%); opacity: .7; }
.bm-web { position: absolute; }
.bm-web-l { width: 110px; left: 0; top: 140px; }
@media (max-width: 1399px) { .bm-web-l { display: none; } }
@media (max-width: 760px) { .bm-arch { display: none; } }

.bm-front .bm-web-r { right: 0; top: 110px; width: clamp(90px, 7vw, 130px); }
@media (max-width: 1479px) { .bm-front .bm-web-r { display: none; } }
.bm-front .bm-pipe-f { left: -2%; bottom: 60px; width: 38%; height: 70px; opacity: .95; }
@media (max-width: 1100px) { .bm-front .bm-pipe-f { display: none; } }

.bm-ground {
  background:
    linear-gradient(180deg, #4A4757 0 5px, transparent 5px),
    repeating-linear-gradient(90deg, transparent 0 116px, rgba(13, 17, 32, .9) 116px 120px),
    repeating-linear-gradient(0deg, transparent 0 26px, rgba(13, 17, 32, .6) 26px 29px),
    linear-gradient(180deg, #3A3846, #2B2935);
}

/* positions: desktop room 1200 × 600 */
.bm-boiler { --x: 8;   --y: 126; --w: 270; }
.bm-sign   { --x: 300; --y: 50;  --w: 150; }
.bm-bulb   { --x: 470; --y: 12;  --w: 50; z-index: 4; pointer-events: none; }
.bm-count  { --x: 294; --y: 150; --w: 162; }
.bm-unit   { --x: 330; --y: 256; --w: 200; z-index: 5; }
.bm-crates { --x: 564; --y: 412; --w: 150; }
.bm-drip   { --x: 700; --y: 190; --w: 52; pointer-events: none; }
.bm-doodle { --x: 580; --y: 96;  --w: 92; }
.bm-mouse  { --x: 284; --y: 508; --w: 44; }
.bm-door   { --x: 744; --y: 54;  --w: 430; z-index: 3; }
.bm-plaque { --x: 849; --y: 4;   --w: 220; z-index: 4; }

/* boiler */
.bm-boiler svg { transform-origin: 50% 100%; }
.bm-boiler:hover svg { transform: scale(1.01, .99); transition: transform .3s var(--spring); }
.bm-boiler.is-bang svg { animation: br-rumble .08s linear 6; }
.bm-fire { animation: bm-fire 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes bm-fire { 0%, 100% { transform: scale(1, 1); opacity: 1; } 33% { transform: scale(1.04, .9); opacity: .88; } 66% { transform: scale(.97, 1.08); opacity: .95; } }
.bm-gauge { transform-box: view-box; transform-origin: 135px 118px; animation: bm-gauge 3s ease-in-out infinite; }
@keyframes bm-gauge { 0%, 100% { transform: rotate(-30deg); } 50% { transform: rotate(40deg); } }
.bm-boiler.is-bang .bm-gauge { animation: none; transform: rotate(75deg); }
.bm-vp { opacity: 0; transform-box: fill-box; transform-origin: center; animation: ws-puff 3.4s ease-out infinite; }
.bm-vp.p2 { animation-delay: -1.7s; }

/* the bulb. It hangs from the ceiling (the top of the floor): --pv is that pivot, measured by basement.js */
.bm-arm { position: relative; transform-origin: 50% var(--pv, 0px); animation: bm-swing 4.5s ease-in-out infinite; }
.bm-arm > svg { display: block; width: 100%; height: auto; overflow: visible; }
.bm-arm.is-js { animation: none; }
@keyframes bm-swing { 0%, 100% { transform: rotate(.9deg); } 50% { transform: rotate(-.9deg); } }
.bm-bulb-glow { animation: bm-hum 5s ease-in-out infinite; }
@keyframes bm-hum { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }
/* SHADOW PUPPETS: the bulb is a toy. Its hit area is a circle round the glass, big enough for a thumb */
.bm-bulb-hit {
  position: absolute; left: 50%; top: 80%; width: 120%; aspect-ratio: 1; min-width: 44px; translate: -50% -50%;
  border-radius: 50%; pointer-events: auto; cursor: grab; touch-action: pan-y; -webkit-touch-callout: none; user-select: none;
}
.bm-bulb-hit:active, .bm-bulb.is-held .bm-bulb-hit { cursor: grabbing; }
.bm-bulb-hit:focus-visible { outline: 3px solid var(--molten); outline-offset: 2px; border-radius: 50%; }
.bm-bulb.is-dog .bm-bulb-glass { fill: #FFF3DF; }
.bm-shadow { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 1; overflow: visible; pointer-events: none; }
.bm-shade { fill: rgba(4, 4, 10, .7); }
.bm-pool { opacity: .9; }
.bm-shelf { display: none; }

/* the drip */
.bm-drop { transform-box: view-box; animation: bm-drop 2.6s cubic-bezier(.55, 0, 1, .45) infinite; }
@keyframes bm-drop { 0%, 30% { transform: translateY(0) scale(.4); opacity: 0; } 40% { transform: translateY(0) scale(1); opacity: 1; } 96% { transform: translateY(412px); opacity: 1; } 100% { transform: translateY(418px); opacity: 0; } }
.bm-ripple { transform-box: fill-box; transform-origin: center; animation: bm-ripple 2.6s ease-out infinite; }
@keyframes bm-ripple { 0%, 94% { transform: scale(.2); opacity: 0; } 96% { opacity: 1; } 100% { transform: scale(2.4); opacity: 0; } }

/* the mouse hole */
.bm-eyes { animation: bm-blink 4.6s steps(1) infinite; transform-box: fill-box; transform-origin: center; }
@keyframes bm-blink { 0%, 92%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.1); } }
.bm-mouse.is-gone .bm-eyes { opacity: 0; animation: none; transition: opacity .1s; }

/* ── DO NOT PRESS ── */
.bm-count {
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: .5em .7em; text-align: center; gap: .1em;
  font: 600 max(12.5px, calc(15 * var(--u)))/1.15 var(--font-display); color: var(--cream);
  background: #232A40; border: calc(4 * var(--u)) solid var(--outline); border-radius: calc(12 * var(--u));
  box-shadow: inset 0 0 0 calc(2.5 * var(--u)) var(--brass), 0 calc(5 * var(--u)) 0 rgba(0, 0, 0, .35);
}
.bm-count b { color: var(--molten); font-variant-numeric: tabular-nums; }
.bm-count.is-bump b { display: inline-block; animation: squash .45s var(--spring); }
.bm-unit { transition: translate .28s var(--spring); }
.bm-unit > .bm-ped { width: 100%; height: auto; overflow: visible; }
.bm-press { position: absolute; left: 25%; top: 10.4%; width: 50%; z-index: 1; }
.bm-press svg { display: block; width: 100%; height: auto; overflow: visible; transform-origin: 50% 90%; transition: transform .12s ease-out; }
.bm-press:hover svg { transform: scale(1.03, .97); }
.bm-press:active svg, .bm-press.is-down svg { transform: scaleY(.62); }
.bm-press:focus-visible { outline: 3px solid var(--molten); outline-offset: 6px; border-radius: 50%; }
.bm-lid {
  position: absolute; left: 10%; top: .4%; width: 80%; z-index: 2;
  transform-origin: 50% 6%; transform: perspective(420px) rotateX(0deg); transition: transform .55s var(--spring);
}
.bm-lid svg { display: block; width: 100%; height: auto; overflow: visible; }
.bm-lid:hover { transform: perspective(420px) rotateX(-14deg); }
.bm-unit.is-open .bm-lid { transform: perspective(420px) rotateX(-128deg); }
.bm-unit.is-open .bm-lid:hover { transform: perspective(420px) rotateX(-122deg); }
.bm-lid:focus-visible { outline: 3px solid var(--molten); outline-offset: 4px; border-radius: 18px; }
.bm-unit:not(.is-open) .bm-press { pointer-events: none; }
.bm-legs { opacity: 0; transition: opacity .15s; }
.bm-unit.is-running .bm-legs { opacity: 1; animation: bm-legs .18s steps(2) infinite; }
@keyframes bm-legs { 50% { transform: translateY(-3px); } }
.bm-unit.is-running .bm-ped, .bm-unit.is-running .bm-press, .bm-unit.is-running .bm-lid { animation: bm-hop .36s ease-in-out infinite; }
@keyframes bm-hop { 50% { translate: 0 -6px; } }
.bm-trophy { opacity: 0; transform-box: fill-box; transform-origin: center; }
.bm-unit.is-gold .bm-trophy { opacity: 1; animation: bm-trophy 2.4s ease-in-out infinite; }
@keyframes bm-trophy { 50% { transform: rotate(-12deg) scale(1.1); } }
.bm-unit.is-gold .bm-rim { fill: #FFD76A; }
.bm-unit.is-gold .bm-rim-face { fill: #C99A2E; }
.bm-unit.is-gold .bm-ped { filter: drop-shadow(0 0 10px rgba(255, 215, 106, .55)); }

/* the outcomes */
.bm-cloud { position: absolute; z-index: 9; left: 50%; top: -34%; width: 76%; transform: translateX(-50%); pointer-events: none; animation: bm-cloud-in .5s var(--spring) both; }
.bm-cloud.out { animation: bm-cloud-out .6s ease-in both; }
.bm-cloud svg { width: 100%; height: auto; overflow: visible; display: block; }
.bm-cloud .bm-rain path { animation: bm-rain .5s linear infinite; }
.bm-cloud .bm-rain path:nth-child(2n) { animation-delay: -.25s; }
.bm-cloud .bm-rain path:nth-child(3n) { animation-delay: -.12s; }
@keyframes bm-rain { from { transform: translateY(-6px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(46px); opacity: 0; } }
@keyframes bm-cloud-in { from { transform: translateX(-50%) scale(.3); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
@keyframes bm-cloud-out { to { transform: translateX(-50%) translateY(-30px); opacity: 0; } }
.bm-float {
  position: absolute; z-index: 9; left: 50%; top: -10%; margin: 0; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  font: 700 max(20px, calc(34 * var(--u)))/1 var(--font-display); color: var(--cream);
  text-shadow: 0 3px 0 var(--outline), 3px 0 0 var(--outline), -3px 0 0 var(--outline), 0 -3px 0 var(--outline);
  animation: bm-float 2.4s ease-out both;
}
@keyframes bm-float { 0% { transform: translateX(-50%) scale(.4) rotate(-8deg); opacity: 0; } 15% { transform: translateX(-50%) scale(1.1) rotate(4deg); opacity: 1; } 30% { transform: translateX(-50%) scale(1) rotate(-3deg); } 80% { opacity: 1; } 100% { transform: translateX(-50%) translateY(40px) rotate(-10deg); opacity: 0; } }

/* ── THE VAULT DOOR ── */
.bm-door { transition: transform .3s var(--spring); }
.bm-door > .bm-frame { width: 100%; height: auto; overflow: visible; }
.bm-door:focus-visible { outline: 3px solid var(--molten); outline-offset: 6px; border-radius: 48% 48% 14px 14px / 40% 40% 14px 14px; }
.bm-leaf-wrap {
  position: absolute; left: 9.302%; top: 8.163%; width: 81.395%; height: 91.837%; display: block;
  transform-origin: 0 50%; transform: perspective(1400px) rotateY(0deg);
  transition: transform 1.7s cubic-bezier(.55, 0, .25, 1), filter 1.7s;
}
.bm-leaf { display: block; width: 100%; height: 100%; overflow: visible; }
.bm-door.is-rattle .bm-leaf-wrap { animation: bm-rattle .42s linear; }
@keyframes bm-rattle { 15% { transform: perspective(1400px) translateX(-4px) rotate(-.6deg); } 35% { transform: perspective(1400px) translateX(5px) rotate(.5deg); } 55% { transform: perspective(1400px) translateX(-4px); } 75% { transform: perspective(1400px) translateX(3px); } }
.bm-door.is-open .bm-leaf-wrap { transform: perspective(1400px) rotateY(-106deg); filter: brightness(.6); }
.bm-light { opacity: 0; transition: opacity 1.2s ease .3s; }
.bm-door.is-open .bm-light { opacity: 1; }
.bm-rays { transform-box: view-box; transform-origin: 215px 250px; animation: bm-rays 12s linear infinite; }
@keyframes bm-rays { 0%, 100% { transform: rotate(-6deg); opacity: .35; } 50% { transform: rotate(6deg); opacity: .55; } }
.bm-door:not(.is-open):hover .bm-leaf-wrap { transform: perspective(1400px) rotateY(-3deg); }
.bm-bolts-door { transform-box: view-box; transition: transform .35s var(--spring); }
.bm-door.is-unbolted .bm-bolts-door { transform: translateX(-38px); }
.bm-star .bm-st-a { fill: #F1E4C2; stroke: #E2CFA0; stroke-width: 1; stroke-linejoin: round; }
.bm-star .bm-st-b { fill: #2B241A; stroke: #E2CFA0; stroke-width: 1; stroke-linejoin: round; }
.bm-star .bm-st-a.bm-st-minor { fill: #CDB98C; }
.bm-eng { stroke-width: 1.2; }
.bm-keyhole { transition: fill .3s; }
.bm-door:hover .bm-keyhole { fill: #2A1C08; }
.bm-key {
  position: absolute; left: 50%; top: 51.55%; width: 26%; height: auto; overflow: visible;
  transform: translate(-50%, -50%) scale(0) rotate(-40deg); opacity: 0; transition: transform .5s var(--spring), opacity .2s;
}
.bm-door.is-keyed .bm-key { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
.bm-door.is-turned .bm-key { transform: translate(-50%, -50%) scale(1) rotate(90deg); transition-duration: .45s; }
.bm-door.is-half .bm-key { transform: translate(-50%, -50%) scale(1) rotate(42deg); transition-duration: .3s; }
.bm-door.is-clunk .bm-key { animation: bm-clunk .35s ease-out; }
@keyframes bm-clunk { 30% { translate: 0 3px; } 60% { translate: 0 -1px; } }

/* the lamps around the keyhole (one per Spark the lock wants) and the counter plate */
.bm-lamp-bulb { fill: #2B241A; stroke: #C8A15A; stroke-width: 1.2; transition: fill .4s, stroke .4s; }
.bm-lamp-halo { fill: #FFC23D; opacity: 0; transition: opacity .4s; }
.bm-lamp.on .bm-lamp-bulb { fill: #FFE08A; stroke: #FFF3DF; }
.bm-lamp.on .bm-lamp-halo { opacity: .3; }
.bm-lamp.is-new .bm-lamp-halo { animation: bm-lamp-new 1.2s ease-out; }
@keyframes bm-lamp-new { 0% { opacity: .9; } 100% { opacity: .3; } }
.bm-lamps.is-flicker .bm-lamp.on { animation: bm-flicker .9s steps(1) 1; }
.bm-lamps.is-flicker .bm-lamp:not(.on) .bm-lamp-halo { animation: bm-want .9s ease-in-out 1; }
@keyframes bm-flicker { 0%, 100% { opacity: 1; } 22% { opacity: .25; } 40% { opacity: 1; } 62% { opacity: .35; } 80% { opacity: 1; } }
@keyframes bm-want { 0%, 100% { opacity: 0; } 50% { opacity: .22; } }
.bm-plate-n { font-variant-numeric: tabular-nums; }
.bm-door.is-ready .bm-plate rect:first-child { fill: #E3C27E; }
.bm-door.is-ready .bm-keyhole { fill: #3A2708; }
.bm-door.is-ready:not(.is-open) .bm-leaf { filter: drop-shadow(0 0 10px rgba(255, 194, 61, .35)); }
.bm-door.is-open .bm-key { opacity: 1; }
.bm-spill {
  position: absolute; z-index: 1; bottom: 0; left: calc(784 / var(--rw) * 100%); width: calc(350 / var(--rw) * 100%); height: calc(var(--gh) / var(--rh) * 100% + 4px);
  background: linear-gradient(180deg, rgba(255, 214, 140, .75), rgba(255, 160, 60, .12));
  clip-path: polygon(4% 0, 96% 0, 128% 100%, -28% 100%); opacity: 0; transition: opacity 1.2s ease .5s; pointer-events: none;
}
.floor-basement.is-vault-open .bm-spill { opacity: 1; }
.bm-plaque {
  display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; padding: .32em .6em .38em; gap: .12em; text-align: center;
  background: linear-gradient(180deg, #E3C27E, #C8A15A 55%, #A9823E); color: #2A1C08;
  border: calc(3.5 * var(--u)) solid var(--outline); border-radius: calc(6 * var(--u));
  box-shadow: inset 0 0 0 calc(2 * var(--u)) rgba(255, 243, 223, .5), 0 calc(4 * var(--u)) 0 rgba(0, 0, 0, .4);
  font: italic 700 max(12px, calc(17 * var(--u)))/1.05 Georgia, 'Times New Roman', serif; letter-spacing: .04em; white-space: nowrap;
}
.bm-plaque small { font: italic 400 max(10.5px, calc(12.5 * var(--u)))/1.1 Georgia, 'Times New Roman', serif; letter-spacing: .02em; color: #3A2710; }
.bm-plaque small b { font-weight: 700; }
.bm-plaque.is-glint { animation: bm-glint .9s ease-out; }
@keyframes bm-glint { 0% { filter: brightness(1); transform: rotate(0); } 25% { filter: brightness(1.5); transform: rotate(-3deg); } 60% { transform: rotate(2deg); } 100% { filter: brightness(1); transform: rotate(0); } }

/* the vault card (in the cabinet) */
.bm-card { padding: clamp(22px, 4vw, 40px); text-align: center; background: radial-gradient(70% 60% at 50% 0%, rgba(255, 200, 120, .16), transparent 70%); }
.bm-card svg { width: 110px; height: 110px; margin: 0 auto 14px; display: block; }
.bm-card .lede { margin: 0 auto .6em; max-width: 34ch; color: var(--cream); font: 600 var(--step-1)/1.3 var(--font-display); }
.bm-card .warn { margin: 0 auto 1.4em; color: #FFB27A; font-weight: 800; }
.bm-card .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 760px) { .floor-basement .fb-head { padding-right: 58px; } }

/* ── the Basement on phones and small tablets: room 400 × 620 ── */
@media (max-width: 1020px) {
  /* a band of bare wall under the sign for the crates' shelf and their shadow (SHADOW PUPPETS) */
  .bm-room { --rh: 710; --gh: 70; }
  .bm-door   { --x: 150; --y: 364; --w: 246; }
  .bm-plaque { --x: 166; --y: 302; --w: 214; }
  .bm-unit   { --x: 4;   --y: 426; --w: 150; }
  .bm-count  { --x: 0;   --y: 334; --w: 150; padding: .4em .5em; }
  .bm-sign   { --x: 16;  --y: 30;  --w: 150; }
  .bm-bulb   { --x: 196; --y: 0;   --w: 44; }
  .bm-arm    { animation: none; }
  .bm-doodle { --x: 22;  --y: 150; --w: 80; }
  .bm-crates { --x: 168; --y: 186; --w: 100; }
  .bm-crates-floor { display: none; }
  .bm-shelf  { display: inline; }
  .bm-spill  { left: calc(173 / 400 * 100%); width: calc(200 / 400 * 100%); }
  .bm-boiler, .bm-drip { display: none; }
  .bm-mouse  { --x: 150; --y: 611; --w: 38; z-index: 4; }
}
.bm-card-status { margin: 1em 0 0; min-height: 1.3em; color: var(--fg-muted); font-weight: 700; }
.bm-card .btn[aria-busy="true"] { cursor: progress; filter: saturate(.7); }

/* MOUSE FRIEND: the mouse comes out to sniff you when you stay still */
.bm-mouse { -webkit-touch-callout: none; user-select: none; overflow: visible; }
.bm-critter {
  position: absolute; left: -40%; bottom: -8%; width: 240%; height: auto; overflow: visible; pointer-events: none;
  opacity: 0; transform-origin: 30% 100%; transform: translate(-18%, 8%) scale(.25);
  transition: transform .45s var(--spring), opacity .2s;
}
.bm-mouse.is-friend .bm-critter { opacity: 1; transform: none; }
.bm-mouse.is-friend .bm-eyes { opacity: 0; }
.bm-mouse.is-friend .bm-nose { animation: bm-sniff .22s ease-in-out .5s 8 alternate; transform-box: fill-box; transform-origin: 0 50%; }
.bm-mouse.is-friend .bm-head { animation: bm-tilt 1.2s ease-in-out .4s 2 alternate; transform-box: fill-box; transform-origin: 30% 90%; }
.bm-mouse.is-friend .bm-tail { animation: bm-tail .5s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 100% 100%; }
.bm-crumb { opacity: 0; }
.bm-mouse.is-friend .bm-crumb { animation: bm-crumb .5s var(--spring) 1.3s both; }
@keyframes bm-sniff { to { transform: translate(1px, -1px) rotate(-6deg); } }
@keyframes bm-tilt { to { transform: rotate(-9deg); } }
@keyframes bm-tail { to { transform: rotate(-12deg); } }
@keyframes bm-crumb { from { opacity: 0; transform: translate(-10px, -14px) scale(.4); } to { opacity: 1; transform: none; } }
html.calm .bm-critter, html.calm .bm-mouse.is-friend .bm-nose, html.calm .bm-mouse.is-friend .bm-head, html.calm .bm-mouse.is-friend .bm-tail, html.calm .bm-mouse.is-friend .bm-crumb { transition: none; animation: none; }
html.calm .bm-mouse.is-friend .bm-crumb { opacity: 1; }

/* MOUSE HOUSE: the crumb trail, and the mouse's room under the floorboards (a cutaway in the front of the floor) */
.bm-mouse.has-trail .bm-crumb { visibility: hidden; }
.bm-mouse.is-away .bm-eyes { opacity: 0; animation: none; }
.bm-trail { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.bm-crumb-btn {
  position: absolute; left: calc(var(--cx) / var(--rw) * 100%); top: calc(var(--cy) / var(--rh) * 100%);
  width: 38px; height: 38px; translate: -50% -50%; display: grid; place-items: center; pointer-events: auto;
}
.bm-crumb-btn svg { width: max(11px, calc(13 * var(--u))); height: auto; overflow: visible; transform: rotate(var(--r, 0deg)); }
.bm-crumb-btn.is-in svg { animation: bm-toss .55s cubic-bezier(.3, .7, .4, 1) var(--d, 0s) both; }
@keyframes bm-toss {
  0% { transform: translate(calc(var(--fx) * var(--u)), 0) scale(.3) rotate(0); opacity: 0; }
  15% { opacity: 1; }
  55% { transform: translate(calc(var(--fx) * var(--u) * .45), calc(-22 * var(--u))) scale(1.1) rotate(180deg); }
  100% { transform: translate(0, 0) scale(1) rotate(var(--r, 0deg)); opacity: 1; }
}
.bm-crumb-btn::after { /* the twinkle on the next crumb */
  content: ''; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -12px 0 0 2px; opacity: 0; pointer-events: none;
  background: #FFF3DF; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  filter: drop-shadow(0 0 3px #FFC23D);
}
.bm-crumb-btn.is-next::after { animation: bm-twinkle 1.3s ease-in-out .6s infinite; }
.bm-crumb-btn.is-next svg { filter: drop-shadow(0 0 3px rgba(255, 214, 140, .8)); }
.bm-crumb-btn.is-hint::after { animation-duration: .45s; }
@keyframes bm-twinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0); } 40% { opacity: 1; transform: scale(1.1) rotate(45deg); } 70% { opacity: .6; transform: scale(.7) rotate(80deg); } }
.bm-crumb-btn.is-nope svg { animation: bm-nope .35s ease-in-out; }
@keyframes bm-nope { 25% { transform: translateX(-2px) rotate(var(--r)); } 75% { transform: translateX(2px) rotate(var(--r)); } }
.bm-crumb-btn.is-eaten { pointer-events: none; }
.bm-crumb-btn.is-eaten svg { animation: none; transform: scale(0); opacity: 0; transition: transform .18s ease-in, opacity .18s; }
.bm-crumb-btn:focus-visible { outline: 3px solid var(--molten); outline-offset: -4px; border-radius: 50%; }

.bm-house { --x: 404; --y: 545; --w: 170; z-index: 6; }
.bm-house[hidden] { display: none; }
.bm-house-btn { position: relative; display: block; width: 100%; padding: 0; cursor: pointer; }
.bm-house-btn:focus-visible { outline: 3px solid var(--molten); outline-offset: 3px; border-radius: 6px; }
.bm-hm { display: block; width: 100%; height: auto; }
.bm-hm-door { /* the section of the floor's face that swings open, dollhouse style */
  position: absolute; left: 1.4%; top: 4.8%; width: 97.2%; height: 90.4%; border-radius: 2px;
  background: repeating-linear-gradient(0deg, transparent 0 calc(26 * var(--u)), rgba(13, 17, 32, .6) 0 calc(29 * var(--u))), linear-gradient(180deg, #353341, #2B2935);
  box-shadow: inset 0 0 0 2px #0D1120; transform-origin: 0 50%; transform: perspective(900px) rotateY(0); opacity: 0;
  transition: transform .85s cubic-bezier(.5, 0, .25, 1.15), filter .85s;
}
.bm-house.is-crack .bm-hm-door { opacity: 1; animation: bm-crack .3s ease-out; }
@keyframes bm-crack { 0% { box-shadow: inset 0 0 0 2px #FFD98A; } 100% { box-shadow: inset 0 0 0 2px #0D1120; } }
.bm-house.is-open .bm-hm-door { transform: perspective(900px) rotateY(-104deg); filter: brightness(.75); }
.bm-hm-mouse { transform: translateX(-46px); opacity: 0; }
.bm-house.is-home .bm-hm-mouse { animation: bm-hm-in .85s cubic-bezier(.3, .6, .4, 1) both; }
@keyframes bm-hm-in { 0% { transform: translateX(-46px); opacity: 0; } 12% { opacity: 1; } 100% { transform: none; opacity: 1; } }
.bm-house.is-home .bm-hm-bob { animation: bm-hm-scurry .11s ease-in-out 8 alternate; }
@keyframes bm-hm-scurry { to { transform: translateY(-1.4px); } }
.bm-hm-paw { opacity: 0; transform-box: fill-box; transform-origin: 0% 100%; }
.bm-house.is-wave .bm-hm-paw { opacity: 1; animation: bm-hm-wave .28s ease-in-out 8 alternate; }
@keyframes bm-hm-wave { from { transform: rotate(-24deg); } to { transform: rotate(22deg); } }
.bm-hm-glow { animation: bm-hum 3.6s ease-in-out infinite; }
html.calm .bm-house .bm-hm-door, html.calm .bm-crumb-btn svg { transition: none; animation: none; }
html.calm .bm-house.is-home .bm-hm-mouse { animation: none; transform: none; opacity: 1; }
html.calm .bm-house.is-wave .bm-hm-paw { animation: none; transform: rotate(-10deg); }
html.calm .bm-crumb-btn.is-eaten svg { opacity: 0; }
@media (max-width: 1020px) {
  .bm-house { --x: 236; --y: 648; --w: 156; }
}
