/* Kofe Room
 *
 * A room you walk into. The wall takes the theme's colour, the floor and its
 * light come from the theme's photograph, and the things stand where things
 * stand: frames on the wall, books on the shelf, the question on the table.
 * Gold only for what you can touch. Motion is slow, or none.
 *
 * Order: page frame, the room (wall, floor, shelf, table, light), things,
 * the room's overlays (presence, tools, plate, music), sheets, below the room,
 * editing, first time, phone.
 */

/* ------------------------------------------------------------------ frame */
.rm-shell .main { padding-top: var(--s-4); }
.rm-page { display: grid; gap: var(--s-6); }
.rm-wait { padding: 4px 0; }
.rm-skel { aspect-ratio: 16 / 9; border-radius: var(--r-lg); }
.rm-empty { display: grid; gap: var(--s-3); justify-items: center; text-align: center; padding: 14vh var(--s-4); }
.rm-muted { color: var(--muted); font-size: var(--t-sm); }
.rm-k { font-size: 11.5px; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 800; color: var(--door); }
html[lang="hy"] .rm-k { text-transform: none; letter-spacing: 0.03em; }

/* ------------------------------------------------------------------ the room */
.rm-stage { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #0b0908; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); isolation: isolate; }
.rm-scene { --wall-a: #3a2418; --wall-b: #1c120c; --trim: #6b4a2e; --split: 62%; position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 78vh; min-height: 420px; overflow: hidden; color: #f4eee2; container-type: inline-size; }
.rm-wall { position: absolute; inset: 0 0 calc(100% - var(--split)) 0; background:
    radial-gradient(ellipse 60% 70% at 50% 30%, rgba(255, 220, 170, 0.07), transparent 70%),
    linear-gradient(180deg, var(--wall-a), var(--wall-b)); }
.rm-wall::before { content: ""; position: absolute; inset: 0; background-image: var(--grain); opacity: 0.55; mix-blend-mode: soft-light; }
/* a dado rail: panelled lower wall */
.rm-wall::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26%; border-top: 2px solid color-mix(in srgb, var(--trim) 70%, black); background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.32)), repeating-linear-gradient(90deg, transparent 0 12%, rgba(0, 0, 0, 0.18) 12% 12.25%, transparent 12.25% 12.6%); }
.rm-sconce { position: absolute; top: 9%; width: 22%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255, 196, 120, 0.22), transparent 62%); pointer-events: none; }
.rm-sconce.s1 { left: 2%; } .rm-sconce.s2 { right: 34%; }
.rm-ornament { position: absolute; left: 0; right: 0; top: 4%; height: 7%; opacity: 0.4; background:
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(214, 160, 90, 0.5) 18px 20px, transparent 20px 38px),
    linear-gradient(180deg, transparent 45%, rgba(214, 160, 90, 0.55) 45% 55%, transparent 55%);
  -webkit-mask: repeating-linear-gradient(45deg, #000 0 6px, transparent 6px 12px); mask: repeating-linear-gradient(45deg, #000 0 6px, transparent 6px 12px); }
.rm-floor { position: absolute; left: 0; right: 0; bottom: 0; top: var(--split); background: #120d0a var(--floor) center 60% / 112% auto no-repeat; filter: brightness(0.95) saturate(0.95); }
.rm-floor::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 28%, transparent 80%, rgba(0, 0, 0, 0.3)); }
.rm-skirting { position: absolute; left: 0; right: 0; top: calc(var(--split) - 1.6%); height: 2.2%; background: linear-gradient(180deg, color-mix(in srgb, var(--trim) 85%, white 6%), color-mix(in srgb, var(--trim) 60%, black)); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5); }
.rm-shelfboard { position: absolute; left: 63%; width: 34%; top: 45%; height: 2.4%; border-radius: 2px; background: linear-gradient(180deg, #7b5636, #3e2816); box-shadow: 0 10px 18px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 220, 170, 0.25); }
.rm-shelfboard::before, .rm-shelfboard::after { content: ""; position: absolute; top: 100%; width: 3%; height: 160%; background: linear-gradient(180deg, #3e2816, #22160b); }
.rm-shelfboard::before { left: 10%; } .rm-shelfboard::after { right: 10%; }
.rm-tabletop { position: absolute; left: 36%; width: 30%; top: 82%; height: 9%; border-radius: 50%; background: radial-gradient(ellipse at 50% 35%, #6e4a2c, #3b2615 60%, #24170c); box-shadow: 0 18px 30px rgba(0, 0, 0, 0.6), inset 0 2px 0 rgba(255, 220, 170, 0.18); }
.rm-tabletop::after { content: ""; position: absolute; left: 12%; right: 12%; top: 96%; height: 70%; background: linear-gradient(180deg, #22160b, transparent); clip-path: polygon(8% 0, 92% 0, 80% 100%, 20% 100%); }
.rm-light { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; transition: background 1.2s var(--ease); background: radial-gradient(ellipse 70% 60% at 50% 60%, rgba(255, 190, 110, 0.35), transparent 70%); }
.rm-scene::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 85% 80% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.6)); }
.light-golden .rm-light { background: radial-gradient(ellipse 80% 60% at 30% 40%, rgba(255, 170, 70, 0.55), transparent 70%); }
.light-candle .rm-light { background: radial-gradient(ellipse 50% 45% at 50% 70%, rgba(255, 160, 70, 0.5), transparent 70%); }
.light-candle .rm-wall, .light-dim .rm-wall { filter: brightness(0.75); }
.light-dim .rm-light { background: radial-gradient(ellipse 50% 40% at 50% 65%, rgba(255, 190, 110, 0.18), transparent 70%); }
.light-dim .rm-floor { filter: brightness(0.5) saturate(0.8); }
.light-cool .rm-light { background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(150, 190, 255, 0.28), transparent 70%); }
.lamp-off .rm-cone { opacity: 0 !important; }
.rm-rainfall { position: absolute; inset: 0; pointer-events: none; opacity: 0.18; background: repeating-linear-gradient(105deg, transparent 0 9px, rgba(200, 220, 255, 0.5) 9px 10px, transparent 10px 23px); background-size: 120px 120px; animation: rm-rain 0.9s linear infinite; mix-blend-mode: screen; -webkit-mask: linear-gradient(180deg, #000, transparent 60%); mask: linear-gradient(180deg, #000, transparent 60%); }

/* ------------------------------------------------------------------ things */
.rm-things { position: absolute; inset: 0; z-index: 2; }
.rm-obj { position: absolute; left: var(--x); top: var(--y); width: var(--w); z-index: var(--z); padding: 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; transform: translate(-50%, -100%); transition: transform 0.35s var(--ease), filter 0.25s, opacity 0.3s; -webkit-tap-highlight-color: transparent; }
.rm-obj.on-wall { transform: translate(-50%, -50%); }
.rm-obj:hover { filter: brightness(1.12) drop-shadow(0 0 18px rgba(227, 173, 84, 0.25)); }
.rm-obj:focus-visible { outline: 2px solid #e3ad54; outline-offset: 4px; border-radius: 6px; }
.rm-obj.is-poke { animation: rm-poke 0.5s var(--ease); }
.rm-obj.is-hidden { opacity: 0.35; }
.rm-img { display: block; width: 100%; height: auto; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.55)); pointer-events: none; }

/* a frame on the wall */
.rm-frame { display: block; padding: 7%; background: linear-gradient(135deg, #8a6236, #4a2f17 55%, #7a5530); border-radius: 2px; box-shadow: 0 14px 26px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 220, 160, 0.25); }
.rm-mat { display: block; aspect-ratio: 4 / 5; padding: 6%; background: #efe6d4; box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.25); overflow: hidden; }
.rm-mat img { width: 100%; height: 100%; object-fit: cover; display: block; filter: sepia(0.08) contrast(1.02); }
.rm-blank { display: grid; place-items: center; width: 100%; height: 100%; background: repeating-linear-gradient(45deg, #ddd2bd 0 6px, #e7dcc8 6px 12px); color: #8a7a5e; font-style: normal; font-size: clamp(14px, 2.4cqi, 28px); font-weight: 300; }
.rm-poster { position: relative; display: grid; align-content: end; gap: 3px; aspect-ratio: 2 / 3; padding: 12% 10%; text-align: left; background: radial-gradient(circle at 70% 25%, hsl(var(--h) 60% 55% / 0.55), transparent 45%), linear-gradient(180deg, hsl(var(--h) 35% 30%), hsl(var(--h) 40% 10%)); outline: 4px solid #2a1d12; outline-offset: 0; box-shadow: 0 0 0 5px #8a6236, 0 16px 28px rgba(0, 0, 0, 0.6); overflow: hidden; }
.rm-poster::before { content: ""; position: absolute; left: 10%; right: 10%; top: 10%; height: 1px; background: rgba(244, 226, 180, 0.4); }
.rm-poster small { font-size: clamp(6px, 0.8cqi, 10px); letter-spacing: 0.24em; text-transform: uppercase; color: #cba660; font-weight: 800; }
.rm-poster b { font-family: var(--display); font-weight: 500; font-size: clamp(9px, 1.25cqi, 17px); line-height: 1.05; color: #fff7e6; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.rm-poster i { font-style: normal; font-size: clamp(6px, 0.8cqi, 10px); color: rgba(244, 238, 226, 0.6); }
.rm-note { position: relative; display: block; padding: 14% 11% 12%; background: #efe4cb; color: #2b2116; transform: rotate(-2deg); box-shadow: 0 10px 18px rgba(0, 0, 0, 0.45); }
.rm-note q { display: block; font-family: var(--display); font-style: italic; font-size: clamp(7px, 1.05cqi, 14px); line-height: 1.25; quotes: '“' '”'; }
.rm-pin { position: absolute; top: 5%; left: 50%; width: 9px; height: 9px; margin-left: -4px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e57a62, #8a2a1c); box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5); }
.rm-window { position: relative; display: block; aspect-ratio: 3 / 4; border: 5px solid #3b2a1c; border-radius: 40% 40% 3px 3px / 26% 26% 3px 3px; overflow: hidden; background: linear-gradient(180deg, #0d1626, #1d2a3d 70%, #26354a); box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7), 0 14px 24px rgba(0, 0, 0, 0.55); }
.rm-sky { position: absolute; inset: 0; background: radial-gradient(circle at 70% 20%, rgba(230, 236, 255, 0.35), transparent 18%), radial-gradient(ellipse at 50% 120%, rgba(255, 190, 120, 0.25), transparent 60%); }
.rm-rain { position: absolute; inset: -20% 0 0; background: repeating-linear-gradient(100deg, transparent 0 6px, rgba(200, 220, 255, 0.4) 6px 7px, transparent 7px 15px); background-size: 60px 60px; animation: rm-rain 0.7s linear infinite; }
.rm-sash { position: absolute; inset: 0; background: linear-gradient(90deg, transparent 48%, #3b2a1c 48% 52%, transparent 52%), linear-gradient(180deg, transparent 55%, #3b2a1c 55% 58%, transparent 58%); }
/* books on a shelf */
.rm-spines { display: flex; align-items: flex-end; gap: 2%; height: clamp(40px, 9.5cqi, 130px); padding: 0 4%; }
.rm-spines i { position: relative; flex: 1; height: var(--hh); border-radius: 2px 2px 1px 1px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, black), var(--c) 30%, color-mix(in srgb, var(--c) 80%, white 8%) 55%, color-mix(in srgb, var(--c) 60%, black)); box-shadow: inset 0 6% 0 rgba(203, 166, 96, 0.4), inset 0 -8% 0 rgba(0, 0, 0, 0.25); }
.rm-spines i span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-90deg); white-space: nowrap; font-family: var(--display); font-size: clamp(5px, 0.7cqi, 10px); color: rgba(244, 226, 180, 0.85); max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
/* record player */
.rm-record { display: block; }
.rm-plinth { position: relative; display: block; aspect-ratio: 1.25; background: linear-gradient(135deg, #6b4526, #3a2412 60%, #54361c); border-radius: 6%; box-shadow: 0 14px 24px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 220, 170, 0.3); transform: perspective(500px) rotateX(38deg); transform-origin: 50% 100%; }
.rm-vinyl { position: absolute; left: 7%; top: 8%; width: 66%; aspect-ratio: 1; border-radius: 50%; background: repeating-radial-gradient(circle, #111 0 1.4%, #1d1d1d 1.4% 2.6%), #111; box-shadow: 0 0 0 2px #0a0a0a, inset 0 0 0 1px rgba(255, 255, 255, 0.04); }
.rm-vinyl::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 30deg, transparent 0 20%, rgba(255, 255, 255, 0.1) 25%, transparent 32% 70%, rgba(255, 255, 255, 0.08) 75%, transparent 82%); }
.rm-label { position: absolute; left: 34%; top: 34%; width: 32%; height: 32%; border-radius: 50%; background: radial-gradient(circle, #111 0 9%, hsl(var(--h) 55% 45%) 10%); }
.rm-arm { position: absolute; right: 9%; top: 12%; width: 6%; height: 60%; border-radius: 3px; background: linear-gradient(90deg, #ccc, #8b8b8b); transform: rotate(18deg); transform-origin: 50% 8%; box-shadow: 2px 3px 4px rgba(0, 0, 0, 0.5); transition: transform 0.8s var(--ease); }
.rm-record.is-on .rm-vinyl { animation: rm-spin 1.8s linear infinite; }
.rm-record.is-on .rm-arm { transform: rotate(30deg); }
/* lamp */
.rm-lamp { position: relative; display: block; aspect-ratio: 1 / 3.4; }
.rm-shade { position: absolute; top: 0; left: 8%; right: 8%; height: 20%; background: linear-gradient(180deg, #e9d6ae, #b8925c); clip-path: polygon(22% 0, 78% 0, 100% 100%, 0 100%); box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.2); }
.rm-pole { position: absolute; left: 47%; width: 6%; top: 19%; bottom: 4%; background: linear-gradient(90deg, #6b5536, #2c2114); }
.rm-foot { position: absolute; left: 22%; right: 22%; bottom: 0; height: 4%; border-radius: 50%; background: #2c2114; box-shadow: 0 6px 10px rgba(0, 0, 0, 0.6); }
.rm-cone { position: absolute; left: -110%; right: -110%; top: 12%; height: 120%; background: radial-gradient(ellipse 50% 60% at 50% 0%, rgba(255, 210, 140, 0.45), transparent 70%); pointer-events: none; animation: rm-glow 6s ease-in-out infinite; transition: opacity 0.6s; }
/* candle flame flicker */
.rm-candle { position: relative; display: block; }
.rm-flame { position: absolute; left: 50%; top: 2%; width: 160%; aspect-ratio: 1; transform: translate(-50%, -40%); border-radius: 50%; background: radial-gradient(circle, rgba(255, 200, 120, 0.45), transparent 60%); animation: rm-flicker 2.4s ease-in-out infinite; pointer-events: none; }
/* cards on the table */
.rm-obj.on-wall .rm-card { transform: rotate(-2deg); }
.rm-card { display: grid; gap: 4%; padding: 10% 9%; text-align: left; background: #f1e7d2; color: #2b2116; border-radius: 4px; box-shadow: 0 12px 18px rgba(0, 0, 0, 0.55); transform: perspective(500px) rotateX(28deg) rotate(-3deg); transform-origin: 50% 100%; }
.rm-card small { font-size: clamp(5px, 0.75cqi, 10px); letter-spacing: 0.2em; text-transform: uppercase; font-weight: 800; color: #9a6b2e; }
.rm-card b { font-family: var(--display); font-weight: 500; font-size: clamp(7px, 1cqi, 14px); line-height: 1.2; }
.rm-pcard i { display: block; height: 5px; border-radius: 3px; background: #d8c6a2; }
.rm-pcard i:first-of-type { width: 70%; background: #b98b47; }
.rm-deck { position: relative; display: block; aspect-ratio: 0.72; transform: perspective(500px) rotateX(30deg); transform-origin: 50% 100%; }
.rm-deck i { position: absolute; inset: 0; border-radius: 6px; background: #7a1f1a; border: 2px solid #f1e7d2; box-shadow: 0 8px 14px rgba(0, 0, 0, 0.55); }
.rm-deck i:nth-child(1) { transform: rotate(-9deg) translate(-6%, 2%); }
.rm-deck i:nth-child(2) { transform: rotate(5deg) translate(5%, 1%); background: #1f1a17; }
.rm-deck-top { display: grid; place-items: center; background: #f1e7d2 !important; border-color: #f1e7d2 !important; }
.rm-deck-top b { font-size: clamp(12px, 2cqi, 26px); color: #1a1410; font-family: var(--display); }
.rm-deck-sm { width: 56px; transform: none; }
/* empty things in my own room show where they could be */
.rm-obj.is-empty { opacity: 0.7; }
.rm-obj.is-empty:hover { opacity: 1; }

/* the places, while arranging */
.rm-place { position: absolute; left: var(--x); top: var(--y); width: 7%; aspect-ratio: 1; border: 1.5px dashed rgba(227, 173, 84, 0.65); border-radius: 10px; transform: translate(-50%, -50%); pointer-events: none; animation: rm-pulse 1.6s ease-in-out infinite; }
.rm-place:not(.on-wall) { transform: translate(-50%, -100%); height: auto; aspect-ratio: 1.6; border-radius: 50% / 40%; }
.rm-scene.is-edit .rm-obj { cursor: grab; touch-action: none; }
.rm-scene.is-edit .rm-obj.is-selected { outline: 2px solid #e3ad54; outline-offset: 5px; border-radius: 6px; filter: drop-shadow(0 0 22px rgba(227, 173, 84, 0.35)); }
.rm-obj.is-dragging { cursor: grabbing; z-index: 999; transition: none; opacity: 0.92; }

/* ------------------------------------------------------------------ over the room */
.rm-hud { position: absolute; left: 0; right: 0; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px; pointer-events: none; }
.rm-presence { position: absolute; left: 16px; top: 82px; }
.rm-hud > * { pointer-events: auto; }
.rm-here { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 8px; border-radius: 99px; background: rgba(12, 10, 9, 0.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: 13px; font-weight: 600; color: #f4eee2; animation: rm-in 0.5s var(--ease); }
.rm-here .mf-av, .rm-here .av { margin-left: -6px; box-shadow: 0 0 0 2px rgba(12, 10, 9, 0.8); }
.rm-live { width: 7px; height: 7px; border-radius: 50%; background: #e3ad54; box-shadow: 0 0 0 4px rgba(227, 173, 84, 0.2); margin-right: 6px; animation: rm-glow 2.4s ease-in-out infinite; }
.rm-tools { position: relative; display: flex; gap: 6px; margin-left: auto; }
.rm-tool { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 99px; border: 1px solid rgba(244, 238, 226, 0.16); background: rgba(12, 10, 9, 0.55); color: #f4eee2; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.rm-tool:hover { background: rgba(12, 10, 9, 0.8); }
.rm-tool svg { width: 18px; height: 18px; }
.rm-tool.is-text { padding: 0 14px; }
.rm-menu { position: absolute; right: 0; top: 46px; min-width: 180px; display: grid; padding: 6px; border-radius: 14px; background: #1d1814; border: 1px solid rgba(244, 238, 226, 0.12); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); }
.rm-menu a, .rm-menu button { display: block; padding: 10px 12px; border-radius: 9px; color: #f4eee2; text-decoration: none; text-align: left; background: none; border: 0; font: inherit; font-size: var(--t-sm); cursor: pointer; }
.rm-menu a:hover, .rm-menu button:hover { background: rgba(244, 238, 226, 0.08); }
.rm-plate { position: absolute; left: 16px; top: 16px; z-index: 6; display: flex; align-items: center; gap: 12px; max-width: min(60%, 420px); padding: 8px 16px 8px 8px; border-radius: 99px; background: rgba(12, 10, 9, 0.55); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #f4eee2; }
.rm-plate > div { display: grid; min-width: 0; line-height: 1.25; }
.rm-plate b { font-family: var(--display); font-weight: 500; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-plate small { color: #dcd3c3; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-mood { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #cba660; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-mood i { width: 6px; height: 6px; border-radius: 50%; background: #e3ad54; }
.rm-mini { position: absolute; right: 16px; bottom: 16px; z-index: 5; display: flex; align-items: center; gap: 10px; max-width: min(46%, 320px); padding: 6px 6px 6px 8px; border-radius: 99px; border: 0; background: rgba(12, 10, 9, 0.6); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #f4eee2; font: inherit; cursor: pointer; text-align: left; }
.rm-mini-disc { width: 30px; height: 30px; flex: none; border-radius: 50%; background: radial-gradient(circle, #e3ad54 0 16%, #111 17% 22%, #222 23%), repeating-radial-gradient(circle, #111 0 2px, #1d1d1d 2px 3px); box-shadow: 0 0 0 1px #000; }
.rm-mini.is-on .rm-mini-disc, .rm-mini-disc.is-spin { animation: rm-spin 2.2s linear infinite; }
.rm-mini-t { display: grid; min-width: 0; line-height: 1.2; }
.rm-mini-t b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-mini-t small { font-size: 11.5px; color: #a69d8f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-mini-btn { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #e3ad54; color: #2a1c05; }
.rm-mini-btn svg { width: 15px; height: 15px; }

/* ------------------------------------------------------------------ sheets */
#rm-layer { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; padding: 20px; }
#rm-layer.is-on { display: grid; }
.rm-veil { position: absolute; inset: 0; background: rgba(6, 5, 4, 0.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: rm-fade 0.3s ease; }
.rm-sheet { position: relative; width: min(560px, 100%); max-height: 86dvh; overflow: auto; padding: 28px; border-radius: 24px; background: #1d1814; color: #f4eee2; box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6); animation: rm-rise 0.45s var(--ease); }
.rm-sheet.is-player { width: min(480px, 100%); }
.rm-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(244, 238, 226, 0.06); color: #f4eee2; display: grid; place-items: center; cursor: pointer; z-index: 2; }
.rm-x svg { width: 18px; height: 18px; }
.rm-sheet-in { display: grid; gap: 10px; }
.rm-line b { font-weight: 700; }
.rm-line small { color: #a69d8f; }
.rm-big { margin: 0; display: grid; gap: 12px; }
.rm-big img { width: 100%; max-height: 70dvh; object-fit: contain; border-radius: 12px; background: #000; }
.rm-big figcaption { font-family: var(--display); font-style: italic; font-size: 20px; color: #dcd3c3; }
.rm-bigquote { margin: 0; padding: 12px 6px; }
.rm-bigquote p { font-family: var(--display); font-style: italic; font-size: clamp(24px, 4vw, 34px); line-height: 1.3; }
.rm-bigquote cite { font-style: normal; color: #cba660; font-weight: 700; }
.rm-player-head { display: flex; gap: 14px; align-items: center; padding-right: 40px; }
.rm-player-head .rm-mini-disc { width: 54px; height: 54px; }
.rm-player-head div { display: grid; }
.rm-player-head b { font-family: var(--display); font-size: 22px; font-weight: 500; }
.rm-player-head small { color: #a69d8f; }
.rm-embed { width: 100%; border: 0; border-radius: 12px; background: #000; }
.rm-open { color: #cba660; font-size: var(--t-sm); font-weight: 700; }
.rm-amb { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(244, 238, 226, 0.05); }
.rm-amb span { flex: 1; font-weight: 700; }
.rm-amb input { width: 120px; accent-color: #e3ad54; }

/* ------------------------------------------------------------------ under the room */
.rm-visit { display: flex; flex-wrap: wrap; gap: 8px; margin-top: calc(var(--s-6) * -0.5); }
.rm-below { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s-6) var(--s-7); align-items: start; }
.rm-sec { display: grid; gap: 12px; align-content: start; }
.rm-talk { grid-row: span 3; }
.rm-q { font-family: var(--display); font-weight: 500; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.12; text-wrap: balance; }
.rm-answer { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 16px; border-radius: 99px; background: var(--raised); }
.rm-answer input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 16px; min-height: 44px; outline: none; }
.rm-answer:focus-within { box-shadow: inset 0 0 0 1px var(--door); }
.rm-send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--lamp); color: var(--lamp-ink); display: grid; place-items: center; cursor: pointer; }
.rm-send svg { width: 18px; height: 18px; }
.rm-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rm-notes li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; }
.rm-notes b { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.rm-notes p { color: var(--ink); line-height: 1.45; }
.rm-poll { display: grid; gap: 10px; margin-top: 12px; padding: 18px; border-radius: 18px; background: var(--surface); }
.rm-poll-q { font-weight: 700; }
.rm-poll-o { display: grid; gap: 8px; }
.rm-poll-b { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.rm-poll-b:hover { border-color: var(--door); }
.rm-poll-r { position: relative; display: flex; justify-content: space-between; padding: 10px 14px; border-radius: 12px; overflow: hidden; isolation: isolate; }
.rm-poll-r::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--door-soft); z-index: -1; animation: rm-bar 0.8s var(--ease); }
.rm-poll-r.is-mine::before { background: rgba(227, 173, 84, 0.3); }
.rm-items { display: grid; gap: 18px; }
.rm-item { display: grid; gap: 2px; }
.rm-item-k { font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.rm-item b { font-family: var(--display); font-weight: 500; font-size: 19px; }
.rm-item small { color: var(--muted); margin-bottom: 6px; }
.rm-quote { margin: 0; padding-left: 16px; border-left: 2px solid var(--door); }
.rm-quote p { font-family: var(--display); font-style: italic; font-size: 20px; line-height: 1.35; }
.rm-quote cite { font-style: normal; color: var(--muted); font-size: 13px; }
.rm-gamecard { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: center; padding: 18px; border-radius: 18px; background: var(--surface); }
.rm-gamecard b { font-weight: 700; }
.rm-gamecard p { color: var(--muted); font-size: var(--t-sm); margin: 2px 0 10px; }
.rm-faces { display: flex; flex-wrap: wrap; gap: 12px; }
.rm-faces a { display: grid; justify-items: center; gap: 4px; color: var(--ink-2); text-decoration: none; }
.rm-faces small { font-size: 12px; }
.rm-hint { padding: 18px; border-radius: 18px; border: 1px dashed var(--line-2); }
.rm-hint p { color: var(--ink-2); }

/* ------------------------------------------------------------------ editing */
.rm-stage.is-edit { box-shadow: 0 0 0 2px rgba(227, 173, 84, 0.5), 0 30px 80px rgba(0, 0, 0, 0.45); }
.rm-edit-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6; padding: 8px 16px; border-radius: 99px; background: rgba(12, 10, 9, 0.7); color: #f4eee2; font-size: 13px; white-space: nowrap; }
.rm-selbar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px; border-radius: 99px; background: rgba(20, 16, 13, 0.92); color: #f4eee2; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); max-width: calc(100% - 24px); overflow-x: auto; }
.rm-selbar > b { font-size: 13px; margin-right: 4px; white-space: nowrap; }
.rm-seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 99px; background: rgba(244, 238, 226, 0.06); }
.rm-seg button { min-width: 34px; height: 32px; padding: 0 10px; border-radius: 99px; border: 0; background: transparent; color: var(--muted, #a69d8f); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.rm-seg button[aria-pressed="true"] { background: #e3ad54; color: #2a1c05; }
.rm-seg.is-wide { display: flex; flex-wrap: wrap; border-radius: 16px; }
.rm-chip { height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid rgba(244, 238, 226, 0.16); background: transparent; color: inherit; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.rm-chip[aria-pressed="true"] { background: var(--door-soft); border-color: var(--door); color: var(--ink); }
.rm-chip.is-plain { border: 0; width: 34px; padding: 0; display: grid; place-items: center; }
.rm-chip.is-plain svg { width: 16px; height: 16px; }
.rm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rm-panel { display: grid; gap: 16px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.rm-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.rm-tabs::-webkit-scrollbar { display: none; }
.rm-tabs button { flex: none; height: 38px; padding: 0 14px; border-radius: 99px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.rm-tabs button[aria-selected="true"] { background: var(--raised); color: var(--ink); }
.rm-panel-in { display: grid; gap: 14px; }
.rm-panel-go { display: flex; justify-content: flex-end; gap: 8px; }
.rm-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.rm-theme { display: grid; gap: 6px; padding: 0; border: 0; background: none; color: var(--ink-2); font: inherit; cursor: pointer; text-align: left; }
.rm-theme-pic { position: relative; aspect-ratio: 16 / 10; border-radius: 12px; background-size: cover; background-position: center 80%; overflow: hidden; outline: 2px solid transparent; outline-offset: 2px; transition: outline-color 0.15s; }
.rm-theme-pic::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 58%; background: linear-gradient(180deg, var(--wall-a), var(--wall-b)); border-bottom: 2px solid rgba(0, 0, 0, 0.4); }
.rm-theme[aria-pressed="true"] .rm-theme-pic { outline-color: var(--door); }
.rm-theme small { font-size: 12.5px; font-weight: 600; }
.rm-addgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.rm-add { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; border-radius: 14px; border: 1px dashed var(--line-2); background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.rm-add:hover { border-color: var(--door); }
.rm-add svg { width: 16px; height: 16px; color: var(--door); flex: none; }
.rm-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.rm-ph { position: relative; display: grid; gap: 6px; }
.rm-ph img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; }
.rm-ph input { min-height: 36px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--sunk); color: var(--ink); font: inherit; font-size: 13px; }
.rm-ph .rm-x { top: 6px; right: 6px; width: 32px; height: 32px; background: rgba(0, 0, 0, 0.6); }
.rm-add-ph { aspect-ratio: 4 / 5; flex-direction: column; justify-content: center; }
.rm-list { display: grid; gap: 6px; }
.rm-li { position: relative; display: grid; padding: 10px 48px 10px 14px; border-radius: 12px; background: var(--raised); }
.rm-li small { color: var(--muted); }
.rm-li .rm-x { top: 50%; transform: translateY(-50%); width: 34px; height: 34px; }
.rm-addrow { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 8px; }
.rm-addrow input, .rm-panel input:not([type]), .rm-panel input[type="text"], .rm-onboard input:not([type]) { min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--sunk); color: var(--ink); font: inherit; font-size: 15px; }
.rm-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rm-switch { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; cursor: pointer; }
.rm-switch input { position: absolute; opacity: 0; pointer-events: none; }
.rm-switch i { width: 44px; height: 26px; border-radius: 99px; background: var(--raised); position: relative; }
.rm-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); transition: transform var(--med) var(--ease); }
.rm-switch input:checked + i { background: var(--door); }
.rm-switch input:checked + i::after { transform: translateX(18px); background: var(--door-ink); }
.rm-switch input:focus-visible + i { outline: 2px solid var(--ink); outline-offset: 2px; }
.rm-switch span { display: grid; }
.rm-switch small { color: var(--muted); }

/* ------------------------------------------------------------------ the first time */
.rm-onboard { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, 1fr); gap: var(--s-6); align-items: start; }
.rm-ob-preview { position: sticky; top: calc(var(--top-h) + 16px); border-radius: var(--r-lg); overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); pointer-events: none; }
.rm-ob-preview .rm-scene { min-height: 0; }
.rm-ob-form { display: grid; gap: 16px; }
.rm-ob-form h1, .rm-ready h1 { font-family: var(--display); font-weight: 500; font-size: var(--t-3xl); line-height: 1.04; }
.rm-lead { color: var(--ink-2); font-size: var(--t-md); }
.rm-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.rm-steps li { flex: 1; height: 4px; border-radius: 4px; background: var(--raised); }
.rm-steps li span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.rm-steps li.is-done, .rm-steps li.is-on { background: var(--door); }
.rm-steps li.is-on { box-shadow: 0 0 0 3px var(--door-soft); }
.rm-themes.is-big { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.rm-qpick { display: grid; gap: 8px; }
.rm-qopt { min-height: 52px; padding: 10px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: transparent; color: var(--ink); font-family: var(--display); font-size: 19px; text-align: left; cursor: pointer; }
.rm-qopt[aria-pressed="true"] { border-color: var(--door); background: var(--door-soft); }
.rm-ob-go { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 6px; }
.rm-ob-r { display: flex; gap: 6px; }
.rm-ready { position: relative; border-radius: var(--r-lg); overflow: hidden; }
.rm-ready-scene { animation: rm-reveal 1.8s var(--ease) both; }
.rm-ready-t { position: absolute; inset: auto 0 0 0; display: grid; gap: 10px; justify-items: start; padding: clamp(20px, 4vw, 48px); background: linear-gradient(0deg, rgba(8, 6, 5, 0.92), transparent); color: #f4eee2; animation: rm-in 1s var(--ease) 1s backwards; }

/* ------------------------------------------------------------------ motion */
@keyframes rm-spin { to { transform: rotate(360deg); } }
@keyframes rm-glow { 50% { opacity: 0.75; } }
@keyframes rm-flicker { 0%, 100% { opacity: 1; transform: translate(-50%, -40%) scale(1); } 40% { opacity: 0.8; transform: translate(-50%, -42%) scale(0.94); } 70% { opacity: 0.95; transform: translate(-51%, -40%) scale(1.04); } }
@keyframes rm-rain { to { background-position: -30px 120px; } }
@keyframes rm-poke { 30% { transform: translate(-50%, -104%) scale(1.04); } }
@keyframes rm-pulse { 50% { opacity: 0.45; } }
@keyframes rm-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes rm-fade { from { opacity: 0; } }
@keyframes rm-rise { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
@keyframes rm-bar { from { width: 0; } }
@keyframes rm-reveal { from { filter: brightness(0) blur(6px); transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) {
  .rm-page *, #rm-layer * { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------------ tablet and phone */
@media (max-width: 1000px) {
  .rm-onboard { grid-template-columns: minmax(0, 1fr); }
  .rm-ob-preview { position: relative; top: 0; }
  .rm-below { grid-template-columns: minmax(0, 1fr); }
  .rm-talk { grid-row: auto; }
}
@media (max-width: 760px) {
  .rm-shell .main { padding-left: 0; padding-right: 0; padding-top: 0; }
  .rm-page { gap: var(--s-5); }
  .rm-stage { border-radius: 0 0 24px 24px; }
  /* the room stands up: a taller room, two rows of frames, the shelf across the middle */
  .rm-scene { aspect-ratio: 3 / 4.2; max-height: none; min-height: 0; --split: 64%; }
  .rm-obj { left: var(--px); top: var(--py); width: var(--pw); }
  .rm-place { left: var(--px); top: var(--py); width: 14%; }
  .rm-shelfboard { left: 16%; width: 68%; top: 53%; }
  .rm-tabletop { left: 18%; width: 64%; top: 85%; height: 8%; }
  .rm-sconce.s2 { right: 4%; }
  .rm-spines { height: clamp(40px, 18cqi, 90px); }
  .rm-poster b { font-size: clamp(9px, 2.6cqi, 15px); }
  .rm-poster small, .rm-poster i { font-size: clamp(6px, 1.6cqi, 9px); }
  .rm-note q { font-size: clamp(8px, 2.1cqi, 13px); }
  .rm-card b { font-size: clamp(8px, 2cqi, 13px); }
  .rm-card small { font-size: clamp(6px, 1.5cqi, 9px); }
  .rm-hud { padding: 10px; }
  .rm-tool.is-text span { display: none; }
  .rm-tool.is-text { padding: 0; width: 40px; }
  .rm-plate { left: 10px; top: 10px; max-width: calc(100% - 120px); padding: 5px 12px 5px 5px; }
  .rm-plate small, .rm-mood span { display: none; }
  .rm-plate .av { --size: 34px !important; }
  .rm-presence { left: 10px; top: 60px; }
  .rm-plate b { font-size: 16px; }
  .rm-mini { right: 10px; bottom: 10px; max-width: 64%; }
  .rm-visit { margin: 0 14px; position: sticky; bottom: calc(var(--tab-h) + 10px + env(safe-area-inset-bottom)); z-index: 20; padding: 8px; border-radius: 99px; background: rgba(27, 24, 21, 0.86); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4); justify-content: center; }
  .rm-below, .rm-panel, .rm-onboard, .rm-wait, .rm-empty { margin: 0 14px; }
  .rm-onboard { gap: var(--s-4); }
  .rm-ob-preview { border-radius: 20px; }
  .rm-addrow { grid-template-columns: 1fr 1fr; }
  .rm-addrow button { grid-column: 1 / -1; }
  .rm-grid2 { grid-template-columns: 1fr; }
  .rm-selbar { bottom: 10px; }
  #rm-layer { place-items: end center; padding: 0; }
  .rm-sheet { border-radius: 24px 24px 0 0; width: 100%; max-height: 88dvh; padding: 24px 18px calc(24px + env(safe-area-inset-bottom)); }
  .rm-ready-t { position: relative; background: none; padding: 20px 14px; color: var(--ink); }
}
.rm-ob-form, .rm-panel-in { min-width: 0; }
.rm-ob-form input, .rm-addrow input, .rm-panel input, .rm-panel textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.rm-panel textarea, .rm-onboard textarea { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--sunk); color: var(--ink); font: inherit; font-size: 15px; resize: vertical; }
.rm-scene.is-edit, .rm-stage.is-edit { -webkit-user-select: none; user-select: none; }
