.moru-room-page {
  display: grid;
  gap: 22px;
  width: min(1280px, calc(100% - 32px));
  margin: 28px auto 72px;
}

.moru-house-hero {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--rf-secondary) 35%, var(--rf-line));
  border-radius: 24px 8px 24px 8px;
  background-image: linear-gradient(90deg, rgba(5, 7, 18, .9) 0%, rgba(5, 7, 18, .56) 48%, rgba(5, 7, 18, .08) 78%), var(--moru-house-image);
  background-position: center;
  background-size: cover;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .38);
}

.moru-house-copy {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  gap: 14px;
  width: min(570px, 62%);
  min-height: 560px;
  padding: clamp(28px, 6vw, 76px);
}

.moru-house-copy h1 {
  max-width: 620px;
  margin: 0;
  color: #fff;
  font-size: clamp(2.3rem, 6vw, 5.4rem);
  line-height: .94;
}

.moru-house-copy > p {
  max-width: 600px;
  margin: 0;
  color: #d9d5e8;
  font-size: clamp(.9rem, 1.5vw, 1.08rem);
  line-height: 1.7;
}

.moru-affinity,
.moru-house-actions,
.moru-format-filter,
.moru-card-meta,
.moru-card-genres {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.moru-affinity span,
.moru-card-genres span {
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 999px;
  padding: 6px 10px;
  color: #e5dcff;
  background: rgba(11, 10, 26, .62);
  font-size: .64rem;
  font-weight: 750;
}

.moru-house-actions { margin-top: 8px; }
.moru-plot-finder {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(320px, 1.3fr);
  gap: 18px 28px;
  align-items: end;
  border: 1px solid var(--rf-line);
  border-radius: 16px 5px 16px 5px;
  padding: 20px;
  background: var(--rf-surface);
}
.moru-plot-finder h2 { margin: 4px 0 8px; }
.moru-plot-finder p,
.moru-plot-finder > small { margin: 0; color: var(--rf-muted); font-size: .72rem; line-height: 1.55; }
.moru-plot-finder form { display: flex; flex-wrap: wrap; gap: 9px; }
.moru-plot-finder textarea { flex: 1 1 100%; min-height: 92px; resize: vertical; }
.moru-plot-finder > small { grid-column: 2; }
.moru-art-credit {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 4;
  margin: 0;
  border-radius: 999px;
  padding: 6px 10px;
  color: rgba(255, 255, 255, .76);
  background: rgba(5, 7, 18, .72);
  font-size: .6rem;
  line-height: 1.25;
  backdrop-filter: blur(6px);
}
.moru-art-credit a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.moru-art-credit a:hover { color: var(--rf-secondary); }
.moru-room-character {
  position: absolute;
  right: clamp(18px, 5vw, 76px);
  bottom: 0;
  z-index: 3;
  display: grid;
  justify-items: center;
  width: min(360px, 32vw);
}

.moru-room-character img {
  display: block;
  width: min(310px, 28vw);
  max-height: 350px;
  object-fit: contain;
  filter: drop-shadow(0 24px 18px rgba(0, 0, 0, .58));
  transition: transform .2s ease;
}

.moru-room-character[data-mood="happy"] img { animation: moru-room-happy .7s ease both; }
.moru-room-character[data-mood="annoyed"] img { transform: translateY(4px) rotate(-1.5deg); }
.moru-room-character[data-mood="thinking"] img { animation: moru-room-think .8s ease-in-out infinite alternate; }
.moru-room-character p {
  position: absolute;
  right: 80%;
  bottom: 45%;
  width: 220px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 14px 14px 3px 14px;
  padding: 12px 14px;
  color: #f4f0ff;
  background: rgba(12, 11, 27, .9);
  font-size: .72rem;
  line-height: 1.45;
  box-shadow: 0 15px 32px rgba(0, 0, 0, .35);
}

.moru-format-filter {
  justify-content: center;
  padding: 3px;
}

.moru-format-filter a {
  border: 1px solid var(--rf-line);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--rf-muted);
  background: var(--rf-surface);
  font-size: .7rem;
  font-weight: 800;
  text-decoration: none;
}

.moru-format-filter a:hover,
.moru-format-filter a:focus-visible,
.moru-format-filter a.active {
  border-color: var(--rf-primary);
  color: var(--rf-text);
  background: color-mix(in srgb, var(--rf-primary) 12%, var(--rf-surface));
}

.moru-recommendation-section {
  display: grid;
  gap: 20px;
}

.moru-shelf-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.moru-shelf-heading h2 { margin: 4px 0 0; font-size: clamp(1.5rem, 3vw, 2.4rem); }
.moru-shelf-heading > span { color: var(--rf-muted); font-size: .72rem; }
.moru-recommendation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.moru-recommendation-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--rf-line);
  border-radius: 16px 5px 16px 5px;
  background: var(--rf-surface);
  transition: border-color .18s ease, transform .18s ease;
}

.moru-recommendation-card:hover { border-color: color-mix(in srgb, var(--rf-primary) 55%, var(--rf-line)); transform: translateY(-2px); }
.moru-recommendation-card.is-rejected { opacity: 0; transform: scale(.97); }
.moru-recommendation-cover { display: block; min-height: 238px; color: var(--rf-text); background: var(--rf-bg); text-decoration: none; }
.moru-recommendation-cover img { width: 100%; height: 100%; object-fit: cover; }
.moru-recommendation-cover > span { display: grid; place-items: center; height: 100%; font-weight: 900; }
.moru-recommendation-copy { display: grid; align-content: start; gap: 7px; min-width: 0; padding: 15px; }
.moru-recommendation-copy > small { overflow: hidden; color: var(--rf-secondary); font-size: .59rem; font-weight: 850; white-space: nowrap; text-overflow: ellipsis; }
.moru-recommendation-copy h3 { margin: 0; overflow: hidden; font-size: .98rem; white-space: nowrap; text-overflow: ellipsis; }
.moru-recommendation-copy h3 a { color: var(--rf-text); text-decoration: none; }
.moru-card-meta span { color: var(--rf-muted); font-size: .62rem; font-weight: 750; }
.moru-card-meta span + span::before { content: "·"; margin-right: 8px; }
.moru-recommendation-copy > p { display: -webkit-box; overflow: hidden; margin: 2px 0; color: var(--rf-muted); font-size: .67rem; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.moru-card-genres span { border-color: var(--rf-line); padding: 4px 7px; color: var(--rf-muted); background: var(--rf-bg); font-size: .55rem; }
.moru-open-pick { align-self: end; color: var(--rf-primary); font-size: .65rem; font-weight: 850; text-decoration: none; }

@keyframes moru-room-happy { 45% { transform: translateY(-18px) rotate(3deg); } }
@keyframes moru-room-think { to { transform: translateY(-8px) rotate(1.5deg); } }

@media (max-width: 1100px) {
  .moru-recommendation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .moru-room-page { width: min(100% - 20px, 1280px); margin-top: 12px; }
  .moru-house-hero { min-height: 670px; background-image: linear-gradient(180deg, rgba(5, 7, 18, .82), rgba(5, 7, 18, .28)), var(--moru-house-image); }
  .moru-house-copy { align-content: start; width: auto; min-height: 0; padding: 32px 24px; }
  .moru-room-character { right: 6px; width: 260px; }
  .moru-room-character img { width: 210px; }
  .moru-room-character p { right: 55%; bottom: 72%; width: 190px; }
  .moru-recommendation-grid { grid-template-columns: 1fr; }
  .moru-plot-finder { grid-template-columns: 1fr; align-items: stretch; }
  .moru-plot-finder > small { grid-column: auto; }
}

@media (max-width: 440px) {
  .moru-house-hero { min-height: 720px; }
  .moru-house-copy h1 { font-size: 2.4rem; }
  .moru-house-actions .button { width: 100%; text-align: center; }
  .moru-room-character { width: 220px; }
  .moru-room-character p { right: 46%; width: 160px; }
  .moru-recommendation-card { grid-template-columns: 104px minmax(0, 1fr); }
  .moru-recommendation-cover { min-height: 210px; }
}

@media (prefers-reduced-motion: reduce) {
  .moru-room-character img,
  .moru-recommendation-card { animation: none !important; transition: none; }
}
