/* Chunky (F9): the chapter pictures' frame, the room's speech bubble, and
 * the one mark Chunky makes on Settings (the bevelled choice buttons).
 * Linked after app.css; every other rule is app.css's.
 *
 * The wall and rail are the room's own (design/play/room-bare-bigwindow.png:
 * mix(bg, wall, 0.6) and mix(wall, cream, 0.12)), so every chapter's picture
 * hangs on the same wall as Now's room. */

:root { --chunky-wall: #342522; --chunky-rail: #52423C; }

/* ---- a chapter screen's picture (bands.js) ----
 * The text may reach --text-bottom (bands.js: at least half the screen, and
 * all the picture leaves); rows past it go to "+N more" (app.js fitRows). */
.screen.chunky .text { max-height: calc(var(--text-bottom, 50cqh) - var(--text-top)); }
.scene.chunky {
  left: 0; right: 0; bottom: 0; top: auto; width: auto; aspect-ratio: auto; transform: none;
  overflow: hidden; background: var(--chunky-wall);
}
/* The rail, just under the figures. */
.scene.chunky::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: var(--rail-h, 3px); background: var(--chunky-rail);
}
/* One image pixel a cell, scaled by a whole number of device pixels. */
.scene.chunky canvas {
  position: absolute; display: block;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
/* The two frames swap at D8's pace (app.css's f1/f2 flicker, which pauses
 * them when the figures are stale and shows the first alone under reduced
 * motion). */
.scene.chunky canvas.f1, .scene.chunky canvas.f2 { animation-duration: .8s; }
/* The backend's cool tone (the no-rent card): a veil of the offline blue,
 * never red. */
.scene.chunky.cool::after { content: ''; position: absolute; inset: 0; background: rgba(127, 176, 216, .10); }

/* ---- Settings: the choice buttons take the art's top-lit bevel ----
 * Square corners, a light top edge and a dark bottom edge (D8's gallery).
 * Their size and spacing are F-S2's, unchanged. */
.settings .seg button {
  border: 0; border-radius: 0; background: var(--wall);
  box-shadow: inset 0 3px 0 rgb(var(--fg) / .14), inset 0 -3px 0 rgba(0, 0, 0, .35), 0 0 0 2px var(--dark);
}
.settings .seg button[aria-pressed="true"] {
  background: var(--cream); color: var(--ink);
  box-shadow: inset 0 3px 0 #FFFFFF, inset 0 -3px 0 #D9C3A8, 0 0 0 2px var(--dark);
}
.settings .seg button:focus-visible { outline-offset: 4px; }

/* ---- the room (room.js, F9) ----
 * What moves (the fire, the coin, the cat, Ember) is drawn on its own
 * canvas over the still room, at a whole number of device pixels a cell. */
.room canvas.roomlive {
  position: absolute; left: 0; top: 0; display: block;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
.room.stale canvas.roomlive { filter: saturate(.55) brightness(.85); }
/* Ember's bubble (D7, as D8's gallery draws it): her words, sized to them,
 * never wider than 62% of the room, with a tail to her head, over the wall.
 * Three lines at most. Shown only while she speaks; a tap completes the
 * line, a second dismisses it. */
.room .bubble {
  position: absolute; z-index: 3; box-sizing: border-box; width: max-content; max-width: 62%;
  padding: 6px 9px; border-radius: 3px; background: var(--cream); color: var(--ink);
  font-size: var(--px-say); line-height: 1.2;
  box-shadow: 0 0 0 2px var(--dark), 3px 3px 0 2px rgba(0, 0, 0, .3);
  opacity: 0; pointer-events: none; transition: opacity var(--dur-fast) var(--ease);
}
.room .bubble.on { opacity: 1; pointer-events: auto; cursor: pointer; }
.room .bubble::after {
  content: ''; position: absolute; left: 14px; bottom: -8px; width: 8px; height: 8px;
  background: var(--cream); clip-path: polygon(0 0, 100% 0, 0 100%);
}
.room .saytxt {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
  overflow-wrap: anywhere;
}
