/* RD-05: inner world panels; the shared RD-01 shell and chat remain intact. */
body:not([data-mobile='true']) #center:has(> #tab-map:not(.hidden)),
body:not([data-mobile='true']) #center:has(> #tab-world:not(.hidden)),
body[data-mobile='true'][data-mp='game'] #center:has(> #tab-map:not(.hidden)),
body[data-mobile='true'][data-mp='game'] #center:has(> #tab-world:not(.hidden)) { display: flex; flex-direction: column; overflow: hidden; }
#center:has(> #tab-map:not(.hidden)) > #guide-box, #center:has(> #tab-world:not(.hidden)) > #guide-box { flex: 0 0 auto; }
#tab-map, #tab-world { flex: 1 1 auto; height: 100%; min-height: 0; min-width: 0; overflow: hidden; container-type: size; }
#tab-map .world-page, #tab-world .world-page { height: 100%; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 4px; overflow: hidden; color: var(--text); font: 15px/1.35 Georgia, 'Times New Roman', serif; background: #0b151ee6 url('../assets/ui/foundation-stone.png') repeat; background-size: 627px; }
.world-page * { min-width: 0; }
.world-page h2, .world-page h3 { font-family: Georgia, 'Times New Roman', serif; font-weight: 600; letter-spacing: 0; border: 0; margin: 0; padding: 0; color: var(--gold); }
.world-page h2 { font-size: clamp(19px, 2.3cqw, 27px); line-height: 1.15; }
.world-page h3 { font-size: 18px; line-height: 1.25; }
.world-page p { margin: 5px 0; overflow-wrap: anywhere; }
.world-page button, .world-page select { font: inherit; }
.world-page .btn, .world-page select, .world-nav button { min-height: 44px; }
.world-page .btn { padding: 6px 10px; white-space: normal; overflow-wrap: anywhere; }
.world-page .btn.primary, .world-nav button[aria-current='page'], .world-nav button.active { color: #fff3ce; border-color: #edc67d; background: linear-gradient(#bc863a,#614017 40%,#72501e 85%,#ca963e); box-shadow: inset 0 0 0 2px #4b301b, 0 0 9px #db9e3c3b; }
.world-page :is(button, select, [tabindex]):focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.world-icon { width: 1.25em; height: 1.25em; display: inline-block; vertical-align: -.2em; margin-right: .35em; object-fit: contain; filter: invert(85%) sepia(31%) saturate(704%) hue-rotate(347deg) brightness(98%); }
.world-nav { flex: 0 0 auto; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; padding-bottom: 7px; border-bottom: 1px solid #a58249; }
.world-nav button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px; color: #f5e8cc; border: 1px solid #9a7b49; background: #121c24; font-family: Georgia, 'Times New Roman', serif; font-size: 18px; line-height: 1.15; cursor: pointer; }
.world-nav .world-icon { margin: 0; flex: 0 0 auto; }
.world-toolbar { display: flex; flex: 0 0 auto; align-items: end; flex-wrap: wrap; gap: 8px 16px; padding: 0 8px 6px; border-bottom: 1px solid #756143; }
.world-toolbar label, .wm-toolbar label { display: flex; align-items: center; gap: 8px; }
.world-toolbar select, .wm-toolbar select { min-width: 0; max-width: 100%; color: #f4e7cd; padding: 6px 28px 6px 10px; border: 1px solid #aa864c; background: #111a21; }
.world-toolbar label { flex: 1; }
.world-toolbar select { flex: 1; }
.world-content { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 8px; }
.world-content > :is(.world-boss-layout,.world-ranking-layout,.world-territories) { flex: 1 1 auto; height: auto; }
.world-toolbar > p { flex: 1 1 40%; margin: 0; font-size: 14px; line-height: 1.2; }
.world-error, .world-empty { padding: 10px; border: 1px solid #a58249; background: #111c26; overflow-wrap: anywhere; }
.world-error { flex: 0 0 auto; display: flex; gap: 12px; align-items: center; justify-content: space-between; color: #ffd6ad; }
.world-empty { display: grid; place-content: center; min-height: 100px; text-align: center; }
.world-pager { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 5px; }
.world-pager button { min-width: 44px; }
.world-pager span { color: var(--gold); font-variant-numeric: tabular-nums; }
.world-pager output { color: var(--gold); text-align: center; font-variant-numeric: tabular-nums; }
.world-pager button:last-child .world-icon { transform: rotate(180deg); }
/* Map controls and data-positioned nodes. The terrain atlas has no authored routes or labels. */
.wm-toolbar { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.25fr); align-items: center; gap: 6px 14px; padding: 0 6px; }
.wm-toolbar label { display: grid; grid-template-columns: auto minmax(0,1fr); }
.wm-toolbar > .small { color: var(--muted); line-height: 1.2; }
.wm-planes { grid-column: 1 / -1; display: flex; gap: 8px; }
.wm-planes .btn { flex: 1; }
.wm-planes .btn.primary { color: #d5ffff; border-color: #66eaf1; background: linear-gradient(#0d3843,#09232c); box-shadow: inset 0 0 9px #2bd9ec44,0 0 7px #37d7ec44; }
.wm-current-location { flex: 0 0 auto; margin: 0 4px !important; padding: 4px 0; text-align: center; color: #e9c982; border-block: 1px solid #756143; font-size: 14px; }
.wm-layout { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0,1.75fr) minmax(225px,1fr); gap: 9px; }
.wm-map-frame { position: relative; min-height: 0; container-type: size; display: flex; align-items: center; justify-content: center; border: 1px solid #b28c50; background: #08111b; box-shadow: inset 0 0 0 3px #090d13,inset 0 0 0 4px #80613a; overflow: hidden; }
#tab-map #wm-wrap { position: relative; flex: 0 0 auto; width: min(100cqw,160cqh); height: min(62.5cqw,100cqh); margin: 0; overflow: hidden; container-type: size; background: #131e28; }
.wm-terrain, .wm-fog { position: absolute; pointer-events: none; max-width: none; }
.wm-terrain { background-image: url('../assets/ui/world-terrain.png'); background-size: 100% 200%; background-repeat: no-repeat; }
.wm-fog { opacity: .96; }
#wm-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wm-road { fill: none; stroke: #d0b36e; stroke-width: 3; opacity: .9; }
.wm-road.rumor { stroke-dasharray: 7 6; opacity: .65; }
.wm-road.route { stroke: #ffdb7b; stroke-width: 5; opacity: 1; filter: drop-shadow(0 0 3px #ffd35b); }
.wm-node { position: absolute; transform: translate(-50%,-50%); width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 2px; border: 2px solid #d4ac61; border-radius: 50%; color: #fff1d3; background: #111923; box-shadow: 0 1px 5px #000d; cursor: pointer; z-index: 2; }
.wm-node-art { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 50%; }
.wm-node.selected { z-index: 4; border-color: var(--cyan); box-shadow: 0 0 9px #2ce9ff, inset 0 0 5px #2ce9ff; }
.wm-node.here { border-color: #ffe3a2; }
.wm-node.rumor .wm-node-art { filter: saturate(.35); }
.wm-label { display: none; position: absolute; top: calc(100% - 3px); left: calc(50% + clamp(0px,62px - var(--wm-node-x)*1cqw,62px) - clamp(0px,62px - (100 - var(--wm-node-x))*1cqw,62px)); transform: translateX(-50%); width: max-content; max-width: 116px; padding: 3px 8px; border: 1px solid #bb9251; background: #101820eb; color: #fff0cc; font-size: 12px; line-height: 1.15; font-weight: 600; text-shadow: 0 1px 2px #000; overflow-wrap: anywhere; pointer-events: none; }
.wm-node.labelled .wm-label, .wm-node:hover .wm-label, .wm-node:focus-visible .wm-label { display: block; }
.wm-node.selected .wm-label { color: #d8ffff; border-color: var(--cyan); box-shadow: 0 0 6px #2ed8e866; }
.wm-node.label-above .wm-label { top: auto; bottom: calc(100% - 3px); }
.wm-node:focus-visible, .wm-node:hover { z-index: 5; }
.wm-current-dot { position: absolute; left: 50%; top: -11px; width: 13px; height: 13px; border: 2px solid #fff0bb; background: #d8a733; border-radius: 50% 50% 50% 0; transform: translateX(-50%) rotate(-45deg); box-shadow: 0 0 7px #ffdd76; }
.wm-party-count { position: absolute; right: -10px; top: -8px; min-width: 21px; padding: 1px 3px; border: 1px solid #94ddc7; border-radius: 10px; color: #e8fff7; background: #183d39; font-size: 12px; }
.wm-node-gate { position: absolute; bottom: 2px; right: -7px; width: 18px; height: 18px; padding: 1px; border: 1px solid var(--cyan); border-radius: 50%; background: #082d3a; }
.wm-node-gate .world-icon { display: block; width: 100%; height: 100%; margin: 0; }
.wm-unknown { position: absolute; transform: translate(-50%,-50%); border: 1px solid #98908a; width: 24px; height: 28px; border-radius: 50%; text-align: center; font-size: 20px; color: #d6d2c8; background: #1a2128d9; }
.wm-zoom { position: absolute; top: 6px; right: 6px; display: flex; flex-direction: column; gap: 4px; z-index: 6; }
.wm-zoom .btn { width: 44px; height: 44px; padding: 0; font-size: 0; }
.wm-zoom .btn::before { font: 28px/1 Georgia,serif; content: '+'; }
.wm-zoom .btn + .btn::before { content: '−'; }
.wm-detail { min-height: 0; display: flex; flex-direction: column; border: 1px solid #a58249; background: #0c1721e8; overflow: hidden; }
.wm-location-art { display: block; width: 100%; height: clamp(70px,23cqh,160px); min-height: 0; flex: 0 1 auto; object-fit: cover; border-bottom: 1px solid #997745; }
.wm-detail-heading { flex: 0 0 auto; padding: 9px 10px 5px; text-align: center; }
.wm-detail-heading h2 { overflow-wrap: anywhere; }
.wm-level { display: inline-block; border: 1px solid #4aa7b4; color: #a9f1f1; background: #082a36; padding: 1px 10px; margin-top: 5px; line-height: 1.2; font-size: 14px; }
.wm-detail-text { flex: 1 1 auto; min-height: 32px; overflow: auto; overscroll-behavior: contain; padding: 4px 10px; scrollbar-width: thin; }
.wm-detail-text > p:first-child { font-style: italic; }
.wm-detail-text .btn { margin: 4px 4px 4px 0; }
.wm-detail-actions { flex: 0 0 auto; display: flex; gap: 5px; padding: 3px 7px 6px; }
.wm-detail-actions > .btn { flex: 1; padding: 4px 5px; font-size: 14px; }
.wm-detail-footer { flex: 0 0 auto; min-height: 0; }
.wm-detail-footer .wm-route { max-height: none; }
.wm-extra { border-top: 1px solid #63583f; margin-top: 6px; padding-top: 5px; }
.wm-danger.safe, .wm-danger.easy { color: #98daba; }
.wm-danger.hard, .wm-danger.deadly, .wm-warning { color: #e8b57f; }
.wm-route { flex: 0 1 auto; min-height: 110px; max-height: 58%; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid #a58249; padding: 7px 10px 10px; }
.wm-route-copy { min-height: 36px; max-height: 90px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.wm-route-count { text-align: right; color: #ead8b9; }
.wm-route-actions { display: flex; flex: 0 0 auto; flex-direction: column; gap: 6px; }
.wm-route-actions .btn { width: 100%; }
.wm-route-actions [role='status'] { text-align: center; color: var(--cyan); }
.wm-detail > .wm-warning { padding: 4px 10px; flex: 0 0 auto; }
.wm-footer { flex: 0 0 auto; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); font-size: 13px; border-top: 1px solid #766242; padding: 4px 6px; }
/* World overview: all server categories use bounded pages, never a page-long table. */
.world-boss-layout { height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(230px,1fr) minmax(0,1.15fr); gap: 10px; }
.world-list { min-height: 0; display: flex; flex-direction: column; gap: 7px; }
.world-boss-rows { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 7px; }
.world-boss-copy { flex: 1 1 auto; }
.world-boss-meta { flex: 0 0 30%; text-align: right; font-size: 13px; }
.world-boss-status.alive { color: #a5e7b7; }
.world-boss-status.waiting { color: #e6c78d; }
.world-boss-row { flex: 1 1 0; min-height: 0; display: flex; align-items: center; gap: 10px; padding: 7px; text-align: left; color: var(--text); border: 1px solid #7d6848; background: #101b25; cursor: pointer; }
.world-boss-row.active { border-color: #e1bb72; background: #34301f; box-shadow: inset 0 0 0 1px #6c5836; }
.world-boss-row img { flex: 0 0 auto; width: clamp(40px,7cqw,66px); height: clamp(40px,7cqw,66px); object-fit: cover; border: 1px solid #8a744c; }
.world-boss-row strong, .world-boss-row b { display: block; color: #efd59a; font-size: 17px; font-weight: 500; }
.world-boss-row span, .world-boss-row small { display: block; overflow-wrap: anywhere; line-height: 1.2; }
.world-detail { min-height: 0; display: flex; flex-direction: column; border: 1px solid #ac884d; padding: 9px; background: #0b1722; overflow: hidden; }
.world-detail-art { flex: 1 1 auto; min-height: 70px; max-height: 48%; overflow: hidden; position: relative; background: #07111c; border: 1px solid #736443; }
.world-detail-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.world-detail h2 { margin: 8px 0 3px; text-align: center; }
.world-detail-text { flex: 1 1 auto; min-height: 30px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.world-detail > .btn, .world-detail > .world-pager { flex: 0 0 auto; margin-top: 8px; }
.world-detail-actions { flex: 0 0 auto; margin-top: 7px; text-align: center; }
.world-detail-actions > .btn { width: 100%; }
.world-detail-actions > p { font-size: 13px; margin: 3px 0; }
.world-boss-facts { display: flex; flex-wrap: wrap; gap: 5px 12px; border-block: 1px solid #60553c; margin-block: 7px; padding-block: 6px; }
.world-detail-text > header { text-align: center; }
.world-detail .world-alive, .world-status-alive { color: #91e9aa; }
.world-detail .world-respawn { color: #e8c276; }
.world-boss-mobile-pager { display: none; }
.world-ranking-layout { height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0,1.7fr) minmax(220px,1fr); gap: 10px; }
.world-ranking-main { min-height: 0; min-width: 0; display: flex; flex-direction: column; border: 1px solid #8b7147; padding: 9px; background: #0b1722d9; }
.world-ranking-main > h2 { margin-bottom: 9px; }
.world-ranking-layout:not(.has-weekly) { grid-template-columns: minmax(0,1fr); }
.world-ranking-main > .world-pager { margin-top: auto; padding-top: 7px; }
.world-ranking-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 15px; }
.world-ranking-table th { color: #e9c780; font-weight: 400; text-align: left; border-bottom: 1px solid #977a49; padding: 7px 5px; overflow-wrap: anywhere; }
.world-ranking-table td { padding: 8px 5px; border-bottom: 1px solid #4b4638; overflow-wrap: anywhere; vertical-align: middle; }
.world-ranking-table th:first-child, .world-ranking-table td:first-child { width: 38px; color: var(--gold); text-align: center; }
.world-ranking-table th[aria-label] { white-space: nowrap; font-size: 13px; }
.world-ranking-table th:nth-child(2) { width: 48%; }
.world-ranking-table td:last-child { color: #bcebf0; font-variant-numeric: tabular-nums; }
.world-player { display: flex; gap: 8px; align-items: center; }
.world-player > .character-portrait { flex: 0 0 40px; width: 40px; height: 48px; }
.world-player > .world-player-art { flex: 0 0 40px; width: 40px; height: 48px; min-height: 0; }
.world-player > img { width: 40px; height: 48px; object-fit: cover; }
.world-player small { display: block; color: var(--muted); line-height: 1.15; }
.world-weekly { display: flex; flex-direction: column; min-height: 0; gap: 7px; border: 1px solid #907447; padding: 9px; background: #0a1724; }
.world-weekly > img { flex: 0 1 auto; display: block; min-height: 50px; height: 24%; width: 100%; object-fit: cover; border: 1px solid #786444; }
.world-weekly-banner { flex: 0 1 110px; position: relative; min-height: 58px; max-height: 24%; overflow: hidden; border: 1px solid #786444; }
.world-weekly-banner > img { width: 100%; height: 100%; display: block; object-fit: cover; }
.world-weekly-banner > h2 { position: absolute; bottom: 0; width: 100%; margin: 0; padding: 14px 6px 5px; font-size: 19px; text-align: center; background: linear-gradient(transparent,#061220e6); text-shadow: 0 2px 4px #000; }
.world-weekly-mobile-banner { flex: 0 1 85px; min-height: 54px; max-height: 16%; }
.world-weekly .world-weekly-summary { flex: 0 0 auto; overflow: visible; }
.world-weekly .world-rewards { flex: 1 1 auto; }
.world-ranking-main > .world-rewards { display: flex; flex-direction: column; overflow: hidden; height: 100%; }
.world-ranking-main > .world-rewards > .world-pager { margin-top: auto; }
.world-rewards .world-ranking-table th:nth-child(2) { width: auto; }
.world-rewards .world-ranking-table th:first-child { width: 17%; }
.world-rewards .world-ranking-table th:last-child { width: 30%; }
.world-rewards .world-ranking-table { font-size: 13px; }
.world-weekly .world-rewards .world-ranking-table th, .world-weekly .world-rewards .world-ranking-table td { padding: 4px 2px; }
.world-weekly h3 { font-size: 18px; }
.world-weekly-tabs { display: flex; gap: 5px; flex: 0 0 auto; }
.world-weekly-tabs .btn { flex: 1; padding: 4px; font-size: 14px; }
.world-weekly-summary, .world-rewards { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.world-rewards > *, .world-weekly-summary > * { margin-block: 5px; }
.world-auto-note { flex: 0 0 auto; margin-top: auto !important; border-top: 1px solid #766242; padding-top: 7px; color: #d8cbb0; font-size: 14px; line-height: 1.3; }
.world-territories { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.world-territories .world-ranking-table th:first-child, .world-territories .world-ranking-table td:first-child { width: 38%; text-align: left; }
.world-territories .world-ranking-table th:nth-child(2) { width: 30%; }
.world-territories .world-ranking-table td { vertical-align: top; }
.world-territories .world-ranking-table .btn { display: block; margin: 5px 0 0; font-size: 13px; }
.world-rules { font-size: 17px; line-height: 1.5; }
.world-territory-rules { flex: 0 1 auto; max-height: 28%; overflow: auto; scrollbar-width: thin; }
/* Compact center column and portrait phone: stack only the scoped content. */
@container (max-width: 650px) {
  .world-nav button { font-size: 15px; gap: 4px; }
  .world-nav .world-icon { width: 1em; height: 1em; }
  .wm-layout { grid-template-columns: minmax(0,1.35fr) minmax(190px,1fr); gap: 6px; }
  .wm-location-art { height: 95px; }
  .wm-detail-heading { padding: 6px; }
  .wm-detail-heading h2 { font-size: 20px; }
  .wm-route { padding: 6px; }
  .world-ranking-layout { grid-template-columns: minmax(0,1fr); }
  .world-weekly { flex-direction: row; flex-wrap: wrap; }
  .world-weekly > img, .world-weekly > .world-weekly-banner { display: none; }
  .world-weekly .world-weekly-summary, .world-weekly .world-rewards { display: none; }
  .world-weekly .world-auto-note { width: 100%; font-size: 13px; }
  .world-ranking-layout:has(.world-weekly) { grid-template-rows: minmax(0,1fr) auto; }
  .world-weekly-tabs { flex: 1; }
  .world-boss-layout { grid-template-columns: minmax(180px,1fr) minmax(0,1fr); }
}
@container (max-width: 470px) {
  #tab-map .world-page, #tab-world .world-page { gap: 5px; padding: 2px; }
  .world-nav { gap: 3px; padding-bottom: 4px; }
  .world-nav button { font-size: 14px; padding: 4px 2px; }
  .world-nav .world-icon { display: none; }
  .wm-toolbar { gap: 4px; padding: 0 2px; }
  .wm-toolbar label { gap: 4px; font-size: 13px; }
  .wm-toolbar select { padding: 5px 2px; font-size: 16px; }
  .wm-planes { gap: 5px; }
  .wm-toolbar > .small { grid-column: 1 / -1; font-size: 12px; }
  .wm-current-location { padding: 2px; font-size: 12px; line-height: 1.2; }
  .wm-layout { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(100px,.9fr) minmax(160px,1.1fr); gap: 4px; }
  .wm-detail { display: flex; flex-direction: column; }
  .wm-location-art { display: none; }
  .wm-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 5px 7px 2px; text-align: left; }
  .wm-detail-heading h2 { font-size: 18px; }
  .wm-level { flex: 0 0 auto; margin: 0; padding: 1px 5px; font-size: 12px; }
  .wm-detail-text { padding: 2px 7px; font-size: 14px; min-height: 28px; }
  .wm-detail-actions { padding: 2px 5px 3px; }
  .wm-detail:has(.wm-route) { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2fr); grid-template-rows: auto minmax(0,1fr) minmax(0,.65fr) 44px; gap: 3px; }
  .wm-detail:has(.wm-route) > .wm-detail-heading { grid-column: 1 / -1; grid-row: 1; }
  .wm-detail:has(.wm-route) > .wm-detail-text { grid-column: 1 / -1; grid-row: 2; min-height: 0; }
  .wm-detail:has(.wm-route) .wm-detail-footer, .wm-detail:has(.wm-route) .wm-route { display: contents; }
  .wm-detail:has(.wm-route) .wm-route-copy { grid-column: 1 / -1; grid-row: 3; min-height: 0; max-height: none; padding: 1px 5px; }
  .wm-detail:has(.wm-route) .wm-detail-actions { grid-column: 1; grid-row: 4; padding: 0; }
  .wm-detail:has(.wm-route) .wm-route-actions { grid-column: 2; grid-row: 4; }
  .wm-detail:has(.wm-route) .wm-detail-actions > .btn, .wm-detail:has(.wm-route) .wm-route-actions > .btn { height: 44px; min-height: 44px; padding: 2px; font-size: 13px; line-height: 1.1; }
  .wm-detail:has(.wm-route) .wm-detail-actions:has(> :nth-child(2)) > .btn { font-size: 11px; padding: 1px; line-height: 1.05; }
  .wm-route { max-height: 145px; min-height: 95px; padding: 4px 7px 6px; gap: 4px; }
  .wm-route h3 { font-size: 15px; }
  .wm-route-copy { font-size: 13px; line-height: 1.2; }
  .wm-route-count { display: inline; }
  .wm-route-actions { flex-direction: row; gap: 5px; }
  .wm-route-actions .btn { width: auto; flex: 1; font-size: 16px; padding: 4px; }
  .wm-footer { gap: 2px 10px; padding: 2px; font-size: 11px; line-height: 1.2; }
  .wm-footer > span:nth-child(2) { display: none; }
  .world-boss-layout { display: block; }
  .world-boss-layout > .world-list { display: none; }
  .world-boss-layout > .world-detail { height: 100%; }
  .world-boss-mobile-pager { display: flex; }
  .world-detail-art { max-height: 44%; }
  .world-detail h2 { font-size: 23px; }
  .world-toolbar { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.7fr); align-items: center; padding: 0 2px 4px; gap: 5px; }
  .world-toolbar label { gap: 5px; flex-wrap: wrap; }
  .world-toolbar label select { flex-basis: 100%; }
  .world-toolbar > p { grid-column: 1 / -1; grid-row: 2; }
  .world-toolbar select { padding: 5px; }
  .world-ranking-main { padding: 5px; }
  .world-ranking-main > h2 { font-size: 18px; margin-bottom: 3px; }
  .world-ranking-table { font-size: 14px; }
  .world-ranking-table td, .world-ranking-table th { padding: 5px 3px; }
  .world-ranking-table th:first-child, .world-ranking-table td:first-child { width: 25px; }
  .world-player { gap: 5px; }
  .world-player > .character-portrait { flex-basis: 31px; width: 31px; height: 40px; }
  .world-player > .world-player-art { flex-basis: 31px; width: 31px; height: 40px; }
  .world-weekly { padding: 5px; gap: 5px; }
  .world-weekly h3 { font-size: 16px; }
  .world-weekly-tabs .btn { font-size: 13px; }
  .world-auto-note { font-size: 12px; }
}
/* Later generic mobile rules must not reintroduce table scroll or negative map margins. */
body[data-mobile='true'] #tab-map #wm-wrap { margin: 0; }
body[data-mobile='true'] #tab-map #wm-wrap { width: 100cqw; height: 100cqh; }
body[data-mobile='true'] #tab-map .wm-node .wm-label { font-size: 11px; }
body[data-mobile='true'] #tab-world .world-ranking-table { display: table; overflow: visible; }
@container (max-height: 370px) and (min-width: 471px) {
  #tab-map .world-page, #tab-world .world-page { gap: 4px; }
  .wm-toolbar { grid-template-columns: minmax(0,1.2fr) minmax(0,1fr) minmax(0,1.4fr); }
  .wm-planes { grid-column: auto; }
  .wm-toolbar > .small { display: none; }
  .wm-toolbar label { gap: 4px; font-size: 12px; }
  .wm-toolbar .btn { font-size: 13px; padding: 4px; }
  .wm-current-location, .wm-footer { font-size: 11px; padding: 1px; }
  .wm-footer > span:nth-child(2) { display: none; }
  .wm-location-art { display: none; }
  .wm-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 3px 6px; }
  .wm-detail-heading h2 { font-size: 17px; }
  .wm-level { flex: 0 0 auto; font-size: 11px; margin: 0; padding: 1px 4px; }
  .wm-detail-text { padding: 1px 6px; min-height: 20px; font-size: 13px; }
  .wm-route { max-height: 65%; min-height: 85px; padding: 3px 6px; gap: 3px; }
  .wm-route-copy { min-height: 22px; font-size: 12px; line-height: 1.15; }
  .wm-route h3 { font-size: 14px; }
  .wm-route-actions { flex-direction: row; }
  .wm-route-actions .btn { flex: 1; padding: 3px; font-size: 14px; }
  .world-detail-art { max-height: 30%; }
  .world-detail h2 { font-size: 19px; margin-top: 3px; }
  .world-boss-row img { width: 38px; height: 38px; }
  .world-boss-row { padding: 3px 6px; }
  .world-boss-row strong { font-size: 15px; }
  .world-ranking-table td, .world-ranking-table th { padding: 3px; }
  .world-player > .character-portrait { width: 28px; height: 34px; flex-basis: 28px; }
  .world-player > .world-player-art { width: 28px; height: 34px; flex-basis: 28px; }
  .world-weekly > img { display: none; }
  .world-weekly-mobile-banner { display: none; }
  .world-auto-note { font-size: 12px; }
  .world-ranking-layout { grid-template-columns: minmax(0,1.6fr) minmax(190px,1fr); grid-template-rows: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) { .wm-node { transition: none; } }
/* Short landscape uses the full inner panel height: navigation moves beside content. */
@container (max-height: 370px) and (min-width: 471px) {
  #tab-world .world-page { position: relative; display: grid; grid-template-columns: 100px minmax(0,1fr); grid-template-rows: minmax(0,1fr); gap: 7px; padding: 2px; }
  #tab-map .world-map-page { position: relative; display: grid; grid-template-columns: 100px minmax(0,1.5fr) minmax(220px,1fr); grid-template-rows: 44px minmax(0,1fr); gap: 5px 7px; padding: 2px; }
  .world-page > .world-nav { grid-column: 1; grid-row: 1 / -1; display: flex; flex-direction: column; gap: 3px; padding: 0 5px 0 0; border-bottom: 0; border-right: 1px solid #a58249; }
  .world-nav button { flex: 1 1 0; min-height: 44px; padding: 3px; font-size: 14px; }
  .world-nav .world-icon { width: 16px; height: 16px; }
  #tab-world .world-content { grid-column: 2; grid-row: 1; gap: 5px; }
  #tab-world .world-page:has(> .world-error) { grid-template-rows: auto minmax(0,1fr); }
  #tab-world .world-page > .world-error { grid-column: 2; grid-row: 1; padding: 3px; font-size: 12px; gap: 4px; }
  #tab-world .world-page:has(> .world-error) > .world-content { grid-row: 2; }
  .world-content > .world-toolbar { padding: 0; gap: 5px; flex-wrap: nowrap; }
  .world-toolbar h2 { font-size: 17px; }
  .world-toolbar > p { display: none; }
  .world-toolbar label { font-size: 13px; }
  .world-toolbar select { min-height: 44px; font-size: 16px; padding: 3px; }
  #tab-map .wm-toolbar { grid-column: 2 / -1; grid-row: 1; padding: 0; gap: 4px; }
  #tab-map .world-map-page > .world-error { position: absolute; left: 109px; bottom: 3px; width: calc((100% - 116px) * .58); max-height: calc(100% - 52px); z-index: 8; padding: 3px; gap: 4px; overflow: auto; font-size: 12px; }
  #tab-map .wm-layout { grid-column: 2 / -1; grid-row: 2; grid-template-columns: minmax(0,1.5fr) minmax(220px,1fr); min-height: 0; }
  #tab-map .wm-current-location, #tab-map .wm-footer { position: absolute; left: 109px; width: calc((100% - 116px) * .58); max-width: none; z-index: 7; padding: 1px 3px; margin: 0 !important; background: #09131dec; border: 1px solid #766242; overflow: auto; scrollbar-width: thin; }
  #tab-map .wm-current-location { bottom: 26px; max-height: 24px; font-size: 10px; line-height: 1.1; }
  #tab-map .wm-footer { bottom: 3px; max-height: 21px; font-size: 10px; line-height: 1.1; }
  .wm-detail-heading { padding: 2px 5px; }
  .wm-detail-heading h2 { font-size: 16px; line-height: 1.1; }
  .wm-detail-text { min-height: 0; padding: 1px 5px; font-size: 13px; }
  .wm-detail-actions { padding: 1px 5px 2px; }
  .wm-detail-actions > .btn { min-height: 44px; font-size: 12px; padding: 2px 3px; }
  .wm-detail:has(.wm-route) { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); grid-template-rows: auto minmax(0,1fr) 44px; gap: 3px; }
  .wm-detail:has(.wm-route) > .wm-detail-heading { grid-column: 1 / -1; grid-row: 1; }
  .wm-detail:has(.wm-route) > .wm-detail-text { grid-column: 1; grid-row: 2; }
  .wm-detail:has(.wm-route) .wm-detail-footer, .wm-detail:has(.wm-route) .wm-route { display: contents; }
  .wm-detail:has(.wm-route) .wm-route-copy { grid-column: 2; grid-row: 2; max-height: none; padding: 1px 3px; }
  .wm-detail:has(.wm-route) .wm-detail-actions { grid-column: 1; grid-row: 3; padding: 0; }
  .wm-detail:has(.wm-route) .wm-route-actions { grid-column: 2; grid-row: 3; }
  .wm-detail:has(.wm-route) .wm-detail-actions > .btn, .wm-detail:has(.wm-route) .wm-route-actions > .btn { height: 44px; min-height: 44px; padding: 2px; font-size: 11px; line-height: 1.1; }
  .wm-route { flex: 0 0 auto; min-height: 0; max-height: none; padding: 2px 5px; gap: 2px; }
  .wm-route-copy { max-height: 28px; min-height: 0; font-size: 12px; }
  .wm-route-copy h3 { font-size: 13px; }
  .wm-route-copy p { margin: 1px 0; }
  .wm-route-actions { gap: 4px; }
  .wm-route-actions .btn { min-height: 44px; font-size: 14px; }
  .world-boss-layout { display: block; }
  .world-boss-layout > .world-list { display: none; }
  .world-boss-layout > .world-detail { height: 100%; padding: 5px; display: grid; grid-template-columns: minmax(75px,.7fr) minmax(0,1.4fr) minmax(135px,1fr); grid-template-rows: 44px minmax(0,1fr); gap: 4px 7px; }
  .world-boss-mobile-pager { display: flex; grid-column: 1 / -1; grid-row: 1; margin: 0 !important; }
  .world-detail-art { grid-column: 1; grid-row: 2; min-height: 0; height: 100%; max-height: none; }
  .world-detail-text { grid-column: 2; grid-row: 2; min-height: 0; font-size: 13px; }
  .world-detail-text h2 { font-size: 18px; margin: 0 0 3px; }
  .world-detail-actions { grid-column: 3; grid-row: 2; margin: 0; display: flex; flex-direction: column; justify-content: center; }
  .world-detail-actions .btn { min-height: 44px; padding: 3px; font-size: 15px; }
  .world-detail-actions .world-note { min-height: 0; overflow: auto; font-size: 12px; line-height: 1.1; }
  .world-boss-facts { gap: 3px 8px; padding: 2px 0; margin: 3px 0; }
  .world-ranking-layout { grid-template-columns: minmax(0,1.7fr) minmax(190px,1fr); grid-template-rows: minmax(0,1fr); gap: 6px; }
  .world-ranking-main { padding: 4px; }
  .world-ranking-table { font-size: 13px; }
  .world-ranking-table th { font-size: 12px; }
  .world-ranking-table th, .world-ranking-table td { padding: 2px 3px; }
  .world-ranking-main > .world-pager { padding-top: 2px; gap: 4px; }
  .world-pager .btn { padding: 3px; font-size: 13px; }
  .world-pager output { font-size: 12px; }
  .world-weekly { padding: 4px; gap: 3px; }
  .world-weekly .world-weekly-banner, .world-weekly .world-weekly-summary, .world-weekly .world-rewards, .world-weekly-mobile-banner { display: none; }
  .world-weekly .world-auto-note { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; font-size: 12px; padding-top: 3px; margin: 0 !important; }
  .world-weekly-tabs .btn { font-size: 12px; }
  .world-ranking-main > .world-rewards > h3 { font-size: 15px; }
  .world-territory-influence { max-height: 60px; overflow: auto; scrollbar-width: thin; }
  .world-territories .world-ranking-table th, .world-territories .world-ranking-table td { padding: 1px 3px; }
  .world-territories .world-ranking-table .btn { margin-top: 2px; min-height: 44px; padding: 3px; }
}
