/* The Living Room. Colors come from TOKENS in room.js, set as custom properties on #stage before it's shown. */

* { box-sizing: border-box; }
body { margin: 0; background: #1C251B; }

/* ---- the room (only with JS) ---- */
.stage { display: none; }
.js .stage {
  display: block; position: relative; height: 100vh; height: 100dvh; min-height: 560px; overflow: hidden;
  background: linear-gradient(180deg, var(--wallFill) 0 var(--split, 55%), var(--rugFill) var(--split, 55%) 100%);
  color: var(--ink); font-family: 'Atkinson Hyperlegible', system-ui, sans-serif; font-size: 17px; line-height: 1.55;
}

.js .stage.in-bedroom { background: linear-gradient(180deg, var(--bedWall) 0 var(--split, 55%), var(--bedFloor) var(--split, 55%) 100%); }
.js .stage.in-kitchen { background: linear-gradient(180deg, var(--kitWall) 0 var(--split, 55%), var(--kitFloor) var(--split, 55%) 100%); }
.js .stage.in-hall { background: linear-gradient(180deg, var(--hallWall) 0 var(--split, 55%), var(--hallFloor) var(--split, 55%) 100%); }

.cam { position: absolute; left: 0; top: 0; width: 320px; height: 180px; transform-origin: 0 0; will-change: transform; }
.ready .cam { transition: transform 0.95s cubic-bezier(0.65, 0, 0.35, 1); }
.room-canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; touch-action: none; cursor: crosshair; }
.hot { position: absolute; background: transparent; border: 0; padding: 0; margin: 0; cursor: pointer; }
.hot:focus-visible { outline: 1px solid #E2BF5E; outline-offset: 0; }

.pbtn { cursor: pointer; }
/* Lift on hover only where there's a real pointer; on touch screens :hover sticks after a tap. */
@media (hover: hover) { .pbtn:hover { transform: translate(-2px, -2px); } }
/* No double-tap zoom on the room or its buttons (quick repeat taps zoomed the page on iPhone). */
.js .stage, .js .stage button { touch-action: manipulation; }
.pbtn:focus-visible, .card-v:focus-visible { outline: 3px solid #E2BF5E; outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.hudbox { background: var(--hud); color: var(--hudInk); border: 3px solid var(--hudLine); box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35); }

.nametag { position: absolute; left: 16px; top: 16px; display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; }
.nametag-name { margin: 0; font-family: 'Pixelify Sans', monospace; font-weight: 700; font-size: 22px; line-height: 1.1; }
.nametag-sub { font-family: Silkscreen, monospace; font-size: 11px; letter-spacing: 0.05em; color: var(--gold); }

/* ---- close-up panels ---- */
.panel {
  position: absolute; right: 24px; top: 24px; bottom: 152px; width: calc(44% - 48px);
  background: var(--panel); color: var(--panelInk); border: 4px solid var(--frame); box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.4);
  overflow: auto; display: flex; flex-direction: column;
  animation: panelIn 0.4s steps(6) 0.6s both;
}
.panel[hidden] { display: none; }
/* the panels' own scroll bars, squared off in the HUD's colors where the browser allows it */
.panel { scrollbar-width: thin; scrollbar-color: var(--hudLine) var(--panel); }
.panel::-webkit-scrollbar { width: 10px; }
.panel::-webkit-scrollbar-track { background: var(--panel); }
.panel::-webkit-scrollbar-thumb { background: var(--hudLine); border: 2px solid var(--panel); }
.panel:focus { outline: none; }
@keyframes panelIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@media (max-width: 759px) { .panel { left: 12px; right: 12px; width: auto; top: 37%; bottom: calc(var(--hud-h, 236px) + 12px); } }

.panel-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; background: var(--hud); color: var(--hudInk); }
.panel-head h2 { margin: 0; font-family: Silkscreen, monospace; font-weight: 400; font-size: 14px; letter-spacing: 0.05em; }
.back-btn { min-height: 44px; padding: 0 12px; background: var(--gold); color: #1D251C; border: 0; font-family: Silkscreen, monospace; font-size: 12px; }
.panel-body { flex: 1 0 auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.panel-body p { margin: 0; }

/* scroll hint: a fade and a chip pinned to the panel's bottom edge while there's more below */
.more {
  position: sticky; bottom: 0; flex: none; height: 64px; margin-top: -64px;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px;
  background: linear-gradient(180deg, transparent, var(--panel) 75%);
  pointer-events: none; opacity: 0; transition: opacity 0.2s steps(3);
}
.more span { padding: 4px 10px; background: var(--hud); color: var(--hudInk); font-family: Silkscreen, monospace; font-size: 11px; letter-spacing: 0.05em; }
.panel.can-scroll .more { opacity: 1; }
.panel.can-scroll .more span { animation: nudge 1.2s steps(2) infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }
/* the narrator flinches when a cactus pricks you */
.ouch { animation: shake 0.3s steps(3) 1; }
/* the neighbor bangs on the wall */
.shake { animation: shake 0.36s steps(3) 2; }
@keyframes shake { 33% { transform: translate(2px, 1px); } 66% { transform: translate(-2px, -1px); } }

/* bookshelf */
.books { display: flex; align-items: flex-end; gap: 4px; padding: 0 10px; overflow-x: auto; }
.spine { flex: 0 0 auto; width: 30px; padding: 0; border: 0; box-shadow: inset -4px 0 0 rgba(0, 0, 0, 0.2); display: flex; align-items: center; justify-content: center; }
.spine-next { height: 140px; background: var(--panel); color: var(--panelMuted); border: 2px dashed var(--panelMuted); box-shadow: none; }
.spine span { writing-mode: vertical-rl; transform: rotate(180deg); font-family: Silkscreen, monospace; font-size: 10px; white-space: nowrap; }
.plank { height: 10px; background: #8A5A34; box-shadow: 0 5px 0 #5E3A1E; }
.book-read { display: flex; flex-direction: column; gap: 8px; min-height: 172px; }
/* Book details in the legible body font; only spines and titles are stylized. */
.book-kicker { font-size: 15px; font-weight: 700; color: var(--panelMuted); }
.book-nav { display: flex; gap: 8px; }
.book-step { flex: 1 1 0; min-height: 44px; background: var(--hud); color: var(--hudInk); border: 0; font-family: Silkscreen, monospace; font-size: 12px; }
/* the map's own way out, next to its stepping buttons */
.map-nav { flex-wrap: wrap; }
.map-back { background: var(--gold); color: #1D251C; }
@media (max-width: 759px) { .map-back { flex-basis: 100%; } }
.book-step:disabled { opacity: 0.35; cursor: default; transform: none !important; }

/* the big title in a close-up's readout (books, the map, the library) */
.station-title { font-family: 'Pixelify Sans', monospace; font-weight: 700; font-size: 24px; line-height: 1.2; }

/* world map */
.panel-wide { left: 24px; width: auto; }
.map-body { gap: 14px; }
/* as big as fits above the caption without scrolling */
.atlas-wrap { position: relative; align-self: center; width: min(100%, calc((100vh - 390px) * 2.75)); }
.atlas { display: block; width: 100%; height: auto; image-rendering: pixelated; border: 6px solid #784C2A; box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3); background: #96BAC4; touch-action: manipulation; }
.atlas-tip { position: absolute; transform: translate(-50%, calc(-100% - 12px)); padding: 3px 8px; background: var(--hud); color: var(--hudInk); font-family: Silkscreen, monospace; font-size: 11px; white-space: nowrap; pointer-events: none; }
.atlas-tip.below { transform: translate(-50%, 14px); }
.map-foot { display: flex; flex-direction: column; gap: 12px; }
.place-out { display: flex; flex-direction: column; gap: 6px; min-height: 64px; }
@media (min-width: 760px) {
  .map-foot { flex-direction: row; align-items: center; gap: 24px; }
  .place-out { flex: 1 1 auto; }
  .map-nav { flex: 0 0 540px; }
}
/* phones: the map keeps its size and scrolls sideways, under a pixel scroll bar of our own (the native one hides) */
.atlas-bar { position: relative; height: 14px; margin-top: -4px; background: var(--panel); border: 3px solid var(--frame); touch-action: none; cursor: pointer; }
.atlas-bar[hidden] { display: none; }
.atlas-bar span { position: absolute; top: 0; bottom: 0; left: 0; background: var(--gold); box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.25); }
@media (max-width: 759px) {
  .atlas-wrap { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .atlas-wrap::-webkit-scrollbar { display: none; }
  .atlas { width: auto; height: 220px; max-width: none; image-rendering: auto; border-width: 4px; }
}

/* bedroom bookshelf: genre tabs over rows of spines, each row on a plank */
.lib-body { gap: 14px; }
.genres { display: flex; flex-wrap: wrap; gap: 6px; }
.genre { min-height: 40px; padding: 0 10px; display: flex; align-items: center; gap: 8px; background: var(--hud); color: var(--hudInk); border: 0; font-family: Silkscreen, monospace; font-size: 11px; }
.genre-n { color: var(--gold); }
.genre[aria-pressed="true"] { background: var(--gold); color: #1D251C; }
.genre[aria-pressed="true"] .genre-n { color: #1D251C; }
.subgenres { margin-top: -6px; }
.subgenre { min-height: 34px; padding: 0 8px; display: flex; align-items: center; gap: 6px; background: var(--panel); color: var(--panelInk); border: 2px solid var(--hud); font-family: Silkscreen, monospace; font-size: 10px; }
.subgenre[hidden] { display: none; }
.subgenre .genre-n { color: var(--panelMuted); }
.subgenre[aria-pressed="true"] { background: var(--hud); color: var(--hudInk); }
.subgenre[aria-pressed="true"] .genre-n { color: var(--gold); }
/* a label card standing between subcategories when the whole category is on the shelf */
.lib-divider { flex: none; width: 18px; height: var(--row); margin: 0 3px; display: flex; align-items: flex-end; }
.lib-divider span { width: 100%; max-height: 100%; padding: 8px 0; display: flex; align-items: center; justify-content: center; background: #2E2B28; color: var(--gold); writing-mode: vertical-rl; transform: rotate(180deg); font-family: Silkscreen, monospace; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-shelf {
  --row: 190px; --gap: 16px;
  display: flex; flex-wrap: wrap; gap: var(--gap) 3px; padding: 0 10px var(--gap);
  background: repeating-linear-gradient(180deg, transparent 0 var(--row), #8A5A34 var(--row) calc(var(--row) + 10px), #5E3A1E calc(var(--row) + 10px) calc(var(--row) + var(--gap)));
}
.lib-spine { flex: 0 0 auto; height: var(--row); padding: 0; border: 0; background: none; display: flex; align-items: flex-end; }
.lib-face { width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: inset -4px 0 0 rgba(0, 0, 0, 0.2); }
.lib-face span { writing-mode: vertical-rl; transform: rotate(180deg); font-family: Silkscreen, monospace; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: calc(100% - 10px); }
.lib-spine[aria-pressed="true"] .lib-face { transform: translateY(-10px); outline: 3px solid var(--gold); }
@media (hover: hover) { .lib-spine:hover { transform: none; } .lib-spine:hover .lib-face { transform: translateY(-6px); } }
@media (max-width: 759px) {
  .genres { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px; }
  .genres::-webkit-scrollbar { display: none; }
  .genre { flex: none; }
  /* one row that scrolls sideways, so the picked book's details stay in view */
  .lib-shelf { --row: 150px; flex-wrap: nowrap; overflow-x: auto; margin: 0 -18px; padding: 12px 18px var(--gap); background-position: 0 12px; background-attachment: local; scrollbar-width: thin; scrollbar-color: var(--hudLine) var(--panel); }
  .lib-shelf::after { content: ""; flex: 0 0 8px; }
  /* Previous / Next stay pinned to the bottom of the panel, so they're never below the fold or under the fade */
  #panel-bshelf .map-foot { display: contents; }
  #panel-bshelf .map-nav { position: sticky; bottom: 0; z-index: 2; margin: 0 -18px -18px; padding: 10px 18px 12px; background: var(--panel); border-top: 2px solid var(--hudLine); }
  #panel-bshelf .more { display: none; }
  #panel-bshelf .place-out { scroll-margin-bottom: 72px; }
}

/* recipe box: a faded, folded printout of a web recipe, with a coffee ring */
.recipe-body { gap: 16px; padding-bottom: 24px; }
.printout {
  position: relative; overflow: hidden; padding: 12px 18px 16px; transform: rotate(-1deg);
  background: linear-gradient(180deg, transparent 32.5%, rgba(120, 104, 70, 0.18) 33%, transparent 34%, transparent 65.5%, rgba(120, 104, 70, 0.18) 66%, transparent 67%),
    radial-gradient(ellipse at 50% 40%, #F3EEDF 40%, #E6DCC0 100%);
  color: #7C7A72; box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.3); display: flex; flex-direction: column; gap: 8px;
}
.printout-head, .printout-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: #A29E92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.printout-head span:first-child { overflow: hidden; text-overflow: ellipsis; }
.printout-kicker { margin-top: 6px !important; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #9C948A; }
.printout-title { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: 26px; line-height: 1.15; color: #5E5A52; }
.printout-lines { display: flex; flex-direction: column; gap: 7px; margin: 6px 0 4px; }
.printout-lines span { height: 6px; background: #C9C3B4; opacity: 0.75; }
.printout-lines span:nth-child(3n) { width: 72%; } .printout-lines span:nth-child(4n+1) { width: 88%; } .printout-lines span:nth-child(5) { width: 40%; margin-bottom: 8px; }
.printout-ring { position: absolute; right: 22px; bottom: 36px; width: 74px; height: 74px; border-radius: 50%; border: 5px solid rgba(132, 92, 52, 0.22); border-left-color: rgba(132, 92, 52, 0.12); pointer-events: none; }
.recipe-link { align-self: flex-start; min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; background: var(--hud); color: var(--hudInk); font-family: Silkscreen, monospace; font-size: 12px; text-decoration: none; }

/* the back of the Dodgers pennant: blue felt with a printed-out meme taped on, a little crooked */
.pennant-body { padding: 22px 18px 28px; }
.pennant-back { background: repeating-linear-gradient(135deg, #1A54A4 0 3px, #12428A 3px 4px); padding: 26px 20px 30px; box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.3); }
.meme { position: relative; margin: 0 auto; max-width: 420px; padding: 8px; background: #F6F4EE; transform: rotate(-1.5deg); box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.35); }
.meme img { display: block; width: 100%; height: auto; filter: contrast(0.92) saturate(0.85); }
.tape { position: absolute; top: -9px; width: 64px; height: 20px; background: rgba(236, 226, 190, 0.78); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12); }
.tape-l { left: -14px; transform: rotate(-32deg); }
.tape-r { right: -14px; transform: rotate(28deg); }

/* the computer: its green phosphor screen, with the side project on the disk */
.apple-body { padding: 22px 18px 28px; }
.crt { background: #0C1A10; border: 10px solid #CCC2A6; border-radius: 6px; box-shadow: inset 0 0 24px rgba(70, 222, 112, 0.18), 5px 5px 0 rgba(0, 0, 0, 0.3); padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.crt-line { margin: 0; font-family: Silkscreen, monospace; font-size: 14px; letter-spacing: 0.06em; color: #46DE70; text-shadow: 0 0 6px rgba(70, 222, 112, 0.55); }
.crt-dim { color: #2C9650; }
.crt-link { align-self: flex-start; margin: 6px 0; padding: 8px 12px; border: 2px solid #46DE70; color: #46DE70; font-family: Silkscreen, monospace; font-size: 15px; letter-spacing: 0.05em; text-decoration: none; text-shadow: 0 0 6px rgba(70, 222, 112, 0.55); }
@media (hover: hover) { .crt-link:hover { background: #46DE70; color: #0C1A10; text-shadow: none; } }
.crt-link:focus-visible { outline: 3px solid #E2BF5E; outline-offset: 3px; }
.crt-cursor { display: inline-block; width: 9px; height: 14px; margin-left: 2px; vertical-align: -2px; background: #46DE70; animation: crtBlink 1.2s steps(1) infinite; }
@keyframes crtBlink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .crt-cursor { animation: none; } }

/* Rolodex */
.contact-body { padding-bottom: 24px; gap: 14px; }
.rolodex { position: relative; padding-top: 22px; }
.rolodex-tab { position: absolute; top: 0; left: 18px; padding: 2px 12px 0; background: #6E9CB8; color: #F1E8CC; font-family: Silkscreen, monospace; font-size: 11px; }
.rolodex-back { position: absolute; top: 14px; left: 8px; right: -6px; height: 100%; background: #CDBE90; }
.card {
  position: relative; background: #F1E8CC; color: #1D251C; padding: 16px 20px 20px; box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.3);
  background-image: repeating-linear-gradient(180deg, transparent 0 31px, #C9D4C0 31px 32px); background-position: 0 50px;
  display: flex; flex-direction: column; gap: 4px;
}
.card-name { margin: 0; font-family: 'Pixelify Sans', monospace; font-weight: 700; font-size: 24px; line-height: 1.2; color: #A63C24; }
.card-role { margin: 0 0 10px !important; font-family: Silkscreen, monospace; font-size: 13px; letter-spacing: 0.06em; color: #1D251C; }
.card-row { display: flex; flex-wrap: wrap; gap: 2px 12px; min-height: 32px; align-items: baseline; }
.card-k { flex: 0 0 88px; font-family: Silkscreen, monospace; font-size: 11px; color: #465643; }
.card-v { font-size: 17px; color: #1D251C; text-underline-offset: 3px; }

/* ---- HUD / narrator ---- */
.hud { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: stretch; padding: 12px 14px; }
.narrator { flex: 3 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 4px; min-height: 76px; }
.action { font-family: Silkscreen, monospace; font-size: 12px; letter-spacing: 0.05em; color: var(--gold); }
.say { margin: 0; font-family: 'Pixelify Sans', monospace; font-size: 19px; line-height: 1.35; }
.caret { color: var(--gold); }
.inv { flex: 2 1 280px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; align-content: center; }
.inv-btn { min-height: 40px; padding: 4px 6px; background: var(--invBg); color: var(--hudInk); border: 2px solid var(--hudLine); font-family: Silkscreen, monospace; font-size: 11px; }
.inv-btn.on { background: var(--invOn); color: #1D251C; }
.inv-btn[hidden] { display: none; }
/* At the door: two wide buttons over the same two rows, so the HUD keeps its height going in */
.inv-hall { grid-column: 1 / -1; }
/* Floor plan: the rooms as a little blueprint beside the menu, walls between them with doorways cut
   through toward the front, a window in the far wall of each room (the one its scene faces) where it is in the scene, and the front door (with
   its swing) in the living room's bottom wall. Kitchen, living room, bedroom, left to right; the
   room you're in is outlined in gold. */
.plan { position: relative; flex: 0 0 172px; min-height: 86px; display: flex; gap: 3px; background: #0E120D; border: 3px solid #0E120D; box-shadow: 0 0 0 2px var(--hudLine); }
.plan[hidden] { display: none; }
.plan-room { position: relative; flex: 1 1 0; min-width: 0; padding: 0; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.plan-label { padding: 1px 3px; background: rgba(14, 18, 13, 0.82); color: var(--hudInk); font-family: Silkscreen, monospace; font-size: 9px; letter-spacing: 0.02em; text-align: center; line-height: 1.2; }
.plan-living { flex-grow: 1.5; background: radial-gradient(circle, #4F6A4B 1px, transparent 1.5px) 0 0 / 4px 4px, #2E3D2C; }
.plan-bedroom { background: repeating-linear-gradient(90deg, #B08052 0 7px, #8A5E36 7px 8px); }
.plan-kitchen { background: conic-gradient(#3A5446 25%, #E4DCC4 0 50%, #3A5446 0 75%, #E4DCC4 0) 0 0 / 8px 8px; }
/* doorways: a gap in each wall the living room shares, and the front door in its bottom wall */
.plan-living::before, .plan-living::after { content: ""; position: absolute; top: calc(66% - 6px); width: 3px; height: 12px; background: #C9B48A; z-index: 1; }
.plan-living::before { left: -3px; }
.plan-living::after { right: -3px; }
.plan-living:first-child::before { display: none; }
.plan-door-front { position: absolute; bottom: -3px; left: calc(50% - 6px); width: 12px; height: 3px; background: var(--gold); pointer-events: none; }
.plan-swing { position: absolute; bottom: 0; left: calc(50% - 6px); width: 11px; height: 11px; border-top: 1px dotted var(--gold); border-right: 1px solid var(--gold); border-top-right-radius: 11px; pointer-events: none; }
/* windows: glass in the wall, pale blue with a sash line */
.plan-win { position: absolute; pointer-events: none; }
.plan-win-top { top: -3px; height: 3px; background: linear-gradient(180deg, #EAF6FA 0 1px, #8EC3D6 1px 2px, #EAF6FA 2px); }
.plan-win-left, .plan-win-right { width: 3px; background: linear-gradient(90deg, #EAF6FA 0 1px, #8EC3D6 1px 2px, #EAF6FA 2px); }
.plan-win-left { left: -3px; }
.plan-win-right { right: -3px; }
.plan-room.on { box-shadow: inset 0 0 0 2px var(--gold); }
.plan-room.on .plan-label { background: var(--gold); color: #1D251C; }
@media (hover: hover) { .plan-room:not(.on):hover { filter: brightness(1.18); } }
.plan-room:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; z-index: 1; }
/* the day/night switch in the narrator's corner */
.narrator { position: relative; }
.daynight { position: absolute; top: -4px; right: 0; min-height: 30px; padding: 0 10px; background: var(--invBg); color: var(--hudInk); border: 2px solid var(--hudLine); font-family: Silkscreen, monospace; font-size: 11px; }
.daynight[aria-checked="true"] { color: var(--gold); }
.daynight[hidden] { display: none; }
.has-plan .action { padding-right: 100px; }
.has-plan .inv { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Fade between rooms */
.fade { position: absolute; inset: 0; background: #0A0E0A; opacity: 0; pointer-events: none; transition: opacity 0.34s steps(4); }
.fading .fade { opacity: 1; }

/* Phones: smaller name tag and a steady-height narrator, so the room doesn't shift as lines change length. */
@media (max-width: 759px) {
  .nametag { left: 12px; top: 12px; padding: 8px 12px; }
  .nametag-name { font-size: 19px; }
  .nametag-sub { font-size: 10px; }
  .hud { left: 12px; right: 12px; bottom: 12px; padding: 10px 12px; }
  .narrator { flex-basis: 100%; min-height: 112px; }
  .say { font-size: 17px; }
  /* the floor plan becomes a strip across the menu, its three rooms in a row, over the buttons */
  .plan { flex-basis: 100%; min-height: 40px; }
  .has-plan .inv { flex-basis: 100%; }
  .has-plan .narrator { min-height: 92px; }
  /* An open panel gets the whole lower screen; it has its own way back. */
  .panel-open .hud { display: none; }
  .panel-open .panel { bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .ready .cam { transition: none; }
  .panel { animation: none; }
  .more, .more span { transition: none; animation: none; }
}

/* ---- text version: the whole page without JS (and for crawlers); the room replaces it when JS runs ---- */
.text-version {
  max-width: 640px; margin: 0 auto; padding: 48px 20px 64px;
  background: #EEF0E2; color: #1D251C; font-family: 'Atkinson Hyperlegible', system-ui, sans-serif; font-size: 18px; line-height: 1.6;
}
.text-version h1 { font-family: 'Pixelify Sans', monospace; font-size: 36px; line-height: 1.1; margin: 0 0 4px; }
.text-version h2 { font-family: Silkscreen, monospace; font-weight: 400; font-size: 16px; letter-spacing: 0.05em; margin: 36px 0 8px; }
.text-version .sub { font-family: Silkscreen, monospace; font-size: 13px; color: #465643; margin: 0; }
.text-version a { color: #1D251C; text-underline-offset: 3px; }
html:not(.js) body { background: #EEF0E2; }
.js .text-version { display: none; }
