/* RD06 inner content only; the shared game shell remains authoritative. */
body:not([data-mobile="true"]) #center:has(> #tab-loc:not(.hidden) > .town-screen),
body[data-mobile="true"][data-mp="game"] #center:has(> #tab-loc:not(.hidden) > .town-screen) {
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
#center > #tab-loc:not(.hidden):has(> .town-screen) {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; min-width: 0; overflow: hidden;
}
#tab-loc:not(.hidden) > .town-screen { flex: 1 1 auto; }
.town-screen { height: 100%; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px; box-sizing: border-box; overflow: hidden; container: city / size; color: #eee3ce; background: #0b151eee; }
.town-screen * { box-sizing: border-box; }
.town-screen h2, .town-screen h3, .town-screen p { margin: 0; }
.town-screen h2 { font-size: 24px; color: #efcf83; }
.town-screen h3 { font-size: 20px; color: #edce8f; }
.town-screen .btn { min-height: 44px; min-width: 44px; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 10px; border: 1px solid #b08c4d; border-radius: 1px; color: #eee3ce; background: linear-gradient(#25313a, #101b25); }
.town-screen .btn.primary { color: #fff1cd; background: linear-gradient(#9e752c, #5e3b10); box-shadow: inset 0 0 0 2px #cba45b55; }
.town-screen .btn:disabled { opacity: .5; }
.town-screen .btn:focus-visible, .town-screen summary:focus-visible { outline: 2px solid #70e5f2; outline-offset: -3px; }
.town-screen .city-icon { display: inline-block; width: 22px; height: 22px; flex: 0 0 22px; vertical-align: middle; filter: invert(85%) sepia(35%) saturate(430%); }
.town-screen .city-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 0 0 auto; min-height: 52px; padding-bottom: 5px; border-bottom: 1px solid #9a7840; }
.town-screen .city-heading > div { min-width: 0; }
.town-screen .city-heading p { font-size: 14px; margin-top: 3px; }
.town-screen .city-heading > .btn { flex: 0 0 auto; }
.town-screen .city-footer { display: flex; gap: 8px; flex: 0 0 auto; }
.town-screen .city-footer > .btn { flex: 1; min-width: 0; }
.town-screen .city-fast-actions .btn { min-height: 54px; font-size: 19px; }
.town-screen .city-access .btn { font-size: 14px; }
.town-screen .city-overview-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 28%); gap: 9px; flex: 1; min-height: 0; }
.town-screen .city-scene { min-width: 0; min-height: 0; position: relative; overflow: hidden; border: 1px solid #ac8749; }
.town-screen .city-scene-art { width: 100%; height: 100%; object-fit: cover; object-position: center; image-rendering: auto; display: block; }
.town-screen .city-scene-links { position: absolute; inset: auto 8px 10px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.town-screen .city-scene-links .btn { background: #0e1923e8; font-size: 14px; }
.town-screen .city-paths { min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.town-screen .city-exit-list { display: grid; align-content: start; gap: 8px; min-height: 0; flex: 1; }
.town-screen .city-exit-list .btn { min-height: 60px; font-size: 15px; text-align: left; justify-content: flex-start; }
.town-screen .city-narrative { flex: 0 1 70px; min-height: 35px; padding: 9px 13px; border: 1px solid #8c703f; font-size: 18px; line-height: 1.3; font-style: italic; overflow: auto; overscroll-behavior: contain; }
.town-screen .city-service-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(44px, 1fr); gap: 9px; }
.town-screen .city-service-grid .btn { justify-content: flex-start; text-align: left; font-size: 18px; }
.town-screen .city-pager { display: flex; justify-content: center; align-items: center; gap: 13px; flex: 0 0 44px; min-height: 44px; }
.town-screen .city-pager .btn { font-size: 0; padding: 8px; width: 44px; flex: 0 0 44px; }
.town-screen .city-next .city-icon { transform: rotate(180deg); }
.town-screen .city-reader { min-height: 0; overflow: auto; overscroll-behavior: contain; line-height: 1.35; }
.town-screen > .city-reader { flex: 1; }
.town-screen .city-reader p + p { margin-top: 8px; }
.town-screen .city-note { flex: 0 0 auto; font-size: 13px; line-height: 1.25; }
.town-screen details.city-note { position: relative; min-width: 0; margin: 0; padding: 0; border: 0; background: transparent; }
.town-screen details.city-note > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; padding: 5px 8px; border: 1px solid #6f613f; }
.town-screen details.city-note[open] > .city-reader { position: absolute; z-index: 8; bottom: 100%; left: 0; right: 0; max-height: min(230px, 55cqh); background: #101c29; border: 1px solid #c7a365; padding: 12px; box-shadow: 0 4px 16px #000; }
.town-screen .city-empty { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px; text-align: center; }
.town-screen .city-legacy-service, .town-screen .city-legacy-activity { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; } /* Internal redesign belongs to home/guildhall/raid/arena cards. */
.town-screen .character-art { position: relative; overflow: hidden; min-width: 0; min-height: 0; container-type: size; background: #101922; }
.town-screen .character-art > span { position: absolute; width: max(100cqw, 75cqh); height: max(133.3333cqw, 100cqh); left: 50%; top: 12%; transform: translate(-50%, -12%); background-image: var(--portrait-image); background-size: 400% 200%; background-position: var(--portrait-x) var(--portrait-y); image-rendering: auto; }
.town-screen .character-art > img, .town-screen .city-portrait-fallback { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.town-screen .city-people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; flex: 1; min-height: 0; }
.town-screen .city-person { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 8px; border: 1px solid #8c703f; min-height: 0; }
.town-screen .city-person > div:last-child { overflow: auto; min-height: 0; overflow-wrap: anywhere; }
.town-screen .city-bubble { color: #91e7ef; font-style: italic; }
.town-screen .emote-bar { display: flex; flex: 0 0 auto; gap: 4px; flex-wrap: wrap; }
.town-screen .emote-bar .btn { padding: 4px; }
body[data-mobile='true'] .town-screen { padding: 6px; gap: 6px; }
body[data-mobile='true'] .town-screen h2 { font-size: 20px; }
body[data-mobile='true'] .town-screen .city-heading p { font-size: 12px; }
body[data-mobile='true'] .town-screen .city-heading > .btn { font-size: 0; width: 44px; padding: 6px; }
body[data-mobile='true'] .town-screen .city-overview-main { display: block; }
body[data-mobile='true'] .town-screen .city-scene { height: 100%; }
body[data-mobile='true'] .town-screen .city-scene-art[src='assets/ui/city-dun-kharag.png'] { object-position: 70% center; }
body[data-mobile='true'] .town-screen .city-paths { display: none; }
body[data-mobile='true'] .town-screen .city-scene-links { grid-template-columns: 1fr; inset: auto 6px 6px auto; max-width: 65%; gap: 4px; }
body[data-mobile='true'] .town-screen .city-scene-links .btn { min-height: 44px; font-size: 12px; padding: 4px 7px; }
body[data-mobile='true'] .town-screen .city-fast-actions .btn { flex-direction: column; font-size: 14px; padding: 4px; }
body[data-mobile='true'] .town-screen .city-narrative { font-size: 15px; flex-basis: 84px; padding: 6px 8px; }
body[data-mobile='true'] .town-screen .city-access { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
body[data-mobile='true'] .town-screen .city-service-grid .btn { font-size: 16px; }
body[data-mobile='true'] .town-screen .city-people { grid-template-columns: 1fr; }
body[data-mobile='true'] .town-screen .emote-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
@container city (max-height: 370px) {
  #tab-loc .town-screen .city-heading { min-height: 44px; padding: 0; }
  #tab-loc .town-screen .city-heading h2 { font-size: 17px; }
  #tab-loc .town-screen .city-heading p { display: none; }
  #tab-loc .town-screen .city-fast-actions .btn { min-height: 44px; font-size: 13px; }
  #tab-loc .town-screen .city-service-grid .btn { font-size: 14px; }
  #tab-loc .town-screen .city-scene-links { display: none; }
  #tab-loc .town-screen .city-narrative { font-size: 14px; }
  #tab-loc .town-screen .city-note { font-size: 12px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  body[data-mobile='true'] .town-screen[data-city-panel='overview'] { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 44px minmax(0, 1fr) 44px; gap: 4px 8px; padding: 4px; }
  body[data-mobile='true'] .town-screen[data-city-panel='overview'] > .city-heading { grid-column: 1 / -1; }
  body[data-mobile='true'] .town-screen[data-city-panel='overview'] .city-narrative { min-height: 0; }
  body[data-mobile='true'] .town-screen .city-fast-actions .btn { flex-direction: row; }
  body[data-mobile='true'] .town-screen .city-fast-actions .city-icon { display: none; }
  body[data-mobile='true'] .town-screen .city-access { display: flex; gap: 3px; }
  body[data-mobile='true'] .town-screen .city-access .btn { font-size: 12px; padding: 3px; }
  body[data-mobile='true'] .town-screen .city-access .city-icon { display: none; }
  body[data-mobile='true'] .town-screen[data-city-panel='people'] { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 44px minmax(0, 1fr) 44px; }
  body[data-mobile='true'] .town-screen[data-city-panel='people'] > .city-heading { grid-column: 1 / -1; }
  body[data-mobile='true'] .town-screen[data-city-panel='people'] .emote-bar { grid-template-columns: repeat(4, 1fr); grid-row: 2; grid-column: 2; }
}
