:root {
  color-scheme: dark;
  --ink: #f5e8d1;
  --muted: #c2b19a;
  --gold: #efbd82;
  --line: #ffffff21;
  --panel: #211b19;
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: #161414;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: radial-gradient(ellipse at 68% 32%, #312320 0%, #171414 68%); }
button, a, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid #ffd69e; outline-offset: 4px; }
button:disabled { cursor: default; }
h1, h2, p, figure { margin: 0; }
h2 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 14px; border: 1px solid #efbd82; border-radius: 40px; padding: .8rem 1.1rem; color: #281b16; background: #efbd82; font-weight: 650; }
.primary:hover { background: #f9d1a2; }
.primary:disabled { opacity: .58; }
.room-viewport { display: flex; align-items: center; width: 100%; height: 100dvh; overflow-x: auto; overflow-y: hidden; overscroll-behavior: contain; scrollbar-width: none; }
.room-viewport::-webkit-scrollbar { display: none; }
.room { position: relative; flex: 0 0 auto; width: max(100%, 150dvh); aspect-ratio: 3 / 2; isolation: isolate; background: #141518; }
.room[data-period="morning"] { --room-light: brightness(1.12) saturate(.63) hue-rotate(7deg); --window-light: #bfd9f166; --lamp-shadow: .61; --lamp-glow: .26; }
.room[data-period="afternoon"] { --room-light: brightness(.91) saturate(.86) sepia(.12); --window-light: #ffb6774f; --lamp-shadow: .73; --lamp-glow: .52; }
.room[data-period="night"] { --room-light: brightness(.31) saturate(.49) hue-rotate(7deg); --window-light: #8ca5c42e; --lamp-shadow: .94; --lamp-glow: .82; }
.room[data-period="night"].lamp-lit { --room-light: brightness(.48) saturate(.72); }
.room-art { position: absolute; inset: 0; isolation: isolate; filter: var(--room-light); transition: filter .65s ease; }
.room-photo { width: 100%; height: 100%; display: block; object-fit: fill; }
.room-view { position: absolute; overflow: hidden; top: 8%; left: 40.55%; width: 25.55%; height: 33.65%; opacity: .88; clip-path: polygon(0 0,100% 0,100% 100%,57.5% 100%,57.5% 1%,47% 1%,47% 100%,42.5% 100%,39% 87%,21% 87%,17% 100%,0 100%); }
.panorama-art { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 52%; }
.room-view .panorama-art { position: absolute; left: 14.5%; width: 71%; object-position: center 58%; }
.room[data-period="night"] .room-view { filter: brightness(1.9); }
.room-view::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 12px #1c1810; background: #100e1527; }
.room-finishes, .room-finishes i { position: absolute; inset: 0; pointer-events: none; }
.wall-tone, .bed-tone, .curtain-tone { mix-blend-mode: color; }
.wall-tone { background: var(--wall-tone, #957957); opacity: .43; }
.wall-left { clip-path: polygon(8.95% 0,28.5% 0,28.5% 47.8%,33% 48.8%,33% 52.3%,24% 52.3%,18% 53.8%,14.8% 60.5%,8.95% 65%); }
.wall-right { clip-path: polygon(77% 0,100% 0,100% 50.3%,85.3% 50.3%,85.3% 38.2%,77% 38.2%); }
.bed-tone { background: var(--bed-tone, #6d8190); opacity: .73; clip-path: polygon(8.9% 65.2%,13% 61.2%,16.4% 58.2%,18.3% 54.3%,21.6% 52.7%,28.3% 52.6%,34.2% 54%,36.8% 56.9%,36.2% 59.4%,37.2% 72.2%,36.45% 76.4%,36.05% 81%,35.55% 86%,34.9% 90.5%,34.05% 94%,33.4% 97.9%,27.7% 97.7%,23.3% 94.1%,9.1% 88.4%); }
.room-finishes .curtain-fold {
  inset: auto;
  top: 2.8%;
  height: 46.5%;
  background: center / 100% 100% no-repeat;
}
.room-finishes .fold-left {
  left: 37.35%;
  width: 11.55%;
  background-image: url("assets/curtain-left.jpg");
  clip-path: polygon(0 0,95% 0,93% 29%,96% 58%,100% 82%,98% 98%,28% 100%,0 97%);
}
.room-finishes .fold-right {
  left: 58%;
  width: 10.3%;
  background-image: url("assets/curtain-right.jpg");
  clip-path: polygon(1% 0,100% 0,100% 98%,0 100%,5% 80%,1% 55%,4% 23%);
}
.curtain-tone { background: var(--curtain-tone, #936740); opacity: .76; }
.curtain-left { clip-path: polygon(30.4% 2.8%,48.35% 2.8%,48.2% 15%,48.55% 28%,48.9% 40%,48.75% 48.6%,40% 49.2%,37.8% 48%,28.9% 49.8%,29.4% 34%); }
.curtain-right { clip-path: polygon(58.1% 3%,75.65% 3%,76.1% 27%,76.15% 38.15%,73.36% 38.15%,73.36% 49.35%,58% 49.5%,58.55% 40%,58.15% 26%,58.4% 12%); }
.lamp-foreground { background: url("assets/room.jpg") center / 100% 100% no-repeat; clip-path: polygon(45.65% 38.05%,46% 37.7%,50.35% 37.7%,51.6% 45.4%,51.57% 46.25%,48.7% 46.7%,48.85% 47.5%,49% 49.25%,47.3% 49.25%,47.65% 47.3%,47.7% 46.6%,44.4% 46.22%,44.5% 45.1%); filter: brightness(.47) saturate(.57); transition: filter .45s ease; }
.lamp-lit .lamp-foreground { filter: none; }
.room[data-period="night"].lamp-lit .lamp-foreground { filter: brightness(1.7); }
.light-from-window, .lamp-shadow, .lamp-pool { position: absolute; inset: 0; pointer-events: none; transition: opacity .55s ease, background .55s ease; }
.light-from-window { mix-blend-mode: screen; background: radial-gradient(ellipse 48% 71% at 53% 24%, var(--window-light), transparent 91%); }
.lamp-shadow { mix-blend-mode: multiply; opacity: var(--lamp-shadow); background: radial-gradient(ellipse 16% 17% at 48% 49%, #4f4747 0%, #847872 38%, transparent 100%); }
.lamp-lit .lamp-shadow { opacity: 0; }
.lamp-pool { mix-blend-mode: screen; opacity: 0; background: radial-gradient(ellipse 24% 29% at 48% 47%, #f092417d 0%, #be672e26 55%, transparent 95%); }
.lamp-lit .lamp-pool { opacity: var(--lamp-glow); }
.wall-picture {
  position: absolute;
  left: 87.6%;
  top: 28.5%;
  width: 10.1%;
  aspect-ratio: 1.31;
  padding: clamp(4px, .56vw, 9px);
  border: 1px solid #6c4a2d;
  background: linear-gradient(152deg, #714324, #442610 48%, #2d1609);
  box-shadow: .14rem .33rem .56rem #12090791, inset 0 0 0 2px #492713;
  transform: rotate(var(--picture-tilt, -8deg));
  transform-origin: 50% 5%;
  transition: transform .43s cubic-bezier(.36, .12, .34, 1.19);
}
.wall-picture-art { position: relative; overflow: hidden; width: 100%; height: 100%; box-shadow: 0 0 0 1px #2b190a; background: #573d25; }
.still-life { display: block; width: 100%; height: 100%; object-fit: cover; }
.orange-roll {
  position: absolute;
  left: var(--orange-x, 29%);
  top: 63.5%;
  width: 21%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  transition: left .76s cubic-bezier(.47, .06, .34, .94) .13s;
}
.orange-roll::before { content: ""; position: absolute; inset: auto 2% -2% 5%; height: 20%; border-radius: 50%; background: #3924108c; filter: blur(1.3px); }
.orange-roll img { display: block; width: 100%; height: 100%; object-fit: contain; transform: rotate(var(--orange-spin, 0deg)); transition: transform .76s cubic-bezier(.47, .06, .34, .94) .13s; }
.hotspot { display: grid; place-items: center; position: absolute; inset: var(--area); z-index: 2; padding: 0; background: transparent; border: 0; border-radius: 12px; cursor: pointer; }
.hotspot[hidden] { display: none; }
.hotspot::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffe4bf;
  box-shadow: 0 0 0 3px #20130e73, 0 0 8px #f4cb92b3;
  opacity: 0;
  transition: opacity .2s ease;
}
.show-hints .hotspot::before { opacity: .68; }
.show-hints .hotspot:is(:hover, :focus-visible)::before { opacity: 0; }
.hotspot > span { pointer-events: none; white-space: nowrap; padding: .35rem .65rem; border: 1px solid #f7d8a969; border-radius: 999px; background: #231916df; color: var(--ink); font-size: .875rem; opacity: 0; transform: translateY(3px); transition: opacity .16s ease, transform .16s ease; }
.hotspot:focus-visible { outline-offset: -4px; }
.hotspot:focus-visible > span { opacity: 1; transform: none; }
@media (hover: hover) {
  .hotspot:hover > span { opacity: 1; transform: none; }
}
.hot-door { --area: 3% 91% 4% 0%; }
.hot-window { --area: 5% 42% 62.5% 48.9%; }
.hot-bed { --area: 52% 62% 4% 9%; }
.hot-desk { --area: 52% 32% 28% 39%; }
.hot-desk::before { top: 23%; }
.hot-book { --area: 51% 34.8% 43.8% 57.8%; z-index: 3; }
.hot-lamp { --area: 37.6% 48.35% 46.1% 44.35%; z-index: 3; }
.hot-lamp > span { position: absolute; left: 53%; top: 50%; }
.hot-tv { --area: 38% 14.5% 49.5% 73%; }
.hot-cabinet { --area: 51% 14.5% 22% 72%; }
.hot-picture { --area: 26.1% .9% 57.8% 86%; }
.hot-wash { --area: 51% 1% 22% 86%; }
.room-controls { position: fixed; z-index: 3; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); display: flex; gap: 6px; }
.room-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .34rem;
  border: 1px solid #e8cda53d;
  border-radius: 30px;
  min-height: 36px;
  background: #211914cc;
  color: #efdfc8;
  padding: .32rem .62rem;
  font-size: .875rem;
}
.room-control:hover, .room-control:focus-visible { background: #39291f; }
.room-control > span { position: relative; font-size: 1rem; line-height: 1; }
#toggle-hints > span { color: #f0bc86; font-size: 1.6rem; }
.room-control[aria-pressed="false"] > span { opacity: .68; }
.room-control[aria-pressed="false"] > .sound-symbol::after { content: ""; position: absolute; width: .68rem; height: 1px; background: currentColor; top: 50%; left: -.05rem; transform: rotate(-42deg); }
.pan-control { position: fixed; z-index: 3; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 33px; height: 39px; padding: 0 0 .11rem; border: 1px solid #e8cda53d; border-radius: 40px; background: #211914b0; color: var(--ink); font-size: 1.55rem; opacity: .7; }
.pan-control:hover, .pan-control:focus-visible { opacity: 1; }
.pan-control[hidden] { display: none; }
.pan-left { left: 8px; }
.pan-right { right: 8px; }

body:has(dialog[open]) { overflow: hidden; }
dialog { padding: 0; width: min(760px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; border-radius: 20px; border: 1px solid #efbd8257; background: var(--panel); color: var(--ink); box-shadow: 0 32px 100px #000b; }
dialog::backdrop { background: #100d0de5; backdrop-filter: blur(7px); }
.scene-card { padding: 23px; }
.scene-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.scene-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.scene-header h2 { font-size: clamp(1.65rem, 4vw, 2.45rem); line-height: 1.05; }
.small-button, .drive-controls button { border: 1px solid var(--line); min-height: 40px; border-radius: 10px; background: #382a25; color: var(--ink); padding: .45rem .7rem; font-size: .875rem; }
.small-button:hover, .drive-controls button:hover { border-color: #efbd8299; background: #4a352b; }
.scene-note { color: var(--muted); font-size: .95rem; line-height: 1.5; margin-top: 12px; }
.window-scene { width: min(100%, 510px); height: min(77dvh, 680px); margin: auto; }
.window-scene .panorama-art { object-fit: contain; }
dialog:is([data-scene="bed"], [data-scene="window"], [data-scene="tv"], [data-scene="cabinet"]) .scene-header h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
dialog:is([data-scene="bed"], [data-scene="window"], [data-scene="tv"], [data-scene="cabinet"]) .scene-header { justify-content: flex-end; }
dialog[data-scene="window"] { background: #110f0d; }

dialog:is([data-scene="bed"], [data-scene="cabinet"]) { inset: 0; width: 100%; height: 100dvh; max-height: none; max-width: none; margin: 0; border: 0; border-radius: 0; overflow: hidden; }
dialog:is([data-scene="bed"], [data-scene="cabinet"]) .scene-card { padding: 0; }
dialog:is([data-scene="bed"], [data-scene="cabinet"]) .scene-header { position: absolute; z-index: 2; right: max(16px, env(safe-area-inset-right)); top: max(16px, env(safe-area-inset-top)); margin: 0; }
dialog:is([data-scene="bed"], [data-scene="cabinet"]) .small-button { background: #201710dc; }

.cabinet-view {
  --crossing: 1.05s;
  position: relative;
  isolation: isolate;
  height: 100dvh;
  overflow: hidden;
  background: #231016 url("assets/cabinet-room-chevron.jpg") center / cover no-repeat;
  animation: cabinet-arrive .66s ease-out both;
}
@keyframes cabinet-arrive { from { opacity: 0; transform: scale(1.055); } to { opacity: 1; transform: none; } }
.cabinet-chair {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 23%;
  width: clamp(150px, 30vmin, 320px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  pointer-events: none;
}
.cabinet-chair::before { content: ""; position: absolute; inset: auto -2% -2% -2%; height: 14%; background: radial-gradient(ellipse, #180a0bd9, #16090b84 43%, transparent 73%); }
.cabinet-chair img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; opacity: 0; filter: grayscale(1) brightness(.47); transform: scaleX(.91); transform-origin: center bottom; transition: opacity .26s ease .55s, transform .34s ease .52s; }
.cabinet-view[data-pose="0"] .cabinet-chair img:nth-child(1),
.cabinet-view[data-pose="1"] .cabinet-chair img:nth-child(2),
.cabinet-view[data-pose="2"] .cabinet-chair img:nth-child(3),
.cabinet-view[data-pose="3"] .cabinet-chair img:nth-child(4) { opacity: 1; transform: none; }
.cabinet-advance { --area: 10% 12% 44% 12%; z-index: 3; }
.cabinet-advance:focus-visible { outline: none; }
.cabinet-advance:focus-visible > span, .cabinet-exit:focus-visible > span { outline: 1px solid #ffd69e; outline-offset: 3px; }
.cabinet-view[data-passing] .cabinet-advance { opacity: 0; pointer-events: none; }
.cabinet-exit {
  --area: 19% auto auto 61%;
  z-index: 1;
  height: 39%;
  width: clamp(62px, 8.5vw, 128px);
  transform: translateX(-50%);
  border: 1px solid #d5a981ad;
  border-radius: 41% 15% 11% 22% / 5% 4% 5% 4%;
  background: linear-gradient(90deg, #26131570, transparent 70%, #2513167a), url("assets/room.jpg") 67% 81% / auto 153% no-repeat;
  box-shadow: inset 12px 0 25px #21101d94, 0 0 30px #fac18c44;
  animation: cabinet-reveal .6s ease-out both;
}
@keyframes cabinet-reveal { from { opacity: 0; transform: translateX(-50%) scaleX(.22); } to { opacity: 1; transform: translateX(-50%); } }
.cabinet-veil { position: absolute; z-index: 4; inset: 0; overflow: hidden; pointer-events: none; }
.cabinet-veil span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 51%;
  transform: translateX(-102%);
  box-shadow: 0 0 30px #100308aa;
  background: linear-gradient(180deg, #14050a4d, transparent 24%, #160a158a), url("assets/cabinet-fabric.jpg") center / cover;
}
.cabinet-veil span + span { inset: 0 0 0 auto; transform: translateX(102%); }
.cabinet-view[data-passing] .cabinet-veil span { animation: cabinet-cross var(--crossing) cubic-bezier(.44,.07,.37,.98) both; }
@keyframes cabinet-cross { 38%, 50% { transform: translateX(0); } }

dialog[data-scene="book"] #scene-body { position: relative; }
.book-spread {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 5px 5px 6px;
  border-radius: 9px;
  background: #5a3928;
  box-shadow: 0 10px 24px #100902a6;
}
.book-page {
  display: grid;
  place-items: center;
  min-height: clamp(210px, 37vh, 360px);
  padding: 24px clamp(13px, 3.8vw, 52px) 45px;
  border-radius: 4px 2px 3px 4px;
  background: linear-gradient(90deg, #f1dfbf 83%, #c4a682);
  color: #402b21;
  font: clamp(1rem, 2.4vw, 1.36rem)/1.52 Georgia, serif;
}
.book-page + .book-page { border-radius: 2px 4px 4px 3px; background: linear-gradient(90deg, #c4a682, #f1dfbf 17%); }
.book-corners { position: absolute; inset: auto 8px 8px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.book-progress { color: #664a38; font: .78rem Georgia, serif; font-variant-numeric: tabular-nums; }
.book-corners button { pointer-events: auto; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #674333; font-size: 1.85rem; }
.book-corners button:hover:not(:disabled) { background: #7c513525; }
.book-corners button:focus-visible { outline: 1px solid #76503a; outline-offset: -4px; }
.book-corners button:disabled { visibility: hidden; }

.dream-view { position: relative; height: 100dvh; overflow: hidden; isolation: isolate; background: #080612; }
.dream-ceiling, .dream-tunnel, .dream-vignette, .dream-veil, .dream-halves { position: absolute; inset: 0; width: 100%; height: 100%; }
.dream-ceiling { object-fit: cover; }
.dream-tunnel { display: block; opacity: 1; transition: opacity .55s ease; }
.dream-tunnel:focus-visible { outline: 1px solid #e6cd935d; outline-offset: -5px; }
.dream-vignette { pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 38%, #09071329 76%, #0907137a 100%); }
.dream-veil { opacity: 0; background: #0a070d; pointer-events: none; transition: opacity .65s ease; }
.dream-view[data-stage="entering"] .dream-tunnel, .dream-view[data-stage="entering"] .dream-vignette { opacity: 0; }
.dream-view[data-stage="entering"] .dream-veil { animation: dream-blink 1s ease-in both; }
.dream-view[data-stage="waking"] .dream-veil { opacity: 1; background: radial-gradient(ellipse at 50% 72%, #9a5c36, #0d090f 79%); }
@keyframes dream-blink { 0%, 16% { opacity: 0; } 62%, 100% { opacity: 1; } }
.dream-halves { pointer-events: none; }
.dream-halves[hidden] { display: none; }
.dream-half-label {
  position: absolute;
  left: var(--half-x);
  top: var(--half-y);
  transform: translate(-50%, -50%);
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: .42rem .65rem;
  background: #140f1bed;
  color: #f9cb94;
  font-size: clamp(.77rem, 2.4vw, 1.13rem);
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.dream-half-label[data-half="sleep"] { color: #c1b6ff; }
.dream-drive { position: absolute; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(.55rem, 2.6vw, 1.4rem); pointer-events: none; transition: opacity .3s ease; }
.dream-view:is([data-stage="entering"],[data-stage="waking"]) .dream-drive { opacity: 0; visibility: hidden; }
.dream-turn {
  display: grid;
  place-items: center;
  width: clamp(56px, 9.5dvh, 80px);
  aspect-ratio: 1;
  border: 1px solid #ead3b970;
  border-radius: 16px;
  background: #141322d9;
  color: #fff3df;
  font-size: clamp(1.3rem, 5vw, 2.15rem);
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}
.dream-turn:hover { background: #261d33ed; }
.dream-turn.is-turning { background: #b89a7147; border-color: #ffe1b8; }
.dream-track { display: grid; justify-items: center; gap: .4rem; width: clamp(98px, 18vw, 210px); }
.dream-progress { width: 100%; height: 2px; background: #5e5263db; border-radius: 3px; overflow: hidden; }
.dream-progress span { height: 100%; display: block; background: #f2d5a9; transform: scaleX(var(--lap-progress, 0)); transform-origin: left center; }
.dream-landing { min-width: 90px; padding: .25rem .4rem; border: 1px solid #bba8a54d; border-radius: 4px; background: #14111de8; color: #f0dfc8; text-align: center; font-size: .78rem; font-weight: 650; letter-spacing: .065em; text-transform: uppercase; }
.dream-landing[data-sector="wake"] { color: #f9cb94; border-color: #f9cb94a0; }
.dream-landing[data-sector="sleep"] { color: #c1b6ff; border-color: #c1b6ffa0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; border: 0; }

.television { border: 1px solid #6f5040; border-radius: 24px; padding: clamp(12px, 3vw, 23px); background: linear-gradient(145deg,#513b30,#281e19 85%); box-shadow: inset 0 0 12px #12100f, 0 14px 28px #100b0990; display: grid; grid-template-columns: minmax(0, 1fr) 24px; gap: 13px; }
.tv-screen { min-height: clamp(185px, 45vh, 330px); min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: .65rem; padding: clamp(18px, 5vw, 48px); border-radius: 22px; border: 2px solid #191e16; background: repeating-linear-gradient(#0000 0 3px, #06160d30 3px 4px), radial-gradient(ellipse at 35% 48%, #365742, #1d3129 75%); color: #e7edd1; box-shadow: inset 0 0 28px #080f0bc9; }
.tv-period { color: #cbd9a8; font-size: .95rem; }
.tv-story { font: 400 clamp(1.4rem, 4vw, 2.7rem)/1.22 "Instrument Serif", Georgia, serif; }
.tv-controls { display: grid; align-content: end; gap: 9px; }
.tv-controls i { width: 18px; height: 18px; border-radius: 50%; background: #382a22; border: 2px solid #8a6853; }
.tv-controls span { height: 46px; background: repeating-linear-gradient(0deg,#211710 0 2px,#5f4737 2px 5px); }
.washer-form { display: grid; justify-items: start; gap: 12px; }
.washer-form textarea { width: 100%; color: var(--ink); background: #171412; padding: .7rem; border: 1px solid var(--line); border-radius: 10px; resize: vertical; }
.washer-drum { overflow: hidden; display: grid; place-items: center; justify-self: center; width: min(65%, 220px); aspect-ratio: 1; background: radial-gradient(circle,#3c503e,#182725 70%); border: 13px solid #8b7967; box-shadow: inset 0 0 26px #141b18, 0 0 0 3px #a5927c; border-radius: 50%; }
.washer-drum span { text-align: center; max-width: 72%; overflow-wrap: anywhere; max-height: 72%; }
.washer-drum.washing span { animation: paper-wash 4s ease both; }
@keyframes paper-wash { 0% { opacity: 1; } 100% { transform: rotate(900deg) scale(.25); filter: blur(9px); opacity: 0; } }

.cartridges { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.cartridges button { min-height: 124px; padding: 8px; color: #fae7ce; border: 1px solid #f7d1a066; background: linear-gradient(145deg,#513329,#2d211b); border-radius: 14px; }
.cartridges button:nth-child(2) { background: linear-gradient(145deg,#34473c,#202923); }
.cartridges button:nth-child(3) { background: linear-gradient(145deg,#393d63,#252435); }
.cartridges button:hover { filter: brightness(1.23); }
.cartridges button span { display: block; margin-bottom: 8px; font-size: clamp(1.4rem, 4vw, 2rem); color: #f3c995; }
.game-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.game-header strong { font: 400 clamp(1.3rem, 4vw, 1.85rem) "Instrument Serif", Georgia, serif; }
.tic-board { margin: 16px auto; width: min(100%, 285px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tic-board button { aspect-ratio: 1; color: #f7d19c; border: 1px solid #cba88755; background: #352922; border-radius: 9px; font: 400 clamp(1.55rem, 6vw, 2.6rem) Georgia, serif; }
.tic-board button[aria-disabled="false"]:hover { background: #523a2d; }
.tic-board button[data-mark="O"] { color: #afcec3; }
.game-status { min-height: 2.8em; margin-top: 10px; color: var(--muted); line-height: 1.45; }
.race-screen { width: min(100%, 450px); display: block; aspect-ratio: 12 / 11; margin: auto; border: 1px solid #8f9b755e; border-radius: 14px; background: #263b32; outline-offset: 3px; }
.drive-controls { display: flex; gap: 10px; justify-content: center; margin: 12px 0 0; }
.drive-controls button { min-width: 50px; min-height: 44px; font-size: 1.15rem; touch-action: none; }
.race-start { align-self: center; text-align: center; margin-top: 12px; }
.difference-score { margin: 7px 0 11px; font-size: 1.05rem; font-variant-numeric: tabular-nums; color: var(--gold); }
.differences-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.still { position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 4 / 3; background: #485757; border: 1px solid #d4b68f65; border-radius: 9px; }
.still::before { content: ""; position: absolute; inset: 0; background: linear-gradient(#1b3337 0 64%,#53382d 64% 67%,#9a6549 67%); }
.prop { display: grid; place-items: center; position: absolute; width: 22%; height: 26%; padding: 0; border: 1px solid transparent; border-radius: 7px; color: #ffe2b7; background: transparent; font-size: clamp(1rem, 4.7vw, 2.3rem); }
.prop:hover { border-color: #e9c190; }
.prop.found { border: 2px solid #d6e4a6; }
.prop[data-kind="moon"] { top: 9%; right: 15%; color: #f1d88a; }
.prop[data-kind="frame"] { top: 13%; left: 16%; }
.prop[data-kind="curtain"] { top: 33%; right: 11%; color: #d3a99d; }
.prop[data-kind="cup"] { bottom: 11%; left: 65%; }
.prop[data-kind="plant"] { bottom: 13%; left: 9%; color: #bac48d; }
.prop[data-kind="book"] { bottom: 3%; left: 36%; }
.prop[data-kind="curtain"] .prop-icon { transform: scaleX(var(--fold, 1)); display: block; }
.prop[data-kind="frame"] .prop-icon { transform: rotate(var(--angle, 0deg)); display: block; }

@media (max-width: 550px) {
  .scene-card { padding: 14px; }
  .scene-header { margin-bottom: 13px; }
  .cartridges { grid-template-columns: 1fr; }
  .cartridges button { min-height: 65px; display: flex; align-items: center; justify-content: start; gap: 16px; text-align: left; }
  .cartridges button span { margin: 0; width: 3.4rem; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .cabinet-view, .cabinet-exit { animation: none; }
  .cabinet-view { --crossing: 1ms; }
  .cabinet-chair img { transition: none; }
  .washer-drum.washing span, .dream-view[data-stage="entering"] .dream-veil { animation: none; }
  .room-art, .lamp-foreground, .light-from-window, .lamp-shadow, .lamp-pool { transition: none; }
  .wall-picture, .orange-roll, .orange-roll img { transition: none; }
  .dream-tunnel, .dream-veil { transition-duration: .15s; }
}
