/* Interior rooms of the ARCANA 16 card library. */
.room {
  --room-accent: #365541;
  --room-edge: #d9c8b2;
  --room-paper: #fffaf0;
  max-width: 1380px;
  padding: 15px clamp(16px, 3.7vw, 58px) clamp(45px, 6vw, 84px);
}
.room-chat { --room-accent: #674936; }
.room-rank { --room-accent: #815226; }
.room-game { --room-accent: #984d32; }
.room .back { margin: 0 0 12px 3px; color: #705b46; }
.room-head { position: relative; isolation: isolate; margin-bottom: clamp(20px, 3vw, 38px); }
.room-head h1 { font-size: clamp(36px, 4.8vw, 72px); line-height: 1.13; margin: .16em 0 .25em; color: #352619; }
.room-head .eyebrow { color: var(--room-accent); font-size: clamp(10px, 1.05vw, 14px); }
.room-head .lede { max-width: 40em; color: #564536; line-height: 1.65; font-size: clamp(14px, 1.25vw, 18px); }
.room-banner, .room-exhibit {
  border-radius: clamp(15px, 1.8vw, 26px);
  overflow: hidden; border: 1px solid #d5c1a7; background: #f6e4c9;
}
.room-banner { width: 100%; min-height: 245px; aspect-ratio: 3.4; display: flex; align-items: center; }
.room-banner .room-intro { position: relative; width: 39%; padding: 24px 0 24px 4.4%; }
.room-banner .banner-illustration { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.room-banner::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg,#fff0d67d,transparent 46%); }
.room-chat .room-banner .room-intro { width: 35%; }
.room-chat .room-banner h1 { font-size: clamp(34px, 4vw, 61px); }
.room-heading { padding: 10px 0 clamp(15px, 2vw, 27px); border-bottom: 1px solid var(--room-edge); }
.room-heading h1 { font-size: clamp(34px, 3.8vw, 56px); }
.room-exhibit { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); align-items: stretch; background: linear-gradient(110deg,#fff9ed,#f1e4ce); }
.room-exhibit .room-intro { align-self: center; padding: clamp(22px, 3.4vw, 48px); }
.room-exhibit .formline, .room-exhibit .chips { margin: 20px 0 0; }
.room-exhibit select { background: #fffdf6; border: 1px solid #b6a38a; border-radius: 9px; }
.room-exhibit .formline { row-gap: 10px; column-gap: 8px; }
.room-exhibit .formline select { padding-right: 10px; font-size: 14px; }
.room-exhibit .formline .gold { padding-inline: 13px; }
.room .room-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.room-toolbar h2 { font-size: clamp(23px, 2.3vw, 34px); }
.room-toolbar .portrait-selector { margin: 0; }
.archive-shelves { gap: clamp(26px,3.1vw,43px) clamp(12px,2vw,28px); padding: 5px 10px 18px; }
.archive-shelves .type-card {
  position: relative; overflow: visible; border: 1px solid #c4a884; padding: 5px 5px 0;
  border-radius: 13px 13px 5px 5px; background: linear-gradient(125deg,#fffaf0,#f5e6cd);
  box-shadow: inset 0 0 0 2px #fffaf2, 1px 4px 7px #613c1f20;
}
.archive-shelves .type-card::after {
  content: ""; position: absolute; left: calc(-1 * clamp(7px,1.01vw,15px)); right: calc(-1 * clamp(7px,1.01vw,15px)); bottom: -8px; height: 8px;
  background: linear-gradient(#ddbb88 0 25%,#b68d60 30%,#b58e66 75%,#9d7550); box-shadow: 0 4px 5px #7d562126;
}
.archive-shelves .type-card:hover { transform: none; border-color: #806540; box-shadow: 0 0 0 2px #baa17d; }
.archive-shelves .portrait { border-radius: 9px 9px 2px 2px; aspect-ratio: 1.16; object-position: center top; }
.archive-shelves .plate { display: flex; justify-content: space-between; align-items: center; padding: 12px 7%; }
.archive-shelves .plate b { font-size: clamp(20px,2vw,31px); }
.room-library .detail-layout > section, .room .paper-reading, .room .rank-sheet, .room .quiz-box, .room .chat-room {
  min-width: 0; background: #fffbf3; border: 1px solid var(--room-edge); border-radius: 18px;
  padding: clamp(18px, 2.7vw, 36px); box-shadow: 0 6px 20px #60401f0c;
}
.room-library .detail-layout { grid-template-columns: minmax(175px,265px) minmax(0,1fr); }
.room-library .detail-layout .entry { padding-block: 21px; }
.room-library .detail-layout .fine { margin-top: 16px; }
.room .character-profile .type-card, .room .chat-profile .type-card { padding: 5px; background: #fff8ea; border-color: #c6ae8a; }
.room .character-profile .portrait, .room .chat-profile .portrait { border-radius: 8px; }
.conversation-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(12px,1.6vw,24px); }
.conversation-card {
  position: relative; display: grid; grid-template-columns: minmax(98px,29%) 1fr;
  align-items: stretch; min-width: 0; overflow: hidden; border-radius: 15px; background: #fff8eb;
  border: 1px solid #d9c7ae; box-shadow: 0 3px 10px #6243220b; transition: border-color .18s, transform .18s;
}
.conversation-card:hover { border-color: #967a55; transform: translateY(-2px); }
.guest-photo { width: 100%; height: 100%; max-height: 180px; min-height: 132px; object-fit: cover; object-position: center top; }
.guest-intro { align-self: center; padding: 17px 28px 17px clamp(13px,1.8vw,25px); }
.guest-type { font: 700 13px/1.2 var(--sans); color: var(--room-accent); letter-spacing: .1em; }
.guest-intro h3 { font-size: clamp(20px,1.9vw,29px); margin: 3px 0 6px; }
.guest-intro p { color: #63513d; font-size: clamp(13px,1.1vw,16px); line-height: 1.58; }
.guest-arrow { position: absolute; right: 12px; top: 8px; color: #8b7254; font: 20px var(--sans); }
.room .chat-layout { grid-template-columns: minmax(170px,245px) minmax(0,1fr); gap: clamp(17px,3vw,40px); }
.room .chat-room { border-top: 4px solid #9f7953; }
.room .chat-top h2 { margin: 0; }
.room .chat-top { padding-bottom: 18px; }
.room .chat-line p { border-radius: 3px 15px 15px; }
.room .chat-line.user p { border-radius: 15px 3px 15px 15px; }
.reply-sender { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.reply-sender .character-avatar { width: 30px; height: 30px; }
.reply-sender b { margin: 0; }
.room .chat-starters .chip { background: #f8efdd; border-color: #c9b496; }
.room #chat-input { border-radius: 11px; }
.exhibit-art { position: relative; min-height: 315px; margin: 0; background-position: center; background-size: cover; }
.room .couple-art { display: flex; align-items: flex-end; justify-content: center; gap: clamp(10px,1.1vw,18px); padding: 20px 5% clamp(32px,3.5vw,53px); background-image: url('assets/rooms/pair.webp'); }
.room .couple-art .type-card { padding: 4px; width: clamp(96px,10.5vw,142px); border-radius: 11px; border-color: #bfa678; background: #fbebce; box-shadow: 3px 6px 9px #48301a54; transform: rotate(-5deg); }
.room .couple-art .type-card:last-child { transform: rotate(5deg); }
.room .couple-art .portrait { aspect-ratio: 4/4.7; border-radius: 7px; object-position: center 24%; }
.room .couple-art .plate { padding: 4px 0 2px; }
.room .couple-art .plate b { font-size: clamp(20px,1.8vw,27px); }
.room .couple-art > span { align-self: center; color: #433b26; font-size: 28px; }
.paper-reading > h2 { margin: 8px 0 20px; }
.paper-reading .note { border-radius: 12px; background: #f5ebdc; border-color: #ddc9a9; }
.paper-reading .note:nth-child(2) { background: #edf0df; }
.paper-reading .wide { background: #f7ead8; }
.rank-exhibit { display: flex; align-items: flex-end; justify-content: center; gap: 12px; padding: 22px 6% clamp(28px,4vw,58px); background-image: url('assets/rooms/rank.webp'); }
.featured-rank { position: relative; display: flex; align-items: flex-end; justify-content: center; }
.winner-photo { display: block; height: clamp(175px,14vw,216px); width: auto; border: 5px solid #f2dab2; border-radius: 6px; box-shadow: 3px 5px 9px #38230e66; transform: rotate(-3deg); }
.winner-label { position: relative; display: grid; margin: 0 0 4px -8px; padding: 9px 12px; border: 1px solid #baa16d; border-radius: 5px; background: linear-gradient(130deg,#fff5d3,#eed8a9); box-shadow: 2px 3px 6px #4f301d44; color: #472f16; line-height: 1.35; }
.winner-label small { font-size: 11px; font-weight: 700; }
.winner-label strong { font: 700 clamp(25px,2.4vw,36px) var(--sans); }
.winner-label > span { font-size: 13px; }
.room .rank-sheet { margin: 0; }
.room .rank-sheet > .fine { margin-top: 8px; }
.room .rank-line { grid-template-columns: 42px minmax(130px,190px) 1fr 70px; gap: 12px; padding-block: 9px; }
.rank-person { display: inline-flex; align-items: center; gap: 12px; width: fit-content; }
.rank-person > span:last-child { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.rank-person small { font: 12px var(--sans); color: var(--muted); }
.character-avatar { display: inline-block; flex: none; overflow: hidden; width: 44px; height: 44px; border-radius: 50%; border: 1px solid #d1b997; background: #efddc1; }
.avatar-photo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; transform: scale(1.65); transform-origin: 50% 12%; }
.room .rank-track { height: 8px; background: #efdfc5; }
.room .rank-track span { background: linear-gradient(90deg,#a7b192,#45684d); }
.room .rank-line:first-child .rank-track span { background: linear-gradient(90deg,#e9be72,#b27d31); }
.game-table { display: grid; grid-template-columns: minmax(0,1.22fr) minmax(0,.9fr); gap: clamp(15px,2.3vw,32px); align-items: start; }
.game-scene { position: sticky; top: 20px; margin: 0; padding: 6px; background: #fff5df; border: 1px solid #ccb594; border-radius: 17px; box-shadow: 0 4px 12px #65432016; }
.game-scene img { width: 100%; height: auto; display: block; border-radius: 12px; }
.room .quiz-box { max-width: none; border-top: 4px solid #b97654; }
.room .quiz-box > h2 { font-size: clamp(22px,2.35vw,35px); }
.room .choice { border-radius: 12px; background: #fff9ee; }
.room .choice:hover,.room .choice[aria-pressed=true] { background: #edf1e4; border-color: #536f52; }
.room .answer { background: #f6ecdf; border-radius: 13px; }
.illustrated-note { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 12px; align-items: start; padding-top: 15px; margin-top: 15px; border-top: 1px solid var(--room-edge); }
.illustrated-note > a { line-height: 0; }
.illustrated-note .entry { margin: 0; padding: 0; }
@media (max-width: 800px) {
  .room .conversation-card { grid-template-columns: 92px 1fr; }
  .guest-intro { padding: 12px 17px 12px 12px; }
  .rank-person > span:last-child { display: grid; gap: 2px; }
  .room-exhibit { grid-template-columns: 1fr 1fr; }
  .room .chat-layout { grid-template-columns: 145px minmax(0,1fr); }
  .room .chat-profile { display: flex; flex-direction: column; }
  .room .chat-profile .type-card { width: 100%; }
  .room .chat-profile .portrait-selector button { padding: 7px 8px; }
}
@media (max-width: 660px) {
  .room { padding-inline: 14px; }
  .room .back { font-size: 13px; margin-bottom: 9px; }
  .room-banner { min-height: 0; aspect-ratio: auto; display: block; }
  .room-banner .room-intro, .room-chat .room-banner .room-intro { width: 100%; padding: 20px 20px 15px; }
  .room-banner .banner-illustration { position: static; display: block; width: 143%; max-width: none; height: auto; margin-left: -43%; }
  .room-banner::before { display: none; }
  .room .room-head { margin-bottom: 19px; }
  .room-heading { padding: 5px 0 14px; }
  .room .room-toolbar { margin-bottom: 13px; }
  .room .portrait-selector button { font-size: 12px; padding: 7px 10px; }
  .archive-shelves { grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 12px; row-gap: 23px; padding-inline: 6px; }
  .archive-shelves .plate { padding: 8px 5%; }
  .archive-shelves .plate small { font-size: 12px; }
  .conversation-list { grid-template-columns: 1fr; gap: 10px; }
  .room .conversation-card { grid-template-columns: 29% minmax(0,1fr); }
  .guest-photo { min-height: 112px; height: 124px; }
  .guest-intro { padding: 12px 24px 12px 14px; }
  .room-library .detail-layout, .room .chat-layout { grid-template-columns: 1fr; }
  .room .character-profile, .room .chat-profile { position: static; width: 100%; margin: 0; display: grid; grid-template-columns: 106px minmax(0,1fr); align-items: center; justify-items: start; gap: 8px 15px; }
  .room .character-profile .type-card,.room .chat-profile .type-card { width: 100%; grid-row: span 2; }
  .room .character-profile .portrait,.room .chat-profile .portrait { aspect-ratio: 1; object-position: center 19%; }
  .room .character-profile .portrait-selector,.room .chat-profile .portrait-selector { align-self: end; margin: 0; }
  .room .chat-profile .text-link { align-self: start; }
  .room-exhibit { grid-template-columns: 1fr; }
  .room-exhibit .room-intro { padding: 20px; }
  .room-exhibit .formline,.room-exhibit .chips { margin-top: 14px; }
  .room-exhibit .formline { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .room-exhibit .formline select { width: 100%; min-width: 0; }
  .room-exhibit .formline .gold { grid-column: 1/-1; }
  .exhibit-art { min-height: 0; height: clamp(210px,53vw,260px); }
  .room .couple-art { padding-bottom: 26px; gap: 12px; }
  .room .couple-art .type-card { width: clamp(85px,24vw,118px); }
  .rank-exhibit { padding-bottom: 25px; }
  .winner-photo { height: clamp(140px,36vw,185px); }
  .room .rank-line { grid-template-columns: 27px 88px minmax(20px,1fr) 54px; gap: 7px; }
  .rank-person { gap: 6px; }
  .rank-person .character-avatar { width: 31px; height: 31px; }
  .rank-person small { font-size: 11px; }
  .rank-value { font-size: 13px; }
  .game-table { grid-template-columns: 1fr; }
  .game-scene { position: static; grid-row: 1; width: 100%; padding: 4px; }
  .game-scene img { aspect-ratio: 1.95; object-fit: cover; object-position: center 30%; }
}
@media (max-width: 375px) {
  .room-toolbar h2 { font-size: 20px; }
  .room .rank-line { grid-template-columns: 24px 82px 1fr 48px; gap: 5px; }
  .room-exhibit .formline { align-items: stretch; }
  .room-exhibit .formline .gold { min-width: 100%; }
}
