/* The room is a conversation space; facilities live in the category menu. */
.home-town-screen .home-town-home[data-layout="room"]{display:grid;grid-template-rows:minmax(0,1fr) auto;position:relative;isolation:isolate;width:100%;max-width:640px;height:100%;min-height:0;padding:0;gap:0;overflow:hidden;background:#151622}
.home-town-home[data-layout="room"]::after{display:none}
.home-town-screen:has([data-layout="room"]):has(>.home-alert){grid-template-rows:minmax(0,1fr) auto}
.home-town-screen:has([data-layout="room"])>.home-alert{margin:0;padding:6px 10px;max-width:640px;font-size:11px}
.home-town-home[data-layout="room"] .home-town-scene{position:relative;inset:auto;width:100%;height:100%;min-height:0;max-width:none;margin:0;aspect-ratio:auto;container-type:size;overflow:hidden;background:#27212b}
.home-town-home[data-layout="room"] .home-town-art{object-fit:cover;object-position:50% 20%}
.home-town-home[data-layout="room"] .home-town-world{aspect-ratio:auto}
.home-town-home[data-layout="room"] .home-letter-entry{transition:none}
.home-town-home[data-layout="room"] .home-letter-entry:not(.is-on-table){top:clamp(4px,84px,calc(100cqh - 68px))}
@container(max-height:239px){
 .home-town-home[data-layout="room"] .home-letter-entry:not(.is-on-table){top:4px;left:calc(50% - 56px);right:auto;width:112px;height:44px;min-height:44px;padding:4px 8px;gap:6px}
 .home-town-home[data-layout="room"] .home-letter-entry:not(.is-on-table) .home-letter-envelope{width:24px;height:18px}
 .home-town-home[data-layout="room"] .home-letter-entry:not(.is-on-table) .home-letter-entry-copy strong{font-size:var(--ga-font-note,.75rem);white-space:nowrap}
 .home-town-home[data-layout="room"] .home-letter-entry:not(.is-on-table) .home-letter-entry-copy small{display:none}
}
.home-room-heading{position:absolute;z-index:2000;inset:12px 14px auto;display:flex;justify-content:space-between;align-items:center;gap:8px;color:#f3e5cf;text-shadow:0 2px 5px #080712;pointer-events:none}
.home-room-heading button{pointer-events:auto}
.home-room-heading h2{margin:0;font:500 17px/1.4 "Yu Mincho",serif;letter-spacing:.08em}
.home-room-heading p{margin:3px 0 0;font-size:10px;color:#d2c7bd}
.home-room-heading button{display:flex;align-items:center;gap:7px;min-height:44px;padding:7px 10px;border:1px solid #b6a18066;border-radius:7px;background:#151825d9;color:#e8dac3;font-size:11px;box-shadow:none;white-space:nowrap}
.home-room-heading button span{font-size:10px;color:#b8ac9b;font-variant-numeric:tabular-nums}
.home-room-hint{position:absolute;z-index:1500;bottom:12px;left:0;width:100%;margin:0;text-align:center;font-size:10px;letter-spacing:.05em;color:#e1d3bd;text-shadow:0 2px 5px #160e0e;pointer-events:none}
.home-lounge-entry {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding-inline: 6px;
  font-size: var(--ga-font-note, .75rem);
  text-underline-offset: 3px;
}
.home-lounge-count {
  display: inline-grid;
  place-items: center;
  min-width: 1rem;
  min-height: 1rem;
  padding-inline: 4px;
  border: 1px solid var(--selected-border);
  border-radius: 999px;
  background: var(--selected-end);
  color: var(--selected-text);
  font-size: var(--ga-font-caption, .6875rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: none;
}
.home-town-scene > .home-lounge-entry {
  position: absolute;
  z-index: 1500;
  inset-inline-end: 10px;
  bottom: 30px;
  color: #e1d3bd;
  text-shadow: 0 1px 4px #160e0e, 0 1px 2px #160e0e;
}
.home-town-home[data-layout="room"]:has(.home-town-speech:not([hidden])) .home-room-hint{visibility:hidden}
.home-room-empty{position:absolute;top:56%;left:12%;width:76%;margin:0;z-index:1500;text-align:center;font-size:13px;line-height:1.9;color:#e0d3bf;text-shadow:0 2px 5px #160e0e;pointer-events:none}
.home-town-home[data-layout="room"] .home-town-walker{width:max(44px,var(--town-sprite-size));height:max(44px,var(--town-sprite-size));min-width:44px;min-height:44px}
.home-town-home[data-layout="room"] .home-town-walker[hidden]{display:none}
.home-town-home[data-layout="room"] .home-town-walker img{animation-duration:4s}
.home-town-home[data-layout="room"] .home-town-walker.is-walking img{animation-duration:.55s}
.home-room-scene-caption{position:absolute;z-index:1600;top:65px;left:14px;max-width:calc(100% - 64px);margin:0;padding:4px 9px;border:1px solid #d5bc8b55;border-radius:12px;background:#211e2dba;color:#ead6af;font-size:10px;letter-spacing:.04em;pointer-events:none}
.home-room-scene-caption[hidden],.home-town-ambient-speech[hidden]{display:none}
.home-town-ambient-speech{position:absolute;z-index:1800;width:min(190px,calc(100% - 24px));padding:8px 10px;border:1px solid #c7ad80;border-radius:10px;background:linear-gradient(145deg,#302b39f5,#1a1d2bf5);box-shadow:0 4px 12px #0005;color:#f2e5d2;pointer-events:none;overflow-wrap:anywhere}
.home-town-ambient-speech>strong{display:block;margin-bottom:3px;color:#e5c78e;font-size:.6875rem;font-weight:600}
.home-town-ambient-speech>p{margin:0;font-size:var(--ga-font-note,.75rem);line-height:1.65}
.home-town-ambient-speech::after{position:absolute;left:var(--ambient-tail-x,50%);bottom:-5px;width:8px;height:8px;border-right:1px solid #c7ad80;border-bottom:1px solid #c7ad80;background:#242330;transform:translateX(-50%) rotate(45deg);content:""}
.home-town-ambient-speech[data-tail="top"]::after{top:-5px;bottom:auto;transform:translateX(-50%) rotate(225deg)}
.home-town-ambient-speech[data-tail="left"]::after{top:var(--ambient-tail-y);bottom:auto;left:-5px;transform:translateY(-50%) rotate(135deg)}
.home-town-ambient-speech[data-tail="right"]::after{top:var(--ambient-tail-y);bottom:auto;left:auto;right:-5px;transform:translateY(-50%) rotate(-45deg)}
.home-town-home[data-layout="room"] .home-town-walker.is-social-speaking .home-town-walker-ground{filter:drop-shadow(0 0 3px #ffe0a28c) drop-shadow(0 2px 1px #0008)}
.home-town-home[data-room-household] .home-room-scene-caption{display:none}
.home-town-home[data-room-household] .home-town-walker-ground{filter:drop-shadow(0 2px 2px #17101ad9)}
.home-town-screen .home-town-home[data-layout="room"][data-room-household]{max-width:560px}
.home-town-home[data-layout="room"] .home-town-walker[data-town-activity="chase"].is-walking img{animation-duration:.28s}
.home-town-home[data-layout="room"] .home-town-speech{display:flex;align-items:center;gap:2px;inset:auto;z-index:3000;width:min(240px,calc(100% - 16px));padding:6px 6px 6px 12px;border:2px solid #c3a37a;border-radius:16px;background:linear-gradient(145deg,#242330f7,#131827fa);pointer-events:auto;box-shadow:0 5px 20px #0007}
.home-town-home[data-layout="room"] .home-town-speech[hidden]{display:none}
.home-town-home[data-layout="room"] .home-town-speech::after{border-color:#c3a37a;background:#1d2030;pointer-events:none}
.home-town-home[data-layout="room"] .home-town-speech>p{flex:1;min-width:0;margin:0;font-size:13px;line-height:1.65}
.home-room-actions{display:grid;grid-template-columns:70px minmax(0,1fr);align-items:stretch;gap:10px;padding:9px 12px;background:#151722;border-top:1px solid #8b755b66}
.home-room-actions>button{position:relative;inset:auto;display:flex;align-items:center;justify-content:center;gap:9px;width:100%;min-height:54px;min-width:0;margin:0;padding:7px 10px;border:1px solid #a48d6877;border-radius:8px;background:#292935;color:#f1e5d1;box-shadow:none;text-shadow:none}
.home-room-actions .home-room-formation{flex-direction:column;gap:2px;padding:6px 3px;font-size:var(--ga-font-caption,.6875rem);background:#1d202c;white-space:nowrap}
.home-room-actions img{width:24px;height:24px;object-fit:contain}
.home-room-actions .home-town-departure{justify-content:flex-start;border-color:#b69a6f;background:linear-gradient(125deg,#3e3a3b,#222938);grid-template-columns:none}
.home-room-actions .home-town-departure>span:not(:last-child){flex:1;min-width:0;font-size:14px}
.home-room-actions .home-town-departure strong{display:block;font:500 var(--ga-font-note,.75rem)/1.35 "Yu Mincho",serif;color:#f4e4c7;white-space:nowrap;overflow-wrap:normal}
.home-room-actions .home-town-departure small{display:block;font-size:.625rem;color:#c5b7a2;line-height:1.5;white-space:nowrap}
.home-room-actions .home-town-departure>span:last-child{font-size:22px;color:#ccb78f}
.home-room-actions button:focus-visible,.home-room-heading button:focus-visible{outline:2px solid #f2cf76;outline-offset:-3px}
.home-room-actions button:hover,.home-room-heading button:hover{filter:brightness(1.13)}
body:has(.home-town-home[data-layout="room"]) .global-chat{top:calc(var(--app-header-height) + 78px);bottom:auto;right:0;left:auto;width:32px}
body:has(.home-town-home[data-layout="room"]) .chat-peek{height:44px;min-height:44px}
.navigation{grid-template-columns:repeat(6,minmax(0,1fr))}
@media(max-width:360px){.home-room-heading{inset:10px 10px auto}.home-room-heading h2{font-size:15px}}
@media(max-height:650px){.home-room-actions{padding:6px 10px;gap:8px}.home-room-actions>button{min-height:48px}.home-room-heading{top:8px}.home-room-heading h2{font-size:15px}.home-room-heading p{font-size:9px}}
@media(prefers-reduced-motion:reduce){.home-town-home[data-layout="room"] .home-town-walker img{animation:none!important}}

/* Preserve the whole multi-storey painting and its floor coordinates on short screens. */
.home-town-home[data-room-floors] .home-town-scene{overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#9d7954 #241a16}
.home-town-home[data-room-floors] .home-town-world{position:relative}
.home-town-home[data-room-floors] .home-town-art{object-fit:fill;object-position:center}
.home-town-home[data-room-floors] .home-room-hint{position:sticky;bottom:4px;width:max-content;max-width:100%;margin:-28px auto 8px;padding:2px 8px;background:#211912c9;border-radius:3px;font-size:var(--ga-font-caption,.6875rem)}
.home-room-actions:has([data-home-room-picker]){grid-template-columns:3.25rem 3.75rem minmax(0,1fr);gap:6px;padding:8px}
.home-room-actions .home-room-change{flex-direction:column;gap:2px;padding:6px 3px;font-size:var(--ga-font-caption,.6875rem);background:#1d202c;white-space:nowrap}
@media(max-width:440px){.home-room-actions:has([data-home-room-picker]) .home-town-departure{gap:4px;padding:7px 6px}.home-room-actions:has([data-home-room-picker]) .home-town-departure>img{display:none}}
.home-room-picker{width:min(620px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:0;border:1px solid #a48d68;background:var(--surface,#191e28);color:var(--text,#f1e5d1);overflow:hidden}
.home-room-picker[open]{display:flex;flex-direction:column}
.home-room-picker::backdrop{background:#080b12bb}
.home-room-picker>header,.home-room-picker>footer{flex:none;padding:12px 16px}
.home-room-picker h2{margin:0;font-size:var(--ga-font-page,1.125rem)}
.home-room-picker p{margin:8px 0 0;font-size:var(--ga-font-note,.75rem);line-height:1.6}
.home-room-picker-scroll{min-height:0;overflow-y:auto;padding:0 12px}
.home-room-picker .home-town-background-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.home-room-picker .home-town-background-grid button{min-width:0;text-align:left;white-space:normal;overflow-wrap:anywhere}
.home-room-picker .home-town-background-grid button:focus-visible{outline:2px solid #f1ca82;outline-offset:-4px}
.home-room-picker .home-town-background-grid img{height:150px;object-fit:contain;background:#151722}
.home-room-picker .home-town-background-grid strong{font-size:var(--ga-font-body,.875rem)}
.home-room-picker .home-town-background-grid :is(span,em){font-size:var(--ga-font-note,.75rem)}
.home-room-picker>footer{display:flex;justify-content:flex-end}
.home-room-picker>footer button{min-width:100px;min-height:44px}

/* Each category contains directly accessible tiles, including former home facilities. */
.menu-screen .menu-console-grid{gap:16px}
.menu-screen .menu-category{border:1px solid #8e826144;border-radius:10px;background:#191e22;box-shadow:none}
.menu-screen .menu-category-heading{min-height:44px;padding:10px 12px;border-bottom:0;background:none}
.menu-screen .menu-category-heading>span{display:none}
.menu-screen .menu-category h3{font-size:14px;color:#e1d3b9;letter-spacing:.06em}
.menu-screen .menu-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:0 10px 10px}
.menu-screen .menu-card{display:flex;flex-direction:column;justify-content:flex-start;align-items:center;gap:7px;min-width:0;min-height:110px;height:auto;padding:12px 5px 9px;border:1px solid #b5a47b33;border-radius:8px;background:linear-gradient(145deg,#2c3035,#20242b);box-shadow:none;text-align:center;white-space:normal}
.menu-screen a.menu-card{text-decoration:none}
.menu-screen .menu-card:last-child{border-bottom:1px solid #b5a47b33}
.menu-screen .menu-card::before,.menu-screen .menu-card-arrow{display:none}
.menu-screen .menu-card>img,.menu-screen .menu-card-icon,.menu-screen .menu-card-help-icon{width:34px;height:34px;flex-shrink:0}
.menu-screen .menu-card-copy{display:grid;gap:4px;width:100%;min-width:0}
.menu-screen .menu-card-copy strong{font:500 12px/1.4 "Yu Gothic","Hiragino Kaku Gothic ProN",sans-serif;color:#eee3cf;letter-spacing:0;overflow-wrap:anywhere}
.menu-screen .menu-card-copy span{font-size:10px;line-height:1.4;color:#b6b7b2;overflow-wrap:anywhere}
.menu-screen .menu-card:hover,.menu-screen .menu-card:focus-visible{background:#383b41}
.menu-screen .menu-card:focus-visible{outline:2px solid #e7c587;outline-offset:-3px}
.menu-screen .menu-card .abyss-mechanism-mark{width:34px;height:34px;flex-basis:34px}
@media(max-width:360px){.menu-screen .menu-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.menu-screen .menu-card{min-height:108px}}
@media(min-width:760px){.menu-screen .menu-console-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}}

/* The heading and names share up to three visible rows. */
.home-screen:has(>.home-adventurer-presence){--home-presence-row:max(20px,1.25rem);--home-presence-list-height:calc(3 * var(--home-presence-row))}
.home-screen>.home-adventurer-presence{--home-presence-font:.5625rem;display:flex;flex-wrap:wrap;align-content:flex-start;align-items:center;align-self:start;gap:0 2px;width:100%;max-width:640px;height:var(--home-presence-list-height);min-height:0;margin:0;padding:0 8px;border:0;border-radius:0;background:transparent;box-shadow:none;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-width:thin;scrollbar-color:var(--line) transparent;text-shadow:0 1px 3px #000,0 0 4px #000}
.home-screen>.home-adventurer-presence .home-adventurer-presence-heading{display:flex;align-items:center;flex:0 0 auto;min-height:var(--home-presence-row);line-height:1.3}
.home-screen>.home-adventurer-presence .home-adventurer-presence-heading>strong{font-family:inherit;font-size:var(--home-presence-font);font-weight:600;line-height:1.3;color:var(--text)}
.home-screen>.home-adventurer-presence .home-adventurer-list{display:contents}
.home-screen>.home-adventurer-presence .home-adventurer{display:inline-flex;align-items:center;flex:0 0 auto;gap:3px;max-width:100%;min-height:var(--home-presence-row);margin:0;padding:0 2px;border:0;border-radius:0;background:transparent;box-shadow:none;font-family:inherit;font-size:var(--home-presence-font);line-height:1.3;white-space:normal;color:var(--text);text-shadow:inherit;text-decoration:none}
.home-screen>.home-adventurer-presence .home-adventurer>span{min-width:0;overflow-wrap:anywhere}
.home-screen>.home-adventurer-presence .home-adventurer i{flex:none;width:5px;height:5px;background:#69d49a;box-shadow:0 0 5px #69d49a66}
.home-screen>.home-adventurer-presence .home-adventurer.own{color:var(--gold-strong)}
.home-screen>.home-adventurer-presence .home-adventurer:is(:hover,:focus-visible){color:var(--gold-strong);text-decoration:underline;text-underline-offset:3px}
.home-screen>.home-adventurer-presence .home-adventurer:focus-visible{outline:2px solid var(--gold-strong);outline-offset:-2px}
.home-screen>.home-adventurer-presence .home-adventurer-empty{display:flex;align-items:center;max-width:100%;min-height:var(--home-presence-row);font-size:var(--home-presence-font);overflow-wrap:anywhere}
.home-town-screen:has(>.home-adventurer-presence){grid-template-rows:auto minmax(0,1fr)}
.home-town-screen:has(>.home-adventurer-presence):has(>.home-alert){grid-template-rows:auto minmax(0,1fr) auto}
.home-town-screen:has([data-room-household])>.home-adventurer-presence{max-width:560px}
.home-town-screen:has([data-layout="street"])>.home-adventurer-presence{max-width:480px}
/* Let the room painting show through the names while keeping its heading and letter clear. */
.home-town-screen:has(>.home-adventurer-presence):has([data-layout="room"]){--home-presence-height:var(--home-presence-list-height);grid-template-rows:minmax(0,1fr)}
.home-town-screen:has(>.home-adventurer-presence):has([data-layout="room"]):has(>.home-alert){grid-template-rows:minmax(0,1fr) auto}
.home-town-screen:has([data-layout="room"])>.home-adventurer-presence{position:absolute;z-index:4;top:0;justify-self:center}
.home-town-screen:has(>.home-adventurer-presence) .home-room-heading{top:calc(12px + var(--home-presence-height,0px))}
.home-town-screen:has(>.home-adventurer-presence) .home-room-scene-caption{top:calc(65px + var(--home-presence-height,0px))}
.home-town-screen:has(>.home-adventurer-presence) .home-letter-entry:not(.is-on-table){top:clamp(4px,calc(84px + var(--home-presence-height,0px)),calc(100cqh - 68px))}
@media(max-height:650px){.home-town-screen:has(>.home-adventurer-presence) .home-room-heading{top:calc(8px + var(--home-presence-height,0px))}}
