/* The room is a view of the collection; its original HTML stays available. */
.collection-band.is-room-enhanced { display: block; position: relative; background: transparent; }
.collection-band.is-room-enhanced [hidden] { display: none !important; }
.collection-band[data-room-mode="list"] > .collection-types { border-right: 0; padding: 12px 0; display: flex; flex-wrap: wrap; }
.collection-band[data-room-mode="list"] > .collection-types button { width: auto; flex: 1 1 150px; }
.collection-room { --room-cream: #ede7da; --room-accent: var(--ice, #a7dbe1); position: relative; min-width: 0; }
.room-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px 16px; min-height: 52px; padding: 8px 0; }
.room-back, .room-record-close, .room-reel-arrow { border: 0; background: transparent; color: var(--ink); font: 400 12px/1.6 var(--font-sans); cursor: pointer; }
.room-back { min-height: 44px; padding: 8px 0 8px 14px; flex-shrink: 0; }
.room-stage { position: relative; isolation: isolate; width: 100%; height: clamp(460px, 60vw, 820px); overflow: hidden; background: transparent; border: 1px solid var(--line); }
.room-poster, .room-viewer { position: absolute; inset: 0; width: 100%; height: 100%; }
.room-poster-frame { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.room-poster { display: block; object-fit: contain; object-position: center; transform: scale(1.14); }
.room-viewer { z-index: 1; opacity: 0; overflow: hidden; }
.room-viewer canvas { display: block; width: 100%; height: 100%; touch-action: pan-y pinch-zoom; }
.collection-room[data-state="ready"] .room-poster { opacity: 0; pointer-events: none; }
.collection-room[data-state="ready"] .room-viewer { opacity: 1; }
.room-view-controls { display: flex; flex-shrink: 0; align-items: center; gap: 2px; }
.room-view-control { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 4px 10px; border: 1px solid transparent; background: transparent; color: var(--ink-dim); font: 400 12px/1 var(--font-sans); cursor: pointer; }
.room-view-control:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.room-loading { position: absolute; z-index: 4; left: 20px; bottom: 16px; margin: 0; color: var(--ink-dim); font: 400 12px/1.6 var(--font-sans); pointer-events: none; }
.room-loading::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 8px; vertical-align: 2px; border-radius: 50%; background: var(--room-accent); }
.room-detail { position: absolute; z-index: 5; top: 24px; right: 24px; width: min(420px, 45%); max-height: calc(100% - 48px); overflow: auto; overscroll-behavior: contain; color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); box-shadow: 0 12px 50px #0003; scrollbar-width: thin; }
.room-surface { box-sizing: border-box; min-width: 0; padding: 22px; background: var(--bg); color: var(--ink); }
.room-surface-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.room-surface-heading h3 { margin: 0; font: 500 22px/1.4 var(--font-serif); }
.room-item-count { color: var(--ink-faint); font: 400 11px/1.6 var(--font-sans); white-space: nowrap; }
.room-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; min-height: 230px; text-align: center; }
.room-empty p { color: var(--ink-dim); margin: 0; font: 400 13px/1.8 var(--font-sans); }
.room-empty-object { display: block; position: relative; width: 96px; height: 60px; border: 1px solid var(--line-strong); opacity: .75; }
.room-empty--game .room-empty-object { border-width: 2px 2px 6px; border-radius: 3px; }
.room-empty--game .room-empty-object::after { content: ''; position: absolute; width: 36px; height: 10px; left: 28px; top: 63px; border-bottom: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong); }
.room-empty--music .room-empty-object { width: 88px; height: 88px; border-radius: 50%; background: repeating-radial-gradient(circle, transparent 0 4px, var(--line) 4px 5px); }
.room-empty--music .room-empty-object::after { content: ''; position: absolute; inset: 31px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--bg); }
.room-empty--film-anime .room-empty-object { width: 116px; border-block-width: 5px; }
.room-empty--reading .room-empty-object { width: 112px; height: 76px; border-width: 0 0 5px; background: repeating-linear-gradient(90deg, transparent 0 11px, var(--line-strong) 11px 12px, transparent 12px 25px); }
.room-empty--tool .room-empty-object::after { content: ''; position: absolute; left: 35px; top: 23px; width: 24px; height: 5px; border: 1px solid var(--line-strong); }
.room-surface.is-projected { position: absolute; width: 1024px; height: 640px; overflow: auto; transform-origin: 0 0; background: #111820; color: #eff4f6; --ink: #eff4f6; --ink-dim: #c5d0d7; --ink-faint: #a6b8c3; --line: #cfeaff25; --line-strong: #cfeaff4a; --bg: #111820; padding: 46px; font-size: 22px; scrollbar-width: thin; }
.room-surface--film-anime.is-projected { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 576px; overflow: hidden; background: #101417; --bg: #101417; }
.room-surface.is-projected .room-surface-heading { margin-bottom: 30px; padding-bottom: 20px; }
.room-surface.is-projected .room-surface-heading h3 { font-size: 36px; }
.room-surface.is-projected .room-item-count { font-size: 20px; }
.room-surface.is-projected.is-empty { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.room-surface.is-projected .room-empty { min-height: 0; gap: 38px; }
.room-surface.is-projected .room-empty p { font-size: 24px; }
.room-surface.is-projected .room-empty-object { scale: 1.5; }
.room-game-library { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.room-game, .room-tool, .room-selected-work { display: block; min-width: 0; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.room-game .room-entry-art { display: block; margin-bottom: 12px; aspect-ratio: 16 / 10; overflow: hidden; background: var(--panel); }
.room-entry-art :is(.collection-item-cover, .collection-item-placeholder) { width: 100%; height: 100%; }
.room-entry-art .collection-item-placeholder { border-color: var(--line); }
.room-entry-art .collection-item-placeholder svg { width: 50%; max-width: 70px; }
.room-entry-title { display: block; margin-bottom: 8px; font: 500 14px/1.5 var(--font-sans); overflow-wrap: anywhere; }
.room-game .collection-item-meta { font-size: var(--fs-micro); }
.room-surface.is-projected .room-game-library { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.room-surface.is-projected .room-entry-title { font-size: 22px; }
.room-surface.is-projected .collection-item-meta { font-size: 17px; }
.room-work-cover { position: relative; display: block; margin: 0 auto 20px; }
.room-record-player .room-work-cover { width: 72%; aspect-ratio: 1; margin: 16px 20% 28px 2%; isolation: isolate; }
.room-work-cover :is(.collection-item-cover, .collection-item-placeholder) { width: 100%; height: 100%; aspect-ratio: inherit; position: relative; z-index: 2; }
.room-record-player .room-work-cover :is(.collection-item-cover, .collection-item-placeholder) { box-shadow: 4px 6px 18px #0004; border: 1px solid var(--line-strong); background: var(--bg); }
.room-vinyl { position: absolute; z-index: 1; inset: 3% -24% 3% 30%; display: block; border-radius: 50%; background: repeating-radial-gradient(circle at 50% 50%, #1b1d20 0 3px, #303238 3px 4px, #17191b 4px 6px); box-shadow: 2px 4px 10px #0005; }
.room-vinyl::after { position: absolute; inset: 36%; content: ''; border: 14px solid #859ca1; background: #14181d; border-radius: 50%; }
.room-work-title { display: block; margin-bottom: 10px; font: 500 20px/1.5 var(--font-serif); overflow-wrap: anywhere; }
.room-reel-controls { display: flex; justify-content: center; align-items: center; gap: 28px; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 8px; }
.room-reel-arrow { min-width: 44px; min-height: 44px; font-size: 21px; color: inherit; }
.room-reel-arrow:disabled { opacity: .3; cursor: default; }
.room-reel-count { font: 400 11px/1.5 var(--font-mono); color: var(--ink-faint); }
.room-film-screen { padding: 0 0 8px; background: #101417; color: #eef1f4; --ink-faint: #a6b8c3; --line: #cfeaff25; }
.room-surface--film-anime { background: #101417; color: #eef1f4; --ink-faint: #a6b8c3; --ink-dim: #c5d0d7; --line: #cfeaff25; --line-strong: #cfeaff4a; --bg: #101417; }
.room-film-screen .room-work-cover { aspect-ratio: 16 / 9; overflow: hidden; border-block: 8px solid #020405; }
.room-film-screen .room-work-cover img { object-fit: contain !important; background: #020405; }
.room-surface--film-anime.is-projected .room-surface-heading { margin: 0 0 18px; padding: 0 0 12px; }
/* The physical screen has a fixed height. Reserve its controls before sizing
   the artwork/title; the complete title remains in the button and detail. */
.room-surface--film-anime.is-projected .room-film-screen { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 18px; min-height: 0; padding: 0; }
.room-surface--film-anime.is-projected .room-selected-work { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr) auto; gap: 12px 32px; min-height: 0; }
.room-surface--film-anime.is-projected .room-work-cover { grid-column: 1; grid-row: 1 / -1; align-self: center; width: 100%; max-height: 100%; float: none; margin: 0; }
.room-surface--film-anime.is-projected .room-work-title { grid-column: 2; grid-row: 1; align-self: end; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; min-height: 0; max-height: 5.4em; margin: 0; padding: 0; overflow: hidden; font-size: 34px; line-height: 1.35; }
.room-surface--film-anime.is-projected .room-selected-work > .collection-item-meta { grid-column: 2; grid-row: 2; align-self: start; min-width: 0; max-height: 3.2em; margin: 0; overflow: hidden; }
.room-surface--film-anime.is-projected .room-reel-controls { margin-top: 0; }
.room-surface--film-anime.is-projected .room-reel-arrow { min-width: 80px; min-height: 64px; font-size: 32px; }
.room-surface--film-anime.is-projected .room-reel-count { font-size: 19px; }
.room-bookshelf { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px 4px; padding: 22px 10px 18px; border-bottom: 10px solid color-mix(in srgb, var(--ink-faint) 30%, var(--bg)); background: linear-gradient(0deg, #0002, transparent 45%); }
.room-book { position: relative; display: flex; flex-direction: column; align-items: center; width: 46px; min-width: 46px; height: 205px; padding: 12px 8px; overflow: hidden; color: #fff; border: 0; border-inline: 2px solid #0002; border-radius: 2px 1px 1px 2px; background: var(--book-color); box-shadow: inset 3px 0 #ffffff22, 2px 3px 3px #0002; cursor: pointer; transition: transform 180ms; }
.room-book:nth-child(3n) { height: 186px; }
.room-book:nth-child(4n) { height: 195px; }
.room-book:hover, .room-book:focus-visible { transform: translateY(-8px); }
.room-book-index { flex-shrink: 0; font: 400 var(--fs-micro)/1.2 var(--font-mono); padding-bottom: 12px; opacity: .8; }
.room-book-title { writing-mode: vertical-rl; white-space: nowrap; overflow: hidden; inline-size: 158px; block-size: 22px; min-height: 0; flex: 0 1 158px; text-overflow: ellipsis; font: 500 13px/1.7 var(--font-sans); letter-spacing: .07em; }
.room-equipment { display: grid; gap: 0; }
.room-tool { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 15px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.room-tool .room-entry-art { grid-row: span 2; aspect-ratio: 1; }
.room-tool .room-entry-title { margin: 0; }
.room-tool .collection-item-meta { font-size: var(--fs-micro); }
.room-announcement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.collection-room .room-reading-open:not(:focus-visible) { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.room-record-dialog { width: min(680px, calc(100vw - 36px)); max-width: 680px; max-height: min(86dvh, 960px); box-sizing: border-box; padding: 24px 28px 30px; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--bg); color: var(--ink); overflow-y: auto; overscroll-behavior: contain; }
.room-record-dialog::backdrop { background: #05090dc9; }
.room-record-close { position: sticky; z-index: 1; top: 0; display: block; min-height: 44px; margin: -10px -8px 18px auto; padding: 10px; background: var(--bg); box-shadow: 0 0 0 4px var(--bg); }
.room-record-content .collection-item { display: block; padding: 0; border: 0; }
.room-record-content .collection-item-media { max-width: 340px; margin: 0 auto 24px; }
.room-record-dialog[data-type="reading"] :is(.collection-item-cover, .collection-item-placeholder) { aspect-ratio: 2 / 3; }
.room-record-dialog[data-type="music"] :is(.collection-item-cover, .collection-item-placeholder) { aspect-ratio: 1; }
.room-record-content .collection-item h4 { font-size: 28px; }
.room-record-content .collection-item p { font-size: 15px; line-height: 1.95; }
.room-record-content .collection-item-body > a { font-size: 14px; min-height: 44px; box-sizing: border-box; }
.collection-room :is(button, a):focus-visible { outline: 2px solid var(--room-accent); outline-offset: 4px; }
.room-viewer .room-surface :is(button, a):focus-visible { outline: 3px solid #bdeef3; outline-offset: 5px; }
@media (min-width: 761px) and (max-width: 1050px) {
  .room-stage { height: 600px; }
  .room-detail { top: 16px; right: 16px; width: 44%; max-height: calc(100% - 32px); }
  .room-surface { padding: 18px; }
}
@media (max-width: 760px) {
  .room-toolbar { min-height: 58px; gap: 4px 10px; }
  .room-back { font-size: 12px; }
  .room-view-controls { margin-left: auto; }
  .room-stage { height: auto; min-height: 340px; aspect-ratio: 1.08; overflow: visible; }
  .room-poster, .room-viewer { height: 100%; }
  .collection-room[data-active] .room-stage { aspect-ratio: auto; padding-top: 290px; }
  .collection-room[data-active] .room-poster, .collection-room[data-active] .room-viewer { height: 290px; }
  .collection-room[data-active] .room-poster-frame { height: 290px; }
  .room-detail { position: relative; top: auto; right: auto; width: 100%; max-height: none; border: 0; border-top: 1px solid var(--line-strong); box-shadow: none; overflow: visible; }
  .room-surface { padding: 22px 20px; }
  .room-surface-heading { margin-bottom: 18px; }
  .room-empty { min-height: 190px; }
  .room-record-dialog { padding: 20px; }
  .room-record-content .collection-item h4 { font-size: 24px; }
  .room-record-content .collection-item p { font-size: 14px; }
  .room-bookshelf { gap: 12px 4px; }
  .room-book { width: 42px; min-width: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .collection-room *, .collection-room *::before, .collection-room *::after { transition: none !important; animation: none !important; }
  .room-book:hover, .room-book:focus-visible { transform: none; }
}
