/* Phase A of the walkable world: Dood's spoken guide (games/world/src/guide.js) and My House (house.js).
   A file of its own so it merges cleanly with walk.css. Our own origin only (the CSP's style-src 'self'). */

/* Dood's bubble: bottom left, above the dialogs, never in the way of a tap */
.ww .ww-guide {
  position: absolute; left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 47;
  display: flex; align-items: flex-end; gap: 6px; max-width: min(440px, calc(100% - 24px)); pointer-events: none;
}
.ww-guide__dood { width: 56px; height: 84px; flex: none; }
.ww-guide__text {
  position: relative; margin: 0 0 18px; padding: 10px 14px 12px; background: #fff; font-size: 19px; line-height: 1.25;
  border: 3px solid var(--ink); border-radius: var(--wob); box-shadow: 0 4px 0 var(--ink);
}
.ww-guide__text::before {
  content: ""; position: absolute; left: -14px; bottom: 14px; width: 16px; height: 18px; background: #fff;
  border: 3px solid var(--ink); border-right: 0; clip-path: polygon(0 50%, 100% 0, 100% 100%);
}
.ww-guide.is-in .ww-guide__text { animation: ww-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.ww-guide.is-in .ww-guide__dood { animation: ww-bounce .9s ease-in-out 1; }
@media (prefers-reduced-motion: reduce) { .ww-guide.is-in .ww-guide__text, .ww-guide.is-in .ww-guide__dood { animation: none; } }
@media (max-width: 480px) { .ww-guide__text { font-size: 17px; } .ww-guide__dood { width: 44px; height: 66px; } }
/* a long press says a button's name: no text selection or callout on the way */
.ww button, .ww a.ww-btn { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* the Grown-ups corner's extras */
.ww-set--name { display: grid; gap: 6px; margin: 12px 0; }
.ww-set--name label { font-size: 18px; }
.ww-name-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ww-set--name input {
  flex: 1 1 180px; min-height: 48px; padding: 8px 12px; font: 600 19px Fredoka, sans-serif; color: var(--ink);
  border: 3px solid var(--ink); border-radius: 12px; background: #fff; user-select: text; -webkit-user-select: text;
}
.ww-set--name input:focus-visible { outline: 4px solid var(--blue); outline-offset: 2px; }
.ww-name-msg { min-height: 1.2em; font-size: 16px; color: #2b7a46; }
.ww-name-msg.is-bad { color: #b3261e; }
.ww-set--guide { margin: 12px 0; padding: 8px 12px 10px; border: 2px dashed #c9c2b2; border-radius: 12px; }
.ww-set--guide legend { padding: 0 6px; font-size: 18px; }
.ww-set--guide label { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 16px; line-height: 1.3; }
.ww-set--guide input { width: 22px; height: 22px; flex: none; }

/* My House */
.ww-house { display: block; padding: 0; background: #FFE9F2; overflow: hidden; }
.ww-house__title {
  position: absolute; left: 50%; top: max(12px, env(safe-area-inset-top)); transform: translateX(-50%) rotate(-1.5deg); margin: 0;
  padding: 6px 18px; font-size: 26px; background: #fff; border: 3px solid var(--ink); border-radius: var(--wob); box-shadow: 0 4px 0 var(--ink);
  white-space: nowrap; max-width: calc(100% - 170px); overflow: hidden; text-overflow: ellipsis; z-index: 2;
}
.ww-house__out { position: absolute; left: max(12px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top)); z-index: 3; }
.ww-house__scene { position: absolute; z-index: 1; touch-action: none; cursor: pointer; }
.ww-house__item { position: absolute; display: block; padding: 0; margin: 0; border: 0; background: none; pointer-events: none; }
.ww-house__item canvas, .ww-house__me { display: block; width: 100%; height: 100%; }
.ww-house__item.ww-house__thing { pointer-events: auto; cursor: pointer; border-radius: 12px; transition: transform .15s ease; }
.ww-house__thing:hover, .ww-house__thing:focus-visible { transform: translateY(-3px); }
.ww-house__thing:focus-visible { outline: 4px solid var(--blue); outline-offset: 2px; }
.ww-house__me { position: absolute; pointer-events: none; transform-origin: 50% 100%; }

.ww-house__panel { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(255, 233, 242, .92); }
.ww-house__card {
  position: relative; width: min(760px, 100%); max-height: 100%; overflow: auto; padding: 18px 18px 20px; background: #fff;
  border: 3px solid var(--ink); border-radius: var(--wob); box-shadow: 0 6px 0 var(--ink);
}
.ww-house__back { position: absolute; right: 12px; top: 12px; }
.ww-house__h { display: flex; align-items: center; gap: 10px; margin: 0 72px 14px 0; font-size: 26px; }
.ww-house__h .ww-ico { width: 36px; height: 36px; flex: none; }

/* the Fridge Wall: magnet-held pictures on a big fridge door */
.ww-fridge { padding: 22px 16px 18px; background: #DDEFFF; border: 3px solid var(--ink); border-radius: 26px; min-height: 220px; }
.ww-fridge__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 22px 16px; }
.ww-fridge__item { position: relative; transform: rotate(var(--rot)); }
.ww-fridge__item::before {
  content: ""; position: absolute; left: 50%; top: -10px; width: 22px; height: 22px; margin-left: -11px; z-index: 1;
  background: var(--mag); border: 3px solid var(--ink); border-radius: 50%; box-shadow: 0 2px 0 var(--ink);
}
.ww-fridge__pic { display: block; width: 100%; padding: 6px; background: #fff; border: 3px solid var(--ink); border-radius: 6px; cursor: pointer; box-shadow: 0 4px 0 rgba(26, 26, 26, .25); }
.ww-fridge__pic:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }
.ww-fridge__thumb { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.ww-fridge__empty, .ww-tray__empty { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 19px; color: #5c574e; }
.ww-fridge__empty .ww-ico, .ww-tray__empty .ww-ico { width: 52px; height: 52px; flex: none; }
.ww-house__big { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(255, 253, 247, .96); }
.ww-house__bigcard { max-width: 100%; max-height: 100%; padding: 10px; background: #fff; border: 3px solid var(--ink); border-radius: 10px; box-shadow: 0 6px 0 var(--ink); }
.ww-house__bigpic { display: block; max-width: min(88vw, 900px); max-height: 78vh; width: auto; height: auto; }
.ww-house__bigclose { position: absolute; right: 16px; top: 16px; }

/* the sticker board and the tray of stickers to put up */
.ww-board {
  position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: 52vh; margin: 0 auto 14px; background: #E8C391;
  border: 8px solid #9A6234; border-radius: 14px; box-shadow: inset 0 0 0 3px var(--ink), 0 4px 0 var(--ink);
  background-image: radial-gradient(#c99a62 1.4px, transparent 1.6px); background-size: 18px 18px;
}
.ww-tray { display: flex; flex-wrap: wrap; gap: 10px; min-height: 70px; padding: 10px; background: #FFF8E6; border: 3px dashed #c9b48c; border-radius: 14px; }
.ww-sticker-p {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px; width: 84px; padding: 6px 4px; touch-action: none; cursor: grab;
  background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 3px 0 var(--ink); font: 600 12px/1.1 Fredoka, sans-serif; color: var(--ink);
}
.ww-sticker-p .ww-ico { width: 52px; height: 52px; }
.ww-sticker-p__name { text-align: center; }
.ww-sticker-p.is-up { position: absolute; width: 64px; padding: 4px; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); border-radius: 50%; }
.ww-sticker-p.is-up .ww-ico { width: 50px; height: 50px; }
.ww-sticker-p.is-lifted { opacity: .35; }
.ww-sticker-ghost { position: absolute; left: 0; top: 0; z-index: 30; pointer-events: none; cursor: grabbing; }
.ww-sticker-p:focus-visible { outline: 4px solid var(--blue); outline-offset: 2px; }
@media (max-width: 480px) { .ww-house__title { font-size: 20px; } .ww-house__h { font-size: 21px; } .ww-sticker-p { width: 72px; } .ww-sticker-p.is-up { width: 52px; } .ww-sticker-p.is-up .ww-ico { width: 40px; height: 40px; } }

/* My House's rooms (corners.js): picture tabs for the bedroom, Nana's kitchen and Femi's inventor corner */
.ww-house__rooms {
  position: absolute; right: max(12px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); z-index: 3;
  display: flex; flex-direction: column; gap: 10px;
}
.ww-house__rooms[hidden] { display: none; }
.ww-house__tab {
  display: flex; align-items: center; justify-content: center; width: 76px; height: 76px; padding: 6px; cursor: pointer;
  background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 4px 0 var(--ink); transition: transform .15s ease;
}
.ww-house__tab canvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; }
.ww-house__tab[aria-pressed="true"] { background: #FFE38A; transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.ww-house__tab:focus-visible { outline: 4px solid var(--blue); outline-offset: 2px; }
.ww-house__scene { transition: opacity .18s ease; }
.ww-house__scene.is-leaving { opacity: 0; }
@media (max-aspect-ratio: 1/1) {
  .ww-house__rooms { top: auto; bottom: max(12px, env(safe-area-inset-bottom)); transform: none; flex-direction: row; }
}
@media (max-width: 480px) { .ww-house__tab { width: 60px; height: 60px; border-radius: 14px; } }

/* the two plays: make the soup, build a junk robot */
.ww-play { display: grid; gap: 14px; }
.ww-play__stage { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 18px; min-height: 230px; padding: 12px; background: #FFF8E6; border: 3px solid var(--ink); border-radius: 20px; }
.ww-play__drop { position: relative; width: min(300px, 62%); }
.ww-house__panel--robot .ww-play__drop { width: min(420px, 86%); }
.ww-play__drop > canvas:first-child { display: block; width: 100%; height: auto; }
.ww-play__in { position: absolute; inset: 0; pointer-events: none; }
.ww-house__panel--robot .ww-play__in { bottom: 55%; }       /* the parts sit on the bench top */
.ww-house__panel--soup .ww-play__in { bottom: 50%; top: 4%; } /* the veg drop in at the pot's mouth */
.ww-play__piece { position: absolute; height: 56px; width: auto; transform: translate(-50%, -50%); animation: ww-play-in .4s cubic-bezier(.3, 1.5, .5, 1); }
.ww-house__panel--soup .ww-play__piece { height: 46px; }
.ww-play__ladle { position: absolute; right: 2%; top: -22%; height: 70%; width: auto; transform-origin: 50% 90%; transform: rotate(18deg); pointer-events: none; }
.ww-play__apron { position: absolute; left: 12px; top: 12px; height: 110px; width: auto; transform: rotate(-4deg); pointer-events: none; }
.ww-play__done { display: flex; align-items: flex-end; }
.ww-play__done canvas { display: block; height: 130px; width: auto; animation: ww-play-in .5s cubic-bezier(.3, 1.5, .5, 1); }
.ww-house__panel--robot .ww-play__done { position: absolute; left: 50%; bottom: 46%; transform: translateX(-50%); }
.ww-house__panel--robot .ww-play__done canvas { height: 150px; }
.ww-play__tray { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; min-height: 96px; padding: 10px; background: #FFF8E6; border: 3px dashed #c9b48c; border-radius: 14px; }
.ww-play__part {
  display: flex; align-items: center; justify-content: center; width: 88px; height: 88px; padding: 8px; touch-action: none; cursor: grab;
  background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 3px 0 var(--ink);
}
.ww-play__part canvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; }
.ww-play__part:focus-visible { outline: 4px solid var(--blue); outline-offset: 2px; }
.ww-play__part.is-lifted { opacity: .35; }
.ww-play__ghost { position: absolute; left: 0; top: 0; z-index: 30; width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.ww-play__ghost canvas { max-width: 100%; max-height: 100%; width: auto; height: auto; transform: rotate(-6deg) scale(1.15); }
.ww-play__again { margin: 0; text-align: center; }
.ww-play__again .ww-btn { display: inline-flex; align-items: center; gap: 8px; font-size: 19px; }
.ww-play__again .ww-ico { width: 30px; height: 30px; }
.ww-play__stage.is-stirring .ww-play__ladle { animation: ww-stir .8s ease-in-out 2; }
.ww-play__stage.is-stirring .ww-play__piece { animation: ww-bob .8s ease-in-out 2; }
.ww-play__stage.is-building .ww-play__piece { animation: ww-bob .5s ease-in-out 3; }
@keyframes ww-play-in { from { transform: translate(-50%, -140%) scale(.6); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.ww-play__done canvas { transform-origin: 50% 100%; }
@keyframes ww-stir { 0%, 100% { transform: rotate(18deg); } 50% { transform: rotate(-16deg); } }
@keyframes ww-bob { 0%, 100% { margin-top: 0; } 50% { margin-top: -6px; } }
.is-calm .ww-play__piece, .is-calm .ww-play__done canvas, .is-calm .ww-play__ladle, .is-calm .ww-play__stage.is-stirring .ww-play__ladle,
.is-calm .ww-play__stage.is-stirring .ww-play__piece, .is-calm .ww-play__stage.is-building .ww-play__piece { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .ww-play__piece, .ww-play__done canvas, .ww-play__stage.is-stirring .ww-play__ladle, .ww-play__stage.is-stirring .ww-play__piece,
  .ww-play__stage.is-building .ww-play__piece, .ww-house__tab, .ww-house__scene { animation: none; transition: none; }
}
@media (max-width: 480px) { .ww-play__part { width: 70px; height: 70px; } .ww-play__apron { height: 74px; } .ww-play__done canvas { height: 96px; } }
/* Tilly's line when she visits (house.js cameoSays): a resident's speech bubble, lifted above her head */
.ww-house__say { z-index: 2000; margin: 0; white-space: nowrap; font-size: 17px; line-height: 1.25; text-align: center;
  transform: translate(-50%, calc(-100% - 16px)); }
.ww-house__say[hidden] { display: none; }
/* the bookshelf (games/world/src/shelf.js; docs/order-bridge.md) */
.ww-shelf-list { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 6px; }
.ww-shelf-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ww-set.ww-set--shelf { display: grid; gap: 6px; align-items: start; }
